create-lik-app 1.2.3 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/index.mjs +50 -50
- package/package.json +1 -1
- package/templates/template-react/eslint.config.mjs +35 -16
- package/templates/template-react/package.json +1 -1
- package/templates/template-react-tanstack-jotai/eslint.config.mjs +35 -16
- package/templates/template-react-tanstack-jotai/package.json +1 -1
- package/templates/template-react-tanstack-jotai-tailwindcss/.husky/commit-msg +6 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/.husky/lintstagedrc.cjs +8 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/.husky/pre-commit +10 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/.prettierignore +13 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/.vscode/extensions.json +5 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/README.md +40 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/_gitignore +27 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/commitlint.config.mjs +28 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/config/build/_base.ts +36 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/config/build/development.ts +7 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/config/build/production.ts +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/config/build/test.ts +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/env/.env +0 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/env/.env.development +2 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/env/.env.production +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/eslint.config.mjs +63 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/index.html +13 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/package.json +50 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/postcss.config.js +6 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/prettier.config.mjs +11 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/public/lic.svg +1263 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/public/react.svg +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/public/vite.svg +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/assets/react.svg +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/components/Lic/index.tsx +12 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/main.tsx +21 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/routeTree.gen.ts +145 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/__root.tsx +11 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/_layout/about.tsx +6 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/_layout/index.tsx +6 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/routes/_layout.tsx +23 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/store/index.ts +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/store/module/favorite.ts +5 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/animation.css +8 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/main.css +11 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/tailwind.css +30 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/styles/variable.css +21 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/types/auto-imports.d.ts +33 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/types/color.d.ts +1 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/utils/rainbow-print.ts +10 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/views/404/index.tsx +18 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/views/About/index.tsx +7 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/Button/index.tsx +24 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/React/index.tsx +18 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/Vite/index.tsx +20 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/src/views/Index/index.tsx +50 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/tailwind.config.js +8 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/tsconfig.app.json +36 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/tsconfig.json +7 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/tsconfig.node.json +24 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/types/vite-env.d.ts +10 -0
- package/templates/template-react-tanstack-jotai-tailwindcss/vite.config.ts +15 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/.husky/commit-msg +6 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/.husky/lintstagedrc.cjs +8 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/.husky/pre-commit +10 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/.prettierignore +13 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/.vscode/extensions.json +5 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/README.md +40 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/_gitignore +27 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/commitlint.config.mjs +28 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/_base.ts +36 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/development.ts +7 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/production.ts +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/config/build/test.ts +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/env/.env +0 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/env/.env.development +2 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/env/.env.production +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/eslint.config.mjs +63 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/index.html +13 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/package.json +50 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/postcss.config.js +6 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/prettier.config.mjs +11 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/public/lic.svg +1263 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/public/react.svg +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/public/vite.svg +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/assets/react.svg +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/components/Lic/index.tsx +12 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/main.tsx +21 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/routeTree.gen.ts +145 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/__root.tsx +11 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/_layout/about.tsx +6 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/_layout/index.tsx +6 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/routes/_layout.tsx +23 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/store/index.ts +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/store/module/favorite.ts +5 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/animation.css +8 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/main.css +11 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/tailwind.css +30 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/styles/variable.css +21 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/types/auto-imports.d.ts +33 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/types/color.d.ts +1 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/utils/rainbow-print.ts +10 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/404/index.tsx +18 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/About/index.tsx +7 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/Button/index.tsx +24 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/React/index.tsx +18 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/Vite/index.tsx +20 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/src/views/Index/index.tsx +50 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/tailwind.config.js +8 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/tsconfig.app.json +36 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/tsconfig.json +7 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/tsconfig.node.json +24 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/types/vite-env.d.ts +10 -0
- package/templates/template-react18-tanstack-jotai-tailwindcss/vite.config.ts +15 -0
- package/templates/template-vue/eslint.config.js +20 -1
- package/templates/template-vue/package.json +2 -2
package/dist/index.mjs
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
import
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
1
|
+
import Dt from"readline";import It from"events";import j from"node:fs";import F from"node:path";import bi from"child_process";import ee from"path";import te from"fs";var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function K(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var re,At;function yi(){if(At)return re;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 re=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||{},l={_:[]};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(l,M.split("."),$),(s[M]||[]).forEach(function(T){d(l,T.split("."),$)})}}Object.keys(u.bools).forEach(function(M){f(M,r[M]===void 0?!1:r[M])});var h=[];t.indexOf("--")!==-1&&(h=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)&&l._.push(u.strings._||!n(b)?b:Number(b)),o.stopEarly){l._.push.apply(l._,t.slice(c+1));break}}return Object.keys(r).forEach(function(M){e(l,M.split("."))||(d(l,M.split("."),r[M]),(s[M]||[]).forEach(function(P){d(l,P.split("."),r[M])}))}),o["--"]?l["--"]=h.slice():h.forEach(function(M){l._.push(M)}),l},re}var xi=yi();const $i=K(xi);var Z={exports:{}},jt;function Si(){if(jt)return Z.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,l=g)=>i=>{let d=""+i,f=d.indexOf(r,g.length);return~f?g+u(d,r,l,f)+r:g+d+r},u=(g,r,l,i)=>{let d="",f=0;do d+=g.substring(f,i)+l,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 Z.exports=s(),Z.exports.createColors=s,Z.exports}var k=Si();const Mi=K(k);var ie={},se,Ft;function R(){if(Ft)return se;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 l=0,i,d="",f="";for(;l<g.length;l++)i=g[l],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 l={has:g,keys:r};return l.reset=t.reset.bind(l),l.bold=t.bold.bind(l),l.dim=t.dim.bind(l),l.italic=t.italic.bind(l),l.underline=t.underline.bind(l),l.inverse=t.inverse.bind(l),l.hidden=t.hidden.bind(l),l.strikethrough=t.strikethrough.bind(l),l.black=t.black.bind(l),l.red=t.red.bind(l),l.green=t.green.bind(l),l.yellow=t.yellow.bind(l),l.blue=t.blue.bind(l),l.magenta=t.magenta.bind(l),l.cyan=t.cyan.bind(l),l.white=t.white.bind(l),l.gray=t.gray.bind(l),l.grey=t.grey.bind(l),l.bgBlack=t.bgBlack.bind(l),l.bgRed=t.bgRed.bind(l),l.bgGreen=t.bgGreen.bind(l),l.bgYellow=t.bgYellow.bind(l),l.bgBlue=t.bgBlue.bind(l),l.bgMagenta=t.bgMagenta.bind(l),l.bgCyan=t.bgCyan.bind(l),l.bgWhite=t.bgWhite.bind(l),l}function s(g,r){let l={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(l)),i===void 0?this:t.enabled?o(this.keys,i+""):i+""):i===void 0?u([g],[l]):t.enabled?o([l],i+""):i+""}}return se=t,se}var ne,kt;function Oi(){return kt||(kt=1,ne=(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}}),ne}var oe,Nt;function le(){return Nt||(Nt=1,oe=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}),oe}var he,Yt;function C(){if(Yt)return he;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 he={cursor:t,scroll:o,erase:u,beep:a},he}var ue,Ht;function Pi(){if(Ht)return ue;Ht=1;function e(r,l){var i=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!i){if(Array.isArray(r)||(i=n(r))||l){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 h=!0,c=!1,b;return{s:function(){i=i.call(r)},n:function(){var p=i.next();return h=p.done,p},e:function(p){c=!0,b=p},f:function(){try{!h&&i.return!=null&&i.return()}finally{if(c)throw b}}}}function n(r,l){if(r){if(typeof r=="string")return a(r,l);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,l)}}function a(r,l){(l==null||l>r.length)&&(l=r.length);for(var i=0,d=new Array(l);i<l;i++)d[i]=r[i];return d}const t=le(),o=C(),u=o.erase,s=o.cursor,g=r=>[...t(r)].length;return ue=function(r,l){if(!l)return u.line+s.to(0);let i=0;const d=r.split(/\r?\n/);var f=e(d),h;try{for(f.s();!(h=f.n()).done;){let c=h.value;i+=1+Math.floor(Math.max(g(c)-1,0)/l)}}catch(c){f.e(c)}finally{f.f()}return u.lines(i)},ue}var ae,Bt;function Lt(){if(Bt)return ae;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 ae=process.platform==="win32"?n:e,ae}var ce,Vt;function Ti(){if(Vt)return ce;Vt=1;const e=R(),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 ce={styles:a,render:t,symbols:o,symbol:(r,l,i)=>l?o.aborted:i?o.exited:r?o.done:o.default,delimiter:r=>e.gray(r?n.ellipsis:n.pointerSmall),item:(r,l)=>e.gray(r?l?n.pointerSmall:"+":n.line)},ce}var de,Ut;function qi(){if(Ut)return de;Ut=1;const e=le();return de=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},de}var fe,Gt;function Ei(){return Gt||(Gt=1,fe=(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
|
-
`)}),fe}var pe,
|
4
|
+
`)}),fe}var pe,Wt;function Ri(){return Wt||(Wt=1,pe=(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}}),pe}var me,zt;function Y(){return zt||(zt=1,me={action:Oi(),clear:Pi(),style:Ti(),strip:le(),figures:Lt(),lines:qi(),wrap:Ei(),entriesToDisplay:Ri()}),me}var ge,Jt;function V(){if(Jt)return ge;Jt=1;const e=Dt,n=Y(),a=n.action,t=It,o=C(),u=o.beep,s=o.cursor,g=R();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,h=(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",h),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",h)}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 ge=r,ge}var ve,Kt;function Ci(){if(Kt)return ve;Kt=1;function e(h,c,b,v,p,m,w){try{var y=h[m](w),x=y.value}catch(S){b(S);return}y.done?c(x):Promise.resolve(x).then(v,p)}function n(h){return function(){var c=this,b=arguments;return new Promise(function(v,p){var m=h.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=R(),t=V(),o=C(),u=o.erase,s=o.cursor,g=Y(),r=g.style,l=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=l("",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
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)+
|
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)+l(this.outputError,this.out.columns)),this.out.write(l(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
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 ve=f,ve}var be,
|
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 ve=f,ve}var be,Zt;function _i(){if(Zt)return be;Zt=1;const e=R(),n=V(),a=Y(),t=a.style,o=a.clear,u=a.figures,s=a.wrap,g=a.entriesToDisplay,r=C(),l=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((h,c)=>(typeof h=="string"&&(h={title:h,value:c}),{title:h&&(h.title||h.value||h),value:h&&(h.value===void 0?c:h.value),description:h&&h.description,selected:h&&h.selected,disabled:h&&h.disabled})),this.optionsPerPage=f.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=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()}_(f,
|
11
|
-
`;for(let b=
|
10
|
+
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(f,h){if(f===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(l.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let f=g(this.cursor,this.choices.length,this.optionsPerPage),h=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=h;b<c;b++){let v,p,m="",w=this.choices[b];b===h&&h>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
12
|
`+s(w.description,{margin:3,width:this.out.columns})))),this.outputText+=`${p} ${v}${e.gray(m)}
|
13
|
-
`}}this.out.write(this.outputText)}}return be=i,be}var we,
|
13
|
+
`}}this.out.write(this.outputText)}}return be=i,be}var we,Xt;function Di(){if(Xt)return we;Xt=1;const e=R(),n=V(),a=Y(),t=a.style,o=a.clear,u=C(),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()}_(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 we=r,we}var ye,
|
16
|
-
`),this.close()}validate(){var
|
17
|
-
`)
|
18
|
-
`).reduce((
|
19
|
-
${E?" ":g.pointerSmall} ${a.red().italic(T)}`,"")),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()}_(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 we=r,we}var ye,Qt;function B(){if(Qt)return ye;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 ye=e,ye}var xe,er;function Ii(){if(er)return xe;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 xe=n,xe}var $e,tr;function Ai(){if(tr)return $e;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 $e=a,$e}var Se,rr;function ji(){if(rr)return Se;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 Se=n,Se}var Me,ir;function Fi(){if(ir)return Me;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 Me=n,Me}var Oe,sr;function ki(){if(sr)return Oe;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 Oe=n,Oe}var Pe,nr;function Ni(){if(nr)return Pe;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 Pe=n,Pe}var Te,or;function Yi(){if(or)return Te;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 Te=n,Te}var qe,lr;function Hi(){if(lr)return qe;lr=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 qe=n,qe}var Ee,hr;function Bi(){return hr||(hr=1,Ee={DatePart:B(),Meridiem:Ii(),Day:Ai(),Hours:ji(),Milliseconds:Fi(),Minutes:ki(),Month:Ni(),Seconds:Yi(),Year:Hi()}),Ee}var Re,ur;function Li(){if(ur)return Re;ur=1;function e(O,$,T,E,q,D,N){try{var A=O[D](N),I=A.value}catch(W){T(W);return}A.done?$(I):Promise.resolve(I).then(E,q)}function n(O){return function(){var $=this,T=arguments;return new Promise(function(E,q){var D=O.apply($,T);function N(I){e(D,E,q,N,A,"next",I)}function A(I){e(D,E,q,N,A,"throw",I)}N(void 0)})}}const a=R(),t=V(),o=Y(),u=o.style,s=o.clear,g=o.figures,r=C(),l=r.erase,i=r.cursor,d=Bi(),f=d.DatePart,h=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 h(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(),D=T.findIndex(N=>N!=null);this.parts.push(D in S?S[D]({token:T[D]||q,date:this.date,parts:this.parts,locales:this.locales}):T[D]||q)}let E=this.parts.reduce((q,D)=>(typeof D=="string"&&typeof q[q.length-1]=="string"?q[q.length-1]+=D:q.push(D),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(l.line+i.to(0)+this.outputText))}}return Re=P,Re}var Ce,ar;function Vi(){if(ar)return Ce;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=R(),t=V(),o=C(),u=o.cursor,s=o.erase,g=Y(),r=g.style,l=g.figures,i=g.clear,d=g.lines,f=/[0-9]/,h=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=h(p.initial)?p.initial:"",this.float=!!p.float,this.round=p.round||2,this.inc=p.increment||1,this.min=h(p.min)?p.min:-1/0,this.max=h(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
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
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
22
|
`).reduce((p,m,w)=>p+`
|
23
|
-
${w?" ":
|
24
|
-
`),this.close()}submit(){const f=this.value.filter(
|
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(
|
23
|
+
${w?" ":l.pointerSmall} ${a.red().italic(m)}`,"")),this.out.write(s.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore))}}return Ce=b,Ce}var _e,cr;function dr(){if(cr)return _e;cr=1;const e=R(),n=C(),a=n.cursor,t=V(),o=Y(),u=o.clear,s=o.figures,g=o.style,r=o.wrap,l=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((h,c)=>(typeof h=="string"&&(h={title:h,value:c}),{title:h&&(h.title||h.value||h),description:h&&h.description,value:h&&(h.value===void 0?c:h.value),selected:h&&h.selected,disabled:h&&h.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(h=>h.selected);this.minSelected&&f.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
25
|
+
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(f=>f.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const f=this.value[this.cursor];if(f.selected)f.selected=!1,this.render();else{if(f.disabled||this.value.filter(h=>h.selected).length>=this.maxChoices)return this.bell();f.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const f=!this.value[this.cursor].selected;this.value.filter(h=>!h.disabled).forEach(h=>h.selected=f),this.render()}_(f,h){if(f===" ")this.handleSpaceToggle();else if(f==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
26
26
|
Instructions:
|
27
27
|
${s.arrowUp}/${s.arrowDown}: Highlight option
|
28
28
|
${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection
|
29
29
|
`+(this.maxChoices===void 0?` a: Toggle all
|
30
|
-
`:"")+" enter/return: Complete answer":""}renderOption(f,
|
31
|
-
`+r(
|
30
|
+
`:"")+" enter/return: Complete answer":""}renderOption(f,h,c,b){const v=(h.selected?e.green(s.radioOn):s.radioOff)+" "+b+" ";let p,m;return h.disabled?p=f===c?e.gray().underline(h.title):e.strikethrough().gray(h.title):(p=f===c?e.cyan().underline(h.title):h.title,f===c&&h.description&&(m=` - ${h.description}`,(v.length+p.length+m.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(m=`
|
31
|
+
`+r(h.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 h=l(this.cursor,f.length,this.optionsPerPage),c=h.startIndex,b=h.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
32
|
`+p.join(`
|
33
|
-
`)}renderOptions(f){return this.done?"":this.paginateOptions(f)}renderDoneOrInstructions(){if(this.done)return this.value.filter(
|
33
|
+
`)}renderOptions(f){return this.done?"":this.paginateOptions(f)}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");const f=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&f.push(e.yellow(this.warn)),f.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(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 _e=i,_e}var De,fr;function Ui(){if(fr)return De;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=R(),t=V(),o=C(),u=o.erase,s=o.cursor,g=Y(),r=g.style,l=g.clear,i=g.figures,d=g.wrap,f=g.entriesToDisplay,h=(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=l("",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=h(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:h(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,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
|
37
|
-
`+d(m.description,{margin:3,width:this.out.columns}))),M+" "+P+a.gray(
|
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(l(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||a.gray(this.fallback.title))}this.out.write(u.line+s.to(0)+this.outputText)}}return De=v,De}var Ie,
|
39
|
+
`+(x||a.gray(this.fallback.title))}this.out.write(u.line+s.to(0)+this.outputText)}}return De=v,De}var Ie,pr;function Gi(){if(pr)return Ie;pr=1;const e=R(),n=C(),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,47 +44,47 @@ 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(i,d,f){let
|
47
|
+
`}renderOption(i,d,f){let h;return d.disabled?h=i===f?e.gray().underline(d.title):e.strikethrough().gray(d.title):h=i===f?e.cyan().underline(d.title):d.title,(d.selected?e.green(g.radioOn):g.radioOff)+" "+h}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 Ie=r,Ie}var Ae,mr;function Wi(){if(mr)return Ae;mr=1;const e=R(),n=V(),a=Y(),t=a.style,o=a.clear,u=C(),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()}_(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 Ae=r,Ae}var je,
|
50
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0
|
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 Ae=r,Ae}var je,gr;function zi(){return gr||(gr=1,je={TextPrompt:Ci(),SelectPrompt:_i(),TogglePrompt:Di(),DatePrompt:Li(),NumberPrompt:Vi(),MultiselectPrompt:dr(),AutocompletePrompt:Ui(),AutocompleteMultiselectPrompt:Gi(),ConfirmPrompt:Wi()}),je}var vr;function Ji(){return vr||(vr=1,function(e){const n=e,a=zi(),t=s=>s;function o(s,g,r={}){return new Promise((l,i)=>{const d=new a[s](g),f=r.onAbort||t,h=r.onSubmit||t,c=r.onExit||t;d.on("state",g.onState||t),d.on("submit",b=>l(h(b))),d.on("exit",b=>l(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(l=>l.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(l=>l.selected).map(l=>l.value);return o("MultiselectPrompt",s,{onAbort:g,onSubmit:g})},n.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(l=>l.selected).map(l=>l.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))}(ie)),ie}var Fe,br;function Ki(){if(br)return Fe;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=Ji(),l=["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*(I,W,_t=!1){if(!(!_t&&I.validate&&I.validate(W)!==!0))return I.format?yield I.format(W,w):W});return function(W,_t){return A.apply(this,arguments)}}();var E=t(v),q;try{for(E.s();!(q=E.n()).done;){S=q.value;var D=S;if(P=D.name,O=D.type,typeof O=="function"&&(O=yield O(x,n({},w),S),S.type=O),!!O){for(let A in S){if(l.includes(A))continue;let I=S[A];S[A]=typeof I=="function"?yield I(x,n({},w),$):I}if($=S,typeof S.message!="string")throw new Error("prompt message is required");var N=S;if(P=N.name,O=N.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?h(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 h(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 Fe=Object.assign(d,{prompt:d,prompts:r,inject:c,override:b}),Fe}var ke={},Ne,wr;function Zi(){return wr||(wr=1,Ne=(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}}),Ne}var Ye,yr;function He(){return yr||(yr=1,Ye=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}),Ye}var Be,xr;function Xi(){if(xr)return Be;xr=1;const e=He(),{erase:n,cursor:a}=C(),t=o=>[...e(o)].length;return Be=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)},Be}var Le,$r;function Sr(){if($r)return Le;$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 Le=process.platform==="win32"?n:e,Le}var Ve,Mr;function Qi(){if(Mr)return Ve;Mr=1;const e=R(),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 Ve={styles:a,render:t,symbols:o,symbol:(r,l,i)=>l?o.aborted:i?o.exited:r?o.done:o.default,delimiter:r=>e.gray(r?n.ellipsis:n.pointerSmall),item:(r,l)=>e.gray(r?l?n.pointerSmall:"+":n.line)},Ve}var Ue,Or;function es(){if(Or)return Ue;Or=1;const e=He();return Ue=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},Ue}var Ge,Pr;function ts(){return Pr||(Pr=1,Ge=(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
|
-
`)}),Ge}var
|
52
|
+
`)}),Ge}var We,Tr;function rs(){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 ze,qr;function H(){return qr||(qr=1,ze={action:Zi(),clear:Xi(),style:Qi(),strip:He(),figures:Sr(),lines:es(),wrap:ts(),entriesToDisplay:rs()}),ze}var Je,Er;function U(){if(Er)return Je;Er=1;const e=Dt,{action:n}=H(),a=It,{beep:t,cursor:o}=C(),u=R();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 l=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,l),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,d=(f,h)=>{let c=n(h,i);c===!1?this._&&this._(f,h):typeof this[c]=="function"?this[c](h):this.bell()};this.close=()=>{this.out.write(o.show),this.in.removeListener("keypress",d),this.in.isTTY&&this.in.setRawMode(!1),l.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 Je=s,Je}var Ke,Rr;function is(){if(Rr)return Ke;Rr=1;const e=R(),n=U(),{erase:a,cursor:t}=C(),{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
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),
|
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),h=this.value.slice(this.cursor);this.value=`${f}${i}${h}`,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
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 Ke=r,Ke}var Ze,Cr;function ss(){if(Cr)return Ze;Cr=1;const e=
|
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 Ke=r,Ke}var Ze,Cr;function ss(){if(Cr)return Ze;Cr=1;const e=R(),n=U(),{style:a,clear:t,figures:o,wrap:u,entriesToDisplay:s}=H(),{cursor:g}=C();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
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
|
60
|
-
`+u(v.description,{margin:3,width:this.out.columns})))),this.outputText+=`${c} ${
|
61
|
-
`}}this.out.write(this.outputText)}}return Ze=r,Ze}var Xe,
|
59
|
+
`;for(let f=i;f<d;f++){let h,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?(h=this.cursor===f?e.gray().underline(v.title):e.strikethrough().gray(v.title),c=(this.cursor===f?e.bold().gray(o.pointer)+" ":" ")+c):(h=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+h.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} ${h}${e.gray(b)}
|
61
|
+
`}}this.out.write(this.outputText)}}return Ze=r,Ze}var Xe,_r;function ns(){if(_r)return Xe;_r=1;const e=R(),n=U(),{style:a,clear:t}=H(),{cursor:o,erase:u}=C();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()}_(r,
|
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,l){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 Xe=s,Xe}var Qe,Dr;function L(){if(Dr)return Qe;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 Qe=e,Qe}var et,Ir;function os(){if(Ir)return et;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 et=n,et}var tt,Ar;function ls(){if(Ar)return tt;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 tt=a,tt}var rt,jr;function hs(){if(jr)return rt;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 rt=n,rt}var it,Fr;function us(){if(Fr)return it;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 it=n,it}var st,kr;function as(){if(kr)return st;kr=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 st=n,st}var nt,Nr;function cs(){if(Nr)return nt;Nr=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 nt=n,nt}var ot,Yr;function ds(){if(Yr)return ot;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 ot=n,ot}var lt,Hr;function fs(){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 ht,Br;function ps(){return Br||(Br=1,ht={DatePart:L(),Meridiem:os(),Day:ls(),Hours:hs(),Milliseconds:us(),Minutes:as(),Month:cs(),Seconds:ds(),Year:fs()}),ht}var ut,Lr;function ms(){if(Lr)return ut;Lr=1;const e=R(),n=U(),{style:a,clear:t,figures:o}=H(),{erase:u,cursor:s}=C(),{DatePart:g,Meridiem:r,Day:l,Hours:i,Milliseconds:d,Minutes:f,Month:h,Seconds:c,Year:b}=ps(),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 l(y),3:y=>new h(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(
|
66
|
-
`).reduce((x
|
67
|
-
${M?" ":o.pointerSmall} ${e.red().italic(
|
68
|
-
`),this.close()}async validate(){let
|
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
|
70
|
-
`).reduce((
|
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 at=d,at}var ct,
|
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 ut=w,ut}var at,Vr;function gs(){if(Vr)return at;Vr=1;const e=R(),n=U(),{cursor:a,erase:t}=C(),{style:o,figures:u,clear:s,lines:g}=H(),r=/[0-9]/,l=f=>f!==void 0,i=(f,h)=>{let c=Math.pow(10,h);return Math.round(f*c)/c};class d extends n{constructor(h={}){super(h),this.transform=o.render(h.style),this.msg=h.message,this.initial=l(h.initial)?h.initial:"",this.float=!!h.float,this.round=h.round||2,this.inc=h.increment||1,this.min=l(h.min)?h.min:-1/0,this.max=l(h.max)?h.max:1/0,this.errorMsg=h.error||"Please Enter A Valid Value",this.validator=h.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(h){!h&&h!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${i(h,this.round)}`),this._value=i(h,this.round)),this.fire()}get value(){return this._value}parse(h){return this.float?parseFloat(h):parseInt(h)}valid(h){return h==="-"||h==="."&&this.float||r.test(h)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let h=this.value;this.value=h!==""?h:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
68
|
+
`),this.close()}async validate(){let h=await this.validator(this.value);typeof h=="string"&&(this.errorMsg=h,h=!1),this.error=!h}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let h=this.value;this.value=h!==""?h:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
69
|
+
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let h=this.value.toString();if(h.length===0)return this.bell();this.value=this.parse(h=h.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(h,c){if(!this.valid(h))return this.bell();const b=Date.now();if(b-this.lastHit>1e3&&(this.typed=""),this.typed+=h,this.lastHit=b,this.color="cyan",h===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(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((h,c,b)=>h+`
|
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 at=d,at}var ct,Ur;function Gr(){if(Ur)return ct;Ur=1;const e=R(),{cursor:n}=C(),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
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
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
75
|
${o.arrowUp}/${o.arrowDown}: Highlight option
|
76
76
|
${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection
|
77
77
|
`+(this.maxChoices===void 0?` a: Toggle all
|
78
|
-
`:"")+" enter/return: Complete answer":""}renderOption(i,d,f,
|
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),
|
78
|
+
`:"")+" enter/return: Complete answer":""}renderOption(i,d,f,h){const c=(d.selected?e.green(o.radioOn):o.radioOff)+" "+h+" ";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),h,c=[];for(let b=d;b<f;b++)b===d&&d>0?h=o.arrowUp:b===f-1&&f<i.length?h=o.arrowDown:h=" ",c.push(this.renderOption(this.cursor,i[b],b,h));return`
|
80
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 ct=r,ct}var dt,
|
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 ct=r,ct}var dt,Wr;function vs(){if(Wr)return dt;Wr=1;const e=R(),n=U(),{erase:a,cursor:t}=C(),{style:o,clear:u,figures:s,wrap:g,entriesToDisplay:r}=H(),l=(h,c)=>h[c]&&(h[c].value||h[c].title||h[c]),i=(h,c)=>h[c]&&(h[c].title||h[c].value||h[c]),d=(h,c)=>{const b=h.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=l(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:l(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
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
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(a.line+t.to(0)+this.outputText)}}return dt=f,dt}var ft,zr;function bs(){if(zr)return ft;zr=1;const e=
|
87
|
+
`+(v||e.gray(this.fallback.title))}this.out.write(a.line+t.to(0)+this.outputText)}}return dt=f,dt}var ft,zr;function bs(){if(zr)return ft;zr=1;const e=R(),{cursor:n}=C(),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 l=this.filteredOptions.findIndex(i=>i===r);this.cursor=l<0?0:l,this.render()}handleSpaceToggle(){const r=this.filteredOptions[this.cursor];if(r.selected)r.selected=!1,this.render();else{if(r.disabled||this.value.filter(l=>l.selected).length>=this.maxChoices)return this.bell();r.selected=!0,this.render()}}handleInputChange(r){this.inputValue=this.inputValue+r,this.updateFilteredOptions()}_(r,l){r===" "?this.handleSpaceToggle():this.handleInputChange(r)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
88
88
|
Instructions:
|
89
89
|
${u.arrowUp}/${u.arrowDown}: Highlight option
|
90
90
|
${u.arrowLeft}/${u.arrowRight}/[space]: Toggle selection
|
@@ -92,16 +92,16 @@ Instructions:
|
|
92
92
|
enter/return: Complete answer
|
93
93
|
`:""}renderCurrentInput(){return`
|
94
94
|
Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
|
95
|
-
`}renderOption(r,
|
95
|
+
`}renderOption(r,l,i){let d;return l.disabled?d=r===i?e.gray().underline(l.title):e.strikethrough().gray(l.title):d=r===i?e.cyan().underline(l.title):l.title,(l.selected?e.green(u.radioOn):u.radioOff)+" "+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(l=>l.selected).map(l=>l.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 ft=s,ft}var pt,Jr;function ws(){if(Jr)return pt;Jr=1;const e=R(),n=U(),{style:a,clear:t}=H(),{erase:o,cursor:u}=C();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()}_(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 pt=s,pt}var mt,Jr;function ys(){return Jr||(Jr=1,mt={TextPrompt:is(),SelectPrompt:ss(),TogglePrompt:ns(),DatePrompt:ms(),NumberPrompt:gs(),MultiselectPrompt:Ur(),AutocompletePrompt:vs(),AutocompleteMultiselectPrompt:bs(),ConfirmPrompt:ws()}),mt}var Kr;function xs(){return Kr||(Kr=1,function(e){const n=e,a=ys(),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))}(Ne)),Ne}var gt,Zr;function Ss(){if(Zr)return gt;Zr=1;const e=xs(),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 gt=Object.assign(t,{prompt:t,prompts:e,inject:u,override:s}),gt}var vt,Xr;function $s(){if(Xr)return vt;Xr=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 vt=e("8.6.0")?Ki():Ss(),vt}var Ms=$s();const Os=J(Ms);var G={exports:{}},bt,Qr;function Ps(){if(Qr)return bt;Qr=1,bt=t,t.sync=o;var e=te;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 bt}var wt,ei;function Ts(){if(ei)return wt;ei=1,wt=n,n.sync=a;var e=te;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 wt}var yt,ti;function qs(){if(ti)return yt;ti=1;var e;process.platform==="win32"||wi.TESTING_WINDOWS?e=Ps():e=Ts(),yt=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 yt}var xt,ri;function Es(){if(ri)return xt;ri=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",n=ee,a=e?";":":",t=qs(),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,$=n.join(x,r),M=!x&&/^\.[\\\/]/.test(r)?r.slice(0,2)+$:$;m(v(M,p,0))}),v=(p,m,w)=>new Promise((y,x)=>{if(w===f.length)return y(b(m+1));const $=f[w];t(p+$,{pathExt:l},(M,P)=>{if(!M&&P)if(h.all)c.push(p+$);else return y(p+$);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 xt=s,s.sync=g,xt}var Z={exports:{}},ii;function Cs(){if(ii)return Z.exports;ii=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 Z.exports=e,Z.exports.default=e,Z.exports}var St,si;function Rs(){if(si)return St;si=1;const e=ee,n=Es(),a=Cs();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 X={},ni;function _s(){if(ni)return X;ni=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 X.command=n,X.argument=a,X}var $t,oi;function Ds(){return oi||(oi=1,$t=/^#!(.*)/),$t}var Mt,hi;function Is(){if(hi)return Mt;hi=1;const e=Ds();return Mt=(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},Mt}var Ot,li;function As(){if(li)return Ot;li=1;const e=te,n=Is();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 Ot=a,Ot}var Pt,ui;function js(){if(ui)return Pt;ui=1;const e=ee,n=Rs(),a=_s(),t=As(),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 Pt=h,Pt}var Tt,ai;function Fs(){if(ai)return Tt;ai=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 Tt={hookChildProcess:a,verifyENOENT:t,verifyENOENTSync:o,notFoundError:n},Tt}var ci;function Ns(){if(ci)return G.exports;ci=1;const e=bi,n=js(),a=Fs();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 ks=Ns();const Ys=J(ks),{blue:Hs,cyan:di,green:qt,yellowBright:fi,white:Bs,red:pi,cyanBright:mi,bgYellowBright:Ls}=Mi,I={react:di("React"),mobx:di("Mobx"),"tanstack-router":mi("Tanstack Router"),jotai:mi("Jotai"),ts:Hs("TS"),vue:qt("Vue3"),pinia:qt("Pinia"),bun:Bs("Bun"),elysia:pi("Elysia"),vite:fi("Vite"),rspack:fi("Rspack")};function Q(){return this._label+" "+(this.completed?qt("\u2714"):pi("\u2718 uncompleted"))+" "+(this.recommended?Ls("recommended"):"")}const W={frontend:{react:{get label(){return Q.call(this)},_label:`${I.react} + ${I.mobx} + ${I.ts} + ${I.vite}`,value:"react",completed:!0},vue:{get label(){return Q.call(this)},_label:`${I.vue} + ${I.pinia} + ${I.ts} + ${I.vite}`,value:"vue",completed:!0},"react-tanstack-jotai":{get label(){return Q.call(this)},_label:`${I.react} + ${I.jotai} + ${I["tanstack-router"]} + ${I.ts} + ${I.vite}`,value:"react",completed:!0,recommended:!0}},backend:{bun:{get label(){return Q.call(this)},_label:`${I.bun} + ${I.elysia} + ${I.ts}`,value:"bun",completed:!1}}};function gi(e){return e?.trim().replace(/\/+$/g,"")}function Et(e){return F.basename(F.resolve(e))}function Vs(e){const n=j.readdirSync(e);return n.length===0||n.length===1&&n[0]===".git"}function Us(e){return j.existsSync(e)}function Gs(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function zs(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ws(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 Js(e){if(!e)return;const n=e.split(" ")[0].split("/");return{name:n[0],version:n[1]}}function Ks(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);vi(t,o)}}function vi(e,n){Zs(e)?Ks(e,n):j.copyFileSync(e,n)}function Zs(e){return j.statSync(e).isDirectory()}const Ct=Si(process.argv.slice(2),{boolean:["help"],string:["_"],default:{help:!1},alias:{h:"help",t:"template"}}),Xs=Object.keys(W).map(e=>` ${N.gray(e)}:
|
98
|
-
${Object.values(
|
97
|
+
`),this.close()}_(r,l){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 pt=s,pt}var mt,Kr;function ys(){return Kr||(Kr=1,mt={TextPrompt:is(),SelectPrompt:ss(),TogglePrompt:ns(),DatePrompt:ms(),NumberPrompt:gs(),MultiselectPrompt:Gr(),AutocompletePrompt:vs(),AutocompleteMultiselectPrompt:bs(),ConfirmPrompt:ws()}),mt}var Zr;function xs(){return Zr||(Zr=1,function(e){const n=e,a=ys(),t=s=>s;function o(s,g,r={}){return new Promise((l,i)=>{const d=new a[s](g),f=r.onAbort||t,h=r.onSubmit||t,c=r.onExit||t;d.on("state",g.onState||t),d.on("submit",b=>l(h(b))),d.on("exit",b=>l(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(l=>l.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(l=>l.selected).map(l=>l.value);return o("MultiselectPrompt",s,{onAbort:g,onSubmit:g})},n.autocompleteMultiselect=s=>{s.choices=[].concat(s.choices||[]);const g=r=>r.filter(l=>l.selected).map(l=>l.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 gt,Xr;function $s(){if(Xr)return gt;Xr=1;const e=xs(),n=["suggest","format","onState","validate","onRender","type"],a=()=>{};async function t(g=[],{onSubmit:r=a,onCancel:l=a}={}){const i={},d=t._override||{};g=[].concat(g);let f,h,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(h of g)if({name:b,type:v}=h,typeof v=="function"&&(v=await v(f,{...i},h),h.type=v),!!v){for(let w in h){if(n.includes(w))continue;let y=h[w];h[w]=typeof y=="function"?await y(f,{...i},p):y}if(p=h,typeof h.message!="string")throw new Error("prompt message is required");if({name:b,type:v}=h,e[v]===void 0)throw new Error(`prompt type (${v}) is not defined`);if(d[h.name]!==void 0&&(f=await m(h,d[h.name]),f!==void 0)){i[b]=f;continue}try{f=t._injected?o(t._injected,h.initial):await e[v](h),i[b]=f=await m(h,f,!0),c=await r(h,f,i)}catch{c=!await l(h,i)}if(c)return i}return i}function o(g,r){const l=g.shift();if(l instanceof Error)throw l;return l===void 0?r:l}function u(g){t._injected=(t._injected||[]).concat(g)}function s(g){t._override=Object.assign({},g)}return gt=Object.assign(t,{prompt:t,prompts:e,inject:u,override:s}),gt}var vt,Qr;function Ss(){if(Qr)return vt;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 vt=e("8.6.0")?Ki():$s(),vt}var Ms=Ss();const Os=K(Ms);var G={exports:{}},bt,ei;function Ps(){if(ei)return bt;ei=1,bt=t,t.sync=o;var e=te;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 l=g[r].toLowerCase();if(l&&u.substr(-l.length).toLowerCase()===l)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,l){g(r,r?!1:a(l,u,s))})}function o(u,s){return a(e.statSync(u),u,s)}return bt}var wt,ti;function Ts(){if(ti)return wt;ti=1,wt=n,n.sync=a;var e=te;function n(u,s,g){e.stat(u,function(r,l){g(r,r?!1:t(l,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,l=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),h=parseInt("010",8),c=parseInt("001",8),b=f|h,v=g&c||g&h&&l===d||g&f&&r===i||g&b&&i===0;return v}return wt}var yt,ri;function qs(){if(ri)return yt;ri=1;var e;process.platform==="win32"||wi.TESTING_WINDOWS?e=Ps():e=Ts(),yt=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,l){r?g(r):s(l)})})}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 yt}var xt,ii;function Es(){if(ii)return xt;ii=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",n=ee,a=e?";":":",t=qs(),o=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),u=(r,l)=>{const i=l.colon||a,d=r.match(/\//)||e&&r.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(l.path||process.env.PATH||"").split(i)],f=e?l.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",h=e?f.split(i):[""];return e&&r.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:d,pathExt:h,pathExtExe:f}},s=(r,l,i)=>{typeof l=="function"&&(i=l,l={}),l||(l={});const{pathEnv:d,pathExt:f,pathExtExe:h}=u(r,l),c=[],b=p=>new Promise((m,w)=>{if(p===d.length)return l.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:h},(M,P)=>{if(!M&&P)if(l.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,l)=>{l=l||{};const{pathEnv:i,pathExt:d,pathExtExe:f}=u(r,l),h=[];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(l.all)h.push(y);else return y}catch{}}}if(l.all&&h.length)return h;if(l.nothrow)return null;throw o(r)};return xt=s,s.sync=g,xt}var X={exports:{}},si;function Rs(){if(si)return X.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 X.exports=e,X.exports.default=e,X.exports}var $t,ni;function Cs(){if(ni)return $t;ni=1;const e=ee,n=Es(),a=Rs();function t(u,s){const g=u.options.env||process.env,r=process.cwd(),l=u.options.cwd!=null,i=l&&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(l?u.options.cwd:"",d)),d}function o(u){return t(u)||t(u,!0)}return $t=o,$t}var Q={},oi;function _s(){if(oi)return Q;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 Q.command=n,Q.argument=a,Q}var St,li;function Ds(){return li||(li=1,St=/^#!(.*)/),St}var Mt,hi;function Is(){if(hi)return Mt;hi=1;const e=Ds();return Mt=(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},Mt}var Ot,ui;function As(){if(ui)return Ot;ui=1;const e=te,n=Is();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 Ot=a,Ot}var Pt,ai;function js(){if(ai)return Pt;ai=1;const e=ee,n=Cs(),a=_s(),t=As(),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 h=s.test(d);i.command=e.normalize(i.command),i.command=a.command(i.command),i.args=i.args.map(b=>a.argument(b,h));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 l(i,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const h={command:i,args:d,options:f,file:void 0,original:{command:i,args:d}};return f.shell?h:r(h)}return Pt=l,Pt}var Tt,ci;function Fs(){if(ci)return Tt;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,l){if(r==="exit"){const i=t(l,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 Tt={hookChildProcess:a,verifyENOENT:t,verifyENOENTSync:o,notFoundError:n},Tt}var di;function ks(){if(di)return G.exports;di=1;const e=bi,n=js(),a=Fs();function t(u,s,g){const r=n(u,s,g),l=e.spawn(r.command,r.args,r.options);return a.hookChildProcess(l,r),l}function o(u,s,g){const r=n(u,s,g),l=e.spawnSync(r.command,r.args,r.options);return l.error=l.error||a.verifyENOENTSync(l.status,r),l}return G.exports=t,G.exports.spawn=t,G.exports.sync=o,G.exports._parse=n,G.exports._enoent=a,G.exports}var Ns=ks();const Ys=K(Ns),{blue:Hs,cyan:qt,green:Et,yellowBright:fi,white:Bs,red:pi,cyanBright:mi,bgYellowBright:Ls}=Mi,_={react:qt("React"),mobx:qt("Mobx"),"tanstack-router":mi("Tanstack Router"),jotai:mi("Jotai"),vue:Et("Vue3"),pinia:Et("Pinia"),bun:Bs("Bun"),elysia:pi("Elysia"),rspack:fi("Rspack"),tailwinds:qt("Tailwinds"),vite:fi("Vite"),ts:Hs("TS")};function z(){return this._label+" "+(this.completed?Et("\u2714"):pi("\u2718 uncompleted"))+" "+(this.recommended?Ls("recommended"):"")}const J={frontend:{react:{get label(){return z.call(this)},_label:`${_.react} + ${_.mobx}`,value:"react",completed:!0},vue:{get label(){return z.call(this)},_label:`${_.vue} + ${_.pinia}`,value:"vue",completed:!0,recommended:!0},"react-tanstack-jotai":{get label(){return z.call(this)},_label:`${_.react} + ${_.jotai} + ${_["tanstack-router"]}`,value:"react",completed:!0,recommended:!0},"react-tanstack-jotai-tailwindcss":{get label(){return z.call(this)},_label:`${_.react} + ${_.jotai} + ${_["tanstack-router"]} + ${_.tailwinds}`,value:"react",completed:!0,recommended:!0},"react18-tanstack-jotai-tailwindcss":{get label(){return z.call(this)},_label:`${_.react}18 + ${_.jotai} + ${_["tanstack-router"]} + ${_.tailwinds}`,value:"react",completed:!0,recommended:!0}},backend:{bun:{get label(){return z.call(this)},_label:`${_.bun} + ${_.elysia} + ${_.ts}`,value:"bun",completed:!1}}};function gi(e){return e?.trim().replace(/\/+$/g,"")}function Rt(e){return F.basename(F.resolve(e))}function Vs(e){const n=j.readdirSync(e);return n.length===0||n.length===1&&n[0]===".git"}function Us(e){return j.existsSync(e)}function Gs(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function Ws(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function zs(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 Js(e){if(!e)return;const n=e.split(" ")[0].split("/");return{name:n[0],version:n[1]}}function Ks(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);vi(t,o)}}function vi(e,n){Zs(e)?Ks(e,n):j.copyFileSync(e,n)}function Zs(e){return j.statSync(e).isDirectory()}const Ct=$i(process.argv.slice(2),{boolean:["help"],string:["_"],default:{help:!1},alias:{h:"help",t:"template"}}),Xs=Object.keys(J).map(e=>` ${k.gray(e)}:
|
98
|
+
${Object.values(J[e]).map(n=>` ${n.label}
|
99
99
|
`).join("")}`).join(`
|
100
100
|
`),Qs=`
|
101
101
|
Create a new project from lik's template.
|
102
102
|
|
103
103
|
Usage:
|
104
|
-
${
|
104
|
+
${k.magenta("lik-create")} [OPTIONS]... [DIRECTORY]
|
105
105
|
|
106
106
|
Options:
|
107
107
|
-h, --help Show this help message and exit.
|
@@ -111,9 +111,9 @@ Avaliable templates:
|
|
111
111
|
${Xs}
|
112
112
|
|
113
113
|
Thx create-vite.
|
114
|
-
`,en=()=>console.log(Qs),tn=Object.values(
|
115
|
-
`);const m=F.relative(
|
114
|
+
`,en=()=>console.log(Qs),tn=Object.values(J).flatMap(e=>Object.values(e)),rn=async()=>{if(Ct.help)return en();const e="lik-create-template",n=Ct._[0];let a=gi(n)||e;const t=a===".",o=Ct.template;try{const u=await Os([{type:n?null:"text",name:"projectName",message:k.reset("Project name: "),initial:e,onState:w=>{a=gi(w.value)||e}},{type:!Us(a)||Vs(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(k.red("\u2716")+" Operation cancelled");return null},name:"overwriteChecker",message:"Overwrite?"},{type:()=>Gs(Rt(a))?null:"text",initial:()=>Ws(Rt(a)),name:"packageName",message:k.reset("Package name:")},{type:()=>{if(!o)return"select";const w=tn.find(y=>y.value===o);if(w&&w.completed)return null;throw new Error(k.red("\u2716")+"This template is not available/complete, plz check by `--help`")},name:"end",message:k.reset("Select type:"),choices:Object.keys(J).map(w=>({title:w,value:w}))},{type:w=>w&&J[w]?"select":null,name:"template",message:w=>k.reset(`Select a template ${w==="frontend"?`(all based ${_.ts} and ${_.vite})`:""} :`),choices:w=>Object.entries(J[w]).map(([y,x])=>({title:x.label,value:y,disabled:!x.completed}))}],{onCancel:()=>{throw new Error(k.red("\u2716")+" Operation cancelled")}}),{overwrite:s,template:g,packageName:r}=u,l=process.cwd(),i=F.join(l,a);s==="yes"?zs(i):j.existsSync(i)||j.mkdirSync(i,{recursive:!0});const d=Js(process.env.npm_config_user_agent),f=g||o,h=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):vi(F.join(h,w),x)},v=j.readdirSync(h);for(const w of v.filter(y=>y!=="package.json"))b(w);const p=JSON.parse(j.readFileSync(F.join(h,"package.json"),"utf-8"));p.name=r||Rt(a),b("package.json",JSON.stringify(p,null,2)+`
|
115
|
+
`);const m=F.relative(l,i);switch(console.log(`${k.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
|
-
`),i!==
|
119
|
+
`),i!==l&&console.log(` cd ${m.includes(" ")?`"${m}"`:m}`),Ys("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)}};rn();
|