create-lik-app 1.0.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/dist/index.mjs +73 -73
  2. package/package.json +2 -3
  3. package/templates/template-react/_gitignore +3 -0
  4. package/templates/template-react/{plugins/index.ts → config/build/_base.ts} +16 -4
  5. package/templates/template-react/config/build/development.ts +7 -0
  6. package/templates/template-react/config/build/production.ts +1 -0
  7. package/templates/template-react/config/build/test.ts +1 -0
  8. package/templates/template-react/src/components/Lic/index.tsx +1 -1
  9. package/templates/template-react/src/main.tsx +1 -1
  10. package/templates/template-react/src/store/index.ts +1 -2
  11. package/templates/template-react/src/styles/main.css +10 -0
  12. package/templates/template-react/{types → src/types}/auto-imports.d.ts +21 -0
  13. package/templates/template-react/src/views/Home/components/React/index.tsx +2 -3
  14. package/templates/template-react/src/views/Home/index.tsx +0 -1
  15. package/templates/template-react/src/views/Layout/index.tsx +0 -1
  16. package/templates/template-react/tsconfig.node.json +1 -6
  17. package/templates/template-react/vite.config.ts +13 -16
  18. package/templates/template-react-tanstack-jotai/.husky/commit-msg +6 -0
  19. package/templates/template-react-tanstack-jotai/.husky/lintstagedrc.cjs +8 -0
  20. package/templates/template-react-tanstack-jotai/.husky/pre-commit +10 -0
  21. package/templates/template-react-tanstack-jotai/.prettierignore +13 -0
  22. package/templates/template-react-tanstack-jotai/.vscode/extensions.json +5 -0
  23. package/templates/template-react-tanstack-jotai/README.md +40 -0
  24. package/templates/template-react-tanstack-jotai/_gitignore +27 -0
  25. package/templates/template-react-tanstack-jotai/commitlint.config.mjs +28 -0
  26. package/templates/template-react-tanstack-jotai/config/build/_base.ts +38 -0
  27. package/templates/template-react-tanstack-jotai/config/build/development.ts +7 -0
  28. package/templates/template-react-tanstack-jotai/config/build/production.ts +1 -0
  29. package/templates/template-react-tanstack-jotai/config/build/test.ts +1 -0
  30. package/templates/template-react-tanstack-jotai/config/uno/rules.ts +127 -0
  31. package/templates/template-react-tanstack-jotai/env/.env +0 -0
  32. package/templates/template-react-tanstack-jotai/env/.env.development +2 -0
  33. package/templates/template-react-tanstack-jotai/env/.env.production +1 -0
  34. package/templates/template-react-tanstack-jotai/eslint.config.mjs +44 -0
  35. package/templates/template-react-tanstack-jotai/index.html +13 -0
  36. package/templates/template-react-tanstack-jotai/package.json +52 -0
  37. package/templates/template-react-tanstack-jotai/prettier.config.mjs +11 -0
  38. package/templates/template-react-tanstack-jotai/public/lic.svg +1263 -0
  39. package/templates/template-react-tanstack-jotai/public/react.svg +1 -0
  40. package/templates/template-react-tanstack-jotai/public/vite.svg +1 -0
  41. package/templates/template-react-tanstack-jotai/src/assets/react.svg +1 -0
  42. package/templates/template-react-tanstack-jotai/src/components/Lic/index.tsx +12 -0
  43. package/templates/template-react-tanstack-jotai/src/libs/gsap/index.ts +6 -0
  44. package/templates/template-react-tanstack-jotai/src/main.tsx +23 -0
  45. package/templates/template-react-tanstack-jotai/src/routeTree.gen.ts +145 -0
  46. package/templates/template-react-tanstack-jotai/src/routes/__root.tsx +11 -0
  47. package/templates/template-react-tanstack-jotai/src/routes/_layout/about.tsx +6 -0
  48. package/templates/template-react-tanstack-jotai/src/routes/_layout/index.tsx +6 -0
  49. package/templates/template-react-tanstack-jotai/src/routes/_layout.tsx +23 -0
  50. package/templates/template-react-tanstack-jotai/src/store/index.ts +1 -0
  51. package/templates/template-react-tanstack-jotai/src/store/module/favorite.ts +5 -0
  52. package/templates/template-react-tanstack-jotai/src/styles/animation.css +8 -0
  53. package/templates/template-react-tanstack-jotai/src/styles/variable.css +21 -0
  54. package/templates/template-react-tanstack-jotai/src/types/auto-imports.d.ts +33 -0
  55. package/templates/template-react-tanstack-jotai/src/types/color.d.ts +1 -0
  56. package/templates/template-react-tanstack-jotai/src/utils/rainbow-print.ts +10 -0
  57. package/templates/template-react-tanstack-jotai/src/views/404/index.tsx +18 -0
  58. package/templates/template-react-tanstack-jotai/src/views/About/index.tsx +7 -0
  59. package/templates/template-react-tanstack-jotai/src/views/Index/Button/index.tsx +24 -0
  60. package/templates/template-react-tanstack-jotai/src/views/Index/React/index.tsx +18 -0
  61. package/templates/template-react-tanstack-jotai/src/views/Index/Vite/index.tsx +20 -0
  62. package/templates/template-react-tanstack-jotai/src/views/Index/index.tsx +50 -0
  63. package/templates/template-react-tanstack-jotai/tsconfig.app.json +36 -0
  64. package/templates/template-react-tanstack-jotai/tsconfig.json +7 -0
  65. package/templates/template-react-tanstack-jotai/tsconfig.node.json +24 -0
  66. package/templates/template-react-tanstack-jotai/types/vite-env.d.ts +10 -0
  67. package/templates/template-react-tanstack-jotai/uno.config.ts +40 -0
  68. package/templates/template-react-tanstack-jotai/vite.config.ts +15 -0
  69. package/templates/template-vue/_gitignore +3 -0
  70. package/templates/template-vue/config/build/_base.ts +42 -0
  71. package/templates/template-vue/config/build/development.ts +7 -0
  72. package/templates/template-vue/config/build/production.ts +1 -0
  73. package/templates/template-vue/config/build/test.ts +1 -0
  74. package/templates/template-vue/plugins/index.ts +0 -28
  75. package/templates/template-vue/src/types/components.d.ts +21 -0
  76. package/templates/template-vue/tsconfig.node.json +1 -1
  77. package/templates/template-vue/vite.config.ts +13 -14
  78. package/templates/template-react/src/store/module/counter.ts +0 -20
  79. package/templates/template-vue/types/components.d.ts +0 -21
  80. /package/templates/{template-react/src/styles/mian.css → template-react-tanstack-jotai/src/styles/main.css} +0 -0
  81. /package/templates/template-vue/{types → src/types}/auto-imports.d.ts +0 -0
package/dist/index.mjs CHANGED
@@ -1,42 +1,42 @@
1
- import Rt from"readline";import It from"events";import A from"node:fs";import j from"node:path";import wi from"child_process";import re from"path";import ie from"fs";var yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xi(e,t){var n=e;t.slice(0,-1).forEach(function(l){n=n[l]||{}});var r=t[t.length-1];return r in n}function At(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function jt(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}var $i=function(e,t){t||(t={});var n={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(n.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?n.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(w){n.bools[w]=!0});var r={};function l(w){return r[w].some(function(x){return n.bools[x]})}Object.keys(t.alias||{}).forEach(function(w){r[w]=[].concat(t.alias[w]),r[w].forEach(function(x){r[x]=[w].concat(r[w].filter(function($){return x!==$}))})}),[].concat(t.string).filter(Boolean).forEach(function(w){n.strings[w]=!0,r[w]&&[].concat(r[w]).forEach(function(x){n.strings[x]=!0})});var p=t.default||{},i={_:[]};function g(w,x){return n.allBools&&/^--[^=]+$/.test(x)||n.strings[w]||n.bools[w]||r[w]}function h(w,x,$){for(var O=w,P=0;P<x.length-1;P++){var S=x[P];if(jt(O,S))return;O[S]===void 0&&(O[S]={}),(O[S]===Object.prototype||O[S]===Number.prototype||O[S]===String.prototype)&&(O[S]={}),O[S]===Array.prototype&&(O[S]=[]),O=O[S]}var M=x[x.length-1];jt(O,M)||((O===Object.prototype||O===Number.prototype||O===String.prototype)&&(O={}),O===Array.prototype&&(O=[]),O[M]===void 0||n.bools[M]||typeof O[M]=="boolean"?O[M]=$:Array.isArray(O[M])?O[M].push($):O[M]=[O[M],$])}function u(w,x,$){if(!($&&n.unknownFn&&!g(w,$)&&n.unknownFn($)===!1)){var O=!n.strings[w]&&At(x)?Number(x):x;h(i,w.split("."),O),(r[w]||[]).forEach(function(P){h(i,P.split("."),O)})}}Object.keys(n.bools).forEach(function(w){u(w,p[w]===void 0?!1:p[w])});var s=[];e.indexOf("--")!==-1&&(s=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var d=0;d<e.length;d++){var c=e[d],o,a;if(/^--.+=/.test(c)){var y=c.match(/^--([^=]+)=([\s\S]*)$/);o=y[1];var v=y[2];n.bools[o]&&(v=v!=="false"),u(o,v,c)}else if(/^--no-.+/.test(c))o=c.match(/^--no-(.+)/)[1],u(o,!1,c);else if(/^--.+/.test(c))o=c.match(/^--(.+)/)[1],a=e[d+1],a!==void 0&&!/^(-|--)[^-]/.test(a)&&!n.bools[o]&&!n.allBools&&(!r[o]||!l(o))?(u(o,a,c),d+=1):/^(true|false)$/.test(a)?(u(o,a==="true",c),d+=1):u(o,n.strings[o]?"":!0,c);else if(/^-[^-]+/.test(c)){for(var f=c.slice(1,-1).split(""),m=!1,b=0;b<f.length;b++){if(a=c.slice(b+2),a==="-"){u(f[b],a,c);continue}if(/[A-Za-z]/.test(f[b])&&a[0]==="="){u(f[b],a.slice(1),c),m=!0;break}if(/[A-Za-z]/.test(f[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(a)){u(f[b],a,c),m=!0;break}if(f[b+1]&&f[b+1].match(/\W/)){u(f[b],c.slice(b+2),c),m=!0;break}else u(f[b],n.strings[f[b]]?"":!0,c)}o=c.slice(-1)[0],!m&&o!=="-"&&(e[d+1]&&!/^(-|--)[^-]/.test(e[d+1])&&!n.bools[o]&&(!r[o]||!l(o))?(u(o,e[d+1],c),d+=1):e[d+1]&&/^(true|false)$/.test(e[d+1])?(u(o,e[d+1]==="true",c),d+=1):u(o,n.strings[o]?"":!0,c))}else if((!n.unknownFn||n.unknownFn(c)!==!1)&&i._.push(n.strings._||!At(c)?c:Number(c)),t.stopEarly){i._.push.apply(i._,e.slice(d+1));break}}return Object.keys(p).forEach(function(w){xi(i,w.split("."))||(h(i,w.split("."),p[w]),(r[w]||[]).forEach(function(x){h(i,x.split("."),p[w])}))}),t["--"]?i["--"]=s.slice():s.forEach(function(w){i._.push(w)}),i};const Si=Z($i);var se={exports:{}};let X=process||{},Ft=X.argv||[],Q=X.env||{},Oi=!(Q.NO_COLOR||Ft.includes("--no-color"))&&(!!Q.FORCE_COLOR||Ft.includes("--color")||X.platform==="win32"||(X.stdout||{}).isTTY&&Q.TERM!=="dumb"||!!Q.CI),Mi=(e,t,n=e)=>r=>{let l=""+r,p=l.indexOf(t,e.length);return~p?e+Pi(l,t,n,p)+t:e+l+t},Pi=(e,t,n,r)=>{let l="",p=0;do l+=e.substring(p,r)+n,p=r+t.length,r=e.indexOf(t,p);while(~r);return l+e.substring(p)},Nt=(e=Oi)=>{let t=e?Mi:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};se.exports=Nt(),se.exports.createColors=Nt;var F=se.exports;const Ti=Z(F);var ne={},oe,kt;function E(){if(kt)return oe;kt=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:n}=process.env,r={enabled:!t&&n!=="dumb"&&e!=="0",reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function l(g,h){let u=0,s,d="",c="";for(;u<g.length;u++)s=g[u],d+=s.open,c+=s.close,h.includes(s.close)&&(h=h.replace(s.rgx,s.close+s.open));return d+h+c}function p(g,h){let u={has:g,keys:h};return u.reset=r.reset.bind(u),u.bold=r.bold.bind(u),u.dim=r.dim.bind(u),u.italic=r.italic.bind(u),u.underline=r.underline.bind(u),u.inverse=r.inverse.bind(u),u.hidden=r.hidden.bind(u),u.strikethrough=r.strikethrough.bind(u),u.black=r.black.bind(u),u.red=r.red.bind(u),u.green=r.green.bind(u),u.yellow=r.yellow.bind(u),u.blue=r.blue.bind(u),u.magenta=r.magenta.bind(u),u.cyan=r.cyan.bind(u),u.white=r.white.bind(u),u.gray=r.gray.bind(u),u.grey=r.grey.bind(u),u.bgBlack=r.bgBlack.bind(u),u.bgRed=r.bgRed.bind(u),u.bgGreen=r.bgGreen.bind(u),u.bgYellow=r.bgYellow.bind(u),u.bgBlue=r.bgBlue.bind(u),u.bgMagenta=r.bgMagenta.bind(u),u.bgCyan=r.bgCyan.bind(u),u.bgWhite=r.bgWhite.bind(u),u}function i(g,h){let u={open:`\x1B[${g}m`,close:`\x1B[${h}m`,rgx:new RegExp(`\\x1b\\[${h}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(g)||(this.has.push(g),this.keys.push(u)),s===void 0?this:r.enabled?l(this.keys,s+""):s+""):s===void 0?p([g],[u]):r.enabled?l([u],s+""):s+""}}return oe=r,oe}var le,Yt;function Ei(){return Yt||(Yt=1,le=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),le}var he,Ht;function ue(){return Ht||(Ht=1,he=e=>{const t=["[\\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("|"),n=new RegExp(t,"g");return typeof e=="string"?e.replace(n,""):e}),he}var ae,Bt;function C(){if(Bt)return ae;Bt=1;const e="\x1B",t=`${e}[`,n="\x07",r={to(i,g){return g?`${t}${g+1};${i+1}H`:`${t}${i+1}G`},move(i,g){let h="";return i<0?h+=`${t}${-i}D`:i>0&&(h+=`${t}${i}C`),g<0?h+=`${t}${-g}A`:g>0&&(h+=`${t}${g}B`),h},up:(i=1)=>`${t}${i}A`,down:(i=1)=>`${t}${i}B`,forward:(i=1)=>`${t}${i}C`,backward:(i=1)=>`${t}${i}D`,nextLine:(i=1)=>`${t}E`.repeat(i),prevLine:(i=1)=>`${t}F`.repeat(i),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${e}7`,restore:`${e}8`},l={up:(i=1)=>`${t}S`.repeat(i),down:(i=1)=>`${t}T`.repeat(i)},p={screen:`${t}2J`,up:(i=1)=>`${t}1J`.repeat(i),down:(i=1)=>`${t}J`.repeat(i),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(i){let g="";for(let h=0;h<i;h++)g+=this.line+(h<i-1?r.up():"");return i&&(g+=r.left),g}};return ae={cursor:r,scroll:l,erase:p,beep:n},ae}var ce,Lt;function Ci(){if(Lt)return ce;Lt=1;function e(h,u){var s=typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(!s){if(Array.isArray(h)||(s=t(h))||u&&h&&typeof h.length=="number"){s&&(h=s);var d=0,c=function(){};return{s:c,n:function(){return d>=h.length?{done:!0}:{done:!1,value:h[d++]}},e:function(f){throw f},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,y;return{s:function(){s=s.call(h)},n:function(){var f=s.next();return o=f.done,f},e:function(f){a=!0,y=f},f:function(){try{!o&&s.return!=null&&s.return()}finally{if(a)throw y}}}}function t(h,u){if(h){if(typeof h=="string")return n(h,u);var s=Object.prototype.toString.call(h).slice(8,-1);if(s==="Object"&&h.constructor&&(s=h.constructor.name),s==="Map"||s==="Set")return Array.from(h);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return n(h,u)}}function n(h,u){(u==null||u>h.length)&&(u=h.length);for(var s=0,d=new Array(u);s<u;s++)d[s]=h[s];return d}const r=ue(),l=C(),p=l.erase,i=l.cursor,g=h=>[...r(h)].length;return ce=function(h,u){if(!u)return p.line+i.to(0);let s=0;const d=h.split(/\r?\n/);var c=e(d),o;try{for(c.s();!(o=c.n()).done;){let a=o.value;s+=1+Math.floor(Math.max(g(a)-1,0)/u)}}catch(a){c.e(a)}finally{c.f()}return p.lines(s)},ce}var de,Vt;function Ut(){if(Vt)return de;Vt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return de=process.platform==="win32"?t:e,de}var fe,Gt;function _i(){if(Gt)return fe;Gt=1;const e=E(),t=Ut(),n=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),r=h=>n[h]||n.default,l=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return fe={styles:n,render:r,symbols:l,symbol:(h,u,s)=>u?l.aborted:s?l.exited:h?l.done:l.default,delimiter:h=>e.gray(h?t.ellipsis:t.pointerSmall),item:(h,u)=>e.gray(h?u?t.pointerSmall:"+":t.line)},fe}var pe,zt;function qi(){if(zt)return pe;zt=1;const e=ue();return pe=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map(l=>Math.ceil(l.length/n)).reduce((l,p)=>l+p):r.length},pe}var me,Wt;function Di(){return Wt||(Wt=1,me=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((p,i)=>(i.length+n.length>=r||p[p.length-1].length+i.length+1<r?p[p.length-1]+=` ${i}`:p.push(`${n}${i}`),p),[n]).join(`
1
+ import Dt from"readline";import It from"events";import j from"node:fs";import F from"node:path";import vi from"child_process";import te from"path";import re from"fs";var bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ie,At;function wi(){if(At)return ie;At=1;function e(t,o){var u=t;o.slice(0,-1).forEach(function(g){u=u[g]||{}});var s=o[o.length-1];return s in u}function n(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function a(t,o){return o==="constructor"&&typeof t[o]=="function"||o==="__proto__"}return ie=function(t,o){o||(o={});var u={bools:{},strings:{},unknownFn:null};typeof o.unknown=="function"&&(u.unknownFn=o.unknown),typeof o.boolean=="boolean"&&o.boolean?u.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach(function(M){u.bools[M]=!0});var s={};function g(M){return s[M].some(function(P){return u.bools[P]})}Object.keys(o.alias||{}).forEach(function(M){s[M]=[].concat(o.alias[M]),s[M].forEach(function(P){s[P]=[M].concat(s[M].filter(function(O){return P!==O}))})}),[].concat(o.string).filter(Boolean).forEach(function(M){u.strings[M]=!0,s[M]&&[].concat(s[M]).forEach(function(P){u.strings[P]=!0})});var r=o.default||{},h={_:[]};function i(M,P){return u.allBools&&/^--[^=]+$/.test(P)||u.strings[M]||u.bools[M]||s[M]}function d(M,P,O){for(var $=M,T=0;T<P.length-1;T++){var E=P[T];if(a($,E))return;$[E]===void 0&&($[E]={}),($[E]===Object.prototype||$[E]===Number.prototype||$[E]===String.prototype)&&($[E]={}),$[E]===Array.prototype&&($[E]=[]),$=$[E]}var q=P[P.length-1];a($,q)||(($===Object.prototype||$===Number.prototype||$===String.prototype)&&($={}),$===Array.prototype&&($=[]),$[q]===void 0||u.bools[q]||typeof $[q]=="boolean"?$[q]=O:Array.isArray($[q])?$[q].push(O):$[q]=[$[q],O])}function f(M,P,O){if(!(O&&u.unknownFn&&!i(M,O)&&u.unknownFn(O)===!1)){var $=!u.strings[M]&&n(P)?Number(P):P;d(h,M.split("."),$),(s[M]||[]).forEach(function(T){d(h,T.split("."),$)})}}Object.keys(u.bools).forEach(function(M){f(M,r[M]===void 0?!1:r[M])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var c=0;c<t.length;c++){var b=t[c],v,p;if(/^--.+=/.test(b)){var m=b.match(/^--([^=]+)=([\s\S]*)$/);v=m[1];var w=m[2];u.bools[v]&&(w=w!=="false"),f(v,w,b)}else if(/^--no-.+/.test(b))v=b.match(/^--no-(.+)/)[1],f(v,!1,b);else if(/^--.+/.test(b))v=b.match(/^--(.+)/)[1],p=t[c+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!u.bools[v]&&!u.allBools&&(!s[v]||!g(v))?(f(v,p,b),c+=1):/^(true|false)$/.test(p)?(f(v,p==="true",b),c+=1):f(v,u.strings[v]?"":!0,b);else if(/^-[^-]+/.test(b)){for(var y=b.slice(1,-1).split(""),x=!1,S=0;S<y.length;S++){if(p=b.slice(S+2),p==="-"){f(y[S],p,b);continue}if(/[A-Za-z]/.test(y[S])&&p[0]==="="){f(y[S],p.slice(1),b),x=!0;break}if(/[A-Za-z]/.test(y[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){f(y[S],p,b),x=!0;break}if(y[S+1]&&y[S+1].match(/\W/)){f(y[S],b.slice(S+2),b),x=!0;break}else f(y[S],u.strings[y[S]]?"":!0,b)}v=b.slice(-1)[0],!x&&v!=="-"&&(t[c+1]&&!/^(-|--)[^-]/.test(t[c+1])&&!u.bools[v]&&(!s[v]||!g(v))?(f(v,t[c+1],b),c+=1):t[c+1]&&/^(true|false)$/.test(t[c+1])?(f(v,t[c+1]==="true",b),c+=1):f(v,u.strings[v]?"":!0,b))}else if((!u.unknownFn||u.unknownFn(b)!==!1)&&h._.push(u.strings._||!n(b)?b:Number(b)),o.stopEarly){h._.push.apply(h._,t.slice(c+1));break}}return Object.keys(r).forEach(function(M){e(h,M.split("."))||(d(h,M.split("."),r[M]),(s[M]||[]).forEach(function(P){d(h,P.split("."),r[M])}))}),o["--"]?h["--"]=l.slice():l.forEach(function(M){h._.push(M)}),h},ie}var yi=wi();const xi=Z(yi);var X={exports:{}},jt;function $i(){if(jt)return X.exports;jt=1;let e=process||{},n=e.argv||[],a=e.env||{},t=!(a.NO_COLOR||n.includes("--no-color"))&&(!!a.FORCE_COLOR||n.includes("--color")||e.platform==="win32"||(e.stdout||{}).isTTY&&a.TERM!=="dumb"||!!a.CI),o=(g,r,h=g)=>i=>{let d=""+i,f=d.indexOf(r,g.length);return~f?g+u(d,r,h,f)+r:g+d+r},u=(g,r,h,i)=>{let d="",f=0;do d+=g.substring(f,i)+h,f=i+r.length,i=g.indexOf(r,f);while(~i);return d+g.substring(f)},s=(g=t)=>{let r=g?o:()=>String;return{isColorSupported:g,reset:r("\x1B[0m","\x1B[0m"),bold:r("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:r("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:r("\x1B[3m","\x1B[23m"),underline:r("\x1B[4m","\x1B[24m"),inverse:r("\x1B[7m","\x1B[27m"),hidden:r("\x1B[8m","\x1B[28m"),strikethrough:r("\x1B[9m","\x1B[29m"),black:r("\x1B[30m","\x1B[39m"),red:r("\x1B[31m","\x1B[39m"),green:r("\x1B[32m","\x1B[39m"),yellow:r("\x1B[33m","\x1B[39m"),blue:r("\x1B[34m","\x1B[39m"),magenta:r("\x1B[35m","\x1B[39m"),cyan:r("\x1B[36m","\x1B[39m"),white:r("\x1B[37m","\x1B[39m"),gray:r("\x1B[90m","\x1B[39m"),bgBlack:r("\x1B[40m","\x1B[49m"),bgRed:r("\x1B[41m","\x1B[49m"),bgGreen:r("\x1B[42m","\x1B[49m"),bgYellow:r("\x1B[43m","\x1B[49m"),bgBlue:r("\x1B[44m","\x1B[49m"),bgMagenta:r("\x1B[45m","\x1B[49m"),bgCyan:r("\x1B[46m","\x1B[49m"),bgWhite:r("\x1B[47m","\x1B[49m"),blackBright:r("\x1B[90m","\x1B[39m"),redBright:r("\x1B[91m","\x1B[39m"),greenBright:r("\x1B[92m","\x1B[39m"),yellowBright:r("\x1B[93m","\x1B[39m"),blueBright:r("\x1B[94m","\x1B[39m"),magentaBright:r("\x1B[95m","\x1B[39m"),cyanBright:r("\x1B[96m","\x1B[39m"),whiteBright:r("\x1B[97m","\x1B[39m"),bgBlackBright:r("\x1B[100m","\x1B[49m"),bgRedBright:r("\x1B[101m","\x1B[49m"),bgGreenBright:r("\x1B[102m","\x1B[49m"),bgYellowBright:r("\x1B[103m","\x1B[49m"),bgBlueBright:r("\x1B[104m","\x1B[49m"),bgMagentaBright:r("\x1B[105m","\x1B[49m"),bgCyanBright:r("\x1B[106m","\x1B[49m"),bgWhiteBright:r("\x1B[107m","\x1B[49m")}};return X.exports=s(),X.exports.createColors=s,X.exports}var N=$i();const Si=Z(N);var se={},ne,Ft;function C(){if(Ft)return ne;Ft=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:n,TERM:a}=process.env,t={enabled:!n&&a!=="dumb"&&e!=="0",reset:s(0,0),bold:s(1,22),dim:s(2,22),italic:s(3,23),underline:s(4,24),inverse:s(7,27),hidden:s(8,28),strikethrough:s(9,29),black:s(30,39),red:s(31,39),green:s(32,39),yellow:s(33,39),blue:s(34,39),magenta:s(35,39),cyan:s(36,39),white:s(37,39),gray:s(90,39),grey:s(90,39),bgBlack:s(40,49),bgRed:s(41,49),bgGreen:s(42,49),bgYellow:s(43,49),bgBlue:s(44,49),bgMagenta:s(45,49),bgCyan:s(46,49),bgWhite:s(47,49)};function o(g,r){let h=0,i,d="",f="";for(;h<g.length;h++)i=g[h],d+=i.open,f+=i.close,r.includes(i.close)&&(r=r.replace(i.rgx,i.close+i.open));return d+r+f}function u(g,r){let h={has:g,keys:r};return h.reset=t.reset.bind(h),h.bold=t.bold.bind(h),h.dim=t.dim.bind(h),h.italic=t.italic.bind(h),h.underline=t.underline.bind(h),h.inverse=t.inverse.bind(h),h.hidden=t.hidden.bind(h),h.strikethrough=t.strikethrough.bind(h),h.black=t.black.bind(h),h.red=t.red.bind(h),h.green=t.green.bind(h),h.yellow=t.yellow.bind(h),h.blue=t.blue.bind(h),h.magenta=t.magenta.bind(h),h.cyan=t.cyan.bind(h),h.white=t.white.bind(h),h.gray=t.gray.bind(h),h.grey=t.grey.bind(h),h.bgBlack=t.bgBlack.bind(h),h.bgRed=t.bgRed.bind(h),h.bgGreen=t.bgGreen.bind(h),h.bgYellow=t.bgYellow.bind(h),h.bgBlue=t.bgBlue.bind(h),h.bgMagenta=t.bgMagenta.bind(h),h.bgCyan=t.bgCyan.bind(h),h.bgWhite=t.bgWhite.bind(h),h}function s(g,r){let h={open:`\x1B[${g}m`,close:`\x1B[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(g)||(this.has.push(g),this.keys.push(h)),i===void 0?this:t.enabled?o(this.keys,i+""):i+""):i===void 0?u([g],[h]):t.enabled?o([h],i+""):i+""}}return ne=t,ne}var oe,Nt;function Mi(){return Nt||(Nt=1,oe=(e,n)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(n){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),oe}var he,kt;function le(){return kt||(kt=1,he=e=>{const n=["[\\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("|"),a=new RegExp(n,"g");return typeof e=="string"?e.replace(a,""):e}),he}var ue,Yt;function R(){if(Yt)return ue;Yt=1;const e="\x1B",n=`${e}[`,a="\x07",t={to(s,g){return g?`${n}${g+1};${s+1}H`:`${n}${s+1}G`},move(s,g){let r="";return s<0?r+=`${n}${-s}D`:s>0&&(r+=`${n}${s}C`),g<0?r+=`${n}${-g}A`:g>0&&(r+=`${n}${g}B`),r},up:(s=1)=>`${n}${s}A`,down:(s=1)=>`${n}${s}B`,forward:(s=1)=>`${n}${s}C`,backward:(s=1)=>`${n}${s}D`,nextLine:(s=1)=>`${n}E`.repeat(s),prevLine:(s=1)=>`${n}F`.repeat(s),left:`${n}G`,hide:`${n}?25l`,show:`${n}?25h`,save:`${e}7`,restore:`${e}8`},o={up:(s=1)=>`${n}S`.repeat(s),down:(s=1)=>`${n}T`.repeat(s)},u={screen:`${n}2J`,up:(s=1)=>`${n}1J`.repeat(s),down:(s=1)=>`${n}J`.repeat(s),line:`${n}2K`,lineEnd:`${n}K`,lineStart:`${n}1K`,lines(s){let g="";for(let r=0;r<s;r++)g+=this.line+(r<s-1?t.up():"");return s&&(g+=t.left),g}};return ue={cursor:t,scroll:o,erase:u,beep:a},ue}var ae,Ht;function Oi(){if(Ht)return ae;Ht=1;function e(r,h){var i=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=n(r))||h){i&&(r=i);var d=0,f=function(){};return{s:f,n:function(){return d>=r.length?{done:!0}:{done:!1,value:r[d++]}},e:function(p){throw p},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l=!0,c=!1,b;return{s:function(){i=i.call(r)},n:function(){var p=i.next();return l=p.done,p},e:function(p){c=!0,b=p},f:function(){try{!l&&i.return!=null&&i.return()}finally{if(c)throw b}}}}function n(r,h){if(r){if(typeof r=="string")return a(r,h);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(r);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return a(r,h)}}function a(r,h){(h==null||h>r.length)&&(h=r.length);for(var i=0,d=new Array(h);i<h;i++)d[i]=r[i];return d}const t=le(),o=R(),u=o.erase,s=o.cursor,g=r=>[...t(r)].length;return ae=function(r,h){if(!h)return u.line+s.to(0);let i=0;const d=r.split(/\r?\n/);var f=e(d),l;try{for(f.s();!(l=f.n()).done;){let c=l.value;i+=1+Math.floor(Math.max(g(c)-1,0)/h)}}catch(c){f.e(c)}finally{f.f()}return u.lines(i)},ae}var ce,Bt;function Lt(){if(Bt)return ce;Bt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},n={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return ce=process.platform==="win32"?n:e,ce}var de,Vt;function Pi(){if(Vt)return de;Vt=1;const e=C(),n=Lt(),a=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),t=r=>a[r]||a.default,o=Object.freeze({aborted:e.red(n.cross),done:e.green(n.tick),exited:e.yellow(n.cross),default:e.cyan("?")});return de={styles:a,render:t,symbols:o,symbol:(r,h,i)=>h?o.aborted:i?o.exited:r?o.done:o.default,delimiter:r=>e.gray(r?n.ellipsis:n.pointerSmall),item:(r,h)=>e.gray(r?h?n.pointerSmall:"+":n.line)},de}var fe,Ut;function Ti(){if(Ut)return fe;Ut=1;const e=le();return fe=function(n,a){let t=String(e(n)||"").split(/\r?\n/);return a?t.map(o=>Math.ceil(o.length/a)).reduce((o,u)=>o+u):t.length},fe}var pe,Gt;function qi(){return Gt||(Gt=1,pe=(e,n={})=>{const a=Number.isSafeInteger(parseInt(n.margin))?new Array(parseInt(n.margin)).fill(" ").join(""):n.margin||"",t=n.width;return(e||"").split(/\r?\n/g).map(o=>o.split(/\s+/g).reduce((u,s)=>(s.length+a.length>=t||u[u.length-1].length+s.length+1<t?u[u.length-1]+=` ${s}`:u.push(`${a}${s}`),u),[a]).join(`
3
3
  `)).join(`
4
- `)}),me}var ge,Jt;function Ri(){return Jt||(Jt=1,ge=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let l=Math.min(r+n,t);return{startIndex:r,endIndex:l}}),ge}var ve,Kt;function Y(){return Kt||(Kt=1,ve={action:Ei(),clear:Ci(),style:_i(),strip:ue(),figures:Ut(),lines:qi(),wrap:Di(),entriesToDisplay:Ri()}),ve}var be,Zt;function V(){if(Zt)return be;Zt=1;const e=Rt,t=Y(),n=t.action,r=It,l=C(),p=l.beep,i=l.cursor,g=E();class h extends r{constructor(s={}){super(),this.firstRender=!0,this.in=s.stdin||process.stdin,this.out=s.stdout||process.stdout,this.onRender=(s.onRender||(()=>{})).bind(this);const d=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,d),this.in.isTTY&&this.in.setRawMode(!0);const c=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,o=(a,y)=>{let v=n(y,c);v===!1?this._&&this._(a,y):typeof this[v]=="function"?this[v](y):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",o),this.in.isTTY&&this.in.setRawMode(!1),d.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",o)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(p)}render(){this.onRender(g),this.firstRender&&(this.firstRender=!1)}}return be=h,be}var we,Xt;function Ii(){if(Xt)return we;Xt=1;function e(o,a,y,v,f,m,b){try{var w=o[m](b),x=w.value}catch($){y($);return}w.done?a(x):Promise.resolve(x).then(v,f)}function t(o){return function(){var a=this,y=arguments;return new Promise(function(v,f){var m=o.apply(a,y);function b(x){e(m,v,f,b,w,"next",x)}function w(x){e(m,v,f,b,w,"throw",x)}b(void 0)})}}const n=E(),r=V(),l=C(),p=l.erase,i=l.cursor,g=Y(),h=g.style,u=g.clear,s=g.lines,d=g.figures;class c extends r{constructor(a={}){super(a),this.transform=h.render(a.style),this.scale=this.transform.scale,this.msg=a.message,this.initial=a.initial||"",this.validator=a.validate||(()=>!0),this.value="",this.errorMsg=a.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=u("",this.out.columns),this.render()}set value(a){!a&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(a)),this._value=a,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
5
- `),this.close()}validate(){var a=this;return t(function*(){let y=yield a.validator(a.value);typeof y=="string"&&(a.errorMsg=y,y=!1),a.error=!y})()}submit(){var a=this;return t(function*(){if(a.value=a.value||a.initial,a.cursorOffset=0,a.cursor=a.rendered.length,yield a.validate(),a.error){a.red=!0,a.fire(),a.render();return}a.done=!0,a.aborted=!1,a.fire(),a.render(),a.out.write(`
6
- `),a.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(a){this.placeholder||(this.cursor=this.cursor+a,this.cursorOffset+=a)}_(a,y){let v=this.value.slice(0,this.cursor),f=this.value.slice(this.cursor);this.value=`${v}${a}${f}`,this.red=!1,this.cursor=this.placeholder?0:v.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let a=this.value.slice(0,this.cursor-1),y=this.value.slice(this.cursor);this.value=`${a}${y}`,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 a=this.value.slice(0,this.cursor),y=this.value.slice(this.cursor+1);this.value=`${a}${y}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(i.down(s(this.outputError,this.out.columns)-1)+u(this.outputError,this.out.columns)),this.out.write(u(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),n.bold(this.msg),h.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
- `).reduce((a,y,v)=>a+`
8
- ${v?" ":d.pointerSmall} ${n.red().italic(y)}`,"")),this.out.write(p.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore+i.move(this.cursorOffset,0)))}}return we=c,we}var ye,Qt;function Ai(){if(Qt)return ye;Qt=1;const e=E(),t=V(),n=Y(),r=n.style,l=n.clear,p=n.figures,i=n.wrap,g=n.entriesToDisplay,h=C(),u=h.cursor;class s extends t{constructor(c={}){super(c),this.msg=c.message,this.hint=c.hint||"- Use arrow-keys. Return to submit.",this.warn=c.warn||"- This option is disabled",this.cursor=c.initial||0,this.choices=c.choices.map((o,a)=>(typeof o=="string"&&(o={title:o,value:a}),{title:o&&(o.title||o.value||o),value:o&&(o.value===void 0?a:o.value),description:o&&o.description,selected:o&&o.selected,disabled:o&&o.disabled})),this.optionsPerPage=c.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=l("",this.out.columns),this.render()}moveCursor(c){this.cursor=c,this.value=this.choices[c].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(`
4
+ `)}),pe}var me,zt;function Ei(){return zt||(zt=1,me=(e,n,a)=>{a=a||n;let t=Math.min(n-a,e-Math.floor(a/2));t<0&&(t=0);let o=Math.min(t+a,n);return{startIndex:t,endIndex:o}}),me}var ge,Wt;function Y(){return Wt||(Wt=1,ge={action:Mi(),clear:Oi(),style:Pi(),strip:le(),figures:Lt(),lines:Ti(),wrap:qi(),entriesToDisplay:Ei()}),ge}var ve,Jt;function V(){if(Jt)return ve;Jt=1;const e=Dt,n=Y(),a=n.action,t=It,o=R(),u=o.beep,s=o.cursor,g=C();class r extends t{constructor(i={}){super(),this.firstRender=!0,this.in=i.stdin||process.stdin,this.out=i.stdout||process.stdout,this.onRender=(i.onRender||(()=>{})).bind(this);const d=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,d),this.in.isTTY&&this.in.setRawMode(!0);const f=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,l=(c,b)=>{let v=a(b,f);v===!1?this._&&this._(c,b):typeof this[v]=="function"?this[v](b):this.bell()};this.close=()=>{this.out.write(s.show),this.in.removeListener("keypress",l),this.in.isTTY&&this.in.setRawMode(!1),d.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",l)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(u)}render(){this.onRender(g),this.firstRender&&(this.firstRender=!1)}}return ve=r,ve}var be,Kt;function Ci(){if(Kt)return be;Kt=1;function e(l,c,b,v,p,m,w){try{var y=l[m](w),x=y.value}catch(S){b(S);return}y.done?c(x):Promise.resolve(x).then(v,p)}function n(l){return function(){var c=this,b=arguments;return new Promise(function(v,p){var m=l.apply(c,b);function w(x){e(m,v,p,w,y,"next",x)}function y(x){e(m,v,p,w,y,"throw",x)}w(void 0)})}}const a=C(),t=V(),o=R(),u=o.erase,s=o.cursor,g=Y(),r=g.style,h=g.clear,i=g.lines,d=g.figures;class f extends t{constructor(c={}){super(c),this.transform=r.render(c.style),this.scale=this.transform.scale,this.msg=c.message,this.initial=c.initial||"",this.validator=c.validate||(()=>!0),this.value="",this.errorMsg=c.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=h("",this.out.columns),this.render()}set value(c){!c&&this.initial?(this.placeholder=!0,this.rendered=a.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(c)),this._value=c,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
5
+ `),this.close()}validate(){var c=this;return n(function*(){let b=yield c.validator(c.value);typeof b=="string"&&(c.errorMsg=b,b=!1),c.error=!b})()}submit(){var c=this;return n(function*(){if(c.value=c.value||c.initial,c.cursorOffset=0,c.cursor=c.rendered.length,yield c.validate(),c.error){c.red=!0,c.fire(),c.render();return}c.done=!0,c.aborted=!1,c.fire(),c.render(),c.out.write(`
6
+ `),c.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(c){this.placeholder||(this.cursor=this.cursor+c,this.cursorOffset+=c)}_(c,b){let v=this.value.slice(0,this.cursor),p=this.value.slice(this.cursor);this.value=`${v}${c}${p}`,this.red=!1,this.cursor=this.placeholder?0:v.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let c=this.value.slice(0,this.cursor-1),b=this.value.slice(this.cursor);this.value=`${c}${b}`,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 c=this.value.slice(0,this.cursor),b=this.value.slice(this.cursor+1);this.value=`${c}${b}`,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(s.down(i(this.outputError,this.out.columns)-1)+h(this.outputError,this.out.columns)),this.out.write(h(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[r.symbol(this.done,this.aborted),a.bold(this.msg),r.delimiter(this.done),this.red?a.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
+ `).reduce((c,b,v)=>c+`
8
+ ${v?" ":d.pointerSmall} ${a.red().italic(b)}`,"")),this.out.write(u.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore+s.move(this.cursorOffset,0)))}}return be=f,be}var we,Zt;function Ri(){if(Zt)return we;Zt=1;const e=C(),n=V(),a=Y(),t=a.style,o=a.clear,u=a.figures,s=a.wrap,g=a.entriesToDisplay,r=R(),h=r.cursor;class i extends n{constructor(f={}){super(f),this.msg=f.message,this.hint=f.hint||"- Use arrow-keys. Return to submit.",this.warn=f.warn||"- This option is disabled",this.cursor=f.initial||0,this.choices=f.choices.map((l,c)=>(typeof l=="string"&&(l={title:l,value:c}),{title:l&&(l.title||l.value||l),value:l&&(l.value===void 0?c:l.value),description:l&&l.description,selected:l&&l.selected,disabled:l&&l.disabled})),this.optionsPerPage=f.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=o("",this.out.columns),this.render()}moveCursor(f){this.cursor=f,this.value=this.choices[f].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
9
9
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
10
- `),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()}_(c,o){if(c===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(u.hide):this.out.write(l(this.outputText,this.out.columns)),super.render();let c=g(this.cursor,this.choices.length,this.optionsPerPage),o=c.startIndex,a=c.endIndex;if(this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
- `;for(let y=o;y<a;y++){let v,f,m="",b=this.choices[y];y===o&&o>0?f=p.arrowUp:y===a-1&&a<this.choices.length?f=p.arrowDown:f=" ",b.disabled?(v=this.cursor===y?e.gray().underline(b.title):e.strikethrough().gray(b.title),f=(this.cursor===y?e.bold().gray(p.pointer)+" ":" ")+f):(v=this.cursor===y?e.cyan().underline(b.title):b.title,f=(this.cursor===y?e.cyan(p.pointer)+" ":" ")+f,b.description&&this.cursor===y&&(m=` - ${b.description}`,(f.length+v.length+m.length>=this.out.columns||b.description.split(/\r?\n/).length>1)&&(m=`
12
- `+i(b.description,{margin:3,width:this.out.columns})))),this.outputText+=`${f} ${v}${e.gray(m)}
13
- `}}this.out.write(this.outputText)}}return ye=s,ye}var xe,er;function ji(){if(er)return xe;er=1;const e=E(),t=V(),n=Y(),r=n.style,l=n.clear,p=C(),i=p.cursor,g=p.erase;class h extends t{constructor(s={}){super(s),this.msg=s.message,this.value=!!s.initial,this.active=s.active||"on",this.inactive=s.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(`
10
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(f,l){if(f===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(h.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let f=g(this.cursor,this.choices.length,this.optionsPerPage),l=f.startIndex,c=f.endIndex;if(this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
+ `;for(let b=l;b<c;b++){let v,p,m="",w=this.choices[b];b===l&&l>0?p=u.arrowUp:b===c-1&&c<this.choices.length?p=u.arrowDown:p=" ",w.disabled?(v=this.cursor===b?e.gray().underline(w.title):e.strikethrough().gray(w.title),p=(this.cursor===b?e.bold().gray(u.pointer)+" ":" ")+p):(v=this.cursor===b?e.cyan().underline(w.title):w.title,p=(this.cursor===b?e.cyan(u.pointer)+" ":" ")+p,w.description&&this.cursor===b&&(m=` - ${w.description}`,(p.length+v.length+m.length>=this.out.columns||w.description.split(/\r?\n/).length>1)&&(m=`
12
+ `+s(w.description,{margin:3,width:this.out.columns})))),this.outputText+=`${p} ${v}${e.gray(m)}
13
+ `}}this.out.write(this.outputText)}}return we=i,we}var ye,Xt;function _i(){if(Xt)return ye;Xt=1;const e=C(),n=V(),a=Y(),t=a.style,o=a.clear,u=R(),s=u.cursor,g=u.erase;class r extends n{constructor(i={}){super(i),this.msg=i.message,this.value=!!i.initial,this.active=i.active||"on",this.inactive=i.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
14
14
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
15
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(s,d){if(s===" ")this.value=!this.value;else if(s==="1")this.value=!0;else if(s==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.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(g.line+i.to(0)+this.outputText))}}return xe=h,xe}var $e,tr;function B(){if(tr)return $e;tr=1;class e{constructor({token:n,date:r,parts:l,locales:p}){this.token=n,this.date=r||new Date,this.parts=l||[this],this.locales=p||{}}up(){}down(){}next(){const n=this.parts.indexOf(this);return this.parts.find((r,l)=>l>n&&r instanceof e)}setTo(n){}prev(){let n=[].concat(this.parts).reverse();const r=n.indexOf(this);return n.find((l,p)=>p>r&&l instanceof e)}toString(){return String(this.date)}}return $e=e,$e}var Se,rr;function Fi(){if(rr)return Se;rr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}return Se=t,Se}var Oe,ir;function Ni(){if(ir)return Oe;ir=1;const e=B(),t=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th");class n extends e{constructor(l={}){super(l)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(l){this.date.setDate(parseInt(l.substr(-2)))}toString(){let l=this.date.getDate(),p=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+t(l):this.token==="d"?p+1:this.token==="ddd"?this.locales.weekdaysShort[p]:this.token==="dddd"?this.locales.weekdays[p]:l}}return Oe=n,Oe}var Me,sr;function ki(){if(sr)return Me;sr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}}return Me=t,Me}var Pe,nr;function Yi(){if(nr)return Pe;nr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Pe=t,Pe}var Te,or;function Hi(){if(or)return Te;or=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}return Te=t,Te}var Ee,lr;function Bi(){if(lr)return Ee;lr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),l=this.token.length;return l===2?String(r+1).padStart(2,"0"):l===3?this.locales.monthsShort[r]:l===4?this.locales.months[r]:String(r+1)}}return Ee=t,Ee}var Ce,hr;function Li(){if(hr)return Ce;hr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}return Ce=t,Ce}var _e,ur;function Vi(){if(ur)return _e;ur=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}return _e=t,_e}var qe,ar;function Ui(){return ar||(ar=1,qe={DatePart:B(),Meridiem:Fi(),Day:Ni(),Hours:ki(),Milliseconds:Yi(),Minutes:Hi(),Month:Bi(),Seconds:Li(),Year:Vi()}),qe}var De,cr;function Gi(){if(cr)return De;cr=1;function e(S,M,T,R,_,q,k){try{var I=S[q](k),D=I.value}catch(G){T(G);return}I.done?M(D):Promise.resolve(D).then(R,_)}function t(S){return function(){var M=this,T=arguments;return new Promise(function(R,_){var q=S.apply(M,T);function k(D){e(q,R,_,k,I,"next",D)}function I(D){e(q,R,_,k,I,"throw",D)}k(void 0)})}}const n=E(),r=V(),l=Y(),p=l.style,i=l.clear,g=l.figures,h=C(),u=h.erase,s=h.cursor,d=Ui(),c=d.DatePart,o=d.Meridiem,a=d.Day,y=d.Hours,v=d.Milliseconds,f=d.Minutes,m=d.Month,b=d.Seconds,w=d.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,$={1:({token:S})=>S.replace(/\\(.)/g,"$1"),2:S=>new a(S),3:S=>new m(S),4:S=>new w(S),5:S=>new o(S),6:S=>new y(S),7:S=>new f(S),8:S=>new b(S),9:S=>new v(S)},O={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class P extends r{constructor(M={}){super(M),this.msg=M.message,this.cursor=0,this.typed="",this.locales=Object.assign(O,M.locales),this._date=M.initial||new Date,this.errorMsg=M.error||"Please Enter A Valid Value",this.validator=M.validate||(()=>!0),this.mask=M.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(M){M&&this._date.setTime(M.getTime())}set mask(M){let T;for(this.parts=[];T=x.exec(M);){let _=T.shift(),q=T.findIndex(k=>k!=null);this.parts.push(q in $?$[q]({token:T[q]||_,date:this.date,parts:this.parts,locales:this.locales}):T[q]||_)}let R=this.parts.reduce((_,q)=>(typeof q=="string"&&typeof _[_.length-1]=="string"?_[_.length-1]+=q:_.push(q),_),[]);this.parts.splice(0),this.parts.push(...R),this.reset()}moveCursor(M){this.typed="",this.cursor=M,this.fire()}reset(){this.moveCursor(this.parts.findIndex(M=>M instanceof c)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
- `),this.close()}validate(){var M=this;return t(function*(){let T=yield M.validator(M.value);typeof T=="string"&&(M.errorMsg=T,T=!1),M.error=!T})()}submit(){var M=this;return t(function*(){if(yield M.validate(),M.error){M.color="red",M.fire(),M.render();return}M.done=!0,M.aborted=!1,M.fire(),M.render(),M.out.write(`
17
- `),M.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let M=this.parts[this.cursor].prev();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}right(){let M=this.parts[this.cursor].next();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}next(){let M=this.parts[this.cursor].next();this.moveCursor(M?this.parts.indexOf(M):this.parts.findIndex(T=>T instanceof c)),this.render()}_(M){/\d/.test(M)&&(this.typed+=M,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[p.symbol(this.done,this.aborted),n.bold(this.msg),p.delimiter(!1),this.parts.reduce((M,T,R)=>M.concat(R===this.cursor&&!this.done?n.cyan().underline(T.toString()):T),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
- `).reduce((M,T,R)=>M+`
19
- ${R?" ":g.pointerSmall} ${n.red().italic(T)}`,"")),this.out.write(u.line+s.to(0)+this.outputText))}}return De=P,De}var Re,dr;function zi(){if(dr)return Re;dr=1;function e(v,f,m,b,w,x,$){try{var O=v[x]($),P=O.value}catch(S){m(S);return}O.done?f(P):Promise.resolve(P).then(b,w)}function t(v){return function(){var f=this,m=arguments;return new Promise(function(b,w){var x=v.apply(f,m);function $(P){e(x,b,w,$,O,"next",P)}function O(P){e(x,b,w,$,O,"throw",P)}$(void 0)})}}const n=E(),r=V(),l=C(),p=l.cursor,i=l.erase,g=Y(),h=g.style,u=g.figures,s=g.clear,d=g.lines,c=/[0-9]/,o=v=>v!==void 0,a=(v,f)=>{let m=Math.pow(10,f);return Math.round(v*m)/m};class y extends r{constructor(f={}){super(f),this.transform=h.render(f.style),this.msg=f.message,this.initial=o(f.initial)?f.initial:"",this.float=!!f.float,this.round=f.round||2,this.inc=f.increment||1,this.min=o(f.min)?f.min:-1/0,this.max=o(f.max)?f.max:1/0,this.errorMsg=f.error||"Please Enter A Valid Value",this.validator=f.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(f){!f&&f!==0?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${a(f,this.round)}`),this._value=a(f,this.round)),this.fire()}get value(){return this._value}parse(f){return this.float?parseFloat(f):parseInt(f)}valid(f){return f==="-"||f==="."&&this.float||c.test(f)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let f=this.value;this.value=f!==""?f:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
- `),this.close()}validate(){var f=this;return t(function*(){let m=yield f.validator(f.value);typeof m=="string"&&(f.errorMsg=m,m=!1),f.error=!m})()}submit(){var f=this;return t(function*(){if(yield f.validate(),f.error){f.color="red",f.fire(),f.render();return}let m=f.value;f.value=m!==""?m:f.initial,f.done=!0,f.aborted=!1,f.error=!1,f.fire(),f.render(),f.out.write(`
21
- `),f.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 f=this.value.toString();if(f.length===0)return this.bell();this.value=this.parse(f=f.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()}_(f,m){if(!this.valid(f))return this.bell();const b=Date.now();if(b-this.lastHit>1e3&&(this.typed=""),this.typed+=f,this.lastHit=b,this.color="cyan",f===".")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(p.down(d(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),n.bold(this.msg),h.delimiter(this.done),!this.done||!this.done&&!this.placeholder?n[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
22
- `).reduce((f,m,b)=>f+`
23
- ${b?" ":u.pointerSmall} ${n.red().italic(m)}`,"")),this.out.write(i.line+p.to(0)+this.outputText+p.save+this.outputError+p.restore))}}return Re=y,Re}var Ie,fr;function pr(){if(fr)return Ie;fr=1;const e=E(),t=C(),n=t.cursor,r=V(),l=Y(),p=l.clear,i=l.figures,g=l.style,h=l.wrap,u=l.entriesToDisplay;class s extends r{constructor(c={}){super(c),this.msg=c.message,this.cursor=c.cursor||0,this.scrollIndex=c.cursor||0,this.hint=c.hint||"",this.warn=c.warn||"- This option is disabled -",this.minSelected=c.min,this.showMinError=!1,this.maxChoices=c.max,this.instructions=c.instructions,this.optionsPerPage=c.optionsPerPage||10,this.value=c.choices.map((o,a)=>(typeof o=="string"&&(o={title:o,value:a}),{title:o&&(o.title||o.value||o),description:o&&o.description,value:o&&(o.value===void 0?a:o.value),selected:o&&o.selected,disabled:o&&o.disabled})),this.clear=p("",this.out.columns),c.overrideRender||this.render()}reset(){this.value.map(c=>!c.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(c=>c.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
24
- `),this.close()}submit(){const c=this.value.filter(o=>o.selected);this.minSelected&&c.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
25
- `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(c=>c.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const c=this.value[this.cursor];if(c.selected)c.selected=!1,this.render();else{if(c.disabled||this.value.filter(o=>o.selected).length>=this.maxChoices)return this.bell();c.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const c=!this.value[this.cursor].selected;this.value.filter(o=>!o.disabled).forEach(o=>o.selected=c),this.render()}_(c,o){if(c===" ")this.handleSpaceToggle();else if(c==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
15
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(i,d){if(i===" ")this.value=!this.value;else if(i==="1")this.value=!0;else if(i==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(g.line+s.to(0)+this.outputText))}}return ye=r,ye}var xe,Qt;function B(){if(Qt)return xe;Qt=1;class e{constructor({token:a,date:t,parts:o,locales:u}){this.token=a,this.date=t||new Date,this.parts=o||[this],this.locales=u||{}}up(){}down(){}next(){const a=this.parts.indexOf(this);return this.parts.find((t,o)=>o>a&&t instanceof e)}setTo(a){}prev(){let a=[].concat(this.parts).reverse();const t=a.indexOf(this);return a.find((o,u)=>u>t&&o instanceof e)}toString(){return String(this.date)}}return xe=e,xe}var $e,er;function Di(){if(er)return $e;er=1;const e=B();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}return $e=n,$e}var Se,tr;function Ii(){if(tr)return Se;tr=1;const e=B(),n=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class a extends e{constructor(o={}){super(o)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(o){this.date.setDate(parseInt(o.substr(-2)))}toString(){let o=this.date.getDate(),u=this.date.getDay();return this.token==="DD"?String(o).padStart(2,"0"):this.token==="Do"?o+n(o):this.token==="d"?u+1:this.token==="ddd"?this.locales.weekdaysShort[u]:this.token==="dddd"?this.locales.weekdays[u]:o}}return Se=a,Se}var Me,rr;function Ai(){if(rr)return Me;rr=1;const e=B();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}return Me=n,Me}var Oe,ir;function ji(){if(ir)return Oe;ir=1;const e=B();class n extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Oe=n,Oe}var Pe,sr;function Fi(){if(sr)return Pe;sr=1;const e=B();class n extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return Pe=n,Pe}var Te,nr;function Ni(){if(nr)return Te;nr=1;const e=B();class n extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),o=this.token.length;return o===2?String(t+1).padStart(2,"0"):o===3?this.locales.monthsShort[t]:o===4?this.locales.months[t]:String(t+1)}}return Te=n,Te}var qe,or;function ki(){if(or)return qe;or=1;const e=B();class n extends e{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}return qe=n,qe}var Ee,hr;function Yi(){if(hr)return Ee;hr=1;const e=B();class n extends e{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}return Ee=n,Ee}var Ce,lr;function Hi(){return lr||(lr=1,Ce={DatePart:B(),Meridiem:Di(),Day:Ii(),Hours:Ai(),Milliseconds:ji(),Minutes:Fi(),Month:Ni(),Seconds:ki(),Year:Yi()}),Ce}var Re,ur;function Bi(){if(ur)return Re;ur=1;function e(O,$,T,E,q,_,k){try{var A=O[_](k),D=A.value}catch(z){T(z);return}A.done?$(D):Promise.resolve(D).then(E,q)}function n(O){return function(){var $=this,T=arguments;return new Promise(function(E,q){var _=O.apply($,T);function k(D){e(_,E,q,k,A,"next",D)}function A(D){e(_,E,q,k,A,"throw",D)}k(void 0)})}}const a=C(),t=V(),o=Y(),u=o.style,s=o.clear,g=o.figures,r=R(),h=r.erase,i=r.cursor,d=Hi(),f=d.DatePart,l=d.Meridiem,c=d.Day,b=d.Hours,v=d.Milliseconds,p=d.Minutes,m=d.Month,w=d.Seconds,y=d.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,S={1:({token:O})=>O.replace(/\\(.)/g,"$1"),2:O=>new c(O),3:O=>new m(O),4:O=>new y(O),5:O=>new l(O),6:O=>new b(O),7:O=>new p(O),8:O=>new w(O),9:O=>new v(O)},M={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class P extends t{constructor($={}){super($),this.msg=$.message,this.cursor=0,this.typed="",this.locales=Object.assign(M,$.locales),this._date=$.initial||new Date,this.errorMsg=$.error||"Please Enter A Valid Value",this.validator=$.validate||(()=>!0),this.mask=$.mask||"YYYY-MM-DD HH:mm:ss",this.clear=s("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date($){$&&this._date.setTime($.getTime())}set mask($){let T;for(this.parts=[];T=x.exec($);){let q=T.shift(),_=T.findIndex(k=>k!=null);this.parts.push(_ in S?S[_]({token:T[_]||q,date:this.date,parts:this.parts,locales:this.locales}):T[_]||q)}let E=this.parts.reduce((q,_)=>(typeof _=="string"&&typeof q[q.length-1]=="string"?q[q.length-1]+=_:q.push(_),q),[]);this.parts.splice(0),this.parts.push(...E),this.reset()}moveCursor($){this.typed="",this.cursor=$,this.fire()}reset(){this.moveCursor(this.parts.findIndex($=>$ instanceof f)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
+ `),this.close()}validate(){var $=this;return n(function*(){let T=yield $.validator($.value);typeof T=="string"&&($.errorMsg=T,T=!1),$.error=!T})()}submit(){var $=this;return n(function*(){if(yield $.validate(),$.error){$.color="red",$.fire(),$.render();return}$.done=!0,$.aborted=!1,$.fire(),$.render(),$.out.write(`
17
+ `),$.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let $=this.parts[this.cursor].prev();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}right(){let $=this.parts[this.cursor].next();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}next(){let $=this.parts[this.cursor].next();this.moveCursor($?this.parts.indexOf($):this.parts.findIndex(T=>T instanceof f)),this.render()}_($){/\d/.test($)&&(this.typed+=$,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[u.symbol(this.done,this.aborted),a.bold(this.msg),u.delimiter(!1),this.parts.reduce(($,T,E)=>$.concat(E===this.cursor&&!this.done?a.cyan().underline(T.toString()):T),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
+ `).reduce(($,T,E)=>$+`
19
+ ${E?" ":g.pointerSmall} ${a.red().italic(T)}`,"")),this.out.write(h.line+i.to(0)+this.outputText))}}return Re=P,Re}var _e,ar;function Li(){if(ar)return _e;ar=1;function e(v,p,m,w,y,x,S){try{var M=v[x](S),P=M.value}catch(O){m(O);return}M.done?p(P):Promise.resolve(P).then(w,y)}function n(v){return function(){var p=this,m=arguments;return new Promise(function(w,y){var x=v.apply(p,m);function S(P){e(x,w,y,S,M,"next",P)}function M(P){e(x,w,y,S,M,"throw",P)}S(void 0)})}}const a=C(),t=V(),o=R(),u=o.cursor,s=o.erase,g=Y(),r=g.style,h=g.figures,i=g.clear,d=g.lines,f=/[0-9]/,l=v=>v!==void 0,c=(v,p)=>{let m=Math.pow(10,p);return Math.round(v*m)/m};class b extends t{constructor(p={}){super(p),this.transform=r.render(p.style),this.msg=p.message,this.initial=l(p.initial)?p.initial:"",this.float=!!p.float,this.round=p.round||2,this.inc=p.increment||1,this.min=l(p.min)?p.min:-1/0,this.max=l(p.max)?p.max:1/0,this.errorMsg=p.error||"Please Enter A Valid Value",this.validator=p.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(p){!p&&p!==0?(this.placeholder=!0,this.rendered=a.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${c(p,this.round)}`),this._value=c(p,this.round)),this.fire()}get value(){return this._value}parse(p){return this.float?parseFloat(p):parseInt(p)}valid(p){return p==="-"||p==="."&&this.float||f.test(p)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let p=this.value;this.value=p!==""?p:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
+ `),this.close()}validate(){var p=this;return n(function*(){let m=yield p.validator(p.value);typeof m=="string"&&(p.errorMsg=m,m=!1),p.error=!m})()}submit(){var p=this;return n(function*(){if(yield p.validate(),p.error){p.color="red",p.fire(),p.render();return}let m=p.value;p.value=m!==""?m:p.initial,p.done=!0,p.aborted=!1,p.error=!1,p.fire(),p.render(),p.out.write(`
21
+ `),p.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 p=this.value.toString();if(p.length===0)return this.bell();this.value=this.parse(p=p.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()}_(p,m){if(!this.valid(p))return this.bell();const w=Date.now();if(w-this.lastHit>1e3&&(this.typed=""),this.typed+=p,this.lastHit=w,this.color="cyan",p===".")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(u.down(d(this.outputError,this.out.columns)-1)+i(this.outputError,this.out.columns)),this.out.write(i(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[r.symbol(this.done,this.aborted),a.bold(this.msg),r.delimiter(this.done),!this.done||!this.done&&!this.placeholder?a[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
22
+ `).reduce((p,m,w)=>p+`
23
+ ${w?" ":h.pointerSmall} ${a.red().italic(m)}`,"")),this.out.write(s.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore))}}return _e=b,_e}var De,cr;function dr(){if(cr)return De;cr=1;const e=C(),n=R(),a=n.cursor,t=V(),o=Y(),u=o.clear,s=o.figures,g=o.style,r=o.wrap,h=o.entriesToDisplay;class i extends t{constructor(f={}){super(f),this.msg=f.message,this.cursor=f.cursor||0,this.scrollIndex=f.cursor||0,this.hint=f.hint||"",this.warn=f.warn||"- This option is disabled -",this.minSelected=f.min,this.showMinError=!1,this.maxChoices=f.max,this.instructions=f.instructions,this.optionsPerPage=f.optionsPerPage||10,this.value=f.choices.map((l,c)=>(typeof l=="string"&&(l={title:l,value:c}),{title:l&&(l.title||l.value||l),description:l&&l.description,value:l&&(l.value===void 0?c:l.value),selected:l&&l.selected,disabled:l&&l.disabled})),this.clear=u("",this.out.columns),f.overrideRender||this.render()}reset(){this.value.map(f=>!f.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(f=>f.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
24
+ `),this.close()}submit(){const f=this.value.filter(l=>l.selected);this.minSelected&&f.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
25
+ `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(f=>f.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const f=this.value[this.cursor];if(f.selected)f.selected=!1,this.render();else{if(f.disabled||this.value.filter(l=>l.selected).length>=this.maxChoices)return this.bell();f.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const f=!this.value[this.cursor].selected;this.value.filter(l=>!l.disabled).forEach(l=>l.selected=f),this.render()}_(f,l){if(f===" ")this.handleSpaceToggle();else if(f==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
26
26
  Instructions:
27
- ${i.arrowUp}/${i.arrowDown}: Highlight option
28
- ${i.arrowLeft}/${i.arrowRight}/[space]: Toggle selection
27
+ ${s.arrowUp}/${s.arrowDown}: Highlight option
28
+ ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
29
29
  `+(this.maxChoices===void 0?` a: Toggle all
30
- `:"")+" enter/return: Complete answer":""}renderOption(c,o,a,y){const v=(o.selected?e.green(i.radioOn):i.radioOff)+" "+y+" ";let f,m;return o.disabled?f=c===a?e.gray().underline(o.title):e.strikethrough().gray(o.title):(f=c===a?e.cyan().underline(o.title):o.title,c===a&&o.description&&(m=` - ${o.description}`,(v.length+f.length+m.length>=this.out.columns||o.description.split(/\r?\n/).length>1)&&(m=`
31
- `+h(o.description,{margin:v.length,width:this.out.columns})))),v+f+e.gray(m||"")}paginateOptions(c){if(c.length===0)return e.red("No matches for this query.");let o=u(this.cursor,c.length,this.optionsPerPage),a=o.startIndex,y=o.endIndex,v,f=[];for(let m=a;m<y;m++)m===a&&a>0?v=i.arrowUp:m===y-1&&y<c.length?v=i.arrowDown:v=" ",f.push(this.renderOption(this.cursor,c[m],m,v));return`
32
- `+f.join(`
33
- `)}renderOptions(c){return this.done?"":this.paginateOptions(c)}renderDoneOrInstructions(){if(this.done)return this.value.filter(o=>o.selected).map(o=>o.title).join(", ");const c=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&c.push(e.yellow(this.warn)),c.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let c=[g.symbol(this.done,this.aborted),e.bold(this.msg),g.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(c+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),c+=this.renderOptions(this.value),this.out.write(this.clear+c),this.clear=p(c,this.out.columns)}}return Ie=s,Ie}var Ae,mr;function Wi(){if(mr)return Ae;mr=1;function e(f,m,b,w,x,$,O){try{var P=f[$](O),S=P.value}catch(M){b(M);return}P.done?m(S):Promise.resolve(S).then(w,x)}function t(f){return function(){var m=this,b=arguments;return new Promise(function(w,x){var $=f.apply(m,b);function O(S){e($,w,x,O,P,"next",S)}function P(S){e($,w,x,O,P,"throw",S)}O(void 0)})}}const n=E(),r=V(),l=C(),p=l.erase,i=l.cursor,g=Y(),h=g.style,u=g.clear,s=g.figures,d=g.wrap,c=g.entriesToDisplay,o=(f,m)=>f[m]&&(f[m].value||f[m].title||f[m]),a=(f,m)=>f[m]&&(f[m].title||f[m].value||f[m]),y=(f,m)=>{const b=f.findIndex(w=>w.value===m||w.title===m);return b>-1?b:void 0};class v extends r{constructor(m={}){super(m),this.msg=m.message,this.suggest=m.suggest,this.choices=m.choices,this.initial=typeof m.initial=="number"?m.initial:y(m.choices,m.initial),this.select=this.initial||m.cursor||0,this.i18n={noMatches:m.noMatches||"no matches found"},this.fallback=m.fallback||this.initial,this.clearFirst=m.clearFirst||!1,this.suggestions=[],this.input="",this.limit=m.limit||10,this.cursor=0,this.transform=h.render(m.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=u("",this.out.columns),this.complete(this.render),this.render()}set fallback(m){this._fb=Number.isSafeInteger(parseInt(m))?parseInt(m):m}get fallback(){let m;return typeof this._fb=="number"?m=this.choices[this._fb]:typeof this._fb=="string"&&(m={title:this._fb}),m||this._fb||{title:this.i18n.noMatches}}moveSelect(m){this.select=m,this.suggestions.length>0?this.value=o(this.suggestions,m):this.value=this.fallback.value,this.fire()}complete(m){var b=this;return t(function*(){const w=b.completing=b.suggest(b.input,b.choices),x=yield w;if(b.completing!==w)return;b.suggestions=x.map((O,P,S)=>({title:a(S,P),value:o(S,P),description:O.description})),b.completing=!1;const $=Math.max(x.length-1,0);b.moveSelect(Math.min($,b.select)),m&&m()})()}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(`
30
+ `:"")+" enter/return: Complete answer":""}renderOption(f,l,c,b){const v=(l.selected?e.green(s.radioOn):s.radioOff)+" "+b+" ";let p,m;return l.disabled?p=f===c?e.gray().underline(l.title):e.strikethrough().gray(l.title):(p=f===c?e.cyan().underline(l.title):l.title,f===c&&l.description&&(m=` - ${l.description}`,(v.length+p.length+m.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(m=`
31
+ `+r(l.description,{margin:v.length,width:this.out.columns})))),v+p+e.gray(m||"")}paginateOptions(f){if(f.length===0)return e.red("No matches for this query.");let l=h(this.cursor,f.length,this.optionsPerPage),c=l.startIndex,b=l.endIndex,v,p=[];for(let m=c;m<b;m++)m===c&&c>0?v=s.arrowUp:m===b-1&&b<f.length?v=s.arrowDown:v=" ",p.push(this.renderOption(this.cursor,f[m],m,v));return`
32
+ `+p.join(`
33
+ `)}renderOptions(f){return this.done?"":this.paginateOptions(f)}renderDoneOrInstructions(){if(this.done)return this.value.filter(l=>l.selected).map(l=>l.title).join(", ");const f=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&f.push(e.yellow(this.warn)),f.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(a.hide),super.render();let f=[g.symbol(this.done,this.aborted),e.bold(this.msg),g.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(f+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),f+=this.renderOptions(this.value),this.out.write(this.clear+f),this.clear=u(f,this.out.columns)}}return De=i,De}var Ie,fr;function Vi(){if(fr)return Ie;fr=1;function e(p,m,w,y,x,S,M){try{var P=p[S](M),O=P.value}catch($){w($);return}P.done?m(O):Promise.resolve(O).then(y,x)}function n(p){return function(){var m=this,w=arguments;return new Promise(function(y,x){var S=p.apply(m,w);function M(O){e(S,y,x,M,P,"next",O)}function P(O){e(S,y,x,M,P,"throw",O)}M(void 0)})}}const a=C(),t=V(),o=R(),u=o.erase,s=o.cursor,g=Y(),r=g.style,h=g.clear,i=g.figures,d=g.wrap,f=g.entriesToDisplay,l=(p,m)=>p[m]&&(p[m].value||p[m].title||p[m]),c=(p,m)=>p[m]&&(p[m].title||p[m].value||p[m]),b=(p,m)=>{const w=p.findIndex(y=>y.value===m||y.title===m);return w>-1?w:void 0};class v extends t{constructor(m={}){super(m),this.msg=m.message,this.suggest=m.suggest,this.choices=m.choices,this.initial=typeof m.initial=="number"?m.initial:b(m.choices,m.initial),this.select=this.initial||m.cursor||0,this.i18n={noMatches:m.noMatches||"no matches found"},this.fallback=m.fallback||this.initial,this.clearFirst=m.clearFirst||!1,this.suggestions=[],this.input="",this.limit=m.limit||10,this.cursor=0,this.transform=r.render(m.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=h("",this.out.columns),this.complete(this.render),this.render()}set fallback(m){this._fb=Number.isSafeInteger(parseInt(m))?parseInt(m):m}get fallback(){let m;return typeof this._fb=="number"?m=this.choices[this._fb]:typeof this._fb=="string"&&(m={title:this._fb}),m||this._fb||{title:this.i18n.noMatches}}moveSelect(m){this.select=m,this.suggestions.length>0?this.value=l(this.suggestions,m):this.value=this.fallback.value,this.fire()}complete(m){var w=this;return n(function*(){const y=w.completing=w.suggest(w.input,w.choices),x=yield y;if(w.completing!==y)return;w.suggestions=x.map((M,P,O)=>({title:c(O,P),value:l(O,P),description:M.description})),w.completing=!1;const S=Math.max(x.length-1,0);w.moveSelect(Math.min(S,w.select)),m&&m()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
34
34
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
35
35
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
36
- `),this.close()}_(m,b){let w=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${w}${m}${x}`,this.cursor=w.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let m=this.input.slice(0,this.cursor-1),b=this.input.slice(this.cursor);this.input=`${m}${b}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let m=this.input.slice(0,this.cursor),b=this.input.slice(this.cursor+1);this.input=`${m}${b}`,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(m,b,w,x){let $,O=w?s.arrowUp:x?s.arrowDown:" ",P=b?n.cyan().underline(m.title):m.title;return O=(b?n.cyan(s.pointer)+" ":" ")+O,m.description&&($=` - ${m.description}`,(O.length+P.length+$.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&($=`
37
- `+d(m.description,{margin:3,width:this.out.columns}))),O+" "+P+n.gray($||"")}render(){if(this.closed)return;this.firstRender?this.out.write(i.hide):this.out.write(u(this.outputText,this.out.columns)),super.render();let m=c(this.select,this.choices.length,this.limit),b=m.startIndex,w=m.endIndex;if(this.outputText=[h.symbol(this.done,this.aborted,this.exited),n.bold(this.msg),h.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const x=this.suggestions.slice(b,w).map(($,O)=>this.renderOption($,this.select===O+b,O===0&&b>0,O+b===w-1&&w<this.choices.length)).join(`
36
+ `),this.close()}_(m,w){let y=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${y}${m}${x}`,this.cursor=y.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let m=this.input.slice(0,this.cursor-1),w=this.input.slice(this.cursor);this.input=`${m}${w}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let m=this.input.slice(0,this.cursor),w=this.input.slice(this.cursor+1);this.input=`${m}${w}`,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(m,w,y,x){let S,M=y?i.arrowUp:x?i.arrowDown:" ",P=w?a.cyan().underline(m.title):m.title;return M=(w?a.cyan(i.pointer)+" ":" ")+M,m.description&&(S=` - ${m.description}`,(M.length+P.length+S.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&(S=`
37
+ `+d(m.description,{margin:3,width:this.out.columns}))),M+" "+P+a.gray(S||"")}render(){if(this.closed)return;this.firstRender?this.out.write(s.hide):this.out.write(h(this.outputText,this.out.columns)),super.render();let m=f(this.select,this.choices.length,this.limit),w=m.startIndex,y=m.endIndex;if(this.outputText=[r.symbol(this.done,this.aborted,this.exited),a.bold(this.msg),r.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const x=this.suggestions.slice(w,y).map((S,M)=>this.renderOption(S,this.select===M+w,M===0&&w>0,M+w===y-1&&y<this.choices.length)).join(`
38
38
  `);this.outputText+=`
39
- `+(x||n.gray(this.fallback.title))}this.out.write(p.line+i.to(0)+this.outputText)}}return Ae=v,Ae}var je,gr;function Ji(){if(gr)return je;gr=1;const e=E(),t=C(),n=t.cursor,r=pr(),l=Y(),p=l.clear,i=l.style,g=l.figures;class h extends r{constructor(s={}){s.overrideRender=!0,super(s),this.inputValue="",this.clear=p("",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(s=>s.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const s=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(c=>this.inputValue?!!(typeof c.title=="string"&&c.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof c.value=="string"&&c.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const d=this.filteredOptions.findIndex(c=>c===s);this.cursor=d<0?0:d,this.render()}handleSpaceToggle(){const s=this.filteredOptions[this.cursor];if(s.selected)s.selected=!1,this.render();else{if(s.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();s.selected=!0,this.render()}}handleInputChange(s){this.inputValue=this.inputValue+s,this.updateFilteredOptions()}_(s,d){s===" "?this.handleSpaceToggle():this.handleInputChange(s)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
39
+ `+(x||a.gray(this.fallback.title))}this.out.write(u.line+s.to(0)+this.outputText)}}return Ie=v,Ie}var Ae,pr;function Ui(){if(pr)return Ae;pr=1;const e=C(),n=R(),a=n.cursor,t=dr(),o=Y(),u=o.clear,s=o.style,g=o.figures;class r extends t{constructor(i={}){i.overrideRender=!0,super(i),this.inputValue="",this.clear=u("",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(i=>i.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const i=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(f=>this.inputValue?!!(typeof f.title=="string"&&f.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof f.value=="string"&&f.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const d=this.filteredOptions.findIndex(f=>f===i);this.cursor=d<0?0:d,this.render()}handleSpaceToggle(){const i=this.filteredOptions[this.cursor];if(i.selected)i.selected=!1,this.render();else{if(i.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();i.selected=!0,this.render()}}handleInputChange(i){this.inputValue=this.inputValue+i,this.updateFilteredOptions()}_(i,d){i===" "?this.handleSpaceToggle():this.handleInputChange(i)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
40
40
  Instructions:
41
41
  ${g.arrowUp}/${g.arrowDown}: Highlight option
42
42
  ${g.arrowLeft}/${g.arrowRight}/[space]: Toggle selection
@@ -44,76 +44,76 @@ Instructions:
44
44
  enter/return: Complete answer
45
45
  `:""}renderCurrentInput(){return`
46
46
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
47
- `}renderOption(s,d,c){let o;return d.disabled?o=s===c?e.gray().underline(d.title):e.strikethrough().gray(d.title):o=s===c?e.cyan().underline(d.title):d.title,(d.selected?e.green(g.radioOn):g.radioOff)+" "+o}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const s=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&s.push(e.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let s=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),s+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+s),this.clear=p(s,this.out.columns)}}return je=h,je}var Fe,vr;function Ki(){if(vr)return Fe;vr=1;const e=E(),t=V(),n=Y(),r=n.style,l=n.clear,p=C(),i=p.erase,g=p.cursor;class h extends t{constructor(s={}){super(s),this.msg=s.message,this.value=s.initial,this.initialValue=!!s.initial,this.yesMsg=s.yes||"yes",this.yesOption=s.yesOption||"(Y/n)",this.noMsg=s.no||"no",this.noOption=s.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
47
+ `}renderOption(i,d,f){let l;return d.disabled?l=i===f?e.gray().underline(d.title):e.strikethrough().gray(d.title):l=i===f?e.cyan().underline(d.title):d.title,(d.selected?e.green(g.radioOn):g.radioOff)+" "+l}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const i=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&i.push(e.yellow(this.warn)),i.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(a.hide),super.render();let i=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(i+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),i+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+i),this.clear=u(i,this.out.columns)}}return Ae=r,Ae}var je,mr;function Gi(){if(mr)return je;mr=1;const e=C(),n=V(),a=Y(),t=a.style,o=a.clear,u=R(),s=u.erase,g=u.cursor;class r extends n{constructor(i={}){super(i),this.msg=i.message,this.value=i.initial,this.initialValue=!!i.initial,this.yesMsg=i.yes||"yes",this.yesOption=i.yesOption||"(Y/n)",this.noMsg=i.no||"no",this.noOption=i.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
48
48
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
49
- `),this.close()}_(s,d){return s.toLowerCase()==="y"?(this.value=!0,this.submit()):s.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(g.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+g.to(0)+this.outputText))}}return Fe=h,Fe}var Ne,br;function Zi(){return br||(br=1,Ne={TextPrompt:Ii(),SelectPrompt:Ai(),TogglePrompt:ji(),DatePrompt:Gi(),NumberPrompt:zi(),MultiselectPrompt:pr(),AutocompletePrompt:Wi(),AutocompleteMultiselectPrompt:Ji(),ConfirmPrompt:Ki()}),Ne}var wr;function Xi(){return wr||(wr=1,function(e){const t=e,n=Zi(),r=i=>i;function l(i,g,h={}){return new Promise((u,s)=>{const d=new n[i](g),c=h.onAbort||r,o=h.onSubmit||r,a=h.onExit||r;d.on("state",g.onState||r),d.on("submit",y=>u(o(y))),d.on("exit",y=>u(a(y))),d.on("abort",y=>s(c(y)))})}t.text=i=>l("TextPrompt",i),t.password=i=>(i.style="password",t.text(i)),t.invisible=i=>(i.style="invisible",t.text(i)),t.number=i=>l("NumberPrompt",i),t.date=i=>l("DatePrompt",i),t.confirm=i=>l("ConfirmPrompt",i),t.list=i=>{const g=i.separator||",";return l("TextPrompt",i,{onSubmit:h=>h.split(g).map(u=>u.trim())})},t.toggle=i=>l("TogglePrompt",i),t.select=i=>l("SelectPrompt",i),t.multiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("MultiselectPrompt",i,{onAbort:g,onSubmit:g})},t.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("AutocompleteMultiselectPrompt",i,{onAbort:g,onSubmit:g})};const p=(i,g)=>Promise.resolve(g.filter(h=>h.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));t.autocomplete=i=>(i.suggest=i.suggest||p,i.choices=[].concat(i.choices||[]),l("AutocompletePrompt",i))}(ne)),ne}var ke,yr;function Qi(){if(yr)return ke;yr=1;function e(v,f){var m=Object.keys(v);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(v);f&&(b=b.filter(function(w){return Object.getOwnPropertyDescriptor(v,w).enumerable})),m.push.apply(m,b)}return m}function t(v){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?e(Object(m),!0).forEach(function(b){n(v,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(m)):e(Object(m)).forEach(function(b){Object.defineProperty(v,b,Object.getOwnPropertyDescriptor(m,b))})}return v}function n(v,f,m){return f in v?Object.defineProperty(v,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):v[f]=m,v}function r(v,f){var m=typeof Symbol<"u"&&v[Symbol.iterator]||v["@@iterator"];if(!m){if(Array.isArray(v)||(m=l(v))||f&&v&&typeof v.length=="number"){m&&(v=m);var b=0,w=function(){};return{s:w,n:function(){return b>=v.length?{done:!0}:{done:!1,value:v[b++]}},e:function(S){throw S},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,$=!1,O;return{s:function(){m=m.call(v)},n:function(){var S=m.next();return x=S.done,S},e:function(S){$=!0,O=S},f:function(){try{!x&&m.return!=null&&m.return()}finally{if($)throw O}}}}function l(v,f){if(v){if(typeof v=="string")return p(v,f);var m=Object.prototype.toString.call(v).slice(8,-1);if(m==="Object"&&v.constructor&&(m=v.constructor.name),m==="Map"||m==="Set")return Array.from(v);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return p(v,f)}}function p(v,f){(f==null||f>v.length)&&(f=v.length);for(var m=0,b=new Array(f);m<f;m++)b[m]=v[m];return b}function i(v,f,m,b,w,x,$){try{var O=v[x]($),P=O.value}catch(S){m(S);return}O.done?f(P):Promise.resolve(P).then(b,w)}function g(v){return function(){var f=this,m=arguments;return new Promise(function(b,w){var x=v.apply(f,m);function $(P){i(x,b,w,$,O,"next",P)}function O(P){i(x,b,w,$,O,"throw",P)}$(void 0)})}}const h=Xi(),u=["suggest","format","onState","validate","onRender","type"],s=()=>{};function d(){return c.apply(this,arguments)}function c(){return c=g(function*(v=[],{onSubmit:f=s,onCancel:m=s}={}){const b={},w=d._override||{};v=[].concat(v);let x,$,O,P,S,M;const T=function(){var I=g(function*(D,G,Dt=!1){if(!(!Dt&&D.validate&&D.validate(G)!==!0))return D.format?yield D.format(G,b):G});return function(G,Dt){return I.apply(this,arguments)}}();var R=r(v),_;try{for(R.s();!(_=R.n()).done;){$=_.value;var q=$;if(P=q.name,S=q.type,typeof S=="function"&&(S=yield S(x,t({},b),$),$.type=S),!!S){for(let I in $){if(u.includes(I))continue;let D=$[I];$[I]=typeof D=="function"?yield D(x,t({},b),M):D}if(M=$,typeof $.message!="string")throw new Error("prompt message is required");var k=$;if(P=k.name,S=k.type,h[S]===void 0)throw new Error(`prompt type (${S}) is not defined`);if(w[$.name]!==void 0&&(x=yield T($,w[$.name]),x!==void 0)){b[P]=x;continue}try{x=d._injected?o(d._injected,$.initial):yield h[S]($),b[P]=x=yield T($,x,!0),O=yield f($,x,b)}catch{O=!(yield m($,b))}if(O)return b}}}catch(I){R.e(I)}finally{R.f()}return b}),c.apply(this,arguments)}function o(v,f){const m=v.shift();if(m instanceof Error)throw m;return m===void 0?f:m}function a(v){d._injected=(d._injected||[]).concat(v)}function y(v){d._override=Object.assign({},v)}return ke=Object.assign(d,{prompt:d,prompts:h,inject:a,override:y}),ke}var Ye={},He,xr;function es(){return xr||(xr=1,He=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),He}var Be,$r;function Le(){return $r||($r=1,Be=e=>{const t=["[\\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("|"),n=new RegExp(t,"g");return typeof e=="string"?e.replace(n,""):e}),Be}var Ve,Sr;function ts(){if(Sr)return Ve;Sr=1;const e=Le(),{erase:t,cursor:n}=C(),r=l=>[...e(l)].length;return Ve=function(l,p){if(!p)return t.line+n.to(0);let i=0;const g=l.split(/\r?\n/);for(let h of g)i+=1+Math.floor(Math.max(r(h)-1,0)/p);return t.lines(i)},Ve}var Ue,Or;function Mr(){if(Or)return Ue;Or=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Ue=process.platform==="win32"?t:e,Ue}var Ge,Pr;function rs(){if(Pr)return Ge;Pr=1;const e=E(),t=Mr(),n=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),r=h=>n[h]||n.default,l=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return Ge={styles:n,render:r,symbols:l,symbol:(h,u,s)=>u?l.aborted:s?l.exited:h?l.done:l.default,delimiter:h=>e.gray(h?t.ellipsis:t.pointerSmall),item:(h,u)=>e.gray(h?u?t.pointerSmall:"+":t.line)},Ge}var ze,Tr;function is(){if(Tr)return ze;Tr=1;const e=Le();return ze=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map(l=>Math.ceil(l.length/n)).reduce((l,p)=>l+p):r.length},ze}var We,Er;function ss(){return Er||(Er=1,We=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((p,i)=>(i.length+n.length>=r||p[p.length-1].length+i.length+1<r?p[p.length-1]+=` ${i}`:p.push(`${n}${i}`),p),[n]).join(`
49
+ `),this.close()}_(i,d){return i.toLowerCase()==="y"?(this.value=!0,this.submit()):i.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(g.hide):this.out.write(o(this.outputText,this.out.columns)),super.render(),this.outputText=[t.symbol(this.done,this.aborted),e.bold(this.msg),t.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+g.to(0)+this.outputText))}}return je=r,je}var Fe,gr;function zi(){return gr||(gr=1,Fe={TextPrompt:Ci(),SelectPrompt:Ri(),TogglePrompt:_i(),DatePrompt:Bi(),NumberPrompt:Li(),MultiselectPrompt:dr(),AutocompletePrompt:Vi(),AutocompleteMultiselectPrompt:Ui(),ConfirmPrompt:Gi()}),Fe}var vr;function Wi(){return vr||(vr=1,function(e){const n=e,a=zi(),t=s=>s;function o(s,g,r={}){return new Promise((h,i)=>{const d=new a[s](g),f=r.onAbort||t,l=r.onSubmit||t,c=r.onExit||t;d.on("state",g.onState||t),d.on("submit",b=>h(l(b))),d.on("exit",b=>h(c(b))),d.on("abort",b=>i(f(b)))})}n.text=s=>o("TextPrompt",s),n.password=s=>(s.style="password",n.text(s)),n.invisible=s=>(s.style="invisible",n.text(s)),n.number=s=>o("NumberPrompt",s),n.date=s=>o("DatePrompt",s),n.confirm=s=>o("ConfirmPrompt",s),n.list=s=>{const g=s.separator||",";return o("TextPrompt",s,{onSubmit:r=>r.split(g).map(h=>h.trim())})},n.toggle=s=>o("TogglePrompt",s),n.select=s=>o("SelectPrompt",s),n.multiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(h=>h.selected).map(h=>h.value);return o("MultiselectPrompt",s,{onAbort:g,onSubmit:g})},n.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(h=>h.selected).map(h=>h.value);return o("AutocompleteMultiselectPrompt",s,{onAbort:g,onSubmit:g})};const u=(s,g)=>Promise.resolve(g.filter(r=>r.title.slice(0,s.length).toLowerCase()===s.toLowerCase()));n.autocomplete=s=>(s.suggest=s.suggest||u,s.choices=[].concat(s.choices||[]),o("AutocompletePrompt",s))}(se)),se}var Ne,br;function Ji(){if(br)return Ne;br=1;function e(v,p){var m=Object.keys(v);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(v);p&&(w=w.filter(function(y){return Object.getOwnPropertyDescriptor(v,y).enumerable})),m.push.apply(m,w)}return m}function n(v){for(var p=1;p<arguments.length;p++){var m=arguments[p]!=null?arguments[p]:{};p%2?e(Object(m),!0).forEach(function(w){a(v,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(m)):e(Object(m)).forEach(function(w){Object.defineProperty(v,w,Object.getOwnPropertyDescriptor(m,w))})}return v}function a(v,p,m){return p in v?Object.defineProperty(v,p,{value:m,enumerable:!0,configurable:!0,writable:!0}):v[p]=m,v}function t(v,p){var m=typeof Symbol<"u"&&v[Symbol.iterator]||v["@@iterator"];if(!m){if(Array.isArray(v)||(m=o(v))||p){m&&(v=m);var w=0,y=function(){};return{s:y,n:function(){return w>=v.length?{done:!0}:{done:!1,value:v[w++]}},e:function(O){throw O},f:y}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,S=!1,M;return{s:function(){m=m.call(v)},n:function(){var O=m.next();return x=O.done,O},e:function(O){S=!0,M=O},f:function(){try{!x&&m.return!=null&&m.return()}finally{if(S)throw M}}}}function o(v,p){if(v){if(typeof v=="string")return u(v,p);var m=Object.prototype.toString.call(v).slice(8,-1);if(m==="Object"&&v.constructor&&(m=v.constructor.name),m==="Map"||m==="Set")return Array.from(v);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return u(v,p)}}function u(v,p){(p==null||p>v.length)&&(p=v.length);for(var m=0,w=new Array(p);m<p;m++)w[m]=v[m];return w}function s(v,p,m,w,y,x,S){try{var M=v[x](S),P=M.value}catch(O){m(O);return}M.done?p(P):Promise.resolve(P).then(w,y)}function g(v){return function(){var p=this,m=arguments;return new Promise(function(w,y){var x=v.apply(p,m);function S(P){s(x,w,y,S,M,"next",P)}function M(P){s(x,w,y,S,M,"throw",P)}S(void 0)})}}const r=Wi(),h=["suggest","format","onState","validate","onRender","type"],i=()=>{};function d(){return f.apply(this,arguments)}function f(){return f=g(function*(v=[],{onSubmit:p=i,onCancel:m=i}={}){const w={},y=d._override||{};v=[].concat(v);let x,S,M,P,O,$;const T=function(){var A=g(function*(D,z,_t=!1){if(!(!_t&&D.validate&&D.validate(z)!==!0))return D.format?yield D.format(z,w):z});return function(z,_t){return A.apply(this,arguments)}}();var E=t(v),q;try{for(E.s();!(q=E.n()).done;){S=q.value;var _=S;if(P=_.name,O=_.type,typeof O=="function"&&(O=yield O(x,n({},w),S),S.type=O),!!O){for(let A in S){if(h.includes(A))continue;let D=S[A];S[A]=typeof D=="function"?yield D(x,n({},w),$):D}if($=S,typeof S.message!="string")throw new Error("prompt message is required");var k=S;if(P=k.name,O=k.type,r[O]===void 0)throw new Error(`prompt type (${O}) is not defined`);if(y[S.name]!==void 0&&(x=yield T(S,y[S.name]),x!==void 0)){w[P]=x;continue}try{x=d._injected?l(d._injected,S.initial):yield r[O](S),w[P]=x=yield T(S,x,!0),M=yield p(S,x,w)}catch{M=!(yield m(S,w))}if(M)return w}}}catch(A){E.e(A)}finally{E.f()}return w}),f.apply(this,arguments)}function l(v,p){const m=v.shift();if(m instanceof Error)throw m;return m===void 0?p:m}function c(v){d._injected=(d._injected||[]).concat(v)}function b(v){d._override=Object.assign({},v)}return Ne=Object.assign(d,{prompt:d,prompts:r,inject:c,override:b}),Ne}var ke={},Ye,wr;function Ki(){return wr||(wr=1,Ye=(e,n)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(n){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),Ye}var He,yr;function Be(){return yr||(yr=1,He=e=>{const n=["[\\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("|"),a=new RegExp(n,"g");return typeof e=="string"?e.replace(a,""):e}),He}var Le,xr;function Zi(){if(xr)return Le;xr=1;const e=Be(),{erase:n,cursor:a}=R(),t=o=>[...e(o)].length;return Le=function(o,u){if(!u)return n.line+a.to(0);let s=0;const g=o.split(/\r?\n/);for(let r of g)s+=1+Math.floor(Math.max(t(r)-1,0)/u);return n.lines(s)},Le}var Ve,$r;function Sr(){if($r)return Ve;$r=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},n={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Ve=process.platform==="win32"?n:e,Ve}var Ue,Mr;function Xi(){if(Mr)return Ue;Mr=1;const e=C(),n=Sr(),a=Object.freeze({password:{scale:1,render:r=>"*".repeat(r.length)},emoji:{scale:2,render:r=>"\u{1F603}".repeat(r.length)},invisible:{scale:0,render:r=>""},default:{scale:1,render:r=>`${r}`}}),t=r=>a[r]||a.default,o=Object.freeze({aborted:e.red(n.cross),done:e.green(n.tick),exited:e.yellow(n.cross),default:e.cyan("?")});return Ue={styles:a,render:t,symbols:o,symbol:(r,h,i)=>h?o.aborted:i?o.exited:r?o.done:o.default,delimiter:r=>e.gray(r?n.ellipsis:n.pointerSmall),item:(r,h)=>e.gray(r?h?n.pointerSmall:"+":n.line)},Ue}var Ge,Or;function Qi(){if(Or)return Ge;Or=1;const e=Be();return Ge=function(n,a){let t=String(e(n)||"").split(/\r?\n/);return a?t.map(o=>Math.ceil(o.length/a)).reduce((o,u)=>o+u):t.length},Ge}var ze,Pr;function es(){return Pr||(Pr=1,ze=(e,n={})=>{const a=Number.isSafeInteger(parseInt(n.margin))?new Array(parseInt(n.margin)).fill(" ").join(""):n.margin||"",t=n.width;return(e||"").split(/\r?\n/g).map(o=>o.split(/\s+/g).reduce((u,s)=>(s.length+a.length>=t||u[u.length-1].length+s.length+1<t?u[u.length-1]+=` ${s}`:u.push(`${a}${s}`),u),[a]).join(`
51
51
  `)).join(`
52
- `)}),We}var Je,Cr;function ns(){return Cr||(Cr=1,Je=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let l=Math.min(r+n,t);return{startIndex:r,endIndex:l}}),Je}var Ke,_r;function H(){return _r||(_r=1,Ke={action:es(),clear:ts(),style:rs(),strip:Le(),figures:Mr(),lines:is(),wrap:ss(),entriesToDisplay:ns()}),Ke}var Ze,qr;function U(){if(qr)return Ze;qr=1;const e=Rt,{action:t}=H(),n=It,{beep:r,cursor:l}=C(),p=E();class i extends n{constructor(h={}){super(),this.firstRender=!0,this.in=h.stdin||process.stdin,this.out=h.stdout||process.stdout,this.onRender=(h.onRender||(()=>{})).bind(this);const u=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,u),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,d=(c,o)=>{let a=t(o,s);a===!1?this._&&this._(c,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",d),this.in.isTTY&&this.in.setRawMode(!1),u.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",d)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(r)}render(){this.onRender(p),this.firstRender&&(this.firstRender=!1)}}return Ze=i,Ze}var Xe,Dr;function os(){if(Dr)return Xe;Dr=1;const e=E(),t=U(),{erase:n,cursor:r}=C(),{style:l,clear:p,lines:i,figures:g}=H();class h extends t{constructor(s={}){super(s),this.transform=l.render(s.style),this.scale=this.transform.scale,this.msg=s.message,this.initial=s.initial||"",this.validator=s.validate||(()=>!0),this.value="",this.errorMsg=s.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=p("",this.out.columns),this.render()}set value(s){!s&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(s)),this._value=s,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
53
- `),this.close()}async validate(){let s=await this.validator(this.value);typeof s=="string"&&(this.errorMsg=s,s=!1),this.error=!s}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
54
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(s){this.placeholder||(this.cursor=this.cursor+s,this.cursorOffset+=s)}_(s,d){let c=this.value.slice(0,this.cursor),o=this.value.slice(this.cursor);this.value=`${c}${s}${o}`,this.red=!1,this.cursor=this.placeholder?0:c.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s=this.value.slice(0,this.cursor-1),d=this.value.slice(this.cursor);this.value=`${s}${d}`,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 s=this.value.slice(0,this.cursor),d=this.value.slice(this.cursor+1);this.value=`${s}${d}`,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(r.down(i(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns)),this.out.write(p(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
- `).reduce((s,d,c)=>s+`
56
- ${c?" ":g.pointerSmall} ${e.red().italic(d)}`,"")),this.out.write(n.line+r.to(0)+this.outputText+r.save+this.outputError+r.restore+r.move(this.cursorOffset,0)))}}return Xe=h,Xe}var Qe,Rr;function ls(){if(Rr)return Qe;Rr=1;const e=E(),t=U(),{style:n,clear:r,figures:l,wrap:p,entriesToDisplay:i}=H(),{cursor:g}=C();class h extends t{constructor(s={}){super(s),this.msg=s.message,this.hint=s.hint||"- Use arrow-keys. Return to submit.",this.warn=s.warn||"- This option is disabled",this.cursor=s.initial||0,this.choices=s.choices.map((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),value:d&&(d.value===void 0?c:d.value),description:d&&d.description,selected:d&&d.selected,disabled:d&&d.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=r("",this.out.columns),this.render()}moveCursor(s){this.cursor=s,this.value=this.choices[s].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(`
52
+ `)}),ze}var We,Tr;function ts(){return Tr||(Tr=1,We=(e,n,a)=>{a=a||n;let t=Math.min(n-a,e-Math.floor(a/2));t<0&&(t=0);let o=Math.min(t+a,n);return{startIndex:t,endIndex:o}}),We}var Je,qr;function H(){return qr||(qr=1,Je={action:Ki(),clear:Zi(),style:Xi(),strip:Be(),figures:Sr(),lines:Qi(),wrap:es(),entriesToDisplay:ts()}),Je}var Ke,Er;function U(){if(Er)return Ke;Er=1;const e=Dt,{action:n}=H(),a=It,{beep:t,cursor:o}=R(),u=C();class s extends a{constructor(r={}){super(),this.firstRender=!0,this.in=r.stdin||process.stdin,this.out=r.stdout||process.stdout,this.onRender=(r.onRender||(()=>{})).bind(this);const h=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,h),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,d=(f,l)=>{let c=n(l,i);c===!1?this._&&this._(f,l):typeof this[c]=="function"?this[c](l):this.bell()};this.close=()=>{this.out.write(o.show),this.in.removeListener("keypress",d),this.in.isTTY&&this.in.setRawMode(!1),h.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",d)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(t)}render(){this.onRender(u),this.firstRender&&(this.firstRender=!1)}}return Ke=s,Ke}var Ze,Cr;function rs(){if(Cr)return Ze;Cr=1;const e=C(),n=U(),{erase:a,cursor:t}=R(),{style:o,clear:u,lines:s,figures:g}=H();class r extends n{constructor(i={}){super(i),this.transform=o.render(i.style),this.scale=this.transform.scale,this.msg=i.message,this.initial=i.initial||"",this.validator=i.validate||(()=>!0),this.value="",this.errorMsg=i.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=u("",this.out.columns),this.render()}set value(i){!i&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(i)),this._value=i,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
53
+ `),this.close()}async validate(){let i=await this.validator(this.value);typeof i=="string"&&(this.errorMsg=i,i=!1),this.error=!i}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
54
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(i){this.placeholder||(this.cursor=this.cursor+i,this.cursorOffset+=i)}_(i,d){let f=this.value.slice(0,this.cursor),l=this.value.slice(this.cursor);this.value=`${f}${i}${l}`,this.red=!1,this.cursor=this.placeholder?0:f.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let i=this.value.slice(0,this.cursor-1),d=this.value.slice(this.cursor);this.value=`${i}${d}`,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 i=this.value.slice(0,this.cursor),d=this.value.slice(this.cursor+1);this.value=`${i}${d}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(t.down(s(this.outputError,this.out.columns)-1)+u(this.outputError,this.out.columns)),this.out.write(u(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
+ `).reduce((i,d,f)=>i+`
56
+ ${f?" ":g.pointerSmall} ${e.red().italic(d)}`,"")),this.out.write(a.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return Ze=r,Ze}var Xe,Rr;function is(){if(Rr)return Xe;Rr=1;const e=C(),n=U(),{style:a,clear:t,figures:o,wrap:u,entriesToDisplay:s}=H(),{cursor:g}=R();class r extends n{constructor(i={}){super(i),this.msg=i.message,this.hint=i.hint||"- Use arrow-keys. Return to submit.",this.warn=i.warn||"- This option is disabled",this.cursor=i.initial||0,this.choices=i.choices.map((d,f)=>(typeof d=="string"&&(d={title:d,value:f}),{title:d&&(d.title||d.value||d),value:d&&(d.value===void 0?f:d.value),description:d&&d.description,selected:d&&d.selected,disabled:d&&d.disabled})),this.optionsPerPage=i.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",this.out.columns),this.render()}moveCursor(i){this.cursor=i,this.value=this.choices[i].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
57
57
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
58
- `),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()}_(s,d){if(s===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(g.hide):this.out.write(r(this.outputText,this.out.columns)),super.render();let{startIndex:s,endIndex:d}=i(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
- `;for(let c=s;c<d;c++){let o,a,y="",v=this.choices[c];c===s&&s>0?a=l.arrowUp:c===d-1&&d<this.choices.length?a=l.arrowDown:a=" ",v.disabled?(o=this.cursor===c?e.gray().underline(v.title):e.strikethrough().gray(v.title),a=(this.cursor===c?e.bold().gray(l.pointer)+" ":" ")+a):(o=this.cursor===c?e.cyan().underline(v.title):v.title,a=(this.cursor===c?e.cyan(l.pointer)+" ":" ")+a,v.description&&this.cursor===c&&(y=` - ${v.description}`,(a.length+o.length+y.length>=this.out.columns||v.description.split(/\r?\n/).length>1)&&(y=`
60
- `+p(v.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${o}${e.gray(y)}
61
- `}}this.out.write(this.outputText)}}return Qe=h,Qe}var et,Ir;function hs(){if(Ir)return et;Ir=1;const e=E(),t=U(),{style:n,clear:r}=H(),{cursor:l,erase:p}=C();class i extends t{constructor(h={}){super(h),this.msg=h.message,this.value=!!h.initial,this.active=h.active||"on",this.inactive=h.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(`
58
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(i,d){if(i===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(g.hide):this.out.write(t(this.outputText,this.out.columns)),super.render();let{startIndex:i,endIndex:d}=s(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[a.symbol(this.done,this.aborted),e.bold(this.msg),a.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
+ `;for(let f=i;f<d;f++){let l,c,b="",v=this.choices[f];f===i&&i>0?c=o.arrowUp:f===d-1&&d<this.choices.length?c=o.arrowDown:c=" ",v.disabled?(l=this.cursor===f?e.gray().underline(v.title):e.strikethrough().gray(v.title),c=(this.cursor===f?e.bold().gray(o.pointer)+" ":" ")+c):(l=this.cursor===f?e.cyan().underline(v.title):v.title,c=(this.cursor===f?e.cyan(o.pointer)+" ":" ")+c,v.description&&this.cursor===f&&(b=` - ${v.description}`,(c.length+l.length+b.length>=this.out.columns||v.description.split(/\r?\n/).length>1)&&(b=`
60
+ `+u(v.description,{margin:3,width:this.out.columns})))),this.outputText+=`${c} ${l}${e.gray(b)}
61
+ `}}this.out.write(this.outputText)}}return Xe=r,Xe}var Qe,_r;function ss(){if(_r)return Qe;_r=1;const e=C(),n=U(),{style:a,clear:t}=H(),{cursor:o,erase:u}=R();class s extends n{constructor(r={}){super(r),this.msg=r.message,this.value=!!r.initial,this.active=r.active||"on",this.inactive=r.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
62
62
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
63
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(h,u){if(h===" ")this.value=!this.value;else if(h==="1")this.value=!0;else if(h==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.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(p.line+l.to(0)+this.outputText))}}return et=i,et}var tt,Ar;function L(){if(Ar)return tt;Ar=1;class e{constructor({token:n,date:r,parts:l,locales:p}){this.token=n,this.date=r||new Date,this.parts=l||[this],this.locales=p||{}}up(){}down(){}next(){const n=this.parts.indexOf(this);return this.parts.find((r,l)=>l>n&&r instanceof e)}setTo(n){}prev(){let n=[].concat(this.parts).reverse();const r=n.indexOf(this);return n.find((l,p)=>p>r&&l instanceof e)}toString(){return String(this.date)}}return tt=e,tt}var rt,jr;function us(){if(jr)return rt;jr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}return rt=t,rt}var it,Fr;function as(){if(Fr)return it;Fr=1;const e=L(),t=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th");class n extends e{constructor(l={}){super(l)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(l){this.date.setDate(parseInt(l.substr(-2)))}toString(){let l=this.date.getDate(),p=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+t(l):this.token==="d"?p+1:this.token==="ddd"?this.locales.weekdaysShort[p]:this.token==="dddd"?this.locales.weekdays[p]:l}}return it=n,it}var st,Nr;function cs(){if(Nr)return st;Nr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}}return st=t,st}var nt,kr;function ds(){if(kr)return nt;kr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return nt=t,nt}var ot,Yr;function fs(){if(Yr)return ot;Yr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}return ot=t,ot}var lt,Hr;function ps(){if(Hr)return lt;Hr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),l=this.token.length;return l===2?String(r+1).padStart(2,"0"):l===3?this.locales.monthsShort[r]:l===4?this.locales.months[r]:String(r+1)}}return lt=t,lt}var ht,Br;function ms(){if(Br)return ht;Br=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}return ht=t,ht}var ut,Lr;function gs(){if(Lr)return ut;Lr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}return ut=t,ut}var at,Vr;function vs(){return Vr||(Vr=1,at={DatePart:L(),Meridiem:us(),Day:as(),Hours:cs(),Milliseconds:ds(),Minutes:fs(),Month:ps(),Seconds:ms(),Year:gs()}),at}var ct,Ur;function bs(){if(Ur)return ct;Ur=1;const e=E(),t=U(),{style:n,clear:r,figures:l}=H(),{erase:p,cursor:i}=C(),{DatePart:g,Meridiem:h,Day:u,Hours:s,Milliseconds:d,Minutes:c,Month:o,Seconds:a,Year:y}=vs(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,f={1:({token:w})=>w.replace(/\\(.)/g,"$1"),2:w=>new u(w),3:w=>new o(w),4:w=>new y(w),5:w=>new h(w),6:w=>new s(w),7:w=>new c(w),8:w=>new a(w),9:w=>new d(w)},m={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class b extends t{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(m,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=r("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let $;for(this.parts=[];$=v.exec(x);){let P=$.shift(),S=$.findIndex(M=>M!=null);this.parts.push(S in f?f[S]({token:$[S]||P,date:this.date,parts:this.parts,locales:this.locales}):$[S]||P)}let O=this.parts.reduce((P,S)=>(typeof S=="string"&&typeof P[P.length-1]=="string"?P[P.length-1]+=S:P.push(S),P),[]);this.parts.splice(0),this.parts.push(...O),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof g)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
63
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(r,h){if(r===" ")this.value=!this.value;else if(r==="1")this.value=!0;else if(r==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),e.bold(this.msg),a.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(u.line+o.to(0)+this.outputText))}}return Qe=s,Qe}var et,Dr;function L(){if(Dr)return et;Dr=1;class e{constructor({token:a,date:t,parts:o,locales:u}){this.token=a,this.date=t||new Date,this.parts=o||[this],this.locales=u||{}}up(){}down(){}next(){const a=this.parts.indexOf(this);return this.parts.find((t,o)=>o>a&&t instanceof e)}setTo(a){}prev(){let a=[].concat(this.parts).reverse();const t=a.indexOf(this);return a.find((o,u)=>u>t&&o instanceof e)}toString(){return String(this.date)}}return et=e,et}var tt,Ir;function ns(){if(Ir)return tt;Ir=1;const e=L();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}return tt=n,tt}var rt,Ar;function os(){if(Ar)return rt;Ar=1;const e=L(),n=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class a extends e{constructor(o={}){super(o)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(o){this.date.setDate(parseInt(o.substr(-2)))}toString(){let o=this.date.getDate(),u=this.date.getDay();return this.token==="DD"?String(o).padStart(2,"0"):this.token==="Do"?o+n(o):this.token==="d"?u+1:this.token==="ddd"?this.locales.weekdaysShort[u]:this.token==="dddd"?this.locales.weekdays[u]:o}}return rt=a,rt}var it,jr;function hs(){if(jr)return it;jr=1;const e=L();class n extends e{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}return it=n,it}var st,Fr;function ls(){if(Fr)return st;Fr=1;const e=L();class n extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return st=n,st}var nt,Nr;function us(){if(Nr)return nt;Nr=1;const e=L();class n extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return nt=n,nt}var ot,kr;function as(){if(kr)return ot;kr=1;const e=L();class n extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),o=this.token.length;return o===2?String(t+1).padStart(2,"0"):o===3?this.locales.monthsShort[t]:o===4?this.locales.months[t]:String(t+1)}}return ot=n,ot}var ht,Yr;function cs(){if(Yr)return ht;Yr=1;const e=L();class n extends e{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}return ht=n,ht}var lt,Hr;function ds(){if(Hr)return lt;Hr=1;const e=L();class n extends e{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}return lt=n,lt}var ut,Br;function fs(){return Br||(Br=1,ut={DatePart:L(),Meridiem:ns(),Day:os(),Hours:hs(),Milliseconds:ls(),Minutes:us(),Month:as(),Seconds:cs(),Year:ds()}),ut}var at,Lr;function ps(){if(Lr)return at;Lr=1;const e=C(),n=U(),{style:a,clear:t,figures:o}=H(),{erase:u,cursor:s}=R(),{DatePart:g,Meridiem:r,Day:h,Hours:i,Milliseconds:d,Minutes:f,Month:l,Seconds:c,Year:b}=fs(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,p={1:({token:y})=>y.replace(/\\(.)/g,"$1"),2:y=>new h(y),3:y=>new l(y),4:y=>new b(y),5:y=>new r(y),6:y=>new i(y),7:y=>new f(y),8:y=>new c(y),9:y=>new d(y)},m={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class w extends n{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(m,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let S;for(this.parts=[];S=v.exec(x);){let P=S.shift(),O=S.findIndex($=>$!=null);this.parts.push(O in p?p[O]({token:S[O]||P,date:this.date,parts:this.parts,locales:this.locales}):S[O]||P)}let M=this.parts.reduce((P,O)=>(typeof O=="string"&&typeof P[P.length-1]=="string"?P[P.length-1]+=O:P.push(O),P),[]);this.parts.splice(0),this.parts.push(...M),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof g)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
64
64
  `),this.close()}async validate(){let x=await this.validator(this.value);typeof x=="string"&&(this.errorMsg=x,x=!1),this.error=!x}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
65
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let x=this.parts[this.cursor].prev();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}right(){let x=this.parts[this.cursor].next();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}next(){let x=this.parts[this.cursor].next();this.moveCursor(x?this.parts.indexOf(x):this.parts.findIndex($=>$ instanceof g)),this.render()}_(x){/\d/.test(x)&&(this.typed+=x,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.parts.reduce((x,$,O)=>x.concat(O===this.cursor&&!this.done?e.cyan().underline($.toString()):$),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
- `).reduce((x,$,O)=>x+`
67
- ${O?" ":l.pointerSmall} ${e.red().italic($)}`,"")),this.out.write(p.line+i.to(0)+this.outputText))}}return ct=b,ct}var dt,Gr;function ws(){if(Gr)return dt;Gr=1;const e=E(),t=U(),{cursor:n,erase:r}=C(),{style:l,figures:p,clear:i,lines:g}=H(),h=/[0-9]/,u=c=>c!==void 0,s=(c,o)=>{let a=Math.pow(10,o);return Math.round(c*a)/a};class d extends t{constructor(o={}){super(o),this.transform=l.render(o.style),this.msg=o.message,this.initial=u(o.initial)?o.initial:"",this.float=!!o.float,this.round=o.round||2,this.inc=o.increment||1,this.min=u(o.min)?o.min:-1/0,this.max=u(o.max)?o.max:1/0,this.errorMsg=o.error||"Please Enter A Valid Value",this.validator=o.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(o){!o&&o!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${s(o,this.round)}`),this._value=s(o,this.round)),this.fire()}get value(){return this._value}parse(o){return this.float?parseFloat(o):parseInt(o)}valid(o){return o==="-"||o==="."&&this.float||h.test(o)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let o=this.value;this.value=o!==""?o:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
68
- `),this.close()}async validate(){let o=await this.validator(this.value);typeof o=="string"&&(this.errorMsg=o,o=!1),this.error=!o}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let o=this.value;this.value=o!==""?o:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
69
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let o=this.value.toString();if(o.length===0)return this.bell();this.value=this.parse(o=o.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()}_(o,a){if(!this.valid(o))return this.bell();const y=Date.now();if(y-this.lastHit>1e3&&(this.typed=""),this.typed+=o,this.lastHit=y,this.color="cyan",o===".")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(n.down(g(this.outputError,this.out.columns)-1)+i(this.outputError,this.out.columns)),this.out.write(i(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
- `).reduce((o,a,y)=>o+`
71
- ${y?" ":p.pointerSmall} ${e.red().italic(a)}`,"")),this.out.write(r.line+n.to(0)+this.outputText+n.save+this.outputError+n.restore))}}return dt=d,dt}var ft,zr;function Wr(){if(zr)return ft;zr=1;const e=E(),{cursor:t}=C(),n=U(),{clear:r,figures:l,style:p,wrap:i,entriesToDisplay:g}=H();class h extends n{constructor(s={}){super(s),this.msg=s.message,this.cursor=s.cursor||0,this.scrollIndex=s.cursor||0,this.hint=s.hint||"",this.warn=s.warn||"- This option is disabled -",this.minSelected=s.min,this.showMinError=!1,this.maxChoices=s.max,this.instructions=s.instructions,this.optionsPerPage=s.optionsPerPage||10,this.value=s.choices.map((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),description:d&&d.description,value:d&&(d.value===void 0?c:d.value),selected:d&&d.selected,disabled:d&&d.disabled})),this.clear=r("",this.out.columns),s.overrideRender||this.render()}reset(){this.value.map(s=>!s.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(s=>s.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
- `),this.close()}submit(){const s=this.value.filter(d=>d.selected);this.minSelected&&s.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
- `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(s=>s.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const s=this.value[this.cursor];if(s.selected)s.selected=!1,this.render();else{if(s.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();s.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const s=!this.value[this.cursor].selected;this.value.filter(d=>!d.disabled).forEach(d=>d.selected=s),this.render()}_(s,d){if(s===" ")this.handleSpaceToggle();else if(s==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
65
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let x=this.parts[this.cursor].prev();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}right(){let x=this.parts[this.cursor].next();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}next(){let x=this.parts[this.cursor].next();this.moveCursor(x?this.parts.indexOf(x):this.parts.findIndex(S=>S instanceof g)),this.render()}_(x){/\d/.test(x)&&(this.typed+=x,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),e.bold(this.msg),a.delimiter(!1),this.parts.reduce((x,S,M)=>x.concat(M===this.cursor&&!this.done?e.cyan().underline(S.toString()):S),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
+ `).reduce((x,S,M)=>x+`
67
+ ${M?" ":o.pointerSmall} ${e.red().italic(S)}`,"")),this.out.write(u.line+s.to(0)+this.outputText))}}return at=w,at}var ct,Vr;function ms(){if(Vr)return ct;Vr=1;const e=C(),n=U(),{cursor:a,erase:t}=R(),{style:o,figures:u,clear:s,lines:g}=H(),r=/[0-9]/,h=f=>f!==void 0,i=(f,l)=>{let c=Math.pow(10,l);return Math.round(f*c)/c};class d extends n{constructor(l={}){super(l),this.transform=o.render(l.style),this.msg=l.message,this.initial=h(l.initial)?l.initial:"",this.float=!!l.float,this.round=l.round||2,this.inc=l.increment||1,this.min=h(l.min)?l.min:-1/0,this.max=h(l.max)?l.max:1/0,this.errorMsg=l.error||"Please Enter A Valid Value",this.validator=l.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(l){!l&&l!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${i(l,this.round)}`),this._value=i(l,this.round)),this.fire()}get value(){return this._value}parse(l){return this.float?parseFloat(l):parseInt(l)}valid(l){return l==="-"||l==="."&&this.float||r.test(l)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let l=this.value;this.value=l!==""?l:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
68
+ `),this.close()}async validate(){let l=await this.validator(this.value);typeof l=="string"&&(this.errorMsg=l,l=!1),this.error=!l}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let l=this.value;this.value=l!==""?l:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
69
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let l=this.value.toString();if(l.length===0)return this.bell();this.value=this.parse(l=l.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()}_(l,c){if(!this.valid(l))return this.bell();const b=Date.now();if(b-this.lastHit>1e3&&(this.typed=""),this.typed+=l,this.lastHit=b,this.color="cyan",l===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(a.down(g(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
+ `).reduce((l,c,b)=>l+`
71
+ ${b?" ":u.pointerSmall} ${e.red().italic(c)}`,"")),this.out.write(t.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore))}}return ct=d,ct}var dt,Ur;function Gr(){if(Ur)return dt;Ur=1;const e=C(),{cursor:n}=R(),a=U(),{clear:t,figures:o,style:u,wrap:s,entriesToDisplay:g}=H();class r extends a{constructor(i={}){super(i),this.msg=i.message,this.cursor=i.cursor||0,this.scrollIndex=i.cursor||0,this.hint=i.hint||"",this.warn=i.warn||"- This option is disabled -",this.minSelected=i.min,this.showMinError=!1,this.maxChoices=i.max,this.instructions=i.instructions,this.optionsPerPage=i.optionsPerPage||10,this.value=i.choices.map((d,f)=>(typeof d=="string"&&(d={title:d,value:f}),{title:d&&(d.title||d.value||d),description:d&&d.description,value:d&&(d.value===void 0?f:d.value),selected:d&&d.selected,disabled:d&&d.disabled})),this.clear=t("",this.out.columns),i.overrideRender||this.render()}reset(){this.value.map(i=>!i.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(i=>i.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
+ `),this.close()}submit(){const i=this.value.filter(d=>d.selected);this.minSelected&&i.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
+ `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(i=>i.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const i=this.value[this.cursor];if(i.selected)i.selected=!1,this.render();else{if(i.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();i.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const i=!this.value[this.cursor].selected;this.value.filter(d=>!d.disabled).forEach(d=>d.selected=i),this.render()}_(i,d){if(i===" ")this.handleSpaceToggle();else if(i==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
74
74
  Instructions:
75
- ${l.arrowUp}/${l.arrowDown}: Highlight option
76
- ${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection
75
+ ${o.arrowUp}/${o.arrowDown}: Highlight option
76
+ ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection
77
77
  `+(this.maxChoices===void 0?` a: Toggle all
78
- `:"")+" enter/return: Complete answer":""}renderOption(s,d,c,o){const a=(d.selected?e.green(l.radioOn):l.radioOff)+" "+o+" ";let y,v;return d.disabled?y=s===c?e.gray().underline(d.title):e.strikethrough().gray(d.title):(y=s===c?e.cyan().underline(d.title):d.title,s===c&&d.description&&(v=` - ${d.description}`,(a.length+y.length+v.length>=this.out.columns||d.description.split(/\r?\n/).length>1)&&(v=`
79
- `+i(d.description,{margin:a.length,width:this.out.columns})))),a+y+e.gray(v||"")}paginateOptions(s){if(s.length===0)return e.red("No matches for this query.");let{startIndex:d,endIndex:c}=g(this.cursor,s.length,this.optionsPerPage),o,a=[];for(let y=d;y<c;y++)y===d&&d>0?o=l.arrowUp:y===c-1&&c<s.length?o=l.arrowDown:o=" ",a.push(this.renderOption(this.cursor,s[y],y,o));return`
80
- `+a.join(`
81
- `)}renderOptions(s){return this.done?"":this.paginateOptions(s)}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const s=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&s.push(e.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let s=[p.symbol(this.done,this.aborted),e.bold(this.msg),p.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),s+=this.renderOptions(this.value),this.out.write(this.clear+s),this.clear=r(s,this.out.columns)}}return ft=h,ft}var pt,Jr;function ys(){if(Jr)return pt;Jr=1;const e=E(),t=U(),{erase:n,cursor:r}=C(),{style:l,clear:p,figures:i,wrap:g,entriesToDisplay:h}=H(),u=(o,a)=>o[a]&&(o[a].value||o[a].title||o[a]),s=(o,a)=>o[a]&&(o[a].title||o[a].value||o[a]),d=(o,a)=>{const y=o.findIndex(v=>v.value===a||v.title===a);return y>-1?y:void 0};class c extends t{constructor(a={}){super(a),this.msg=a.message,this.suggest=a.suggest,this.choices=a.choices,this.initial=typeof a.initial=="number"?a.initial:d(a.choices,a.initial),this.select=this.initial||a.cursor||0,this.i18n={noMatches:a.noMatches||"no matches found"},this.fallback=a.fallback||this.initial,this.clearFirst=a.clearFirst||!1,this.suggestions=[],this.input="",this.limit=a.limit||10,this.cursor=0,this.transform=l.render(a.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=p("",this.out.columns),this.complete(this.render),this.render()}set fallback(a){this._fb=Number.isSafeInteger(parseInt(a))?parseInt(a):a}get fallback(){let a;return typeof this._fb=="number"?a=this.choices[this._fb]:typeof this._fb=="string"&&(a={title:this._fb}),a||this._fb||{title:this.i18n.noMatches}}moveSelect(a){this.select=a,this.suggestions.length>0?this.value=u(this.suggestions,a):this.value=this.fallback.value,this.fire()}async complete(a){const y=this.completing=this.suggest(this.input,this.choices),v=await y;if(this.completing!==y)return;this.suggestions=v.map((m,b,w)=>({title:s(w,b),value:u(w,b),description:m.description})),this.completing=!1;const f=Math.max(v.length-1,0);this.moveSelect(Math.min(f,this.select)),a&&a()}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(`
78
+ `:"")+" enter/return: Complete answer":""}renderOption(i,d,f,l){const c=(d.selected?e.green(o.radioOn):o.radioOff)+" "+l+" ";let b,v;return d.disabled?b=i===f?e.gray().underline(d.title):e.strikethrough().gray(d.title):(b=i===f?e.cyan().underline(d.title):d.title,i===f&&d.description&&(v=` - ${d.description}`,(c.length+b.length+v.length>=this.out.columns||d.description.split(/\r?\n/).length>1)&&(v=`
79
+ `+s(d.description,{margin:c.length,width:this.out.columns})))),c+b+e.gray(v||"")}paginateOptions(i){if(i.length===0)return e.red("No matches for this query.");let{startIndex:d,endIndex:f}=g(this.cursor,i.length,this.optionsPerPage),l,c=[];for(let b=d;b<f;b++)b===d&&d>0?l=o.arrowUp:b===f-1&&f<i.length?l=o.arrowDown:l=" ",c.push(this.renderOption(this.cursor,i[b],b,l));return`
80
+ `+c.join(`
81
+ `)}renderOptions(i){return this.done?"":this.paginateOptions(i)}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const i=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&i.push(e.yellow(this.warn)),i.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let i=[u.symbol(this.done,this.aborted),e.bold(this.msg),u.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(i+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),i+=this.renderOptions(this.value),this.out.write(this.clear+i),this.clear=t(i,this.out.columns)}}return dt=r,dt}var ft,zr;function gs(){if(zr)return ft;zr=1;const e=C(),n=U(),{erase:a,cursor:t}=R(),{style:o,clear:u,figures:s,wrap:g,entriesToDisplay:r}=H(),h=(l,c)=>l[c]&&(l[c].value||l[c].title||l[c]),i=(l,c)=>l[c]&&(l[c].title||l[c].value||l[c]),d=(l,c)=>{const b=l.findIndex(v=>v.value===c||v.title===c);return b>-1?b:void 0};class f extends n{constructor(c={}){super(c),this.msg=c.message,this.suggest=c.suggest,this.choices=c.choices,this.initial=typeof c.initial=="number"?c.initial:d(c.choices,c.initial),this.select=this.initial||c.cursor||0,this.i18n={noMatches:c.noMatches||"no matches found"},this.fallback=c.fallback||this.initial,this.clearFirst=c.clearFirst||!1,this.suggestions=[],this.input="",this.limit=c.limit||10,this.cursor=0,this.transform=o.render(c.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=u("",this.out.columns),this.complete(this.render),this.render()}set fallback(c){this._fb=Number.isSafeInteger(parseInt(c))?parseInt(c):c}get fallback(){let c;return typeof this._fb=="number"?c=this.choices[this._fb]:typeof this._fb=="string"&&(c={title:this._fb}),c||this._fb||{title:this.i18n.noMatches}}moveSelect(c){this.select=c,this.suggestions.length>0?this.value=h(this.suggestions,c):this.value=this.fallback.value,this.fire()}async complete(c){const b=this.completing=this.suggest(this.input,this.choices),v=await b;if(this.completing!==b)return;this.suggestions=v.map((m,w,y)=>({title:i(y,w),value:h(y,w),description:m.description})),this.completing=!1;const p=Math.max(v.length-1,0);this.moveSelect(Math.min(p,this.select)),c&&c()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
82
82
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
84
- `),this.close()}_(a,y){let v=this.input.slice(0,this.cursor),f=this.input.slice(this.cursor);this.input=`${v}${a}${f}`,this.cursor=v.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let a=this.input.slice(0,this.cursor-1),y=this.input.slice(this.cursor);this.input=`${a}${y}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let a=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor+1);this.input=`${a}${y}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(a,y,v,f){let m,b=v?i.arrowUp:f?i.arrowDown:" ",w=y?e.cyan().underline(a.title):a.title;return b=(y?e.cyan(i.pointer)+" ":" ")+b,a.description&&(m=` - ${a.description}`,(b.length+w.length+m.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(m=`
85
- `+g(a.description,{margin:3,width:this.out.columns}))),b+" "+w+e.gray(m||"")}render(){if(this.closed)return;this.firstRender?this.out.write(r.hide):this.out.write(p(this.outputText,this.out.columns)),super.render();let{startIndex:a,endIndex:y}=h(this.select,this.choices.length,this.limit);if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),l.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const v=this.suggestions.slice(a,y).map((f,m)=>this.renderOption(f,this.select===m+a,m===0&&a>0,m+a===y-1&&y<this.choices.length)).join(`
84
+ `),this.close()}_(c,b){let v=this.input.slice(0,this.cursor),p=this.input.slice(this.cursor);this.input=`${v}${c}${p}`,this.cursor=v.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let c=this.input.slice(0,this.cursor-1),b=this.input.slice(this.cursor);this.input=`${c}${b}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let c=this.input.slice(0,this.cursor),b=this.input.slice(this.cursor+1);this.input=`${c}${b}`,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(c,b,v,p){let m,w=v?s.arrowUp:p?s.arrowDown:" ",y=b?e.cyan().underline(c.title):c.title;return w=(b?e.cyan(s.pointer)+" ":" ")+w,c.description&&(m=` - ${c.description}`,(w.length+y.length+m.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(m=`
85
+ `+g(c.description,{margin:3,width:this.out.columns}))),w+" "+y+e.gray(m||"")}render(){if(this.closed)return;this.firstRender?this.out.write(t.hide):this.out.write(u(this.outputText,this.out.columns)),super.render();let{startIndex:c,endIndex:b}=r(this.select,this.choices.length,this.limit);if(this.outputText=[o.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),o.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const v=this.suggestions.slice(c,b).map((p,m)=>this.renderOption(p,this.select===m+c,m===0&&c>0,m+c===b-1&&b<this.choices.length)).join(`
86
86
  `);this.outputText+=`
87
- `+(v||e.gray(this.fallback.title))}this.out.write(n.line+r.to(0)+this.outputText)}}return pt=c,pt}var mt,Kr;function xs(){if(Kr)return mt;Kr=1;const e=E(),{cursor:t}=C(),n=Wr(),{clear:r,style:l,figures:p}=H();class i extends n{constructor(h={}){h.overrideRender=!0,super(h),this.inputValue="",this.clear=r("",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(h=>h.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const h=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const u=this.filteredOptions.findIndex(s=>s===h);this.cursor=u<0?0:u,this.render()}handleSpaceToggle(){const h=this.filteredOptions[this.cursor];if(h.selected)h.selected=!1,this.render();else{if(h.disabled||this.value.filter(u=>u.selected).length>=this.maxChoices)return this.bell();h.selected=!0,this.render()}}handleInputChange(h){this.inputValue=this.inputValue+h,this.updateFilteredOptions()}_(h,u){h===" "?this.handleSpaceToggle():this.handleInputChange(h)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
87
+ `+(v||e.gray(this.fallback.title))}this.out.write(a.line+t.to(0)+this.outputText)}}return ft=f,ft}var pt,Wr;function vs(){if(Wr)return pt;Wr=1;const e=C(),{cursor:n}=R(),a=Gr(),{clear:t,style:o,figures:u}=H();class s extends a{constructor(r={}){r.overrideRender=!0,super(r),this.inputValue="",this.clear=t("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const r=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const h=this.filteredOptions.findIndex(i=>i===r);this.cursor=h<0?0:h,this.render()}handleSpaceToggle(){const r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(h=>h.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,h){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
88
88
  Instructions:
89
- ${p.arrowUp}/${p.arrowDown}: Highlight option
90
- ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection
89
+ ${u.arrowUp}/${u.arrowDown}: Highlight option
90
+ ${u.arrowLeft}/${u.arrowRight}/[space]: Toggle selection
91
91
  [a,b,c]/delete: Filter choices
92
92
  enter/return: Complete answer
93
93
  `:""}renderCurrentInput(){return`
94
94
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
95
- `}renderOption(h,u,s){let d;return u.disabled?d=h===s?e.gray().underline(u.title):e.strikethrough().gray(u.title):d=h===s?e.cyan().underline(u.title):u.title,(u.selected?e.green(p.radioOn):p.radioOff)+" "+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(u=>u.selected).map(u=>u.title).join(", ");const h=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&h.push(e.yellow(this.warn)),h.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let h=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(h+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),h+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+h),this.clear=r(h,this.out.columns)}}return mt=i,mt}var gt,Zr;function $s(){if(Zr)return gt;Zr=1;const e=E(),t=U(),{style:n,clear:r}=H(),{erase:l,cursor:p}=C();class i extends t{constructor(h={}){super(h),this.msg=h.message,this.value=h.initial,this.initialValue=!!h.initial,this.yesMsg=h.yes||"yes",this.yesOption=h.yesOption||"(Y/n)",this.noMsg=h.no||"no",this.noOption=h.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
95
+ `}renderOption(r,h,i){let d;return h.disabled?d=r===i?e.gray().underline(h.title):e.strikethrough().gray(h.title):d=r===i?e.cyan().underline(h.title):h.title,(h.selected?e.green(u.radioOn):u.radioOff)+" "+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");const r=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(e.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let r=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=t(r,this.out.columns)}}return pt=s,pt}var mt,Jr;function bs(){if(Jr)return mt;Jr=1;const e=C(),n=U(),{style:a,clear:t}=H(),{erase:o,cursor:u}=R();class s extends n{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
96
96
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
97
- `),this.close()}_(h,u){return h.toLowerCase()==="y"?(this.value=!0,this.submit()):h.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(p.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+p.to(0)+this.outputText))}}return gt=i,gt}var vt,Xr;function Ss(){return Xr||(Xr=1,vt={TextPrompt:os(),SelectPrompt:ls(),TogglePrompt:hs(),DatePrompt:bs(),NumberPrompt:ws(),MultiselectPrompt:Wr(),AutocompletePrompt:ys(),AutocompleteMultiselectPrompt:xs(),ConfirmPrompt:$s()}),vt}var Qr;function Os(){return Qr||(Qr=1,function(e){const t=e,n=Ss(),r=i=>i;function l(i,g,h={}){return new Promise((u,s)=>{const d=new n[i](g),c=h.onAbort||r,o=h.onSubmit||r,a=h.onExit||r;d.on("state",g.onState||r),d.on("submit",y=>u(o(y))),d.on("exit",y=>u(a(y))),d.on("abort",y=>s(c(y)))})}t.text=i=>l("TextPrompt",i),t.password=i=>(i.style="password",t.text(i)),t.invisible=i=>(i.style="invisible",t.text(i)),t.number=i=>l("NumberPrompt",i),t.date=i=>l("DatePrompt",i),t.confirm=i=>l("ConfirmPrompt",i),t.list=i=>{const g=i.separator||",";return l("TextPrompt",i,{onSubmit:h=>h.split(g).map(u=>u.trim())})},t.toggle=i=>l("TogglePrompt",i),t.select=i=>l("SelectPrompt",i),t.multiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("MultiselectPrompt",i,{onAbort:g,onSubmit:g})},t.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("AutocompleteMultiselectPrompt",i,{onAbort:g,onSubmit:g})};const p=(i,g)=>Promise.resolve(g.filter(h=>h.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));t.autocomplete=i=>(i.suggest=i.suggest||p,i.choices=[].concat(i.choices||[]),l("AutocompletePrompt",i))}(Ye)),Ye}var bt,ei;function Ms(){if(ei)return bt;ei=1;const e=Os(),t=["suggest","format","onState","validate","onRender","type"],n=()=>{};async function r(g=[],{onSubmit:h=n,onCancel:u=n}={}){const s={},d=r._override||{};g=[].concat(g);let c,o,a,y,v,f;const m=async(b,w,x=!1)=>{if(!(!x&&b.validate&&b.validate(w)!==!0))return b.format?await b.format(w,s):w};for(o of g)if({name:y,type:v}=o,typeof v=="function"&&(v=await v(c,{...s},o),o.type=v),!!v){for(let b in o){if(t.includes(b))continue;let w=o[b];o[b]=typeof w=="function"?await w(c,{...s},f):w}if(f=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:y,type:v}=o,e[v]===void 0)throw new Error(`prompt type (${v}) is not defined`);if(d[o.name]!==void 0&&(c=await m(o,d[o.name]),c!==void 0)){s[y]=c;continue}try{c=r._injected?l(r._injected,o.initial):await e[v](o),s[y]=c=await m(o,c,!0),a=await h(o,c,s)}catch{a=!await u(o,s)}if(a)return s}return s}function l(g,h){const u=g.shift();if(u instanceof Error)throw u;return u===void 0?h:u}function p(g){r._injected=(r._injected||[]).concat(g)}function i(g){r._override=Object.assign({},g)}return bt=Object.assign(r,{prompt:r,prompts:e,inject:p,override:i}),bt}function Ps(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,n=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}var Ts=Ps("8.6.0")?Qi():Ms();const Es=Z(Ts);var z={exports:{}},wt,ti;function Cs(){if(ti)return wt;ti=1,wt=r,r.sync=l;var e=ie;function t(p,i){var g=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!g||(g=g.split(";"),g.indexOf("")!==-1))return!0;for(var h=0;h<g.length;h++){var u=g[h].toLowerCase();if(u&&p.substr(-u.length).toLowerCase()===u)return!0}return!1}function n(p,i,g){return!p.isSymbolicLink()&&!p.isFile()?!1:t(i,g)}function r(p,i,g){e.stat(p,function(h,u){g(h,h?!1:n(u,p,i))})}function l(p,i){return n(e.statSync(p),p,i)}return wt}var yt,ri;function _s(){if(ri)return yt;ri=1,yt=t,t.sync=n;var e=ie;function t(p,i,g){e.stat(p,function(h,u){g(h,h?!1:r(u,i))})}function n(p,i){return r(e.statSync(p),i)}function r(p,i){return p.isFile()&&l(p,i)}function l(p,i){var g=p.mode,h=p.uid,u=p.gid,s=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),d=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),c=parseInt("100",8),o=parseInt("010",8),a=parseInt("001",8),y=c|o,v=g&a||g&o&&u===d||g&c&&h===s||g&y&&s===0;return v}return yt}var ee;process.platform==="win32"||yi.TESTING_WINDOWS?ee=Cs():ee=_s();var qs=xt;xt.sync=Ds;function xt(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,l){xt(e,t||{},function(p,i){p?l(p):r(i)})})}ee(e,t||{},function(r,l){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,l=!1),n(r,l)})}function Ds(e,t){try{return ee.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const W=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ii=re,Rs=W?";":":",si=qs,ni=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),oi=(e,t)=>{const n=t.colon||Rs,r=e.match(/\//)||W&&e.match(/\\/)?[""]:[...W?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],l=W?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=W?l.split(n):[""];return W&&e.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:r,pathExt:p,pathExtExe:l}},li=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:l,pathExtExe:p}=oi(e,t),i=[],g=u=>new Promise((s,d)=>{if(u===r.length)return t.all&&i.length?s(i):d(ni(e));const c=r[u],o=/^".*"$/.test(c)?c.slice(1,-1):c,a=ii.join(o,e),y=!o&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;s(h(y,u,0))}),h=(u,s,d)=>new Promise((c,o)=>{if(d===l.length)return c(g(s+1));const a=l[d];si(u+a,{pathExt:p},(y,v)=>{if(!y&&v)if(t.all)i.push(u+a);else return c(u+a);return c(h(u,s,d+1))})});return n?g(0).then(u=>n(null,u),n):g(0)},Is=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:l}=oi(e,t),p=[];for(let i=0;i<n.length;i++){const g=n[i],h=/^".*"$/.test(g)?g.slice(1,-1):g,u=ii.join(h,e),s=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<r.length;d++){const c=s+r[d];try{if(si.sync(c,{pathExt:l}))if(t.all)p.push(c);else return c}catch{}}}if(t.all&&p.length)return p;if(t.nothrow)return null;throw ni(e)};var As=li;li.sync=Is;var $t={exports:{}};const hi=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};$t.exports=hi,$t.exports.default=hi;var js=$t.exports;const ui=re,Fs=As,Ns=js;function ai(e,t){const n=e.options.env||process.env,r=process.cwd(),l=e.options.cwd!=null,p=l&&process.chdir!==void 0&&!process.chdir.disabled;if(p)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Fs.sync(e.command,{path:n[Ns({env:n})],pathExt:t?ui.delimiter:void 0})}catch{}finally{p&&process.chdir(r)}return i&&(i=ui.resolve(l?e.options.cwd:"",i)),i}function ks(e){return ai(e)||ai(e,!0)}var Ys=ks,St={};const Ot=/([()\][%!^"`<>&|;, *?])/g;function Hs(e){return e=e.replace(Ot,"^$1"),e}function Bs(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Ot,"^$1"),t&&(e=e.replace(Ot,"^$1")),e}St.command=Hs,St.argument=Bs;var Ls=/^#!(.*)/;const Vs=Ls;var Us=(e="")=>{const t=e.match(Vs);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),l=n.split("/").pop();return l==="env"?r:r?`${l} ${r}`:l};const Mt=ie,Gs=Us;function zs(e){const n=Buffer.alloc(150);let r;try{r=Mt.openSync(e,"r"),Mt.readSync(r,n,0,150,0),Mt.closeSync(r)}catch{}return Gs(n.toString())}var Ws=zs;const Js=re,ci=Ys,di=St,Ks=Ws,Zs=process.platform==="win32",Xs=/\.(?:com|exe)$/i,Qs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function en(e){e.file=ci(e);const t=e.file&&Ks(e.file);return t?(e.args.unshift(e.file),e.command=t,ci(e)):e.file}function tn(e){if(!Zs)return e;const t=en(e),n=!Xs.test(t);if(e.options.forceShell||n){const r=Qs.test(t);e.command=Js.normalize(e.command),e.command=di.command(e.command),e.args=e.args.map(p=>di.argument(p,r));const l=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${l}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function rn(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:tn(r)}var sn=rn;const Pt=process.platform==="win32";function Tt(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function nn(e,t){if(!Pt)return;const n=e.emit;e.emit=function(r,l){if(r==="exit"){const p=fi(l,t);if(p)return n.call(e,"error",p)}return n.apply(e,arguments)}}function fi(e,t){return Pt&&e===1&&!t.file?Tt(t.original,"spawn"):null}function on(e,t){return Pt&&e===1&&!t.file?Tt(t.original,"spawnSync"):null}var ln={hookChildProcess:nn,verifyENOENT:fi,verifyENOENTSync:on,notFoundError:Tt};const pi=wi,Et=sn,Ct=ln;function mi(e,t,n){const r=Et(e,t,n),l=pi.spawn(r.command,r.args,r.options);return Ct.hookChildProcess(l,r),l}function hn(e,t,n){const r=Et(e,t,n),l=pi.spawnSync(r.command,r.args,r.options);return l.error=l.error||Ct.verifyENOENTSync(l.status,r),l}z.exports=mi,z.exports.spawn=mi,z.exports.sync=hn,z.exports._parse=Et,z.exports._enoent=Ct;var un=z.exports;const an=Z(un),{blue:cn,cyan:gi,green:K,yellowBright:dn,white:fn,red:te}=Ti,N={react:gi("React18"),mobx:gi("Mobx"),ts:cn("TS"),vue:K("Vue3"),pinia:K("Pinia"),bun:fn("Bun"),elysia:te("Elysia"),vite:dn("Vite")},J={frontend:{react:{get label(){return`${this._label} ${this.completed?K("\u2714"):te("\u2718 uncompleted")}`},_label:`${N.react} + ${N.mobx} + ${N.ts} + ${N.vite}`,value:"react",completed:!0},vue:{get label(){return`${this._label} ${this.completed?K("\u2714"):te("\u2718 uncompleted")}`},_label:`${N.vue} + ${N.pinia} + ${N.ts} + ${N.vite}`,value:"vue",completed:!0}},backend:{bun:{get label(){return`${this._label} ${this.completed?K("\u2714"):te("\u2718 uncompleted")}`},_label:`${N.bun} + ${N.elysia} + ${N.ts}`,value:"bun",completed:!1}}};function vi(e){return e?.trim().replace(/\/+$/g,"")}function _t(e){return j.basename(j.resolve(e))}function pn(e){const t=A.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function mn(e){return A.existsSync(e)}function gn(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function vn(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function bn(e){if(A.existsSync(e))for(const t of A.readdirSync(e))t!==".git"&&A.rmSync(j.resolve(e,t),{recursive:!0,force:!0})}function wn(e){if(!e)return;const t=e.split(" ")[0].split("/");return{name:t[0],version:t[1]}}function yn(e,t){A.mkdirSync(t,{recursive:!0});for(const n of A.readdirSync(e)){const r=j.resolve(e,n),l=j.resolve(t,n);bi(r,l)}}function bi(e,t){xn(e)?yn(e,t):A.copyFileSync(e,t)}function xn(e){return A.statSync(e).isDirectory()}const qt=Si(process.argv.slice(2),{boolean:["help"],string:["_"],default:{help:!1},alias:{h:"help",t:"template"}}),$n=Object.keys(J).map(e=>` ${F.gray(e)}:
98
- ${Object.values(J[e]).map(t=>` ${t.label}
97
+ `),this.close()}_(r,h){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(u.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[a.symbol(this.done,this.aborted),e.bold(this.msg),a.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(o.line+u.to(0)+this.outputText))}}return mt=s,mt}var gt,Kr;function ws(){return Kr||(Kr=1,gt={TextPrompt:rs(),SelectPrompt:is(),TogglePrompt:ss(),DatePrompt:ps(),NumberPrompt:ms(),MultiselectPrompt:Gr(),AutocompletePrompt:gs(),AutocompleteMultiselectPrompt:vs(),ConfirmPrompt:bs()}),gt}var Zr;function ys(){return Zr||(Zr=1,function(e){const n=e,a=ws(),t=s=>s;function o(s,g,r={}){return new Promise((h,i)=>{const d=new a[s](g),f=r.onAbort||t,l=r.onSubmit||t,c=r.onExit||t;d.on("state",g.onState||t),d.on("submit",b=>h(l(b))),d.on("exit",b=>h(c(b))),d.on("abort",b=>i(f(b)))})}n.text=s=>o("TextPrompt",s),n.password=s=>(s.style="password",n.text(s)),n.invisible=s=>(s.style="invisible",n.text(s)),n.number=s=>o("NumberPrompt",s),n.date=s=>o("DatePrompt",s),n.confirm=s=>o("ConfirmPrompt",s),n.list=s=>{const g=s.separator||",";return o("TextPrompt",s,{onSubmit:r=>r.split(g).map(h=>h.trim())})},n.toggle=s=>o("TogglePrompt",s),n.select=s=>o("SelectPrompt",s),n.multiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(h=>h.selected).map(h=>h.value);return o("MultiselectPrompt",s,{onAbort:g,onSubmit:g})},n.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(h=>h.selected).map(h=>h.value);return o("AutocompleteMultiselectPrompt",s,{onAbort:g,onSubmit:g})};const u=(s,g)=>Promise.resolve(g.filter(r=>r.title.slice(0,s.length).toLowerCase()===s.toLowerCase()));n.autocomplete=s=>(s.suggest=s.suggest||u,s.choices=[].concat(s.choices||[]),o("AutocompletePrompt",s))}(ke)),ke}var vt,Xr;function xs(){if(Xr)return vt;Xr=1;const e=ys(),n=["suggest","format","onState","validate","onRender","type"],a=()=>{};async function t(g=[],{onSubmit:r=a,onCancel:h=a}={}){const i={},d=t._override||{};g=[].concat(g);let f,l,c,b,v,p;const m=async(w,y,x=!1)=>{if(!(!x&&w.validate&&w.validate(y)!==!0))return w.format?await w.format(y,i):y};for(l of g)if({name:b,type:v}=l,typeof v=="function"&&(v=await v(f,{...i},l),l.type=v),!!v){for(let w in l){if(n.includes(w))continue;let y=l[w];l[w]=typeof y=="function"?await y(f,{...i},p):y}if(p=l,typeof l.message!="string")throw new Error("prompt message is required");if({name:b,type:v}=l,e[v]===void 0)throw new Error(`prompt type (${v}) is not defined`);if(d[l.name]!==void 0&&(f=await m(l,d[l.name]),f!==void 0)){i[b]=f;continue}try{f=t._injected?o(t._injected,l.initial):await e[v](l),i[b]=f=await m(l,f,!0),c=await r(l,f,i)}catch{c=!await h(l,i)}if(c)return i}return i}function o(g,r){const h=g.shift();if(h instanceof Error)throw h;return h===void 0?r:h}function u(g){t._injected=(t._injected||[]).concat(g)}function s(g){t._override=Object.assign({},g)}return vt=Object.assign(t,{prompt:t,prompts:e,inject:u,override:s}),vt}var bt,Qr;function $s(){if(Qr)return bt;Qr=1;function e(n){n=(Array.isArray(n)?n:n.split(".")).map(Number);let a=0,t=process.versions.node.split(".").map(Number);for(;a<n.length;a++){if(t[a]>n[a])return!1;if(n[a]>t[a])return!0}return!1}return bt=e("8.6.0")?Ji():xs(),bt}var Ss=$s();const Ms=Z(Ss);var G={exports:{}},wt,ei;function Os(){if(ei)return wt;ei=1,wt=t,t.sync=o;var e=re;function n(u,s){var g=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!g||(g=g.split(";"),g.indexOf("")!==-1))return!0;for(var r=0;r<g.length;r++){var h=g[r].toLowerCase();if(h&&u.substr(-h.length).toLowerCase()===h)return!0}return!1}function a(u,s,g){return!u.isSymbolicLink()&&!u.isFile()?!1:n(s,g)}function t(u,s,g){e.stat(u,function(r,h){g(r,r?!1:a(h,u,s))})}function o(u,s){return a(e.statSync(u),u,s)}return wt}var yt,ti;function Ps(){if(ti)return yt;ti=1,yt=n,n.sync=a;var e=re;function n(u,s,g){e.stat(u,function(r,h){g(r,r?!1:t(h,s))})}function a(u,s){return t(e.statSync(u),s)}function t(u,s){return u.isFile()&&o(u,s)}function o(u,s){var g=u.mode,r=u.uid,h=u.gid,i=s.uid!==void 0?s.uid:process.getuid&&process.getuid(),d=s.gid!==void 0?s.gid:process.getgid&&process.getgid(),f=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),b=f|l,v=g&c||g&l&&h===d||g&f&&r===i||g&b&&i===0;return v}return yt}var xt,ri;function Ts(){if(ri)return xt;ri=1;var e;process.platform==="win32"||bi.TESTING_WINDOWS?e=Os():e=Ps(),xt=n,n.sync=a;function n(t,o,u){if(typeof o=="function"&&(u=o,o={}),!u){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,g){n(t,o||{},function(r,h){r?g(r):s(h)})})}e(t,o||{},function(s,g){s&&(s.code==="EACCES"||o&&o.ignoreErrors)&&(s=null,g=!1),u(s,g)})}function a(t,o){try{return e.sync(t,o||{})}catch(u){if(o&&o.ignoreErrors||u.code==="EACCES")return!1;throw u}}return xt}var $t,ii;function qs(){if(ii)return $t;ii=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",n=te,a=e?";":":",t=Ts(),o=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),u=(r,h)=>{const i=h.colon||a,d=r.match(/\//)||e&&r.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(h.path||process.env.PATH||"").split(i)],f=e?h.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",l=e?f.split(i):[""];return e&&r.indexOf(".")!==-1&&l[0]!==""&&l.unshift(""),{pathEnv:d,pathExt:l,pathExtExe:f}},s=(r,h,i)=>{typeof h=="function"&&(i=h,h={}),h||(h={});const{pathEnv:d,pathExt:f,pathExtExe:l}=u(r,h),c=[],b=p=>new Promise((m,w)=>{if(p===d.length)return h.all&&c.length?m(c):w(o(r));const y=d[p],x=/^".*"$/.test(y)?y.slice(1,-1):y,S=n.join(x,r),M=!x&&/^\.[\\\/]/.test(r)?r.slice(0,2)+S:S;m(v(M,p,0))}),v=(p,m,w)=>new Promise((y,x)=>{if(w===f.length)return y(b(m+1));const S=f[w];t(p+S,{pathExt:l},(M,P)=>{if(!M&&P)if(h.all)c.push(p+S);else return y(p+S);return y(v(p,m,w+1))})});return i?b(0).then(p=>i(null,p),i):b(0)},g=(r,h)=>{h=h||{};const{pathEnv:i,pathExt:d,pathExtExe:f}=u(r,h),l=[];for(let c=0;c<i.length;c++){const b=i[c],v=/^".*"$/.test(b)?b.slice(1,-1):b,p=n.join(v,r),m=!v&&/^\.[\\\/]/.test(r)?r.slice(0,2)+p:p;for(let w=0;w<d.length;w++){const y=m+d[w];try{if(t.sync(y,{pathExt:f}))if(h.all)l.push(y);else return y}catch{}}}if(h.all&&l.length)return l;if(h.nothrow)return null;throw o(r)};return $t=s,s.sync=g,$t}var Q={exports:{}},si;function Es(){if(si)return Q.exports;si=1;const e=(n={})=>{const a=n.env||process.env;return(n.platform||process.platform)!=="win32"?"PATH":Object.keys(a).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};return Q.exports=e,Q.exports.default=e,Q.exports}var St,ni;function Cs(){if(ni)return St;ni=1;const e=te,n=qs(),a=Es();function t(u,s){const g=u.options.env||process.env,r=process.cwd(),h=u.options.cwd!=null,i=h&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(u.options.cwd)}catch{}let d;try{d=n.sync(u.command,{path:g[a({env:g})],pathExt:s?e.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return d&&(d=e.resolve(h?u.options.cwd:"",d)),d}function o(u){return t(u)||t(u,!0)}return St=o,St}var ee={},oi;function Rs(){if(oi)return ee;oi=1;const e=/([()\][%!^"`<>&|;, *?])/g;function n(t){return t=t.replace(e,"^$1"),t}function a(t,o){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(e,"^$1"),o&&(t=t.replace(e,"^$1")),t}return ee.command=n,ee.argument=a,ee}var Mt,hi;function _s(){return hi||(hi=1,Mt=/^#!(.*)/),Mt}var Ot,li;function Ds(){if(li)return Ot;li=1;const e=_s();return Ot=(n="")=>{const a=n.match(e);if(!a)return null;const[t,o]=a[0].replace(/#! ?/,"").split(" "),u=t.split("/").pop();return u==="env"?o:o?`${u} ${o}`:u},Ot}var Pt,ui;function Is(){if(ui)return Pt;ui=1;const e=re,n=Ds();function a(t){const u=Buffer.alloc(150);let s;try{s=e.openSync(t,"r"),e.readSync(s,u,0,150,0),e.closeSync(s)}catch{}return n(u.toString())}return Pt=a,Pt}var Tt,ai;function As(){if(ai)return Tt;ai=1;const e=te,n=Cs(),a=Rs(),t=Is(),o=process.platform==="win32",u=/\.(?:com|exe)$/i,s=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function g(i){i.file=n(i);const d=i.file&&t(i.file);return d?(i.args.unshift(i.file),i.command=d,n(i)):i.file}function r(i){if(!o)return i;const d=g(i),f=!u.test(d);if(i.options.forceShell||f){const l=s.test(d);i.command=e.normalize(i.command),i.command=a.command(i.command),i.args=i.args.map(b=>a.argument(b,l));const c=[i.command].concat(i.args).join(" ");i.args=["/d","/s","/c",`"${c}"`],i.command=process.env.comspec||"cmd.exe",i.options.windowsVerbatimArguments=!0}return i}function h(i,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const l={command:i,args:d,options:f,file:void 0,original:{command:i,args:d}};return f.shell?l:r(l)}return Tt=h,Tt}var qt,ci;function js(){if(ci)return qt;ci=1;const e=process.platform==="win32";function n(u,s){return Object.assign(new Error(`${s} ${u.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${s} ${u.command}`,path:u.command,spawnargs:u.args})}function a(u,s){if(!e)return;const g=u.emit;u.emit=function(r,h){if(r==="exit"){const i=t(h,s);if(i)return g.call(u,"error",i)}return g.apply(u,arguments)}}function t(u,s){return e&&u===1&&!s.file?n(s.original,"spawn"):null}function o(u,s){return e&&u===1&&!s.file?n(s.original,"spawnSync"):null}return qt={hookChildProcess:a,verifyENOENT:t,verifyENOENTSync:o,notFoundError:n},qt}var di;function Fs(){if(di)return G.exports;di=1;const e=vi,n=As(),a=js();function t(u,s,g){const r=n(u,s,g),h=e.spawn(r.command,r.args,r.options);return a.hookChildProcess(h,r),h}function o(u,s,g){const r=n(u,s,g),h=e.spawnSync(r.command,r.args,r.options);return h.error=h.error||a.verifyENOENTSync(h.status,r),h}return G.exports=t,G.exports.spawn=t,G.exports.sync=o,G.exports._parse=n,G.exports._enoent=a,G.exports}var Ns=Fs();const ks=Z(Ns),{blue:Ys,cyan:fi,green:W,yellowBright:Et,white:Hs,red:K,cyanBright:pi}=Si,I={react:fi("React18"),mobx:fi("Mobx"),"tanstack-router":pi("Tanstack Router"),jotai:pi("Jotai"),ts:Ys("TS"),vue:W("Vue3"),pinia:W("Pinia"),bun:Hs("Bun"),elysia:K("Elysia"),vite:Et("Vite"),rspack:Et("Rspack")},J={frontend:{react:{get label(){return`${this._label} ${this.completed?W("\u2714"):K("\u2718 uncompleted")} ${this.recommended?Et("recommended"):""}`},_label:`${I.react} + ${I.mobx} + ${I.ts} + ${I.vite}`,value:"react",completed:!0},vue:{get label(){return`${this._label} ${this.completed?W("\u2714"):K("\u2718 uncompleted")}`},_label:`${I.vue} + ${I.pinia} + ${I.ts} + ${I.vite}`,value:"vue",completed:!0},"react-tanstack-jotai":{get label(){return`${this._label} ${this.completed?W("\u2714"):K("\u2718 uncompleted")}`},_label:`${I.react} + ${I.jotai} + ${I["tanstack-router"]} + ${I.ts} + ${I.vite}`,value:"react",completed:!0,recommended:!0}},backend:{bun:{get label(){return`${this._label} ${this.completed?W("\u2714"):K("\u2718 uncompleted")}`},_label:`${I.bun} + ${I.elysia} + ${I.ts}`,value:"bun",completed:!1}}};function mi(e){return e?.trim().replace(/\/+$/g,"")}function Ct(e){return F.basename(F.resolve(e))}function Bs(e){const n=j.readdirSync(e);return n.length===0||n.length===1&&n[0]===".git"}function Ls(e){return j.existsSync(e)}function Vs(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function Us(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Gs(e){if(j.existsSync(e))for(const n of j.readdirSync(e))n!==".git"&&j.rmSync(F.resolve(e,n),{recursive:!0,force:!0})}function zs(e){if(!e)return;const n=e.split(" ")[0].split("/");return{name:n[0],version:n[1]}}function Ws(e,n){j.mkdirSync(n,{recursive:!0});for(const a of j.readdirSync(e)){const t=F.resolve(e,a),o=F.resolve(n,a);gi(t,o)}}function gi(e,n){Js(e)?Ws(e,n):j.copyFileSync(e,n)}function Js(e){return j.statSync(e).isDirectory()}const Rt=xi(process.argv.slice(2),{boolean:["help"],string:["_"],default:{help:!1},alias:{h:"help",t:"template"}}),Ks=Object.keys(J).map(e=>` ${N.gray(e)}:
98
+ ${Object.values(J[e]).map(n=>` ${n.label}
99
99
  `).join("")}`).join(`
100
- `),Sn=`
100
+ `),Zs=`
101
101
  Create a new project from lik's template.
102
102
 
103
103
  Usage:
104
- ${F.magenta("lik-create")} [OPTIONS]... [DIRECTORY]
104
+ ${N.magenta("lik-create")} [OPTIONS]... [DIRECTORY]
105
105
 
106
106
  Options:
107
107
  -h, --help Show this help message and exit.
108
108
  -t, --template Specify the template to use.
109
109
 
110
110
  Avaliable templates:
111
- ${$n}
111
+ ${Ks}
112
112
 
113
113
  Thx create-vite.
114
- `,On=()=>console.log(Sn),Mn=Object.values(J).flatMap(e=>Object.values(e)),Pn=async()=>{if(qt.help)return On();const e="lik-create-template",t=qt._[0];let n=vi(t)||e;const r=n===".",l=qt.template;try{const p=await Es([{type:t?null:"text",name:"projectName",message:F.reset("Project name: "),initial:e,onState:b=>{n=vi(b.value)||e}},{type:!mn(n)||pn(n)?null:"select",name:"overwrite",message:()=>(r?"Current directory":`Target directory "${n}"`)+"is not empty. Pick an option to continue:",choices:[{title:"Cancel operation",value:"no"},{title:"Remove existing files and continue",value:"yes"},{title:"Ignore files and continue",value:"ignore"}]},{type:(b,w)=>{if(w.overwrite==="no")throw new Error(F.red("\u2716")+" Operation cancelled");return null},name:"overwriteChecker",message:"Overwrite?"},{type:()=>gn(_t(n))?null:"text",initial:()=>vn(_t(n)),name:"packageName",message:F.reset("Package name:")},{type:()=>{if(!l)return"select";const b=Mn.find(w=>w.value===l);if(b&&b.completed)return null;throw new Error(F.red("\u2716")+"This template is not available/complete, plz check by `--help`")},name:"end",message:F.reset("Select type:"),choices:Object.keys(J).map(b=>({title:b,value:b}))},{type:b=>b&&J[b]?"select":null,name:"template",message:F.reset("Select a template:"),choices:b=>Object.entries(J[b]).map(([w,x])=>({title:x.label,value:w,disabled:!x.completed}))}],{onCancel:()=>{throw new Error(F.red("\u2716")+" Operation cancelled")}}),{overwrite:i,template:g,packageName:h}=p,u=process.cwd(),s=j.join(u,n);i==="yes"?bn(s):A.existsSync(s)||A.mkdirSync(s,{recursive:!0});const d=wn(process.env.npm_config_user_agent),c=g||l,o=j.join(import.meta.dirname,"../templates",`template-${c}`),a={_gitignore:".gitignore"},y=(b,w)=>{const x=j.join(s,a[b]||b);w?A.writeFileSync(x,w):bi(j.join(o,b),x)},v=A.readdirSync(o);for(const b of v.filter(w=>w!=="package.json"))y(b);const f=JSON.parse(A.readFileSync(j.join(o,"package.json"),"utf-8"));f.name=h||_t(n),y("package.json",JSON.stringify(f,null,2)+`
115
- `);const m=j.relative(u,s);switch(console.log(`${F.bgRedBright(" Attention:")}
114
+ `,Xs=()=>console.log(Zs),Qs=Object.values(J).flatMap(e=>Object.values(e)),en=async()=>{if(Rt.help)return Xs();const e="lik-create-template",n=Rt._[0];let a=mi(n)||e;const t=a===".",o=Rt.template;try{const u=await Ms([{type:n?null:"text",name:"projectName",message:N.reset("Project name: "),initial:e,onState:w=>{a=mi(w.value)||e}},{type:!Ls(a)||Bs(a)?null:"select",name:"overwrite",message:()=>(t?"Current directory":`Target directory "${a}"`)+"is not empty. Pick an option to continue:",choices:[{title:"Cancel operation",value:"no"},{title:"Remove existing files and continue",value:"yes"},{title:"Ignore files and continue",value:"ignore"}]},{type:(w,y)=>{if(y.overwrite==="no")throw new Error(N.red("\u2716")+" Operation cancelled");return null},name:"overwriteChecker",message:"Overwrite?"},{type:()=>Vs(Ct(a))?null:"text",initial:()=>Us(Ct(a)),name:"packageName",message:N.reset("Package name:")},{type:()=>{if(!o)return"select";const w=Qs.find(y=>y.value===o);if(w&&w.completed)return null;throw new Error(N.red("\u2716")+"This template is not available/complete, plz check by `--help`")},name:"end",message:N.reset("Select type:"),choices:Object.keys(J).map(w=>({title:w,value:w}))},{type:w=>w&&J[w]?"select":null,name:"template",message:N.reset("Select a template:"),choices:w=>Object.entries(J[w]).map(([y,x])=>({title:x.label,value:y,disabled:!x.completed}))}],{onCancel:()=>{throw new Error(N.red("\u2716")+" Operation cancelled")}}),{overwrite:s,template:g,packageName:r}=u,h=process.cwd(),i=F.join(h,a);s==="yes"?Gs(i):j.existsSync(i)||j.mkdirSync(i,{recursive:!0});const d=zs(process.env.npm_config_user_agent),f=g||o,l=F.join(import.meta.dirname,"../templates",`template-${f}`),c={_gitignore:".gitignore"},b=(w,y)=>{const x=F.join(i,c[w]||w);y?j.writeFileSync(x,y):gi(F.join(l,w),x)},v=j.readdirSync(l);for(const w of v.filter(y=>y!=="package.json"))b(w);const p=JSON.parse(j.readFileSync(F.join(l,"package.json"),"utf-8"));p.name=r||Ct(a),b("package.json",JSON.stringify(p,null,2)+`
115
+ `);const m=F.relative(h,i);switch(console.log(`${N.bgRedBright(" Attention:")}
116
116
  git had init, if you want to use husky, please exec before git operation or remove husky:
117
117
  `),console.log(`
118
118
  Done. Now run:
119
- `),s!==u&&console.log(` cd ${m.includes(" ")?`"${m}"`:m}`),an("git",["init"],{cwd:s}),d?.name){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${d?.name} install`),console.log(` ${d?.name} run dev`);break}console.log()}catch(p){console.log(p.message)}};Pn();
119
+ `),i!==h&&console.log(` cd ${m.includes(" ")?`"${m}"`:m}`),ks("git",["init"],{cwd:i}),d?.name){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${d?.name} install`),console.log(` ${d?.name} run dev`);break}console.log()}catch(u){console.log(u.message)}};en();