create-waku 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
  3. package/template/01_template/gitignore +7 -0
  4. package/template/01_template/package.json +5 -5
  5. package/template/02_demo/package.json +5 -5
  6. package/template/02_demo/private/pokemon.json +2586 -0
  7. package/template/02_demo/src/lib/pokemon.ts +5 -2586
  8. package/template/03_minimal/package.json +5 -5
  9. package/template/03_minimal/public/404.html +1 -0
  10. package/template/04_promise/package.json +5 -5
  11. package/template/05_actions/package.json +5 -5
  12. package/template/06_nesting/package.json +5 -5
  13. package/template/07_router/package.json +5 -5
  14. package/template/07_router/src/components/Counter.tsx +3 -1
  15. package/template/07_router/src/entries.tsx +8 -1
  16. package/template/08_cookies/package.json +6 -6
  17. package/template/08_cookies/src/entries.tsx +1 -1
  18. package/template/09_cssmodules/package.json +5 -5
  19. package/template/{10_dynamicroute → 10_fs-router}/package.json +5 -5
  20. package/template/11_form/package.json +5 -5
  21. package/template/12_css/package.json +6 -6
  22. package/template/13_path-alias/package.json +6 -6
  23. package/template/13_path-alias/src/components/App.tsx +4 -1
  24. package/template/13_path-alias/src/components/Counter.tsx +5 -1
  25. package/template/13_path-alias/src/components/MyFragment.tsx +5 -0
  26. package/template/14_react-tweet/package.json +25 -0
  27. package/template/14_react-tweet/postcss.config.js +7 -0
  28. package/template/14_react-tweet/public/images/favicon.png +0 -0
  29. package/template/14_react-tweet/src/components/error-boundary.tsx +28 -0
  30. package/template/14_react-tweet/src/components/footer.tsx +18 -0
  31. package/template/14_react-tweet/src/components/header.tsx +7 -0
  32. package/template/14_react-tweet/src/entries.tsx +18 -0
  33. package/template/14_react-tweet/src/main.tsx +19 -0
  34. package/template/14_react-tweet/src/styles.css +4 -0
  35. package/template/14_react-tweet/src/templates/home-page.tsx +22 -0
  36. package/template/14_react-tweet/src/templates/root-layout.tsx +33 -0
  37. package/template/14_react-tweet/tailwind.config.js +4 -0
  38. package/template/14_react-tweet/tsconfig.json +17 -0
  39. package/template/14_react-tweet/vite.config.ts +15 -0
  40. package/template/10_dynamicroute/vite.config.ts +0 -20
  41. /package/template/08_cookies/{db → private}/items.json +0 -0
  42. /package/template/{10_dynamicroute → 10_fs-router}/src/components/Counter.tsx +0 -0
  43. /package/template/{10_dynamicroute → 10_fs-router}/src/components/ErrorBoundary.tsx +0 -0
  44. /package/template/{10_dynamicroute → 10_fs-router}/src/entries.tsx +0 -0
  45. /package/template/{10_dynamicroute → 10_fs-router}/src/main.tsx +0 -0
  46. /package/template/{10_dynamicroute → 10_fs-router}/src/routes/bar/page.tsx +0 -0
  47. /package/template/{10_dynamicroute → 10_fs-router}/src/routes/foo/page.tsx +0 -0
  48. /package/template/{10_dynamicroute → 10_fs-router}/src/routes/layout.tsx +0 -0
  49. /package/template/{10_dynamicroute → 10_fs-router}/src/routes/nested/[name]/page.tsx +0 -0
  50. /package/template/{10_dynamicroute → 10_fs-router}/src/routes/page.tsx +0 -0
  51. /package/template/{10_dynamicroute → 10_fs-router}/tsconfig.json +0 -0
package/dist/index.js CHANGED
@@ -27,4 +27,4 @@ import{createRequire as t}from"module";var r={1706:t=>{
27
27
  */
28
28
  function isSpecificValue(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp?true:false}function cloneSpecificValue(t){if(t instanceof Buffer){var r=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);t.copy(r);return r}else if(t instanceof Date){return new Date(t.getTime())}else if(t instanceof RegExp){return new RegExp(t)}else{throw new Error("Unexpected situation")}}function deepCloneArray(t){var i=[];t.forEach((function(t,o){if(typeof t==="object"&&t!==null){if(Array.isArray(t)){i[o]=deepCloneArray(t)}else if(isSpecificValue(t)){i[o]=cloneSpecificValue(t)}else{i[o]=r({},t)}}else{i[o]=t}}));return i}function safeGetProperty(t,r){return r==="__proto__"?undefined:t[r]}var r=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=="object"){return false}if(arguments.length<2){return arguments[0]}var t=arguments[0];var i=Array.prototype.slice.call(arguments,1);var o,a,c;i.forEach((function(i){if(typeof i!=="object"||i===null||Array.isArray(i)){return}Object.keys(i).forEach((function(c){a=safeGetProperty(t,c);o=safeGetProperty(i,c);if(o===t){return}else if(typeof o!=="object"||o===null){t[c]=o;return}else if(Array.isArray(o)){t[c]=deepCloneArray(o);return}else if(isSpecificValue(o)){t[c]=cloneSpecificValue(o);return}else if(typeof a!=="object"||a===null||Array.isArray(a)){t[c]=r({},o);return}else{t[c]=r(a,o);return}}))}));return t}},7156:(t,r,i)=>{const o=i(4796);const a=i(1017);const c=i(5933).mkdirsSync;const l=i(3651).utimesMillisSync;const u=i(5470);function copySync(t,r,i){if(typeof i==="function"){i={filter:i}}i=i||{};i.clobber="clobber"in i?!!i.clobber:true;i.overwrite="overwrite"in i?!!i.overwrite:i.clobber;if(i.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002")}const{srcStat:l,destStat:h}=u.checkPathsSync(t,r,"copy",i);u.checkParentPathsSync(t,l,r,"copy");if(i.filter&&!i.filter(t,r))return;const d=a.dirname(r);if(!o.existsSync(d))c(d);return getStats(h,t,r,i)}function getStats(t,r,i,a){const c=a.dereference?o.statSync:o.lstatSync;const l=c(r);if(l.isDirectory())return onDir(l,t,r,i,a);else if(l.isFile()||l.isCharacterDevice()||l.isBlockDevice())return onFile(l,t,r,i,a);else if(l.isSymbolicLink())return onLink(t,r,i,a);else if(l.isSocket())throw new Error(`Cannot copy a socket file: ${r}`);else if(l.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${r}`);throw new Error(`Unknown file: ${r}`)}function onFile(t,r,i,o,a){if(!r)return copyFile(t,i,o,a);return mayCopyFile(t,i,o,a)}function mayCopyFile(t,r,i,a){if(a.overwrite){o.unlinkSync(i);return copyFile(t,r,i,a)}else if(a.errorOnExist){throw new Error(`'${i}' already exists`)}}function copyFile(t,r,i,a){o.copyFileSync(r,i);if(a.preserveTimestamps)handleTimestamps(t.mode,r,i);return setDestMode(i,t.mode)}function handleTimestamps(t,r,i){if(fileIsNotWritable(t))makeFileWritable(i,t);return setDestTimestamps(r,i)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,r){return setDestMode(t,r|128)}function setDestMode(t,r){return o.chmodSync(t,r)}function setDestTimestamps(t,r){const i=o.statSync(t);return l(r,i.atime,i.mtime)}function onDir(t,r,i,o,a){if(!r)return mkDirAndCopy(t.mode,i,o,a);return copyDir(i,o,a)}function mkDirAndCopy(t,r,i,a){o.mkdirSync(i);copyDir(r,i,a);return setDestMode(i,t)}function copyDir(t,r,i){o.readdirSync(t).forEach((o=>copyDirItem(o,t,r,i)))}function copyDirItem(t,r,i,o){const c=a.join(r,t);const l=a.join(i,t);if(o.filter&&!o.filter(c,l))return;const{destStat:h}=u.checkPathsSync(c,l,"copy",o);return getStats(h,c,l,o)}function onLink(t,r,i,c){let l=o.readlinkSync(r);if(c.dereference){l=a.resolve(process.cwd(),l)}if(!t){return o.symlinkSync(l,i)}else{let t;try{t=o.readlinkSync(i)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return o.symlinkSync(l,i);throw t}if(c.dereference){t=a.resolve(process.cwd(),t)}if(u.isSrcSubdir(l,t)){throw new Error(`Cannot copy '${l}' to a subdirectory of itself, '${t}'.`)}if(u.isSrcSubdir(t,l)){throw new Error(`Cannot overwrite '${t}' with '${l}'.`)}return copyLink(l,i)}}function copyLink(t,r){o.unlinkSync(r);return o.symlinkSync(t,r)}t.exports=copySync},938:(t,r,i)=>{const o=i(3357);const a=i(1017);const{mkdirs:c}=i(5933);const{pathExists:l}=i(9932);const{utimesMillis:u}=i(3651);const h=i(5470);async function copy(t,r,i={}){if(typeof i==="function"){i={filter:i}}i.clobber="clobber"in i?!!i.clobber:true;i.overwrite="overwrite"in i?!!i.overwrite:i.clobber;if(i.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001")}const{srcStat:o,destStat:u}=await h.checkPaths(t,r,"copy",i);await h.checkParentPaths(t,o,r,"copy");const d=await runFilter(t,r,i);if(!d)return;const p=a.dirname(r);const m=await l(p);if(!m){await c(p)}await getStatsAndPerformCopy(u,t,r,i)}async function runFilter(t,r,i){if(!i.filter)return true;return i.filter(t,r)}async function getStatsAndPerformCopy(t,r,i,a){const c=a.dereference?o.stat:o.lstat;const l=await c(r);if(l.isDirectory())return onDir(l,t,r,i,a);if(l.isFile()||l.isCharacterDevice()||l.isBlockDevice())return onFile(l,t,r,i,a);if(l.isSymbolicLink())return onLink(t,r,i,a);if(l.isSocket())throw new Error(`Cannot copy a socket file: ${r}`);if(l.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${r}`);throw new Error(`Unknown file: ${r}`)}async function onFile(t,r,i,a,c){if(!r)return copyFile(t,i,a,c);if(c.overwrite){await o.unlink(a);return copyFile(t,i,a,c)}if(c.errorOnExist){throw new Error(`'${a}' already exists`)}}async function copyFile(t,r,i,a){await o.copyFile(r,i);if(a.preserveTimestamps){if(fileIsNotWritable(t.mode)){await makeFileWritable(i,t.mode)}const a=await o.stat(r);await u(i,a.atime,a.mtime)}return o.chmod(i,t.mode)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,r){return o.chmod(t,r|128)}async function onDir(t,r,i,c,l){if(!r){await o.mkdir(c)}const u=await o.readdir(i);await Promise.all(u.map((async t=>{const r=a.join(i,t);const o=a.join(c,t);const u=await runFilter(r,o,l);if(!u)return;const{destStat:d}=await h.checkPaths(r,o,"copy",l);return getStatsAndPerformCopy(d,r,o,l)})));if(!r){await o.chmod(c,t.mode)}}async function onLink(t,r,i,c){let l=await o.readlink(r);if(c.dereference){l=a.resolve(process.cwd(),l)}if(!t){return o.symlink(l,i)}let u=null;try{u=await o.readlink(i)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return o.symlink(l,i);throw t}if(c.dereference){u=a.resolve(process.cwd(),u)}if(h.isSrcSubdir(l,u)){throw new Error(`Cannot copy '${l}' to a subdirectory of itself, '${u}'.`)}if(h.isSrcSubdir(u,l)){throw new Error(`Cannot overwrite '${u}' with '${l}'.`)}await o.unlink(i);return o.symlink(l,i)}t.exports=copy},1798:(t,r,i)=>{const o=i(277).fromPromise;t.exports={copy:o(i(938)),copySync:i(7156)}},9547:(t,r,i)=>{const o=i(277).fromPromise;const a=i(3357);const c=i(1017);const l=i(5933);const u=i(6373);const h=o((async function emptyDir(t){let r;try{r=await a.readdir(t)}catch{return l.mkdirs(t)}return Promise.all(r.map((r=>u.remove(c.join(t,r)))))}));function emptyDirSync(t){let r;try{r=a.readdirSync(t)}catch{return l.mkdirsSync(t)}r.forEach((r=>{r=c.join(t,r);u.removeSync(r)}))}t.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:h,emptydir:h}},7412:(t,r,i)=>{const o=i(277).fromPromise;const a=i(1017);const c=i(3357);const l=i(5933);async function createFile(t){let r;try{r=await c.stat(t)}catch{}if(r&&r.isFile())return;const i=a.dirname(t);let o=null;try{o=await c.stat(i)}catch(r){if(r.code==="ENOENT"){await l.mkdirs(i);await c.writeFile(t,"");return}else{throw r}}if(o.isDirectory()){await c.writeFile(t,"")}else{await c.readdir(i)}}function createFileSync(t){let r;try{r=c.statSync(t)}catch{}if(r&&r.isFile())return;const i=a.dirname(t);try{if(!c.statSync(i).isDirectory()){c.readdirSync(i)}}catch(t){if(t&&t.code==="ENOENT")l.mkdirsSync(i);else throw t}c.writeFileSync(t,"")}t.exports={createFile:o(createFile),createFileSync:createFileSync}},2520:(t,r,i)=>{const{createFile:o,createFileSync:a}=i(7412);const{createLink:c,createLinkSync:l}=i(1684);const{createSymlink:u,createSymlinkSync:h}=i(9386);t.exports={createFile:o,createFileSync:a,ensureFile:o,ensureFileSync:a,createLink:c,createLinkSync:l,ensureLink:c,ensureLinkSync:l,createSymlink:u,createSymlinkSync:h,ensureSymlink:u,ensureSymlinkSync:h}},1684:(t,r,i)=>{const o=i(277).fromPromise;const a=i(1017);const c=i(3357);const l=i(5933);const{pathExists:u}=i(9932);const{areIdentical:h}=i(5470);async function createLink(t,r){let i;try{i=await c.lstat(r)}catch{}let o;try{o=await c.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}if(i&&h(o,i))return;const d=a.dirname(r);const p=await u(d);if(!p){await l.mkdirs(d)}await c.link(t,r)}function createLinkSync(t,r){let i;try{i=c.lstatSync(r)}catch{}try{const r=c.lstatSync(t);if(i&&h(r,i))return}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}const o=a.dirname(r);const u=c.existsSync(o);if(u)return c.linkSync(t,r);l.mkdirsSync(o);return c.linkSync(t,r)}t.exports={createLink:o(createLink),createLinkSync:createLinkSync}},5863:(t,r,i)=>{const o=i(1017);const a=i(3357);const{pathExists:c}=i(9932);const l=i(277).fromPromise;async function symlinkPaths(t,r){if(o.isAbsolute(t)){try{await a.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:t}}const i=o.dirname(r);const l=o.join(i,t);const u=await c(l);if(u){return{toCwd:l,toDst:t}}try{await a.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:o.relative(i,t)}}function symlinkPathsSync(t,r){if(o.isAbsolute(t)){const r=a.existsSync(t);if(!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}const i=o.dirname(r);const c=o.join(i,t);const l=a.existsSync(c);if(l){return{toCwd:c,toDst:t}}const u=a.existsSync(t);if(!u)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:o.relative(i,t)}}t.exports={symlinkPaths:l(symlinkPaths),symlinkPathsSync:symlinkPathsSync}},5016:(t,r,i)=>{const o=i(3357);const a=i(277).fromPromise;async function symlinkType(t,r){if(r)return r;let i;try{i=await o.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}function symlinkTypeSync(t,r){if(r)return r;let i;try{i=o.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}t.exports={symlinkType:a(symlinkType),symlinkTypeSync:symlinkTypeSync}},9386:(t,r,i)=>{const o=i(277).fromPromise;const a=i(1017);const c=i(3357);const{mkdirs:l,mkdirsSync:u}=i(5933);const{symlinkPaths:h,symlinkPathsSync:d}=i(5863);const{symlinkType:p,symlinkTypeSync:m}=i(5016);const{pathExists:y}=i(9932);const{areIdentical:g}=i(5470);async function createSymlink(t,r,i){let o;try{o=await c.lstat(r)}catch{}if(o&&o.isSymbolicLink()){const[i,o]=await Promise.all([c.stat(t),c.stat(r)]);if(g(i,o))return}const u=await h(t,r);t=u.toDst;const d=await p(u.toCwd,i);const m=a.dirname(r);if(!await y(m)){await l(m)}return c.symlink(t,r,d)}function createSymlinkSync(t,r,i){let o;try{o=c.lstatSync(r)}catch{}if(o&&o.isSymbolicLink()){const i=c.statSync(t);const o=c.statSync(r);if(g(i,o))return}const l=d(t,r);t=l.toDst;i=m(l.toCwd,i);const h=a.dirname(r);const p=c.existsSync(h);if(p)return c.symlinkSync(t,r,i);u(h);return c.symlinkSync(t,r,i)}t.exports={createSymlink:o(createSymlink),createSymlinkSync:createSymlinkSync}},3357:(t,r,i)=>{const o=i(277).fromCallback;const a=i(4796);const c=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((t=>typeof a[t]==="function"));Object.assign(r,a);c.forEach((t=>{r[t]=o(a[t])}));r.exists=function(t,r){if(typeof r==="function"){return a.exists(t,r)}return new Promise((r=>a.exists(t,r)))};r.read=function(t,r,i,o,c,l){if(typeof l==="function"){return a.read(t,r,i,o,c,l)}return new Promise(((l,u)=>{a.read(t,r,i,o,c,((t,r,i)=>{if(t)return u(t);l({bytesRead:r,buffer:i})}))}))};r.write=function(t,r,...i){if(typeof i[i.length-1]==="function"){return a.write(t,r,...i)}return new Promise(((o,c)=>{a.write(t,r,...i,((t,r,i)=>{if(t)return c(t);o({bytesWritten:r,buffer:i})}))}))};r.readv=function(t,r,...i){if(typeof i[i.length-1]==="function"){return a.readv(t,r,...i)}return new Promise(((o,c)=>{a.readv(t,r,...i,((t,r,i)=>{if(t)return c(t);o({bytesRead:r,buffers:i})}))}))};r.writev=function(t,r,...i){if(typeof i[i.length-1]==="function"){return a.writev(t,r,...i)}return new Promise(((o,c)=>{a.writev(t,r,...i,((t,r,i)=>{if(t)return c(t);o({bytesWritten:r,buffers:i})}))}))};if(typeof a.realpath.native==="function"){r.realpath.native=o(a.realpath.native)}else{process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}},4342:(t,r,i)=>{const o=i(277).fromPromise;const a=i(7990);a.outputJson=o(i(9859));a.outputJsonSync=i(9690);a.outputJSON=a.outputJson;a.outputJSONSync=a.outputJsonSync;a.writeJSON=a.writeJson;a.writeJSONSync=a.writeJsonSync;a.readJSON=a.readJson;a.readJSONSync=a.readJsonSync;t.exports=a},7990:(t,r,i)=>{const o=i(313);t.exports={readJson:o.readFile,readJsonSync:o.readFileSync,writeJson:o.writeFile,writeJsonSync:o.writeFileSync}},9690:(t,r,i)=>{const{stringify:o}=i(4006);const{outputFileSync:a}=i(2693);function outputJsonSync(t,r,i){const c=o(r,i);a(t,c,i)}t.exports=outputJsonSync},9859:(t,r,i)=>{const{stringify:o}=i(4006);const{outputFile:a}=i(2693);async function outputJson(t,r,i={}){const c=o(r,i);await a(t,c,i)}t.exports=outputJson},5933:(t,r,i)=>{const o=i(277).fromPromise;const{makeDir:a,makeDirSync:c}=i(8517);const l=o(a);t.exports={mkdirs:l,mkdirsSync:c,mkdirp:l,mkdirpSync:c,ensureDir:l,ensureDirSync:c}},8517:(t,r,i)=>{const o=i(3357);const{checkPath:a}=i(3222);const getMode=t=>{const r={mode:511};if(typeof t==="number")return t;return{...r,...t}.mode};t.exports.makeDir=async(t,r)=>{a(t);return o.mkdir(t,{mode:getMode(r),recursive:true})};t.exports.makeDirSync=(t,r)=>{a(t);return o.mkdirSync(t,{mode:getMode(r),recursive:true})}},3222:(t,r,i)=>{const o=i(1017);t.exports.checkPath=function checkPath(t){if(process.platform==="win32"){const r=/[<>:"|?*]/.test(t.replace(o.parse(t).root,""));if(r){const r=new Error(`Path contains invalid characters: ${t}`);r.code="EINVAL";throw r}}}},4041:(t,r,i)=>{const o=i(277).fromPromise;t.exports={move:o(i(7980)),moveSync:i(3140)}},3140:(t,r,i)=>{const o=i(4796);const a=i(1017);const c=i(1798).copySync;const l=i(6373).removeSync;const u=i(5933).mkdirpSync;const h=i(5470);function moveSync(t,r,i){i=i||{};const o=i.overwrite||i.clobber||false;const{srcStat:c,isChangingCase:l=false}=h.checkPathsSync(t,r,"move",i);h.checkParentPathsSync(t,c,r,"move");if(!isParentRoot(r))u(a.dirname(r));return doRename(t,r,o,l)}function isParentRoot(t){const r=a.dirname(t);const i=a.parse(r);return i.root===r}function doRename(t,r,i,a){if(a)return rename(t,r,i);if(i){l(r);return rename(t,r,i)}if(o.existsSync(r))throw new Error("dest already exists.");return rename(t,r,i)}function rename(t,r,i){try{o.renameSync(t,r)}catch(o){if(o.code!=="EXDEV")throw o;return moveAcrossDevice(t,r,i)}}function moveAcrossDevice(t,r,i){const o={overwrite:i,errorOnExist:true,preserveTimestamps:true};c(t,r,o);return l(t)}t.exports=moveSync},7980:(t,r,i)=>{const o=i(3357);const a=i(1017);const{copy:c}=i(1798);const{remove:l}=i(6373);const{mkdirp:u}=i(5933);const{pathExists:h}=i(9932);const d=i(5470);async function move(t,r,i={}){const o=i.overwrite||i.clobber||false;const{srcStat:c,isChangingCase:l=false}=await d.checkPaths(t,r,"move",i);await d.checkParentPaths(t,c,r,"move");const h=a.dirname(r);const p=a.parse(h);if(p.root!==h){await u(h)}return doRename(t,r,o,l)}async function doRename(t,r,i,a){if(!a){if(i){await l(r)}else if(await h(r)){throw new Error("dest already exists.")}}try{await o.rename(t,r)}catch(o){if(o.code!=="EXDEV"){throw o}await moveAcrossDevice(t,r,i)}}async function moveAcrossDevice(t,r,i){const o={overwrite:i,errorOnExist:true,preserveTimestamps:true};await c(t,r,o);return l(t)}t.exports=move},2693:(t,r,i)=>{const o=i(277).fromPromise;const a=i(3357);const c=i(1017);const l=i(5933);const u=i(9932).pathExists;async function outputFile(t,r,i="utf-8"){const o=c.dirname(t);if(!await u(o)){await l.mkdirs(o)}return a.writeFile(t,r,i)}function outputFileSync(t,...r){const i=c.dirname(t);if(!a.existsSync(i)){l.mkdirsSync(i)}a.writeFileSync(t,...r)}t.exports={outputFile:o(outputFile),outputFileSync:outputFileSync}},9932:(t,r,i)=>{const o=i(277).fromPromise;const a=i(3357);function pathExists(t){return a.access(t).then((()=>true)).catch((()=>false))}t.exports={pathExists:o(pathExists),pathExistsSync:a.existsSync}},6373:(t,r,i)=>{const o=i(4796);const a=i(277).fromCallback;function remove(t,r){o.rm(t,{recursive:true,force:true},r)}function removeSync(t){o.rmSync(t,{recursive:true,force:true})}t.exports={remove:a(remove),removeSync:removeSync}},5470:(t,r,i)=>{const o=i(3357);const a=i(1017);const c=i(277).fromPromise;function getStats(t,r,i){const a=i.dereference?t=>o.stat(t,{bigint:true}):t=>o.lstat(t,{bigint:true});return Promise.all([a(t),a(r).catch((t=>{if(t.code==="ENOENT")return null;throw t}))]).then((([t,r])=>({srcStat:t,destStat:r})))}function getStatsSync(t,r,i){let a;const c=i.dereference?t=>o.statSync(t,{bigint:true}):t=>o.lstatSync(t,{bigint:true});const l=c(t);try{a=c(r)}catch(t){if(t.code==="ENOENT")return{srcStat:l,destStat:null};throw t}return{srcStat:l,destStat:a}}async function checkPaths(t,r,i,o){const{srcStat:c,destStat:l}=await getStats(t,r,o);if(l){if(areIdentical(c,l)){const o=a.basename(t);const u=a.basename(r);if(i==="move"&&o!==u&&o.toLowerCase()===u.toLowerCase()){return{srcStat:c,destStat:l,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory()){throw new Error(`Cannot overwrite non-directory '${r}' with directory '${t}'.`)}if(!c.isDirectory()&&l.isDirectory()){throw new Error(`Cannot overwrite directory '${r}' with non-directory '${t}'.`)}}if(c.isDirectory()&&isSrcSubdir(t,r)){throw new Error(errMsg(t,r,i))}return{srcStat:c,destStat:l}}function checkPathsSync(t,r,i,o){const{srcStat:c,destStat:l}=getStatsSync(t,r,o);if(l){if(areIdentical(c,l)){const o=a.basename(t);const u=a.basename(r);if(i==="move"&&o!==u&&o.toLowerCase()===u.toLowerCase()){return{srcStat:c,destStat:l,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(c.isDirectory()&&!l.isDirectory()){throw new Error(`Cannot overwrite non-directory '${r}' with directory '${t}'.`)}if(!c.isDirectory()&&l.isDirectory()){throw new Error(`Cannot overwrite directory '${r}' with non-directory '${t}'.`)}}if(c.isDirectory()&&isSrcSubdir(t,r)){throw new Error(errMsg(t,r,i))}return{srcStat:c,destStat:l}}async function checkParentPaths(t,r,i,c){const l=a.resolve(a.dirname(t));const u=a.resolve(a.dirname(i));if(u===l||u===a.parse(u).root)return;let h;try{h=await o.stat(u,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(r,h)){throw new Error(errMsg(t,i,c))}return checkParentPaths(t,r,u,c)}function checkParentPathsSync(t,r,i,c){const l=a.resolve(a.dirname(t));const u=a.resolve(a.dirname(i));if(u===l||u===a.parse(u).root)return;let h;try{h=o.statSync(u,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(r,h)){throw new Error(errMsg(t,i,c))}return checkParentPathsSync(t,r,u,c)}function areIdentical(t,r){return r.ino&&r.dev&&r.ino===t.ino&&r.dev===t.dev}function isSrcSubdir(t,r){const i=a.resolve(t).split(a.sep).filter((t=>t));const o=a.resolve(r).split(a.sep).filter((t=>t));return i.every(((t,r)=>o[r]===t))}function errMsg(t,r,i){return`Cannot ${i} '${t}' to a subdirectory of itself, '${r}'.`}t.exports={checkPaths:c(checkPaths),checkPathsSync:checkPathsSync,checkParentPaths:c(checkParentPaths),checkParentPathsSync:checkParentPathsSync,isSrcSubdir:isSrcSubdir,areIdentical:areIdentical}},3651:(t,r,i)=>{const o=i(3357);const a=i(277).fromPromise;async function utimesMillis(t,r,i){const a=await o.open(t,"r+");let c=null;try{await o.futimes(a,r,i)}finally{try{await o.close(a)}catch(t){c=t}}if(c){throw c}}function utimesMillisSync(t,r,i){const a=o.openSync(t,"r+");o.futimesSync(a,r,i);return o.closeSync(a)}t.exports={utimesMillis:a(utimesMillis),utimesMillisSync:utimesMillisSync}},3534:t=>{t.exports=clone;var r=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var i={__proto__:r(t)};else var i=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))}));return i}},4796:(t,r,i)=>{var o=i(7147);var a=i(3050);var c=i(8318);var l=i(3534);var u=i(3837);var h;var d;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){h=Symbol.for("graceful-fs.queue");d=Symbol.for("graceful-fs.previous")}else{h="___graceful-fs.queue";d="___graceful-fs.previous"}function noop(){}function publishQueue(t,r){Object.defineProperty(t,h,{get:function(){return r}})}var p=noop;if(u.debuglog)p=u.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))p=function(){var t=u.format.apply(u,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!o[h]){var m=global[h]||[];publishQueue(o,m);o.close=function(t){function close(r,i){return t.call(o,r,(function(t){if(!t){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,d,{value:t});return close}(o.close);o.closeSync=function(t){function closeSync(r){t.apply(o,arguments);resetQueue()}Object.defineProperty(closeSync,d,{value:t});return closeSync}(o.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){p(o[h]);i(9491).equal(o[h].length,0)}))}}if(!global[h]){publishQueue(global,o[h])}t.exports=patch(l(o));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched){t.exports=patch(o);o.__patched=true}function patch(t){a(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var r=t.readFile;t.readFile=readFile;function readFile(t,i,o){if(typeof i==="function")o=i,i=null;return go$readFile(t,i,o);function go$readFile(t,i,o,a){return r(t,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$readFile,[t,i,o],r,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var i=t.writeFile;t.writeFile=writeFile;function writeFile(t,r,o,a){if(typeof o==="function")a=o,o=null;return go$writeFile(t,r,o,a);function go$writeFile(t,r,o,a,c){return i(t,r,o,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[t,r,o,a],i,c||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var o=t.appendFile;if(o)t.appendFile=appendFile;function appendFile(t,r,i,a){if(typeof i==="function")a=i,i=null;return go$appendFile(t,r,i,a);function go$appendFile(t,r,i,a,c){return o(t,r,i,(function(o){if(o&&(o.code==="EMFILE"||o.code==="ENFILE"))enqueue([go$appendFile,[t,r,i,a],o,c||Date.now(),Date.now()]);else{if(typeof a==="function")a.apply(this,arguments)}}))}}var l=t.copyFile;if(l)t.copyFile=copyFile;function copyFile(t,r,i,o){if(typeof i==="function"){o=i;i=0}return go$copyFile(t,r,i,o);function go$copyFile(t,r,i,o,a){return l(t,r,i,(function(c){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$copyFile,[t,r,i,o],c,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}var u=t.readdir;t.readdir=readdir;var h=/^v[0-5]\./;function readdir(t,r,i){if(typeof r==="function")i=r,r=null;var o=h.test(process.version)?function go$readdir(t,r,i,o){return u(t,fs$readdirCallback(t,r,i,o))}:function go$readdir(t,r,i,o){return u(t,r,fs$readdirCallback(t,r,i,o))};return o(t,r,i);function fs$readdirCallback(t,r,i,a){return function(c,l){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([o,[t,r,i],c,a||Date.now(),Date.now()]);else{if(l&&l.sort)l.sort();if(typeof i==="function")i.call(this,c,l)}}}}if(process.version.substr(0,4)==="v0.8"){var d=c(t);ReadStream=d.ReadStream;WriteStream=d.WriteStream}var p=t.ReadStream;if(p){ReadStream.prototype=Object.create(p.prototype);ReadStream.prototype.open=ReadStream$open}var m=t.WriteStream;if(m){WriteStream.prototype=Object.create(m.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var y=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(t){y=t},enumerable:true,configurable:true});var g=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(t){g=t},enumerable:true,configurable:true});function ReadStream(t,r){if(this instanceof ReadStream)return p.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){if(t.autoClose)t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i);t.read()}}))}function WriteStream(t,r){if(this instanceof WriteStream)return m.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(r,i){if(r){t.destroy();t.emit("error",r)}else{t.fd=i;t.emit("open",i)}}))}function createReadStream(r,i){return new t.ReadStream(r,i)}function createWriteStream(r,i){return new t.WriteStream(r,i)}var v=t.open;t.open=open;function open(t,r,i,o){if(typeof i==="function")o=i,i=null;return go$open(t,r,i,o);function go$open(t,r,i,o,a){return v(t,r,i,(function(c,l){if(c&&(c.code==="EMFILE"||c.code==="ENFILE"))enqueue([go$open,[t,r,i,o],c,a||Date.now(),Date.now()]);else{if(typeof o==="function")o.apply(this,arguments)}}))}}return t}function enqueue(t){p("ENQUEUE",t[0].name,t[1]);o[h].push(t);retry()}var y;function resetQueue(){var t=Date.now();for(var r=0;r<o[h].length;++r){if(o[h][r].length>2){o[h][r][3]=t;o[h][r][4]=t}}retry()}function retry(){clearTimeout(y);y=undefined;if(o[h].length===0)return;var t=o[h].shift();var r=t[0];var i=t[1];var a=t[2];var c=t[3];var l=t[4];if(c===undefined){p("RETRY",r.name,i);r.apply(null,i)}else if(Date.now()-c>=6e4){p("TIMEOUT",r.name,i);var u=i.pop();if(typeof u==="function")u.call(null,a)}else{var d=Date.now()-l;var m=Math.max(l-c,1);var g=Math.min(m*1.2,100);if(d>=g){p("RETRY",r.name,i);r.apply(null,i.concat([c]))}else{o[h].push(t)}}if(y===undefined){y=setTimeout(retry,0)}}},8318:(t,r,i)=>{var o=i(9955).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(r,i){if(!(this instanceof ReadStream))return new ReadStream(r,i);o.call(this);var a=this;this.path=r;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var c=Object.keys(i);for(var l=0,u=c.length;l<u;l++){var h=c[l];this[h]=i[h]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){a._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,r){if(t){a.emit("error",t);a.readable=false;return}a.fd=r;a.emit("open",r);a._read()}))}function WriteStream(r,i){if(!(this instanceof WriteStream))return new WriteStream(r,i);o.call(this);this.path=r;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var a=Object.keys(i);for(var c=0,l=a.length;c<l;c++){var u=a[c];this[u]=i[u]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},3050:(t,r,i)=>{var o=i(2057);var a=process.cwd;var c=null;var l=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!c)c=a.call(process);return c};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var u=process.chdir;process.chdir=function(t){c=null;u.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,u)}t.exports=patch;function patch(t){if(o.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(t.chmod&&!t.lchmod){t.lchmod=function(t,r,i){if(i)process.nextTick(i)};t.lchmodSync=function(){}}if(t.chown&&!t.lchown){t.lchown=function(t,r,i,o){if(o)process.nextTick(o)};t.lchownSync=function(){}}if(l==="win32"){t.rename=typeof t.rename!=="function"?t.rename:function(r){function rename(i,o,a){var c=Date.now();var l=0;r(i,o,(function CB(u){if(u&&(u.code==="EACCES"||u.code==="EPERM"||u.code==="EBUSY")&&Date.now()-c<6e4){setTimeout((function(){t.stat(o,(function(t,c){if(t&&t.code==="ENOENT")r(i,o,CB);else a(u)}))}),l);if(l<100)l+=10;return}if(a)a(u)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,r);return rename}(t.rename)}t.read=typeof t.read!=="function"?t.read:function(r){function read(i,o,a,c,l,u){var h;if(u&&typeof u==="function"){var d=0;h=function(p,m,y){if(p&&p.code==="EAGAIN"&&d<10){d++;return r.call(t,i,o,a,c,l,h)}u.apply(this,arguments)}}return r.call(t,i,o,a,c,l,h)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,r);return read}(t.read);t.readSync=typeof t.readSync!=="function"?t.readSync:function(r){return function(i,o,a,c,l){var u=0;while(true){try{return r.call(t,i,o,a,c,l)}catch(t){if(t.code==="EAGAIN"&&u<10){u++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(r,i,a){t.open(r,o.O_WRONLY|o.O_SYMLINK,i,(function(r,o){if(r){if(a)a(r);return}t.fchmod(o,i,(function(r){t.close(o,(function(t){if(a)a(r||t)}))}))}))};t.lchmodSync=function(r,i){var a=t.openSync(r,o.O_WRONLY|o.O_SYMLINK,i);var c=true;var l;try{l=t.fchmodSync(a,i);c=false}finally{if(c){try{t.closeSync(a)}catch(t){}}else{t.closeSync(a)}}return l}}function patchLutimes(t){if(o.hasOwnProperty("O_SYMLINK")&&t.futimes){t.lutimes=function(r,i,a,c){t.open(r,o.O_SYMLINK,(function(r,o){if(r){if(c)c(r);return}t.futimes(o,i,a,(function(r){t.close(o,(function(t){if(c)c(r||t)}))}))}))};t.lutimesSync=function(r,i,a){var c=t.openSync(r,o.O_SYMLINK);var l;var u=true;try{l=t.futimesSync(c,i,a);u=false}finally{if(u){try{t.closeSync(c)}catch(t){}}else{t.closeSync(c)}}return l}}else if(t.futimes){t.lutimes=function(t,r,i,o){if(o)process.nextTick(o)};t.lutimesSync=function(){}}}function chmodFix(r){if(!r)return r;return function(i,o,a){return r.call(t,i,o,(function(t){if(chownErOk(t))t=null;if(a)a.apply(this,arguments)}))}}function chmodFixSync(r){if(!r)return r;return function(i,o){try{return r.call(t,i,o)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(r){if(!r)return r;return function(i,o,a,c){return r.call(t,i,o,a,(function(t){if(chownErOk(t))t=null;if(c)c.apply(this,arguments)}))}}function chownFixSync(r){if(!r)return r;return function(i,o,a){try{return r.call(t,i,o,a)}catch(t){if(!chownErOk(t))throw t}}}function statFix(r){if(!r)return r;return function(i,o,a){if(typeof o==="function"){a=o;o=null}function callback(t,r){if(r){if(r.uid<0)r.uid+=4294967296;if(r.gid<0)r.gid+=4294967296}if(a)a.apply(this,arguments)}return o?r.call(t,i,o,callback):r.call(t,i,callback)}}function statFixSync(r){if(!r)return r;return function(i,o){var a=o?r.call(t,i,o):r.call(t,i);if(a){if(a.uid<0)a.uid+=4294967296;if(a.gid<0)a.gid+=4294967296}return a}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var r=!process.getuid||process.getuid()!==0;if(r){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},7057:(t,r)=>{r.parse=r.decode=decode;r.stringify=r.encode=encode;r.safe=safe;r.unsafe=unsafe;var i=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(t,r){var o=[];var a="";if(typeof r==="string"){r={section:r,whitespace:false}}else{r=r||{};r.whitespace=r.whitespace===true}var c=r.whitespace?" = ":"=";Object.keys(t).forEach((function(r,l,u){var h=t[r];if(h&&Array.isArray(h)){h.forEach((function(t){a+=safe(r+"[]")+c+safe(t)+"\n"}))}else if(h&&typeof h==="object")o.push(r);else a+=safe(r)+c+safe(h)+i}));if(r.section&&a.length)a="["+safe(r.section)+"]"+i+a;o.forEach((function(o,c,l){var u=dotSplit(o).join("\\.");var h=(r.section?r.section+".":"")+u;var d=encode(t[o],{section:h,whitespace:r.whitespace});if(a.length&&d.length)a+=i;a+=d}));return a}function dotSplit(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(t){return t.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(t){var r={};var i=r;var o=null;var a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var c=t.split(/[\r\n]+/g);c.forEach((function(t,c,l){if(!t||t.match(/^\s*[;#]/))return;var u=t.match(a);if(!u)return;if(u[1]!==undefined){o=unsafe(u[1]);if(o==="__proto__"){i={};return}i=r[o]=r[o]||{};return}var h=unsafe(u[2]);if(h==="__proto__")return;var d=u[3]?unsafe(u[4]):true;switch(d){case"true":case"false":case"null":d=JSON.parse(d)}if(h.length>2&&h.slice(-2)==="[]"){h=h.substring(0,h.length-2);if(h==="__proto__")return;if(!i[h])i[h]=[];else if(!Array.isArray(i[h]))i[h]=[i[h]]}if(Array.isArray(i[h]))i[h].push(d);else i[h]=d}));Object.keys(r).filter((function(t,i,o){if(!r[t]||typeof r[t]!=="object"||Array.isArray(r[t]))return false;var a=dotSplit(t);var c=r;var l=a.pop();var u=l.replace(/\\\./g,".");a.forEach((function(t,r,i){if(t==="__proto__")return;if(!c[t]||typeof c[t]!=="object")c[t]={};c=c[t]}));if(c===r&&u===l)return false;c[u]=r[t];return true})).forEach((function(t,i,o){delete r[t]}));return r}function isQuoted(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function safe(t){return typeof t!=="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&isQuoted(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(t,r){t=(t||"").trim();if(isQuoted(t)){if(t.charAt(0)==="'")t=t.substr(1,t.length-2);try{t=JSON.parse(t)}catch(t){}}else{var i=false;var o="";for(var a=0,c=t.length;a<c;a++){var l=t.charAt(a);if(i){if("\\;#".indexOf(l)!==-1)o+=l;else o+="\\"+l;i=false}else if(";#".indexOf(l)!==-1)break;else if(l==="\\")i=true;else o+=l}if(i)o+="\\";return o.trim()}return t}},313:(t,r,i)=>{let o;try{o=i(4796)}catch(t){o=i(7147)}const a=i(277);const{stringify:c,stripBom:l}=i(4006);async function _readFile(t,r={}){if(typeof r==="string"){r={encoding:r}}const i=r.fs||o;const c="throws"in r?r.throws:true;let u=await a.fromCallback(i.readFile)(t,r);u=l(u);let h;try{h=JSON.parse(u,r?r.reviver:null)}catch(r){if(c){r.message=`${t}: ${r.message}`;throw r}else{return null}}return h}const u=a.fromPromise(_readFile);function readFileSync(t,r={}){if(typeof r==="string"){r={encoding:r}}const i=r.fs||o;const a="throws"in r?r.throws:true;try{let o=i.readFileSync(t,r);o=l(o);return JSON.parse(o,r.reviver)}catch(r){if(a){r.message=`${t}: ${r.message}`;throw r}else{return null}}}async function _writeFile(t,r,i={}){const l=i.fs||o;const u=c(r,i);await a.fromCallback(l.writeFile)(t,u,i)}const h=a.fromPromise(_writeFile);function writeFileSync(t,r,i={}){const a=i.fs||o;const l=c(r,i);return a.writeFileSync(t,l,i)}const d={readFile:u,readFileSync:readFileSync,writeFile:h,writeFileSync:writeFileSync};t.exports=d},4006:t=>{function stringify(t,{EOL:r="\n",finalEOL:i=true,replacer:o=null,spaces:a}={}){const c=i?r:"";const l=JSON.stringify(t,o,a);return l.replace(/\n/g,r)+c}function stripBom(t){if(Buffer.isBuffer(t))t=t.toString("utf8");return t.replace(/^\uFEFF/,"")}t.exports={stringify:stringify,stripBom:stripBom}},1081:t=>{const{FORCE_COLOR:r,NODE_DISABLE_COLORS:i,TERM:o}=process.env;const a={enabled:!i&&o!=="dumb"&&r!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(t,r){let i=0,o,a="",c="";for(;i<t.length;i++){o=t[i];a+=o.open;c+=o.close;if(r.includes(o.close)){r=r.replace(o.rgx,o.close+o.open)}}return a+r+c}function chain(t,r){let i={has:t,keys:r};i.reset=a.reset.bind(i);i.bold=a.bold.bind(i);i.dim=a.dim.bind(i);i.italic=a.italic.bind(i);i.underline=a.underline.bind(i);i.inverse=a.inverse.bind(i);i.hidden=a.hidden.bind(i);i.strikethrough=a.strikethrough.bind(i);i.black=a.black.bind(i);i.red=a.red.bind(i);i.green=a.green.bind(i);i.yellow=a.yellow.bind(i);i.blue=a.blue.bind(i);i.magenta=a.magenta.bind(i);i.cyan=a.cyan.bind(i);i.white=a.white.bind(i);i.gray=a.gray.bind(i);i.grey=a.grey.bind(i);i.bgBlack=a.bgBlack.bind(i);i.bgRed=a.bgRed.bind(i);i.bgGreen=a.bgGreen.bind(i);i.bgYellow=a.bgYellow.bind(i);i.bgBlue=a.bgBlue.bind(i);i.bgMagenta=a.bgMagenta.bind(i);i.bgCyan=a.bgCyan.bind(i);i.bgWhite=a.bgWhite.bind(i);return i}function init(t,r){let i={open:`[${t}m`,close:`[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(r){if(this!==void 0&&this.has!==void 0){this.has.includes(t)||(this.has.push(t),this.keys.push(i));return r===void 0?this:a.enabled?run(this.keys,r+""):r+""}return r===void 0?chain([t],[i]):a.enabled?run([i],r+""):r+""}}t.exports=a},4599:t=>{function hasKey(t,r){var i=t;r.slice(0,-1).forEach((function(t){i=i[t]||{}}));var o=r[r.length-1];return o in i}function isNumber(t){if(typeof t==="number"){return true}if(/^0x[0-9a-f]+$/i.test(t)){return true}return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function isConstructorOrProto(t,r){return r==="constructor"&&typeof t[r]==="function"||r==="__proto__"}t.exports=function(t,r){if(!r){r={}}var i={bools:{},strings:{},unknownFn:null};if(typeof r.unknown==="function"){i.unknownFn=r.unknown}if(typeof r.boolean==="boolean"&&r.boolean){i.allBools=true}else{[].concat(r.boolean).filter(Boolean).forEach((function(t){i.bools[t]=true}))}var o={};function aliasIsBoolean(t){return o[t].some((function(t){return i.bools[t]}))}Object.keys(r.alias||{}).forEach((function(t){o[t]=[].concat(r.alias[t]);o[t].forEach((function(r){o[r]=[t].concat(o[t].filter((function(t){return r!==t})))}))}));[].concat(r.string).filter(Boolean).forEach((function(t){i.strings[t]=true;if(o[t]){[].concat(o[t]).forEach((function(t){i.strings[t]=true}))}}));var a=r.default||{};var c={_:[]};function argDefined(t,r){return i.allBools&&/^--[^=]+$/.test(r)||i.strings[t]||i.bools[t]||o[t]}function setKey(t,r,o){var a=t;for(var c=0;c<r.length-1;c++){var l=r[c];if(isConstructorOrProto(a,l)){return}if(a[l]===undefined){a[l]={}}if(a[l]===Object.prototype||a[l]===Number.prototype||a[l]===String.prototype){a[l]={}}if(a[l]===Array.prototype){a[l]=[]}a=a[l]}var u=r[r.length-1];if(isConstructorOrProto(a,u)){return}if(a===Object.prototype||a===Number.prototype||a===String.prototype){a={}}if(a===Array.prototype){a=[]}if(a[u]===undefined||i.bools[u]||typeof a[u]==="boolean"){a[u]=o}else if(Array.isArray(a[u])){a[u].push(o)}else{a[u]=[a[u],o]}}function setArg(t,r,a){if(a&&i.unknownFn&&!argDefined(t,a)){if(i.unknownFn(a)===false){return}}var l=!i.strings[t]&&isNumber(r)?Number(r):r;setKey(c,t.split("."),l);(o[t]||[]).forEach((function(t){setKey(c,t.split("."),l)}))}Object.keys(i.bools).forEach((function(t){setArg(t,a[t]===undefined?false:a[t])}));var l=[];if(t.indexOf("--")!==-1){l=t.slice(t.indexOf("--")+1);t=t.slice(0,t.indexOf("--"))}for(var u=0;u<t.length;u++){var h=t[u];var d;var p;if(/^--.+=/.test(h)){var m=h.match(/^--([^=]+)=([\s\S]*)$/);d=m[1];var y=m[2];if(i.bools[d]){y=y!=="false"}setArg(d,y,h)}else if(/^--no-.+/.test(h)){d=h.match(/^--no-(.+)/)[1];setArg(d,false,h)}else if(/^--.+/.test(h)){d=h.match(/^--(.+)/)[1];p=t[u+1];if(p!==undefined&&!/^(-|--)[^-]/.test(p)&&!i.bools[d]&&!i.allBools&&(o[d]?!aliasIsBoolean(d):true)){setArg(d,p,h);u+=1}else if(/^(true|false)$/.test(p)){setArg(d,p==="true",h);u+=1}else{setArg(d,i.strings[d]?"":true,h)}}else if(/^-[^-]+/.test(h)){var g=h.slice(1,-1).split("");var v=false;for(var w=0;w<g.length;w++){p=h.slice(w+2);if(p==="-"){setArg(g[w],p,h);continue}if(/[A-Za-z]/.test(g[w])&&p[0]==="="){setArg(g[w],p.slice(1),h);v=true;break}if(/[A-Za-z]/.test(g[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){setArg(g[w],p,h);v=true;break}if(g[w+1]&&g[w+1].match(/\W/)){setArg(g[w],h.slice(w+2),h);v=true;break}else{setArg(g[w],i.strings[g[w]]?"":true,h)}}d=h.slice(-1)[0];if(!v&&d!=="-"){if(t[u+1]&&!/^(-|--)[^-]/.test(t[u+1])&&!i.bools[d]&&(o[d]?!aliasIsBoolean(d):true)){setArg(d,t[u+1],h);u+=1}else if(t[u+1]&&/^(true|false)$/.test(t[u+1])){setArg(d,t[u+1]==="true",h);u+=1}else{setArg(d,i.strings[d]?"":true,h)}}}else{if(!i.unknownFn||i.unknownFn(h)!==false){c._.push(i.strings._||!isNumber(h)?h:Number(h))}if(r.stopEarly){c._.push.apply(c._,t.slice(u+1));break}}}Object.keys(a).forEach((function(t){if(!hasKey(c,t.split("."))){setKey(c,t.split("."),a[t]);(o[t]||[]).forEach((function(r){setKey(c,r.split("."),a[t])}))}}));if(r["--"]){c["--"]=l.slice()}else{l.forEach((function(t){c._.push(t)}))}return c}},3:t=>{class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},9265:(t,r,i)=>{const o=i(3);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},4169:(t,r,i)=>{const o=i(3);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},1373:(t,r,i)=>{t.exports={DatePart:i(3),Meridiem:i(2065),Day:i(9265),Hours:i(4169),Milliseconds:i(8589),Minutes:i(2781),Month:i(7025),Seconds:i(5246),Year:i(9301)}},2065:(t,r,i)=>{const o=i(3);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},8589:(t,r,i)=>{const o=i(3);class Milliseconds extends o{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)}}t.exports=Milliseconds},2781:(t,r,i)=>{const o=i(3);class Minutes extends o{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}}t.exports=Minutes},7025:(t,r,i)=>{const o=i(3);class Month extends o{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();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},5246:(t,r,i)=>{const o=i(3);class Seconds extends o{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}}t.exports=Seconds},9301:(t,r,i)=>{const o=i(3);class Year extends o{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}}t.exports=Year},4804:(t,r,i)=>{function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(1081);const a=i(2547);const c=i(5624),l=c.erase,u=c.cursor;const h=i(5970),d=h.style,p=h.clear,m=h.figures,y=h.wrap,g=h.entriesToDisplay;const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=d.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=p("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}complete(t){var r=this;return _asyncToGenerator((function*(){const i=r.completing=r.suggest(r.input,r.choices);const o=yield i;if(r.completing!==i)return;r.suggestions=o.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));r.completing=false;const a=Math.max(o.length-1,0);r.moveSelect(Math.min(a,r.select));t&&t()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let c;let l=i?m.arrowUp:a?m.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;l=(r?o.cyan(m.pointer)+" ":" ")+l;if(t.description){c=` - ${t.description}`;if(l.length+u.length+c.length>=this.out.columns||t.description.split(/\r?\n/).length>1){c="\n"+y(t.description,{margin:3,width:this.out.columns})}}return l+" "+u+o.gray(c||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(p(this.outputText,this.out.columns));super.render();let t=g(this.select,this.choices.length,this.limit),r=t.startIndex,i=t.endIndex;this.outputText=[d.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),d.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const t=this.suggestions.slice(r,i).map(((t,o)=>this.renderOption(t,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(t||o.gray(this.fallback.title))}this.out.write(l.line+u.to(0)+this.outputText)}}t.exports=AutocompletePrompt},6463:(t,r,i)=>{const o=i(1081);const a=i(5624),c=a.cursor;const l=i(4562);const u=i(5970),h=u.clear,d=u.style,p=u.figures;class AutocompleteMultiselectPrompt extends l{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=h("",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(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${p.arrowUp}/${p.arrowDown}: Highlight option\n ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(p.radioOn):p.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);super.render();let t=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},8547:(t,r,i)=>{const o=i(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear;const h=i(5624),d=h.erase,p=h.cursor;class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(d.line+p.to(0)+this.outputText)}}t.exports=ConfirmPrompt},6947:(t,r,i)=>{function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear,h=c.figures;const d=i(5624),p=d.erase,m=d.cursor;const y=i(1373),g=y.DatePart,v=y.Meridiem,w=y.Day,b=y.Hours,S=y.Milliseconds,x=y.Minutes,k=y.Month,_=y.Seconds,O=y.Year;const P=/\\(.)|"((?:\\["\\]|[^"])+)"|(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;const E={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new w(t),3:t=>new k(t),4:t=>new O(t),5:t=>new v(t),6:t=>new b(t),7:t=>new x(t),8:t=>new _(t),9:t=>new S(t)};const T={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(T,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=u("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=P.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in E?E[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof g)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r==="string"){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color="red";t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof g)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(p.line+m.to(0)+this.outputText)}}t.exports=DatePrompt},8595:(t,r,i)=>{t.exports={TextPrompt:i(7740),SelectPrompt:i(2999),TogglePrompt:i(4641),DatePrompt:i(6947),NumberPrompt:i(4827),MultiselectPrompt:i(4562),AutocompletePrompt:i(4804),AutocompleteMultiselectPrompt:i(6463),ConfirmPrompt:i(8547)}},4562:(t,r,i)=>{const o=i(1081);const a=i(5624),c=a.cursor;const l=i(2547);const u=i(5970),h=u.clear,d=u.figures,p=u.style,m=u.wrap,y=u.entriesToDisplay;class MultiselectPrompt extends l{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=h("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${d.arrowUp}/${d.arrowDown}: Highlight option\n`+` ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const c=(r.selected?o.green(d.radioOn):d.radioOff)+" "+a+" ";let l,u;if(r.disabled){l=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{l=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){u=` - ${r.description}`;if(c.length+l.length+u.length>=this.out.columns||r.description.split(/\r?\n/).length>1){u="\n"+m(r.description,{margin:c.length,width:this.out.columns})}}}return c+l+o.gray(u||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let r=y(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,a=r.endIndex;let c,l=[];for(let r=i;r<a;r++){if(r===i&&i>0){c=d.arrowUp}else if(r===a-1&&a<t.length){c=d.arrowDown}else{c=" "}l.push(this.renderOption(this.cursor,t[r],r,c))}return"\n"+l.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);super.render();let t=[p.symbol(this.done,this.aborted),o.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=MultiselectPrompt},4827:(t,r,i)=>{function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(1081);const a=i(2547);const c=i(5624),l=c.cursor,u=c.erase;const h=i(5970),d=h.style,p=h.figures,m=h.clear,y=h.lines;const g=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||g.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color=`red`;t.fire();t.render();return}let r=t.value;t.value=r!==``?r:t.initial;t.done=true;t.aborted=false;t.error=false;t.fire();t.render();t.out.write(`\n`);t.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(y(this.outputError,this.out.columns)-1)+m(this.outputError,this.out.columns));this.out.write(m(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(u.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore)}}t.exports=NumberPrompt},2547:(t,r,i)=>{const o=i(4521);const a=i(5970),c=a.action;const l=i(2361);const u=i(5624),h=u.beep,d=u.cursor;const p=i(1081);class Prompt extends l{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=c(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(d.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(h)}render(){this.onRender(p);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},2999:(t,r,i)=>{const o=i(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear,h=c.figures,d=c.wrap,p=c.entriesToDisplay;const m=i(5624),y=m.cursor;class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=u("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(y.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();let t=p(this.cursor,this.choices.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex;this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let t=r;t<i;t++){let a,c,l="",u=this.choices[t];if(t===r&&r>0){c=h.arrowUp}else if(t===i-1&&i<this.choices.length){c=h.arrowDown}else{c=" "}if(u.disabled){a=this.cursor===t?o.gray().underline(u.title):o.strikethrough().gray(u.title);c=(this.cursor===t?o.bold().gray(h.pointer)+" ":" ")+c}else{a=this.cursor===t?o.cyan().underline(u.title):u.title;c=(this.cursor===t?o.cyan(h.pointer)+" ":" ")+c;if(u.description&&this.cursor===t){l=` - ${u.description}`;if(c.length+a.length+l.length>=this.out.columns||u.description.split(/\r?\n/).length>1){l="\n"+d(u.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${c} ${a}${o.gray(l)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},7740:(t,r,i)=>{function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(1081);const a=i(2547);const c=i(5624),l=c.erase,u=c.cursor;const h=i(5970),d=h.style,p=h.clear,m=h.lines,y=h.figures;class TextPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=p(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){t.value=t.value||t.initial;t.cursorOffset=0;t.cursor=t.rendered.length;yield t.validate();if(t.error){t.red=true;t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{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(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(m(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":y.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore+u.move(this.cursorOffset,0))}}t.exports=TextPrompt},4641:(t,r,i)=>{const o=i(1081);const a=i(2547);const c=i(5970),l=c.style,u=c.clear;const h=i(5624),d=h.cursor,p=h.erase;class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(p.line+d.to(0)+this.outputText)}}t.exports=TogglePrompt},9037:(t,r,i)=>{function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r){o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=true,l=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();c=t.done;return t},e:function e(t){l=true;u=t},f:function f(){try{if(!c&&i.return!=null)i.return()}finally{if(l)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function asyncGeneratorStep(t,r,i,o,a,c,l){try{var u=t[c](l);var h=u.value}catch(t){i(t);return}if(u.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var c=t.apply(r,i);function _next(t){asyncGeneratorStep(c,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(c,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(8078);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const c={};const l=prompt._override||{};t=[].concat(t);let u,h,d,p,m,y;const g=function(){var t=_asyncToGenerator((function*(t,r,i=false){if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?yield t.format(r,c):r}));return function getFormattedAnswer(r,i){return t.apply(this,arguments)}}();var v=_createForOfIteratorHelper(t),w;try{for(v.s();!(w=v.n()).done;){h=w.value;var b=h;p=b.name;m=b.type;if(typeof m==="function"){m=yield m(u,_objectSpread({},c),h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?yield r(u,_objectSpread({},c),y):r}y=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}var S=h;p=S.name;m=S.type;if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(l[h.name]!==undefined){u=yield g(h,l[h.name]);if(u!==undefined){c[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):yield o[m](h);c[p]=u=yield g(h,u,true);d=yield r(h,u,c)}catch(t){d=!(yield i(h,c))}if(d)return c}}catch(t){v.e(t)}finally{v.f()}return c}));return _prompt.apply(this,arguments)}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},8078:(t,r,i)=>{const o=r;const a=i(8595);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,c)=>{const l=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;l.on("state",r.onState||noop);l.on("submit",(t=>o(h(t))));l.on("exit",(t=>o(d(t))));l.on("abort",(t=>c(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},8075:t=>{t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},7640:(t,r,i)=>{function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=true,l=false,u;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();c=t.done;return t},e:function e(t){l=true;u=t},f:function f(){try{if(!c&&i.return!=null)i.return()}finally{if(l)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}const o=i(6375);const a=i(5624),c=a.erase,l=a.cursor;const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return c.line+l.to(0);let i=0;const o=t.split(/\r?\n/);var a=_createForOfIteratorHelper(o),u;try{for(a.s();!(u=a.n()).done;){let t=u.value;i+=1+Math.floor(Math.max(width(t)-1,0)/r)}}catch(t){a.e(t)}finally{a.f()}return c.lines(i)}},1899:t=>{t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},171:t=>{const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},5970:(t,r,i)=>{t.exports={action:i(8075),clear:i(7640),style:i(3392),strip:i(6375),figures:i(171),lines:i(1496),wrap:i(6328),entriesToDisplay:i(1899)}},1496:(t,r,i)=>{const o=i(6375);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},6375:t=>{t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},3392:(t,r,i)=>{const o=i(1081);const a=i(171);const c=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>c[t]||c.default;const l=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?l.aborted:i?l.exited:t?l.done:l.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:c,render:render,symbols:l,symbol:symbol,delimiter:delimiter,item:item}},6328:t=>{t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},5918:(t,r,i)=>{function isNodeLT(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let r=0,i=process.versions.node.split(".").map(Number);for(;r<t.length;r++){if(i[r]>t[r])return false;if(t[r]>i[r])return true}return false}t.exports=isNodeLT("8.6.0")?i(9037):i(8837)},9611:t=>{class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},6205:(t,r,i)=>{const o=i(9611);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},1428:(t,r,i)=>{const o=i(9611);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},5876:(t,r,i)=>{t.exports={DatePart:i(9611),Meridiem:i(3437),Day:i(6205),Hours:i(1428),Milliseconds:i(7908),Minutes:i(1745),Month:i(8043),Seconds:i(8331),Year:i(2197)}},3437:(t,r,i)=>{const o=i(9611);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},7908:(t,r,i)=>{const o=i(9611);class Milliseconds extends o{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)}}t.exports=Milliseconds},1745:(t,r,i)=>{const o=i(9611);class Minutes extends o{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}}t.exports=Minutes},8043:(t,r,i)=>{const o=i(9611);class Month extends o{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();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},8331:(t,r,i)=>{const o=i(9611);class Seconds extends o{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}}t.exports=Seconds},2197:(t,r,i)=>{const o=i(9611);class Year extends o{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}}t.exports=Year},4485:(t,r,i)=>{const o=i(1081);const a=i(432);const{erase:c,cursor:l}=i(5624);const{style:u,clear:h,figures:d,wrap:p,entriesToDisplay:m}=i(1202);const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=u.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=h("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}async complete(t){const r=this.completing=this.suggest(this.input,this.choices);const i=await r;if(this.completing!==r)return;this.suggestions=i.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));this.completing=false;const o=Math.max(i.length-1,0);this.moveSelect(Math.min(o,this.select));t&&t()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let c;let l=i?d.arrowUp:a?d.arrowDown:" ";let u=r?o.cyan().underline(t.title):t.title;l=(r?o.cyan(d.pointer)+" ":" ")+l;if(t.description){c=` - ${t.description}`;if(l.length+u.length+c.length>=this.out.columns||t.description.split(/\r?\n/).length>1){c="\n"+p(t.description,{margin:3,width:this.out.columns})}}return l+" "+u+o.gray(c||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=m(this.select,this.choices.length,this.limit);this.outputText=[u.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),u.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const i=this.suggestions.slice(t,r).map(((i,o)=>this.renderOption(i,this.select===o+t,o===0&&t>0,o+t===r-1&&r<this.choices.length))).join("\n");this.outputText+=`\n`+(i||o.gray(this.fallback.title))}this.out.write(c.line+l.to(0)+this.outputText)}}t.exports=AutocompletePrompt},6061:(t,r,i)=>{const o=i(1081);const{cursor:a}=i(5624);const c=i(244);const{clear:l,style:u,figures:h}=i(1202);class AutocompleteMultiselectPrompt extends c{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=l("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(h.radioOn):h.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=l(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},3223:(t,r,i)=>{const o=i(1081);const a=i(432);const{style:c,clear:l}=i(1202);const{erase:u,cursor:h}=i(5624);class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(u.line+h.to(0)+this.outputText)}}t.exports=ConfirmPrompt},4233:(t,r,i)=>{const o=i(1081);const a=i(432);const{style:c,clear:l,figures:u}=i(1202);const{erase:h,cursor:d}=i(5624);const{DatePart:p,Meridiem:m,Day:y,Hours:g,Milliseconds:v,Minutes:w,Month:b,Seconds:S,Year:x}=i(5876);const k=/\\(.)|"((?:\\["\\]|[^"])+)"|(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;const _={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new y(t),3:t=>new b(t),4:t=>new x(t),5:t=>new m(t),6:t=>new g(t),7:t=>new w(t),8:t=>new S(t),9:t=>new v(t)};const O={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(O,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=l("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=k.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in _?_[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof p)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t==="string"){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof p)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:u.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(h.line+d.to(0)+this.outputText)}}t.exports=DatePrompt},3022:(t,r,i)=>{t.exports={TextPrompt:i(321),SelectPrompt:i(5238),TogglePrompt:i(5362),DatePrompt:i(4233),NumberPrompt:i(9146),MultiselectPrompt:i(244),AutocompletePrompt:i(4485),AutocompleteMultiselectPrompt:i(6061),ConfirmPrompt:i(3223)}},244:(t,r,i)=>{const o=i(1081);const{cursor:a}=i(5624);const c=i(432);const{clear:l,figures:u,style:h,wrap:d,entriesToDisplay:p}=i(1202);class MultiselectPrompt extends c{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=l("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${u.arrowUp}/${u.arrowDown}: Highlight option\n`+` ${u.arrowLeft}/${u.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const c=(r.selected?o.green(u.radioOn):u.radioOff)+" "+a+" ";let l,h;if(r.disabled){l=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{l=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){h=` - ${r.description}`;if(c.length+l.length+h.length>=this.out.columns||r.description.split(/\r?\n/).length>1){h="\n"+d(r.description,{margin:c.length,width:this.out.columns})}}}return c+l+o.gray(h||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let{startIndex:r,endIndex:i}=p(this.cursor,t.length,this.optionsPerPage);let a,c=[];for(let o=r;o<i;o++){if(o===r&&r>0){a=u.arrowUp}else if(o===i-1&&i<t.length){a=u.arrowDown}else{a=" "}c.push(this.renderOption(this.cursor,t[o],o,a))}return"\n"+c.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[h.symbol(this.done,this.aborted),o.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=l(t,this.out.columns)}}t.exports=MultiselectPrompt},9146:(t,r,i)=>{const o=i(1081);const a=i(432);const{cursor:c,erase:l}=i(5624);const{style:u,figures:h,clear:d,lines:p}=i(1202);const m=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||m.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let t=this.value;this.value=t!==``?t:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore)}}t.exports=NumberPrompt},432:(t,r,i)=>{const o=i(4521);const{action:a}=i(1202);const c=i(2361);const{beep:l,cursor:u}=i(5624);const h=i(1081);class Prompt extends c{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=a(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(u.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(l)}render(){this.onRender(h);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},5238:(t,r,i)=>{const o=i(1081);const a=i(432);const{style:c,clear:l,figures:u,wrap:h,entriesToDisplay:d}=i(1202);const{cursor:p}=i(5624);class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=l("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=d(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let i=t;i<r;i++){let a,c,l="",d=this.choices[i];if(i===t&&t>0){c=u.arrowUp}else if(i===r-1&&r<this.choices.length){c=u.arrowDown}else{c=" "}if(d.disabled){a=this.cursor===i?o.gray().underline(d.title):o.strikethrough().gray(d.title);c=(this.cursor===i?o.bold().gray(u.pointer)+" ":" ")+c}else{a=this.cursor===i?o.cyan().underline(d.title):d.title;c=(this.cursor===i?o.cyan(u.pointer)+" ":" ")+c;if(d.description&&this.cursor===i){l=` - ${d.description}`;if(c.length+a.length+l.length>=this.out.columns||d.description.split(/\r?\n/).length>1){l="\n"+h(d.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${c} ${a}${o.gray(l)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},321:(t,r,i)=>{const o=i(1081);const a=i(432);const{erase:c,cursor:l}=i(5624);const{style:u,clear:h,lines:d,figures:p}=i(1202);class TextPrompt extends a{constructor(t={}){super(t);this.transform=u.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=h(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{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(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(d(this.outputError,this.out.columns)-1)+h(this.outputError,this.out.columns));this.out.write(h(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(c.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore+l.move(this.cursorOffset,0))}}t.exports=TextPrompt},5362:(t,r,i)=>{const o=i(1081);const a=i(432);const{style:c,clear:l}=i(1202);const{cursor:u,erase:h}=i(5624);class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(h.line+u.to(0)+this.outputText)}}t.exports=TogglePrompt},8837:(t,r,i)=>{const o=i(3017);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const c={};const l=prompt._override||{};t=[].concat(t);let u,h,d,p,m,y;const getFormattedAnswer=async(t,r,i=false)=>{if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?await t.format(r,c):r};for(h of t){({name:p,type:m}=h);if(typeof m==="function"){m=await m(u,{...c},h);h["type"]=m}if(!m)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?await r(u,{...c},y):r}y=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}({name:p,type:m}=h);if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(l[h.name]!==undefined){u=await getFormattedAnswer(h,l[h.name]);if(u!==undefined){c[p]=u;continue}}try{u=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):await o[m](h);c[p]=u=await getFormattedAnswer(h,u,true);d=await r(h,u,c)}catch(t){d=!await i(h,c)}if(d)return c}return c}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},3017:(t,r,i)=>{const o=r;const a=i(3022);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,c)=>{const l=new a[t](r);const u=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;l.on("state",r.onState||noop);l.on("submit",(t=>o(h(t))));l.on("exit",(t=>o(d(t))));l.on("abort",(t=>c(u(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},1393:t=>{t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},9837:(t,r,i)=>{const o=i(8029);const{erase:a,cursor:c}=i(5624);const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return a.line+c.to(0);let i=0;const o=t.split(/\r?\n/);for(let t of o){i+=1+Math.floor(Math.max(width(t)-1,0)/r)}return a.lines(i)}},3123:t=>{t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},3408:t=>{const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},1202:(t,r,i)=>{t.exports={action:i(1393),clear:i(9837),style:i(4677),strip:i(8029),figures:i(3408),lines:i(957),wrap:i(342),entriesToDisplay:i(3123)}},957:(t,r,i)=>{const o=i(8029);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},8029:t=>{t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},4677:(t,r,i)=>{const o=i(1081);const a=i(3408);const c=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>c[t]||c.default;const l=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?l.aborted:i?l.exited:t?l.done:l.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:c,render:render,symbols:l,symbol:symbol,delimiter:delimiter,item:item}},342:t=>{t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},5835:(t,r,i)=>{var o=i(5877);var a=i(1017).join;var c=i(1706);var l="/etc";var u=process.platform==="win32";var h=u?process.env.USERPROFILE:process.env.HOME;t.exports=function(t,r,d,p){if("string"!==typeof t)throw new Error("rc(name): name *must* be string");if(!d)d=i(4599)(process.argv.slice(2));r=("string"===typeof r?o.json(r):r)||{};p=p||o.parse;var m=o.env(t+"_");var y=[r];var g=[];function addConfigFile(t){if(g.indexOf(t)>=0)return;var r=o.file(t);if(r){y.push(p(r));g.push(t)}}if(!u)[a(l,t,"config"),a(l,t+"rc")].forEach(addConfigFile);if(h)[a(h,".config",t,"config"),a(h,".config",t),a(h,"."+t,"config"),a(h,"."+t+"rc")].forEach(addConfigFile);addConfigFile(o.find("."+t+"rc"));if(m.config)addConfigFile(m.config);if(d.config)addConfigFile(d.config);return c.apply(null,y.concat([m,d,g.length?{configs:g,config:g[g.length-1]}:undefined]))}},5877:(t,r,i)=>{var o=i(7147);var a=i(7057);var c=i(1017);var l=i(411);var u=r.parse=function(t){if(/^\s*{/.test(t))return JSON.parse(l(t));return a.parse(t)};var h=r.file=function(){var t=[].slice.call(arguments).filter((function(t){return t!=null}));for(var r in t)if("string"!==typeof t[r])return;var i=c.join.apply(null,t);var a;try{return o.readFileSync(i,"utf-8")}catch(t){return}};var d=r.json=function(){var t=h.apply(null,arguments);return t?u(t):null};var p=r.env=function(t,r){r=r||process.env;var i={};var o=t.length;for(var a in r){if(a.toLowerCase().indexOf(t.toLowerCase())===0){var c=a.substring(o).split("__");var l;while((l=c.indexOf(""))>-1){c.splice(l,1)}var u=i;c.forEach((function _buildSubObj(t,i){if(!t||typeof u!=="object")return;if(i===c.length-1)u[t]=r[a];if(u[t]===undefined)u[t]={};u=u[t]}))}}return i};var m=r.find=function(){var t=c.join.apply(null,[].slice.call(arguments));function find(t,r){var i=c.join(t,r);try{o.statSync(i);return i}catch(i){if(c.dirname(t)!==t)return find(c.dirname(t),r)}}return find(process.cwd(),t)}},4813:(t,r,i)=>{const o=i(1398).Buffer;function decodeBase64(t){return o.from(t,"base64").toString("utf8")}function encodeBase64(t){return o.from(t,"utf8").toString("base64")}t.exports={decodeBase64:decodeBase64,encodeBase64:encodeBase64}},6084:(t,r,i)=>{var o=i(7310);var a=i(4813);var c=a.decodeBase64;var l=a.encodeBase64;var u=":_authToken";var h=":username";var d=":_password";t.exports=function(){var t;var r;if(arguments.length>=2){t=arguments[0];r=arguments[1]}else if(typeof arguments[0]==="string"){t=arguments[0]}else{r=arguments[0]}r=r||{};r.npmrc=r.npmrc||i(5835)("npm",{registry:"https://registry.npmjs.org/"});t=t||r.npmrc.registry;return getRegistryAuthInfo(t,r)||getLegacyAuthInfo(r.npmrc)};function getRegistryAuthInfo(t,r){var i=o.parse(t,false,true);var a;while(a!=="/"&&i.pathname!==a){a=i.pathname||"/";var c="//"+i.host+a.replace(/\/$/,"");var l=getAuthInfoForUrl(c,r.npmrc);if(l){return l}if(!r.recursive){return/\/$/.test(t)?undefined:getRegistryAuthInfo(o.resolve(t,"."),r)}i.pathname=o.resolve(normalizePath(a),"..")||"/"}return undefined}function getLegacyAuthInfo(t){if(t._auth){return{token:t._auth,type:"Basic"}}return undefined}function normalizePath(t){return t[t.length-1]==="/"?t:t+"/"}function getAuthInfoForUrl(t,r){var i=getBearerToken(r[t+u]||r[t+"/"+u]);if(i){return i}var o=r[t+h]||r[t+"/"+h];var a=r[t+d]||r[t+"/"+d];var c=getTokenForUsernameAndPassword(o,a);if(c){return c}return undefined}function getBearerToken(t){if(!t){return undefined}var r=t.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]}));return{token:r,type:"Bearer"}}function getTokenForUsernameAndPassword(t,r){if(!t||!r){return undefined}var i=c(r.replace(/^\$\{?([^}]*)\}?$/,(function(t,r){return process.env[r]})));var o=l(t+":"+i);return{token:o,type:"Basic",password:i,username:t}}},2107:(t,r,i)=>{t.exports=function(t){var r=i(5835)("npm",{registry:"https://registry.npmjs.org/"});var o=r[t+":registry"]||r.registry;return o.slice(-1)==="/"?o:o+"/"}},1398:(t,r,i)=>{
29
29
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
30
- var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){t.exports=o}else{copyProps(o,r);r.Buffer=SafeBuffer}function SafeBuffer(t,r,i){return a(t,r,i)}SafeBuffer.prototype=Object.create(a.prototype);copyProps(a,SafeBuffer);SafeBuffer.from=function(t,r,i){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return a(t,r,i)};SafeBuffer.alloc=function(t,r,i){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var o=a(t);if(r!==undefined){if(typeof i==="string"){o.fill(r,i)}else{o.fill(r)}}else{o.fill(0)}return o};SafeBuffer.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return a(t)};SafeBuffer.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return o.SlowBuffer(t)}},5624:t=>{const r="";const i=`${r}[`;const o="";const a={to(t,r){if(!r)return`${i}${t+1}G`;return`${i}${r+1};${t+1}H`},move(t,r){let o="";if(t<0)o+=`${i}${-t}D`;else if(t>0)o+=`${i}${t}C`;if(r<0)o+=`${i}${-r}A`;else if(r>0)o+=`${i}${r}B`;return o},up:(t=1)=>`${i}${t}A`,down:(t=1)=>`${i}${t}B`,forward:(t=1)=>`${i}${t}C`,backward:(t=1)=>`${i}${t}D`,nextLine:(t=1)=>`${i}E`.repeat(t),prevLine:(t=1)=>`${i}F`.repeat(t),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${r}7`,restore:`${r}8`};const c={up:(t=1)=>`${i}S`.repeat(t),down:(t=1)=>`${i}T`.repeat(t)};const l={screen:`${i}2J`,up:(t=1)=>`${i}1J`.repeat(t),down:(t=1)=>`${i}J`.repeat(t),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(t){let r="";for(let i=0;i<t;i++)r+=this.line+(i<t-1?a.up():"");if(t)r+=a.left;return r}};t.exports={cursor:a,scroll:c,erase:l,beep:o}},411:t=>{var r=1;var i=2;function stripWithoutWhitespace(){return""}function stripWithWhitespace(t,r,i){return t.slice(r,i).replace(/\S/g," ")}t.exports=function(t,o){o=o||{};var a;var c;var l=false;var u=false;var h=0;var d="";var p=o.whitespace===false?stripWithoutWhitespace:stripWithWhitespace;for(var m=0;m<t.length;m++){a=t[m];c=t[m+1];if(!u&&a==='"'){var y=t[m-1]==="\\"&&t[m-2]!=="\\";if(!y){l=!l}}if(l){continue}if(!u&&a+c==="//"){d+=t.slice(h,m);h=m;u=r;m++}else if(u===r&&a+c==="\r\n"){m++;u=false;d+=p(t,h,m);h=m;continue}else if(u===r&&a==="\n"){u=false;d+=p(t,h,m);h=m}else if(!u&&a+c==="/*"){d+=t.slice(h,m);h=m;u=i;m++;continue}else if(u===i&&a+c==="*/"){m++;u=false;d+=p(t,h,m+1);h=m+1;continue}}return d+(u?p(t.substr(h)):t.substr(h))}},277:(t,r)=>{r.fromCallback=function(t){return Object.defineProperty((function(...r){if(typeof r[r.length-1]==="function")t.apply(this,r);else{return new Promise(((i,o)=>{r.push(((t,r)=>t!=null?o(t):i(r)));t.apply(this,r)}))}}),"name",{value:t.name})};r.fromPromise=function(t){return Object.defineProperty((function(...r){const i=r[r.length-1];if(typeof i!=="function")return t.apply(this,r);else{r.pop();t.apply(this,r).then((t=>i(null,t)),i)}}),"name",{value:t.name})}},9886:(t,r,i)=>{const{URL:o}=i(7310);const{join:a}=i(1017);const c=i(7147);const{promisify:l}=i(3837);const{tmpdir:u}=i(2037);const h=i(2107);const d=l(c.writeFile);const p=l(c.mkdir);const m=l(c.readFile);const compareVersions=(t,r)=>t.localeCompare(r,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,r)=>{const i=u();const o=a(i,"update-check");if(!c.existsSync(o)){await p(o)}let l=`${t.name}-${r}.json`;if(t.scope){l=`${t.scope}-${l}`}return a(o,l)};const evaluateCache=async(t,r,i)=>{if(c.existsSync(t)){const o=await m(t,"utf8");const{lastUpdate:a,latest:c}=JSON.parse(o);const l=a+i;if(l>r){return{shouldCheck:false,latest:c}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,r,i)=>{const o=JSON.stringify({latest:r,lastUpdate:i});await d(t,o,"utf8")};const loadPackage=(t,r)=>new Promise(((o,a)=>{const c={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(r){c.headers.authorization=`${r.type} ${r.token}`}const{get:l}=i(t.protocol==="https:"?5687:3685);l(c,(t=>{const{statusCode:r}=t;if(r!==200){const i=new Error(`Request failed with code ${r}`);i.code=r;a(i);t.resume();return}let i="";t.setEncoding("utf8");t.on("data",(t=>{i+=t}));t.on("end",(()=>{try{const t=JSON.parse(i);o(t)}catch(t){a(t)}}))})).on("error",a).on("timeout",a)}));const getMostRecent=async({full:t,scope:r},a)=>{const c=h(r);const l=new o(t,c);let u=null;try{u=await loadPackage(l)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=i(6084);const r=t(c,{recursive:true});u=await loadPackage(l,r)}else{throw t}}const d=u["dist-tags"][a];if(!d){throw new Error(`Distribution tag ${a} is not available`)}return d};const y={interval:36e5,distTag:"latest"};const getDetails=t=>{const r={full:encode(t)};if(t.includes("/")){const i=t.split("/");r.scope=i[0];r.name=i[1]}else{r.scope=null;r.name=t}return r};t.exports=async(t,r)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const i=getDetails(t.name);const o=Date.now();const{distTag:a,interval:c}=Object.assign({},y,r);const l=await getFile(i,a);let u=null;let h=true;({shouldCheck:h,latest:u}=await evaluateCache(l,o,c));if(h){u=await getMostRecent(i,a);await updateCache(l,u,o)}const d=compareVersions(t.version,u);if(d===-1){return{latest:u,fromCache:!h}}return null}},9491:r=>{r.exports=t(import.meta.url)("assert")},4300:r=>{r.exports=t(import.meta.url)("buffer")},2057:r=>{r.exports=t(import.meta.url)("constants")},2361:r=>{r.exports=t(import.meta.url)("events")},7147:r=>{r.exports=t(import.meta.url)("fs")},3685:r=>{r.exports=t(import.meta.url)("http")},5687:r=>{r.exports=t(import.meta.url)("https")},2037:r=>{r.exports=t(import.meta.url)("os")},1017:r=>{r.exports=t(import.meta.url)("path")},4521:r=>{r.exports=t(import.meta.url)("readline")},9955:r=>{r.exports=t(import.meta.url)("stream")},7310:r=>{r.exports=t(import.meta.url)("url")},3837:r=>{r.exports=t(import.meta.url)("util")}};var i={};function __nccwpck_require__(t){var o=i[t];if(o!==undefined){return o.exports}var a=i[t]={exports:{}};var c=true;try{r[t](a,a.exports,__nccwpck_require__);c=false}finally{if(c)delete i[t]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var o={};(()=>{const r=t(import.meta.url)("node:fs");const i=t(import.meta.url)("node:fs/promises");var o=__nccwpck_require__.n(i);const a=t(import.meta.url)("node:path");var c=__nccwpck_require__.n(a);const l=t(import.meta.url)("node:url");const u=t(import.meta.url)("node:util");var h=__nccwpck_require__(5918);var d=__nccwpck_require__.n(h);let p=true;const m=typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};let y=0;if(m.process&&m.process.env&&m.process.stdout){const{FORCE_COLOR:t,NODE_DISABLE_COLORS:r,NO_COLOR:i,TERM:o,COLORTERM:a}=m.process.env;if(r||i||t==="0"){p=false}else if(t==="1"||t==="2"||t==="3"){p=true}else if(o==="dumb"){p=false}else if("CI"in m.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in m.process.env))){p=true}else{p=process.stdout.isTTY}if(p){if(process.platform==="win32"){y=3}else{if(a&&(a==="truecolor"||a==="24bit")){y=3}else if(o&&(o.endsWith("-256color")||o.endsWith("256"))){y=2}else{y=1}}}}let g={enabled:p,supportLevel:y};function kolorist(t,r,i=1){const o=`[${t}m`;const a=`[${r}m`;const c=new RegExp(`\\x1b\\[${r}m`,"g");return t=>g.enabled&&g.supportLevel>=i?o+(""+t).replace(c,o)+a:""+t}function rgbToAnsi256(t,r,i){if(t>>4===r>>4&&r>>4===i>>4){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5);return o}function stripColors(t){return(""+t).replace(/\x1b\[[0-9;]+m/g,"").replace(/\x1b\]8;;.*?\x07(.*?)\x1b\]8;;\x07/g,((t,r)=>r))}const v=kolorist(0,0);const w=kolorist(1,22);const b=kolorist(2,22);const S=kolorist(3,23);const x=kolorist(4,24);const k=kolorist(7,27);const _=kolorist(8,28);const O=kolorist(9,29);const P=kolorist(30,39);const E=kolorist(31,39);const T=kolorist(32,39);const M=kolorist(33,39);const $=kolorist(34,39);const D=kolorist(35,39);const C=kolorist(36,39);const A=kolorist(97,39);const j=kolorist(90,39);const I=kolorist(37,39);const R=kolorist(91,39);const L=kolorist(92,39);const N=kolorist(93,39);const B=kolorist(94,39);const W=kolorist(95,39);const V=kolorist(96,39);const Y=kolorist(40,49);const J=kolorist(41,49);const U=kolorist(42,49);const H=kolorist(43,49);const q=kolorist(44,49);const G=kolorist(45,49);const K=kolorist(46,49);const z=kolorist(107,49);const Q=kolorist(100,49);const Z=kolorist(101,49);const X=kolorist(102,49);const tt=kolorist(103,49);const et=kolorist(104,49);const rt=kolorist(105,49);const it=kolorist(106,49);const st=kolorist(47,49);const ansi256=t=>kolorist("38;5;"+t,0,2);const ansi256Bg=t=>kolorist("48;5;"+t,0,2);const trueColor=(t,r,i)=>g.supportLevel===2?ansi256(rgbToAnsi256(t,r,i)):kolorist(`38;2;${t};${r};${i}`,0,3);const trueColorBg=(t,r,i)=>g.supportLevel===2?ansi256Bg(rgbToAnsi256(t,r,i)):kolorist(`48;2;${t};${r};${i}`,0,3);const nt="]";const ot="";const at=";";function esm_link(t,r){return g.enabled?nt+"8"+at+at+r+ot+t+nt+"8"+at+at+ot:`${t} (​${r}​)`}var ct=__nccwpck_require__(1798);var lt=__nccwpck_require__(9547);var ut=__nccwpck_require__(2520);var ht=__nccwpck_require__(4342);var dt=__nccwpck_require__(5933);var ft=__nccwpck_require__(4041);var pt=__nccwpck_require__(2693);var mt=__nccwpck_require__(9932);var yt=__nccwpck_require__(6373);const gt=ct.copy;const vt=ct.copySync;const wt=lt.emptyDirSync;const bt=lt.emptydirSync;const St=lt.emptyDir;const xt=lt.emptydir;const kt=ut.createFile;const _t=ut.createFileSync;const Ot=ut.ensureFile;const Pt=ut.ensureFileSync;const Et=ut.createLink;const Tt=ut.createLinkSync;const Ft=ut.ensureLink;const Mt=ut.ensureLinkSync;const $t=ut.createSymlink;const Dt=ut.createSymlinkSync;const Ct=ut.ensureSymlink;const At=ut.ensureSymlinkSync;const jt=ht.readJson;const It=ht.readJSON;const Rt=ht.readJsonSync;const Lt=ht.readJSONSync;const Nt=ht.writeJson;const Bt=ht.writeJSON;const Wt=ht.writeJsonSync;const Vt=ht.writeJSONSync;const Yt=ht.outputJson;const Jt=ht.outputJSON;const Ut=ht.outputJsonSync;const Ht=ht.outputJSONSync;const qt=dt.mkdirs;const Gt=dt.mkdirsSync;const Kt=dt.mkdirp;const zt=dt.mkdirpSync;const Qt=dt.ensureDir;const Zt=dt.ensureDirSync;const Xt=ft.move;const te=ft.moveSync;const ee=pt.outputFile;const re=pt.outputFileSync;const ie=mt.pathExists;const se=mt.pathExistsSync;const ne=yt.remove;const oe=yt.removeSync;const ae={...ct,...lt,...ut,...ht,...dt,...ft,...pt,...mt,...yt};var ce=__nccwpck_require__(9886);var le=__nccwpck_require__.n(ce);const ue=t(import.meta.url)("node:module");const{values:he}=(0,u.parseArgs)({args:process.argv.slice(2),options:{"choose-template":{type:"boolean"}}});function isValidPackageName(t){return/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)}function toValidPackageName(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z0-9-~]+/g,"-")}function canSafelyOverwrite(t){return!(0,r.existsSync)(t)||(0,r.readdirSync)(t).length===0}async function notifyUpdate(){const t=(0,ue.createRequire)(import.meta.url)("../package.json");const r=await le()(t).catch((()=>null));if(r?.latest){console.log(`A new version of 'create-waku' is available!`);console.log("You can update by running: ");console.log();console.log(` npm i -g create-waku`)}}async function init(){let t="";const i="waku-project";const a=c().join((0,l.fileURLToPath)(import.meta.url),"../../template");const u=(await o().readdir(a)).filter((t=>!t.startsWith(".")));let h;try{h=await d()([{name:"projectName",type:"text",message:"Project Name",initial:i,onState:r=>t=String(r.value).trim()||i},{name:"shouldOverwrite",type:()=>canSafelyOverwrite(t)?null:"confirm",message:`${t} is not empty. Remove existing files and continue?`},{name:"overwriteChecker",type:t=>{if(t===false){throw new Error(E("✖")+" Operation cancelled")}return null}},{name:"packageName",type:()=>isValidPackageName(t)?null:"text",message:"Package name",initial:()=>toValidPackageName(t),validate:t=>isValidPackageName(t)||"Invalid package.json name"},...he["choose-template"]?[{name:"chooseTemplate",type:"select",message:"Choose a starter template",choices:[{title:"Basic Template",value:u[0]},{title:"Demo Template",value:u[1]},{title:"Minimal Template",value:u[2]}]}]:[]],{onCancel:()=>{throw new Error(E("✖")+" Operation cancelled")}})}catch(t){if(t instanceof Error){console.log(t.message)}process.exit(1)}const{packageName:p,shouldOverwrite:m,chooseTemplate:y}=h;const g=c().resolve(t);if(m){ae.emptyDirSync(g)}else if(!(0,r.existsSync)(g)){await o().mkdir(g,{recursive:true})}const v={name:p??toValidPackageName(t),version:"0.0.0"};console.log("Setting up project...");const b=c().join(a,y||u[0]);const S=c().join(g,"package.json");const x=c().join(b,"package.json");const k=JSON.parse(await o().readFile(x,"utf-8"));ae.copySync(b,g);await o().writeFile(S,JSON.stringify({...k,...v},null,2));const _=process.env.npm_config_user_agent??"";const O=/pnpm/.test(_)?"pnpm":/yarn/.test(_)?"yarn":"npm";const P={install:{pnpm:"pnpm install",yarn:"yarn",npm:"npm install"},dev:{pnpm:"pnpm dev",yarn:"yarn dev",npm:"npm run dev"}};console.log(`\nDone. Now run:\n`);console.log(`${w(T(`cd ${t}`))}`);console.log(`${w(T(P.install[O]))}`);console.log(`${w(T(P.dev[O]))}`);console.log()}init().then(notifyUpdate).catch((t=>{console.error(t)}))})();
30
+ var o=i(4300);var a=o.Buffer;function copyProps(t,r){for(var i in t){r[i]=t[i]}}if(a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow){t.exports=o}else{copyProps(o,r);r.Buffer=SafeBuffer}function SafeBuffer(t,r,i){return a(t,r,i)}SafeBuffer.prototype=Object.create(a.prototype);copyProps(a,SafeBuffer);SafeBuffer.from=function(t,r,i){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return a(t,r,i)};SafeBuffer.alloc=function(t,r,i){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var o=a(t);if(r!==undefined){if(typeof i==="string"){o.fill(r,i)}else{o.fill(r)}}else{o.fill(0)}return o};SafeBuffer.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return a(t)};SafeBuffer.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return o.SlowBuffer(t)}},5624:t=>{const r="";const i=`${r}[`;const o="";const a={to(t,r){if(!r)return`${i}${t+1}G`;return`${i}${r+1};${t+1}H`},move(t,r){let o="";if(t<0)o+=`${i}${-t}D`;else if(t>0)o+=`${i}${t}C`;if(r<0)o+=`${i}${-r}A`;else if(r>0)o+=`${i}${r}B`;return o},up:(t=1)=>`${i}${t}A`,down:(t=1)=>`${i}${t}B`,forward:(t=1)=>`${i}${t}C`,backward:(t=1)=>`${i}${t}D`,nextLine:(t=1)=>`${i}E`.repeat(t),prevLine:(t=1)=>`${i}F`.repeat(t),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${r}7`,restore:`${r}8`};const c={up:(t=1)=>`${i}S`.repeat(t),down:(t=1)=>`${i}T`.repeat(t)};const l={screen:`${i}2J`,up:(t=1)=>`${i}1J`.repeat(t),down:(t=1)=>`${i}J`.repeat(t),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(t){let r="";for(let i=0;i<t;i++)r+=this.line+(i<t-1?a.up():"");if(t)r+=a.left;return r}};t.exports={cursor:a,scroll:c,erase:l,beep:o}},411:t=>{var r=1;var i=2;function stripWithoutWhitespace(){return""}function stripWithWhitespace(t,r,i){return t.slice(r,i).replace(/\S/g," ")}t.exports=function(t,o){o=o||{};var a;var c;var l=false;var u=false;var h=0;var d="";var p=o.whitespace===false?stripWithoutWhitespace:stripWithWhitespace;for(var m=0;m<t.length;m++){a=t[m];c=t[m+1];if(!u&&a==='"'){var y=t[m-1]==="\\"&&t[m-2]!=="\\";if(!y){l=!l}}if(l){continue}if(!u&&a+c==="//"){d+=t.slice(h,m);h=m;u=r;m++}else if(u===r&&a+c==="\r\n"){m++;u=false;d+=p(t,h,m);h=m;continue}else if(u===r&&a==="\n"){u=false;d+=p(t,h,m);h=m}else if(!u&&a+c==="/*"){d+=t.slice(h,m);h=m;u=i;m++;continue}else if(u===i&&a+c==="*/"){m++;u=false;d+=p(t,h,m+1);h=m+1;continue}}return d+(u?p(t.substr(h)):t.substr(h))}},277:(t,r)=>{r.fromCallback=function(t){return Object.defineProperty((function(...r){if(typeof r[r.length-1]==="function")t.apply(this,r);else{return new Promise(((i,o)=>{r.push(((t,r)=>t!=null?o(t):i(r)));t.apply(this,r)}))}}),"name",{value:t.name})};r.fromPromise=function(t){return Object.defineProperty((function(...r){const i=r[r.length-1];if(typeof i!=="function")return t.apply(this,r);else{r.pop();t.apply(this,r).then((t=>i(null,t)),i)}}),"name",{value:t.name})}},9886:(t,r,i)=>{const{URL:o}=i(7310);const{join:a}=i(1017);const c=i(7147);const{promisify:l}=i(3837);const{tmpdir:u}=i(2037);const h=i(2107);const d=l(c.writeFile);const p=l(c.mkdir);const m=l(c.readFile);const compareVersions=(t,r)=>t.localeCompare(r,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,r)=>{const i=u();const o=a(i,"update-check");if(!c.existsSync(o)){await p(o)}let l=`${t.name}-${r}.json`;if(t.scope){l=`${t.scope}-${l}`}return a(o,l)};const evaluateCache=async(t,r,i)=>{if(c.existsSync(t)){const o=await m(t,"utf8");const{lastUpdate:a,latest:c}=JSON.parse(o);const l=a+i;if(l>r){return{shouldCheck:false,latest:c}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,r,i)=>{const o=JSON.stringify({latest:r,lastUpdate:i});await d(t,o,"utf8")};const loadPackage=(t,r)=>new Promise(((o,a)=>{const c={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(r){c.headers.authorization=`${r.type} ${r.token}`}const{get:l}=i(t.protocol==="https:"?5687:3685);l(c,(t=>{const{statusCode:r}=t;if(r!==200){const i=new Error(`Request failed with code ${r}`);i.code=r;a(i);t.resume();return}let i="";t.setEncoding("utf8");t.on("data",(t=>{i+=t}));t.on("end",(()=>{try{const t=JSON.parse(i);o(t)}catch(t){a(t)}}))})).on("error",a).on("timeout",a)}));const getMostRecent=async({full:t,scope:r},a)=>{const c=h(r);const l=new o(t,c);let u=null;try{u=await loadPackage(l)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=i(6084);const r=t(c,{recursive:true});u=await loadPackage(l,r)}else{throw t}}const d=u["dist-tags"][a];if(!d){throw new Error(`Distribution tag ${a} is not available`)}return d};const y={interval:36e5,distTag:"latest"};const getDetails=t=>{const r={full:encode(t)};if(t.includes("/")){const i=t.split("/");r.scope=i[0];r.name=i[1]}else{r.scope=null;r.name=t}return r};t.exports=async(t,r)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const i=getDetails(t.name);const o=Date.now();const{distTag:a,interval:c}=Object.assign({},y,r);const l=await getFile(i,a);let u=null;let h=true;({shouldCheck:h,latest:u}=await evaluateCache(l,o,c));if(h){u=await getMostRecent(i,a);await updateCache(l,u,o)}const d=compareVersions(t.version,u);if(d===-1){return{latest:u,fromCache:!h}}return null}},9491:r=>{r.exports=t(import.meta.url)("assert")},4300:r=>{r.exports=t(import.meta.url)("buffer")},2057:r=>{r.exports=t(import.meta.url)("constants")},2361:r=>{r.exports=t(import.meta.url)("events")},7147:r=>{r.exports=t(import.meta.url)("fs")},3685:r=>{r.exports=t(import.meta.url)("http")},5687:r=>{r.exports=t(import.meta.url)("https")},2037:r=>{r.exports=t(import.meta.url)("os")},1017:r=>{r.exports=t(import.meta.url)("path")},4521:r=>{r.exports=t(import.meta.url)("readline")},9955:r=>{r.exports=t(import.meta.url)("stream")},7310:r=>{r.exports=t(import.meta.url)("url")},3837:r=>{r.exports=t(import.meta.url)("util")}};var i={};function __nccwpck_require__(t){var o=i[t];if(o!==undefined){return o.exports}var a=i[t]={exports:{}};var c=true;try{r[t](a,a.exports,__nccwpck_require__);c=false}finally{if(c)delete i[t]}return a.exports}(()=>{__nccwpck_require__.n=t=>{var r=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(r,{a:r});return r}})();(()=>{__nccwpck_require__.d=(t,r)=>{for(var i in r){if(__nccwpck_require__.o(r,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:r[i]})}}}})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var o={};(()=>{const r=t(import.meta.url)("node:fs");const i=t(import.meta.url)("node:fs/promises");var o=__nccwpck_require__.n(i);const a=t(import.meta.url)("node:path");var c=__nccwpck_require__.n(a);const l=t(import.meta.url)("node:url");const u=t(import.meta.url)("node:util");var h=__nccwpck_require__(5918);var d=__nccwpck_require__.n(h);let p=true;const m=typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};let y=0;if(m.process&&m.process.env&&m.process.stdout){const{FORCE_COLOR:t,NODE_DISABLE_COLORS:r,NO_COLOR:i,TERM:o,COLORTERM:a}=m.process.env;if(r||i||t==="0"){p=false}else if(t==="1"||t==="2"||t==="3"){p=true}else if(o==="dumb"){p=false}else if("CI"in m.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((t=>t in m.process.env))){p=true}else{p=process.stdout.isTTY}if(p){if(process.platform==="win32"){y=3}else{if(a&&(a==="truecolor"||a==="24bit")){y=3}else if(o&&(o.endsWith("-256color")||o.endsWith("256"))){y=2}else{y=1}}}}let g={enabled:p,supportLevel:y};function kolorist(t,r,i=1){const o=`[${t}m`;const a=`[${r}m`;const c=new RegExp(`\\x1b\\[${r}m`,"g");return t=>g.enabled&&g.supportLevel>=i?o+(""+t).replace(c,o)+a:""+t}function rgbToAnsi256(t,r,i){if(t>>4===r>>4&&r>>4===i>>4){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const o=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5);return o}function stripColors(t){return(""+t).replace(/\x1b\[[0-9;]+m/g,"").replace(/\x1b\]8;;.*?\x07(.*?)\x1b\]8;;\x07/g,((t,r)=>r))}const v=kolorist(0,0);const w=kolorist(1,22);const b=kolorist(2,22);const S=kolorist(3,23);const x=kolorist(4,24);const k=kolorist(7,27);const _=kolorist(8,28);const O=kolorist(9,29);const P=kolorist(30,39);const E=kolorist(31,39);const T=kolorist(32,39);const M=kolorist(33,39);const $=kolorist(34,39);const D=kolorist(35,39);const C=kolorist(36,39);const A=kolorist(97,39);const j=kolorist(90,39);const I=kolorist(37,39);const R=kolorist(91,39);const L=kolorist(92,39);const N=kolorist(93,39);const B=kolorist(94,39);const W=kolorist(95,39);const V=kolorist(96,39);const Y=kolorist(40,49);const J=kolorist(41,49);const U=kolorist(42,49);const H=kolorist(43,49);const q=kolorist(44,49);const G=kolorist(45,49);const K=kolorist(46,49);const z=kolorist(107,49);const Q=kolorist(100,49);const Z=kolorist(101,49);const X=kolorist(102,49);const tt=kolorist(103,49);const et=kolorist(104,49);const rt=kolorist(105,49);const it=kolorist(106,49);const st=kolorist(47,49);const ansi256=t=>kolorist("38;5;"+t,0,2);const ansi256Bg=t=>kolorist("48;5;"+t,0,2);const trueColor=(t,r,i)=>g.supportLevel===2?ansi256(rgbToAnsi256(t,r,i)):kolorist(`38;2;${t};${r};${i}`,0,3);const trueColorBg=(t,r,i)=>g.supportLevel===2?ansi256Bg(rgbToAnsi256(t,r,i)):kolorist(`48;2;${t};${r};${i}`,0,3);const nt="]";const ot="";const at=";";function esm_link(t,r){return g.enabled?nt+"8"+at+at+r+ot+t+nt+"8"+at+at+ot:`${t} (​${r}​)`}var ct=__nccwpck_require__(1798);var lt=__nccwpck_require__(9547);var ut=__nccwpck_require__(2520);var ht=__nccwpck_require__(4342);var dt=__nccwpck_require__(5933);var ft=__nccwpck_require__(4041);var pt=__nccwpck_require__(2693);var mt=__nccwpck_require__(9932);var yt=__nccwpck_require__(6373);const gt=ct.copy;const vt=ct.copySync;const wt=lt.emptyDirSync;const bt=lt.emptydirSync;const St=lt.emptyDir;const xt=lt.emptydir;const kt=ut.createFile;const _t=ut.createFileSync;const Ot=ut.ensureFile;const Pt=ut.ensureFileSync;const Et=ut.createLink;const Tt=ut.createLinkSync;const Ft=ut.ensureLink;const Mt=ut.ensureLinkSync;const $t=ut.createSymlink;const Dt=ut.createSymlinkSync;const Ct=ut.ensureSymlink;const At=ut.ensureSymlinkSync;const jt=ht.readJson;const It=ht.readJSON;const Rt=ht.readJsonSync;const Lt=ht.readJSONSync;const Nt=ht.writeJson;const Bt=ht.writeJSON;const Wt=ht.writeJsonSync;const Vt=ht.writeJSONSync;const Yt=ht.outputJson;const Jt=ht.outputJSON;const Ut=ht.outputJsonSync;const Ht=ht.outputJSONSync;const qt=dt.mkdirs;const Gt=dt.mkdirsSync;const Kt=dt.mkdirp;const zt=dt.mkdirpSync;const Qt=dt.ensureDir;const Zt=dt.ensureDirSync;const Xt=ft.move;const te=ft.moveSync;const ee=pt.outputFile;const re=pt.outputFileSync;const ie=mt.pathExists;const se=mt.pathExistsSync;const ne=yt.remove;const oe=yt.removeSync;const ae={...ct,...lt,...ut,...ht,...dt,...ft,...pt,...mt,...yt};var ce=__nccwpck_require__(9886);var le=__nccwpck_require__.n(ce);const ue=t(import.meta.url)("node:module");const{values:he}=(0,u.parseArgs)({args:process.argv.slice(2),options:{"choose-template":{type:"boolean"}}});function isValidPackageName(t){return/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)}function toValidPackageName(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z0-9-~]+/g,"-")}function canSafelyOverwrite(t){return!(0,r.existsSync)(t)||(0,r.readdirSync)(t).length===0}async function notifyUpdate(){const t=(0,ue.createRequire)(import.meta.url)("../package.json");const r=await le()(t).catch((()=>null));if(r?.latest){console.log(`A new version of 'create-waku' is available!`);console.log("You can update by running: ");console.log();console.log(` npm i -g create-waku`)}}async function init(){let t="";const i="waku-project";const a=c().join((0,l.fileURLToPath)(import.meta.url),"../../template");const u=(await o().readdir(a)).filter((t=>!t.startsWith(".")));let h;try{h=await d()([{name:"projectName",type:"text",message:"Project Name",initial:i,onState:r=>t=String(r.value).trim()||i},{name:"shouldOverwrite",type:()=>canSafelyOverwrite(t)?null:"confirm",message:`${t} is not empty. Remove existing files and continue?`},{name:"overwriteChecker",type:t=>{if(t===false){throw new Error(E("✖")+" Operation cancelled")}return null}},{name:"packageName",type:()=>isValidPackageName(t)?null:"text",message:"Package name",initial:()=>toValidPackageName(t),validate:t=>isValidPackageName(t)||"Invalid package.json name"},...he["choose-template"]?[{name:"chooseTemplate",type:"select",message:"Choose a starter template",choices:[{title:"Basic Template",value:u[0]},{title:"Demo Template",value:u[1]},{title:"Minimal Template",value:u[2]}]}]:[]],{onCancel:()=>{throw new Error(E("✖")+" Operation cancelled")}})}catch(t){if(t instanceof Error){console.log(t.message)}process.exit(1)}const{packageName:p,shouldOverwrite:m,chooseTemplate:y}=h;const g=c().resolve(t);if(m){ae.emptyDirSync(g)}else if(!(0,r.existsSync)(g)){await o().mkdir(g,{recursive:true})}const v={name:p??toValidPackageName(t),version:"0.0.0"};console.log("Setting up project...");const b=c().join(a,y||u[0]);const S=c().join(g,"package.json");const x=c().join(b,"package.json");const k=JSON.parse(await o().readFile(x,"utf-8"));ae.copySync(b,g);if((0,r.existsSync)(c().join(g,"gitignore"))){await o().rename(c().join(g,"gitignore"),c().join(g,".gitignore"))}await o().writeFile(S,JSON.stringify({...k,...v},null,2));const _=process.env.npm_config_user_agent??"";const O=/pnpm/.test(_)?"pnpm":/yarn/.test(_)?"yarn":"npm";const P={install:{pnpm:"pnpm install",yarn:"yarn",npm:"npm install"},dev:{pnpm:"pnpm dev",yarn:"yarn dev",npm:"npm run dev"}};console.log(`\nDone. Now run:\n`);console.log(`${w(T(`cd ${t}`))}`);console.log(`${w(T(P.install[O]))}`);console.log(`${w(T(P.dev[O]))}`);console.log()}init().then(notifyUpdate).catch((t=>{console.error(t)}))})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-waku",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "author": "Daishi Kato",
5
5
  "type": "module",
6
6
  "contributors": [
@@ -31,7 +31,7 @@
31
31
  "start": "node ./dist/index.js",
32
32
  "dev": "ncc build ./src/index.ts -w -o ./dist/",
33
33
  "compile": "rm -rf template dist *.tsbuildinfo && pnpm run template && pnpm run build",
34
- "template": "cp -r ../../examples template/ && rm -rf template/*/dist && rm -rf template/*/node_modules",
34
+ "template": "cp -r ../../examples template/ && rm -rf template/*/dist && rm -rf template/*/node_modules && mv template/01_template/.gitignore template/01_template/gitignore",
35
35
  "build": "ncc build ./src/index.ts -o ./dist/ --minify --no-cache --no-source-map-register"
36
36
  }
37
37
  }
@@ -0,0 +1,7 @@
1
+ node_modules
2
+ dist
3
+ .env*
4
+ *.tsbuildinfo
5
+ .cache
6
+ .DS_Store
7
+ *.pem
@@ -9,13 +9,13 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-14fd9630e-20240213",
13
- "react-dom": "18.3.0-canary-14fd9630e-20240213",
14
- "react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
15
- "waku": "0.19.3"
12
+ "react": "18.3.0-canary-6c3b8dbfe-20240226",
13
+ "react-dom": "18.3.0-canary-6c3b8dbfe-20240226",
14
+ "react-server-dom-webpack": "18.3.0-canary-6c3b8dbfe-20240226",
15
+ "waku": "0.19.4"
16
16
  },
17
17
  "devDependencies": {
18
- "@types/react": "18.2.55",
18
+ "@types/react": "18.2.59",
19
19
  "@types/react-dom": "18.2.19",
20
20
  "autoprefixer": "10.4.17",
21
21
  "tailwindcss": "3.4.1",
@@ -9,13 +9,13 @@
9
9
  "start": "waku start --with-ssr"
10
10
  },
11
11
  "dependencies": {
12
- "react": "18.3.0-canary-14fd9630e-20240213",
13
- "react-dom": "18.3.0-canary-14fd9630e-20240213",
14
- "react-server-dom-webpack": "18.3.0-canary-14fd9630e-20240213",
15
- "waku": "0.19.3"
12
+ "react": "18.3.0-canary-6c3b8dbfe-20240226",
13
+ "react-dom": "18.3.0-canary-6c3b8dbfe-20240226",
14
+ "react-server-dom-webpack": "18.3.0-canary-6c3b8dbfe-20240226",
15
+ "waku": "0.19.4"
16
16
  },
17
17
  "devDependencies": {
18
- "@types/react": "18.2.55",
18
+ "@types/react": "18.2.59",
19
19
  "@types/react-dom": "18.2.19",
20
20
  "autoprefixer": "10.4.17",
21
21
  "tailwindcss": "3.4.1",