@vibecoded/work 0.0.5 → 0.0.7

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 (2) hide show
  1. package/dist/cli.js +2627 -40
  2. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -1,28 +1,2175 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
- import{createRequire as eu}from"node:module";var tu=Object.create;var{getPrototypeOf:ru,defineProperty:aD,getOwnPropertyNames:ou}=Object;var su=Object.prototype.hasOwnProperty;var zD=(D,u,F)=>{F=D!=null?tu(ru(D)):{};let C=u||!D||!D.__esModule?aD(F,"default",{value:D,enumerable:!0}):F;for(let E of ou(D))if(!su.call(C,E))aD(C,E,{get:()=>D[E],enumerable:!0});return C};var MD=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var iD=eu(import.meta.url);var Eu=MD((m0,Cu)=>{Cu.exports=GF;function ZF(D){let u={defaultWidth:0,output:process.stdout,tty:iD("tty")};if(!D)return u;return Object.keys(u).forEach(function(F){if(!D[F])D[F]=u[F]}),D}function GF(D){let u=ZF(D);if(u.output.getWindowSize)return u.output.getWindowSize()[0]||u.defaultWidth;if(u.tty.getWindowSize)return u.tty.getWindowSize()[1]||u.defaultWidth;if(u.output.columns)return u.output.columns;if(process.env.CLI_WIDTH){let F=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(F)&&F!==0)return F}return u.defaultWidth}});var Zu=MD((t0,Xu)=>{Xu.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var Ju=MD((Y2,Ru)=>{var TF=iD("stream");class Nu extends TF{#F=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#u(D,u){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return u}#D(D,...u){if(typeof this._dest?.[D]==="function")this._dest[D](...u);if(typeof this._src?.[D]==="function")this._src[D](...u)}get isTTY(){if(this.#F!==null)return this.#F;return this.#u("isTTY",!1)}set isTTY(D){this.#F=D}get rows(){return this.#u("rows")}get columns(){return this.#u("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,u){return this._dest=D,super.pipe(D,u)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}Ru.exports=Nu});var DD=(D,u=[])=>D.name==="up"||u.includes("vim")&&D.name==="k"||u.includes("emacs")&&D.ctrl&&D.name==="p",AD=(D,u=[])=>D.name==="down"||u.includes("vim")&&D.name==="j"||u.includes("emacs")&&D.ctrl&&D.name==="n";var ND=(D)=>D.name==="backspace",w=(D)=>D.name==="tab";var k=(D)=>D.name==="enter"||D.name==="return";class RD extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class JD extends Error{name="CancelPromptError";message="Prompt was canceled"}class $D extends Error{name="ExitPromptError"}class VD extends Error{name="HookError"}class LD extends Error{name="ValidationError"}import{AsyncResource as CF}from"node:async_hooks";import{AsyncLocalStorage as DF,AsyncResource as uF}from"node:async_hooks";var tD=new DF;function FF(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function rD(D,u){let F=FF(D);return tD.run(F,()=>{function C(E){F.handleChange=()=>{F.index=0,E()},F.handleChange()}return u(C)})}function h(){let D=tD.getStore();if(!D)throw new VD("[Inquirer] Hook functions can only be called from within a prompt");return D}function TD(){return h().rl}function fD(D){let u=(...F)=>{let C=h(),E=!1,B=C.handleChange;C.handleChange=()=>{E=!0};let A=D(...F);if(E)B();return C.handleChange=B,A};return uF.bind(u)}function r(D){let u=h(),{index:F}=u,C={get(){return u.hooks[F]},set(B){u.hooks[F]=B},initialized:F in u.hooks},E=D(C);return u.index++,E}function oD(){h().handleChange()}var g={queue(D){let u=h(),{index:F}=u;u.hooksEffect.push(()=>{u.hooksCleanup[F]?.();let C=D(TD());if(C!=null&&typeof C!=="function")throw new LD("useEffect return value must be a cleanup function or nothing.");u.hooksCleanup[F]=C})},run(){let D=h();fD(()=>{D.hooksEffect.forEach((u)=>{u()}),D.hooksEffect.length=0})()},clearAll(){let D=h();D.hooksCleanup.forEach((u)=>{u?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function L(D){return r((u)=>{let F=CF.bind(function(B){if(u.get()!==B)u.set(B),oD()});if(u.initialized)return[u.get(),F];let C=typeof D==="function"?D():D;return u.set(C),[C,F]})}function S(D,u){r((F)=>{let C=F.get();if(!Array.isArray(C)||u.some((B,A)=>!Object.is(B,C[A])))g.queue(D);F.set(u)})}import{styleText as x}from"node:util";import j from"node:process";function EF(){if(j.platform!=="win32")return j.env.TERM!=="linux";return Boolean(j.env.WT_SESSION)||Boolean(j.env.TERMINUS_SUBLIME)||j.env.ConEmuTask==="{cmd::Cmder}"||j.env.TERM_PROGRAM==="Terminus-Sublime"||j.env.TERM_PROGRAM==="vscode"||j.env.TERM==="xterm-256color"||j.env.TERM==="alacritty"||j.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var sD={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},eD={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},BF={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},AF={...sD,...eD},$F={...sD,...BF},QF=EF(),XF=QF?AF:$F,o=XF,R0=Object.entries(eD);var Du={prefix:{idle:x("blue","?"),done:x("green",o.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map((D)=>x("yellow",D))},style:{answer:(D)=>x("cyan",D),message:(D)=>x("bold",D),error:(D)=>x("red",`> ${D}`),defaultAnswer:(D)=>x("dim",`(${D})`),help:(D)=>x("dim",D),highlight:(D)=>x("cyan",D),key:(D)=>x("cyan",x("bold",`<${D}>`))}};function uu(D){if(typeof D!=="object"||D===null)return!1;let u=D;while(Object.getPrototypeOf(u)!==null)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(D)===u}function Fu(...D){let u={};for(let F of D)for(let[C,E]of Object.entries(F)){let B=u[C];u[C]=uu(B)&&uu(E)?Fu(B,E):E}return u}function b(...D){let u=[Du,...D.filter((F)=>F!=null)];return Fu(...u)}function m({status:D="idle",theme:u}){let[F,C]=L(!1),[E,B]=L(0),{prefix:A,spinner:$}=b(u);if(S(()=>{if(D==="loading"){let Q,X=-1,G=setTimeout(()=>{C(!0),Q=setInterval(()=>{X=X+1,B(X%$.frames.length)},$.interval)},300);return()=>{clearTimeout(G),clearInterval(Q)}}else C(!1)},[D]),F)return $.frames[E];return typeof A==="string"?A:A[D==="loading"?"idle":D]??A.idle}function xD(D,u){return r((F)=>{let C=F.get();if(!C||C.dependencies.length!==u.length||C.dependencies.some((E,B)=>E!==u[B])){let E=D();return F.set({value:E,dependencies:u}),E}return C.value})}function QD(D){return L({current:D})[0]}function p(D){let u=QD(D);u.current=D,S((F)=>{let C=!1,E=fD((B,A)=>{if(C)return;u.current(A,F)});return F.input.on("keypress",E),()=>{C=!0,F.input.removeListener("keypress",E)}},[])}var Mu=zD(Eu(),1);function HD({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var YF=HD();function uD(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(YF,"")}function Bu(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function Au(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function $u(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function qF(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function Qu(D,{ambiguousAsWide:u=!1}={}){if(qF(D),Au(D)||$u(D)||u&&Bu(D))return 2;return 1}var Gu=zD(Zu(),1),OF=new Intl.Segmenter,WF=/^\p{Default_Ignorable_Code_Point}$/u;function d(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:C=!1}=u;if(!C)D=uD(D);if(D.length===0)return 0;let E=0,B={ambiguousAsWide:!F};for(let{segment:A}of OF.segment(D)){let $=A.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(WF.test(A))continue;if(Gu.default().test(A)){E+=2;continue}E+=Qu($,B)}return E}var Yu=(D=0)=>(u)=>`\x1B[${u+D}m`,qu=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,Ou=(D=0)=>(u,F,C)=>`\x1B[${38+D};2;${u};${F};${C}m`,N={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},e0=Object.keys(N.modifier),KF=Object.keys(N.color),UF=Object.keys(N.bgColor),D2=[...KF,...UF];function _F(){let D=new Map;for(let[u,F]of Object.entries(N)){for(let[C,E]of Object.entries(F))N[C]={open:`\x1B[${E[0]}m`,close:`\x1B[${E[1]}m`},F[C]=N[C],D.set(E[0],E[1]);Object.defineProperty(N,u,{value:F,enumerable:!1})}return Object.defineProperty(N,"codes",{value:D,enumerable:!1}),N.color.close="\x1B[39m",N.bgColor.close="\x1B[49m",N.color.ansi=Yu(),N.color.ansi256=qu(),N.color.ansi16m=Ou(),N.bgColor.ansi=Yu(10),N.bgColor.ansi256=qu(10),N.bgColor.ansi16m=Ou(10),Object.defineProperties(N,{rgbToAnsi256:{value(u,F,C){if(u===F&&F===C){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(C/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[C]=F;if(C.length===3)C=[...C].map((B)=>B+B).join("");let E=Number.parseInt(C,16);return[E>>16&255,E>>8&255,E&255]},enumerable:!1},hexToAnsi256:{value:(u)=>N.rgbToAnsi256(...N.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,C,E;if(u>=232)F=((u-232)*10+8)/255,C=F,E=F;else{u-=16;let $=u%36;F=Math.floor(u/36)/5,C=Math.floor($/6)/5,E=$%6/5}let B=Math.max(F,C,E)*2;if(B===0)return 30;let A=30+(Math.round(E)<<2|Math.round(C)<<1|Math.round(F));if(B===2)A+=60;return A},enumerable:!1},rgbToAnsi:{value:(u,F,C)=>N.ansi256ToAnsi(N.rgbToAnsi256(u,F,C)),enumerable:!1},hexToAnsi:{value:(u)=>N.ansi256ToAnsi(N.hexToAnsi256(u)),enumerable:!1}}),N}var zF=_F(),Wu=zF;var ZD=new Set(["\x1B","›"]),MF=39,jD="\x07",_u="[",NF="]",zu="m",XD=`${NF}8;;`,Ku=(D)=>`${ZD.values().next().value}${_u}${D}${zu}`,Uu=(D)=>`${ZD.values().next().value}${XD}${D}${jD}`,RF=(D)=>D.split(" ").map((u)=>d(u)),ID=(D,u,F)=>{let C=[...u],E=!1,B=!1,A=d(uD(D.at(-1)));for(let[$,Z]of C.entries()){let Q=d(Z);if(A+Q<=F)D[D.length-1]+=Z;else D.push(Z),A=0;if(ZD.has(Z))E=!0,B=C.slice($+1,$+1+XD.length).join("")===XD;if(E){if(B){if(Z===jD)E=!1,B=!1}else if(Z===zu)E=!1;continue}if(A+=Q,A===F&&$<C.length-1)D.push(""),A=0}if(!A&&D.at(-1).length>0&&D.length>1)D[D.length-2]+=D.pop()},JF=(D)=>{let u=D.split(" "),F=u.length;while(F>0){if(d(u[F-1])>0)break;F--}if(F===u.length)return D;return u.slice(0,F).join(" ")+u.slice(F).join("")},VF=(D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let C="",E,B,A=RF(D),$=[""];for(let[G,Y]of D.split(" ").entries()){if(F.trim!==!1)$[$.length-1]=$.at(-1).trimStart();let q=d($.at(-1));if(G!==0){if(q>=u&&(F.wordWrap===!1||F.trim===!1))$.push(""),q=0;if(q>0||F.trim===!1)$[$.length-1]+=" ",q++}if(F.hard&&A[G]>u){let K=u-q,U=1+Math.floor((A[G]-K-1)/u);if(Math.floor((A[G]-1)/u)<U)$.push("");ID($,Y,u);continue}if(q+A[G]>u&&q>0&&A[G]>0){if(F.wordWrap===!1&&q<u){ID($,Y,u);continue}$.push("")}if(q+A[G]>u&&F.wordWrap===!1){ID($,Y,u);continue}$[$.length-1]+=Y}if(F.trim!==!1)$=$.map((G)=>JF(G));let Z=$.join(`
4
- `),Q=[...Z],X=0;for(let[G,Y]of Q.entries()){if(C+=Y,ZD.has(Y)){let{groups:K}=new RegExp(`(?:\\${_u}(?<code>\\d+)m|\\${XD}(?<uri>.*)${jD})`).exec(Z.slice(X))||{groups:{}};if(K.code!==void 0){let U=Number.parseFloat(K.code);E=U===MF?void 0:U}else if(K.uri!==void 0)B=K.uri.length===0?void 0:K.uri}let q=Wu.codes.get(Number(E));if(Q[G+1]===`
5
- `){if(B)C+=Uu("");if(E&&q)C+=Ku(q)}else if(Y===`
6
- `){if(E&&q)C+=Ku(E);if(B)C+=Uu(B)}X+=Y.length}return C};function PD(D,u,F){return String(D).normalize().replaceAll(`\r
7
- `,`
1
+ import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __toESM = (mod, isNodeMode, target) => {
8
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
9
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
+ for (let key of __getOwnPropNames(mod))
11
+ if (!__hasOwnProp.call(to, key))
12
+ __defProp(to, key, {
13
+ get: () => mod[key],
14
+ enumerable: true
15
+ });
16
+ return to;
17
+ };
18
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
20
+
21
+ // node_modules/cli-width/index.js
22
+ var require_cli_width = __commonJS((exports, module) => {
23
+ module.exports = cliWidth;
24
+ function normalizeOpts(options) {
25
+ const defaultOpts = {
26
+ defaultWidth: 0,
27
+ output: process.stdout,
28
+ tty: __require("tty")
29
+ };
30
+ if (!options) {
31
+ return defaultOpts;
32
+ }
33
+ Object.keys(defaultOpts).forEach(function(key) {
34
+ if (!options[key]) {
35
+ options[key] = defaultOpts[key];
36
+ }
37
+ });
38
+ return options;
39
+ }
40
+ function cliWidth(options) {
41
+ const opts = normalizeOpts(options);
42
+ if (opts.output.getWindowSize) {
43
+ return opts.output.getWindowSize()[0] || opts.defaultWidth;
44
+ }
45
+ if (opts.tty.getWindowSize) {
46
+ return opts.tty.getWindowSize()[1] || opts.defaultWidth;
47
+ }
48
+ if (opts.output.columns) {
49
+ return opts.output.columns;
50
+ }
51
+ if (process.env.CLI_WIDTH) {
52
+ const width = parseInt(process.env.CLI_WIDTH, 10);
53
+ if (!isNaN(width) && width !== 0) {
54
+ return width;
55
+ }
56
+ }
57
+ return opts.defaultWidth;
58
+ }
59
+ });
60
+
61
+ // node_modules/emoji-regex/index.js
62
+ var require_emoji_regex = __commonJS((exports, module) => {
63
+ module.exports = () => {
64
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
65
+ };
66
+ });
67
+
68
+ // node_modules/mute-stream/lib/index.js
69
+ var require_lib = __commonJS((exports, module) => {
70
+ var Stream = __require("stream");
71
+
72
+ class MuteStream extends Stream {
73
+ #isTTY = null;
74
+ constructor(opts = {}) {
75
+ super(opts);
76
+ this.writable = this.readable = true;
77
+ this.muted = false;
78
+ this.on("pipe", this._onpipe);
79
+ this.replace = opts.replace;
80
+ this._prompt = opts.prompt || null;
81
+ this._hadControl = false;
82
+ }
83
+ #destSrc(key, def) {
84
+ if (this._dest) {
85
+ return this._dest[key];
86
+ }
87
+ if (this._src) {
88
+ return this._src[key];
89
+ }
90
+ return def;
91
+ }
92
+ #proxy(method, ...args) {
93
+ if (typeof this._dest?.[method] === "function") {
94
+ this._dest[method](...args);
95
+ }
96
+ if (typeof this._src?.[method] === "function") {
97
+ this._src[method](...args);
98
+ }
99
+ }
100
+ get isTTY() {
101
+ if (this.#isTTY !== null) {
102
+ return this.#isTTY;
103
+ }
104
+ return this.#destSrc("isTTY", false);
105
+ }
106
+ set isTTY(val) {
107
+ this.#isTTY = val;
108
+ }
109
+ get rows() {
110
+ return this.#destSrc("rows");
111
+ }
112
+ get columns() {
113
+ return this.#destSrc("columns");
114
+ }
115
+ mute() {
116
+ this.muted = true;
117
+ }
118
+ unmute() {
119
+ this.muted = false;
120
+ }
121
+ _onpipe(src) {
122
+ this._src = src;
123
+ }
124
+ pipe(dest, options) {
125
+ this._dest = dest;
126
+ return super.pipe(dest, options);
127
+ }
128
+ pause() {
129
+ if (this._src) {
130
+ return this._src.pause();
131
+ }
132
+ }
133
+ resume() {
134
+ if (this._src) {
135
+ return this._src.resume();
136
+ }
137
+ }
138
+ write(c) {
139
+ if (this.muted) {
140
+ if (!this.replace) {
141
+ return true;
142
+ }
143
+ if (c.match(/^\u001b/)) {
144
+ if (c.indexOf(this._prompt) === 0) {
145
+ c = c.slice(this._prompt.length);
146
+ c = c.replace(/./g, this.replace);
147
+ c = this._prompt + c;
148
+ }
149
+ this._hadControl = true;
150
+ return this.emit("data", c);
151
+ } else {
152
+ if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
153
+ this._hadControl = false;
154
+ this.emit("data", this._prompt);
155
+ c = c.slice(this._prompt.length);
156
+ }
157
+ c = c.toString().replace(/./g, this.replace);
158
+ }
159
+ }
160
+ this.emit("data", c);
161
+ }
162
+ end(c) {
163
+ if (this.muted) {
164
+ if (c && this.replace) {
165
+ c = c.toString().replace(/./g, this.replace);
166
+ } else {
167
+ c = null;
168
+ }
169
+ }
170
+ if (c) {
171
+ this.emit("data", c);
172
+ }
173
+ this.emit("end");
174
+ }
175
+ destroy(...args) {
176
+ return this.#proxy("destroy", ...args);
177
+ }
178
+ destroySoon(...args) {
179
+ return this.#proxy("destroySoon", ...args);
180
+ }
181
+ close(...args) {
182
+ return this.#proxy("close", ...args);
183
+ }
184
+ }
185
+ module.exports = MuteStream;
186
+ });
187
+
188
+ // node_modules/@inquirer/core/dist/lib/key.js
189
+ var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
190
+ var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
191
+ var isBackspaceKey = (key) => key.name === "backspace";
192
+ var isTabKey = (key) => key.name === "tab";
193
+ var isEnterKey = (key) => key.name === "enter" || key.name === "return";
194
+ // node_modules/@inquirer/core/dist/lib/errors.js
195
+ class AbortPromptError extends Error {
196
+ name = "AbortPromptError";
197
+ message = "Prompt was aborted";
198
+ constructor(options) {
199
+ super();
200
+ this.cause = options?.cause;
201
+ }
202
+ }
203
+
204
+ class CancelPromptError extends Error {
205
+ name = "CancelPromptError";
206
+ message = "Prompt was canceled";
207
+ }
208
+
209
+ class ExitPromptError extends Error {
210
+ name = "ExitPromptError";
211
+ }
212
+
213
+ class HookError extends Error {
214
+ name = "HookError";
215
+ }
216
+
217
+ class ValidationError extends Error {
218
+ name = "ValidationError";
219
+ }
220
+ // node_modules/@inquirer/core/dist/lib/use-state.js
221
+ import { AsyncResource as AsyncResource2 } from "node:async_hooks";
222
+
223
+ // node_modules/@inquirer/core/dist/lib/hook-engine.js
224
+ import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
225
+ var hookStorage = new AsyncLocalStorage;
226
+ function createStore(rl) {
227
+ const store = {
228
+ rl,
229
+ hooks: [],
230
+ hooksCleanup: [],
231
+ hooksEffect: [],
232
+ index: 0,
233
+ handleChange() {}
234
+ };
235
+ return store;
236
+ }
237
+ function withHooks(rl, cb) {
238
+ const store = createStore(rl);
239
+ return hookStorage.run(store, () => {
240
+ function cycle(render) {
241
+ store.handleChange = () => {
242
+ store.index = 0;
243
+ render();
244
+ };
245
+ store.handleChange();
246
+ }
247
+ return cb(cycle);
248
+ });
249
+ }
250
+ function getStore() {
251
+ const store = hookStorage.getStore();
252
+ if (!store) {
253
+ throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
254
+ }
255
+ return store;
256
+ }
257
+ function readline() {
258
+ return getStore().rl;
259
+ }
260
+ function withUpdates(fn) {
261
+ const wrapped = (...args) => {
262
+ const store = getStore();
263
+ let shouldUpdate = false;
264
+ const oldHandleChange = store.handleChange;
265
+ store.handleChange = () => {
266
+ shouldUpdate = true;
267
+ };
268
+ const returnValue = fn(...args);
269
+ if (shouldUpdate) {
270
+ oldHandleChange();
271
+ }
272
+ store.handleChange = oldHandleChange;
273
+ return returnValue;
274
+ };
275
+ return AsyncResource.bind(wrapped);
276
+ }
277
+ function withPointer(cb) {
278
+ const store = getStore();
279
+ const { index } = store;
280
+ const pointer = {
281
+ get() {
282
+ return store.hooks[index];
283
+ },
284
+ set(value) {
285
+ store.hooks[index] = value;
286
+ },
287
+ initialized: index in store.hooks
288
+ };
289
+ const returnValue = cb(pointer);
290
+ store.index++;
291
+ return returnValue;
292
+ }
293
+ function handleChange() {
294
+ getStore().handleChange();
295
+ }
296
+ var effectScheduler = {
297
+ queue(cb) {
298
+ const store = getStore();
299
+ const { index } = store;
300
+ store.hooksEffect.push(() => {
301
+ store.hooksCleanup[index]?.();
302
+ const cleanFn = cb(readline());
303
+ if (cleanFn != null && typeof cleanFn !== "function") {
304
+ throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
305
+ }
306
+ store.hooksCleanup[index] = cleanFn;
307
+ });
308
+ },
309
+ run() {
310
+ const store = getStore();
311
+ withUpdates(() => {
312
+ store.hooksEffect.forEach((effect) => {
313
+ effect();
314
+ });
315
+ store.hooksEffect.length = 0;
316
+ })();
317
+ },
318
+ clearAll() {
319
+ const store = getStore();
320
+ store.hooksCleanup.forEach((cleanFn) => {
321
+ cleanFn?.();
322
+ });
323
+ store.hooksEffect.length = 0;
324
+ store.hooksCleanup.length = 0;
325
+ }
326
+ };
327
+
328
+ // node_modules/@inquirer/core/dist/lib/use-state.js
329
+ function useState(defaultValue) {
330
+ return withPointer((pointer) => {
331
+ const setState = AsyncResource2.bind(function setState(newValue) {
332
+ if (pointer.get() !== newValue) {
333
+ pointer.set(newValue);
334
+ handleChange();
335
+ }
336
+ });
337
+ if (pointer.initialized) {
338
+ return [pointer.get(), setState];
339
+ }
340
+ const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
341
+ pointer.set(value);
342
+ return [value, setState];
343
+ });
344
+ }
345
+
346
+ // node_modules/@inquirer/core/dist/lib/use-effect.js
347
+ function useEffect(cb, depArray) {
348
+ withPointer((pointer) => {
349
+ const oldDeps = pointer.get();
350
+ const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
351
+ if (hasChanged) {
352
+ effectScheduler.queue(cb);
353
+ }
354
+ pointer.set(depArray);
355
+ });
356
+ }
357
+
358
+ // node_modules/@inquirer/core/dist/lib/theme.js
359
+ import { styleText } from "node:util";
360
+
361
+ // node_modules/@inquirer/figures/dist/index.js
362
+ import process2 from "node:process";
363
+ function isUnicodeSupported() {
364
+ if (process2.platform !== "win32") {
365
+ return process2.env["TERM"] !== "linux";
366
+ }
367
+ return Boolean(process2.env["WT_SESSION"]) || Boolean(process2.env["TERMINUS_SUBLIME"]) || process2.env["ConEmuTask"] === "{cmd::Cmder}" || process2.env["TERM_PROGRAM"] === "Terminus-Sublime" || process2.env["TERM_PROGRAM"] === "vscode" || process2.env["TERM"] === "xterm-256color" || process2.env["TERM"] === "alacritty" || process2.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
368
+ }
369
+ var common = {
370
+ circleQuestionMark: "(?)",
371
+ questionMarkPrefix: "(?)",
372
+ square: "█",
373
+ squareDarkShade: "▓",
374
+ squareMediumShade: "▒",
375
+ squareLightShade: "░",
376
+ squareTop: "▀",
377
+ squareBottom: "▄",
378
+ squareLeft: "▌",
379
+ squareRight: "▐",
380
+ squareCenter: "■",
381
+ bullet: "●",
382
+ dot: "․",
383
+ ellipsis: "…",
384
+ pointerSmall: "›",
385
+ triangleUp: "▲",
386
+ triangleUpSmall: "▴",
387
+ triangleDown: "▼",
388
+ triangleDownSmall: "▾",
389
+ triangleLeftSmall: "◂",
390
+ triangleRightSmall: "▸",
391
+ home: "⌂",
392
+ heart: "♥",
393
+ musicNote: "♪",
394
+ musicNoteBeamed: "♫",
395
+ arrowUp: "↑",
396
+ arrowDown: "↓",
397
+ arrowLeft: "←",
398
+ arrowRight: "→",
399
+ arrowLeftRight: "↔",
400
+ arrowUpDown: "↕",
401
+ almostEqual: "≈",
402
+ notEqual: "≠",
403
+ lessOrEqual: "≤",
404
+ greaterOrEqual: "≥",
405
+ identical: "≡",
406
+ infinity: "∞",
407
+ subscriptZero: "₀",
408
+ subscriptOne: "₁",
409
+ subscriptTwo: "₂",
410
+ subscriptThree: "₃",
411
+ subscriptFour: "₄",
412
+ subscriptFive: "₅",
413
+ subscriptSix: "₆",
414
+ subscriptSeven: "₇",
415
+ subscriptEight: "₈",
416
+ subscriptNine: "₉",
417
+ oneHalf: "½",
418
+ oneThird: "⅓",
419
+ oneQuarter: "¼",
420
+ oneFifth: "⅕",
421
+ oneSixth: "⅙",
422
+ oneEighth: "⅛",
423
+ twoThirds: "⅔",
424
+ twoFifths: "⅖",
425
+ threeQuarters: "¾",
426
+ threeFifths: "⅗",
427
+ threeEighths: "⅜",
428
+ fourFifths: "⅘",
429
+ fiveSixths: "⅚",
430
+ fiveEighths: "⅝",
431
+ sevenEighths: "⅞",
432
+ line: "─",
433
+ lineBold: "━",
434
+ lineDouble: "═",
435
+ lineDashed0: "┄",
436
+ lineDashed1: "┅",
437
+ lineDashed2: "┈",
438
+ lineDashed3: "┉",
439
+ lineDashed4: "╌",
440
+ lineDashed5: "╍",
441
+ lineDashed6: "╴",
442
+ lineDashed7: "╶",
443
+ lineDashed8: "╸",
444
+ lineDashed9: "╺",
445
+ lineDashed10: "╼",
446
+ lineDashed11: "╾",
447
+ lineDashed12: "−",
448
+ lineDashed13: "–",
449
+ lineDashed14: "‐",
450
+ lineDashed15: "⁃",
451
+ lineVertical: "│",
452
+ lineVerticalBold: "┃",
453
+ lineVerticalDouble: "║",
454
+ lineVerticalDashed0: "┆",
455
+ lineVerticalDashed1: "┇",
456
+ lineVerticalDashed2: "┊",
457
+ lineVerticalDashed3: "┋",
458
+ lineVerticalDashed4: "╎",
459
+ lineVerticalDashed5: "╏",
460
+ lineVerticalDashed6: "╵",
461
+ lineVerticalDashed7: "╷",
462
+ lineVerticalDashed8: "╹",
463
+ lineVerticalDashed9: "╻",
464
+ lineVerticalDashed10: "╽",
465
+ lineVerticalDashed11: "╿",
466
+ lineDownLeft: "┐",
467
+ lineDownLeftArc: "╮",
468
+ lineDownBoldLeftBold: "┓",
469
+ lineDownBoldLeft: "┒",
470
+ lineDownLeftBold: "┑",
471
+ lineDownDoubleLeftDouble: "╗",
472
+ lineDownDoubleLeft: "╖",
473
+ lineDownLeftDouble: "╕",
474
+ lineDownRight: "┌",
475
+ lineDownRightArc: "╭",
476
+ lineDownBoldRightBold: "┏",
477
+ lineDownBoldRight: "┎",
478
+ lineDownRightBold: "┍",
479
+ lineDownDoubleRightDouble: "╔",
480
+ lineDownDoubleRight: "╓",
481
+ lineDownRightDouble: "╒",
482
+ lineUpLeft: "┘",
483
+ lineUpLeftArc: "╯",
484
+ lineUpBoldLeftBold: "┛",
485
+ lineUpBoldLeft: "┚",
486
+ lineUpLeftBold: "┙",
487
+ lineUpDoubleLeftDouble: "╝",
488
+ lineUpDoubleLeft: "╜",
489
+ lineUpLeftDouble: "╛",
490
+ lineUpRight: "└",
491
+ lineUpRightArc: "╰",
492
+ lineUpBoldRightBold: "┗",
493
+ lineUpBoldRight: "┖",
494
+ lineUpRightBold: "┕",
495
+ lineUpDoubleRightDouble: "╚",
496
+ lineUpDoubleRight: "╙",
497
+ lineUpRightDouble: "╘",
498
+ lineUpDownLeft: "┤",
499
+ lineUpBoldDownBoldLeftBold: "┫",
500
+ lineUpBoldDownBoldLeft: "┨",
501
+ lineUpDownLeftBold: "┥",
502
+ lineUpBoldDownLeftBold: "┩",
503
+ lineUpDownBoldLeftBold: "┪",
504
+ lineUpDownBoldLeft: "┧",
505
+ lineUpBoldDownLeft: "┦",
506
+ lineUpDoubleDownDoubleLeftDouble: "╣",
507
+ lineUpDoubleDownDoubleLeft: "╢",
508
+ lineUpDownLeftDouble: "╡",
509
+ lineUpDownRight: "├",
510
+ lineUpBoldDownBoldRightBold: "┣",
511
+ lineUpBoldDownBoldRight: "┠",
512
+ lineUpDownRightBold: "┝",
513
+ lineUpBoldDownRightBold: "┡",
514
+ lineUpDownBoldRightBold: "┢",
515
+ lineUpDownBoldRight: "┟",
516
+ lineUpBoldDownRight: "┞",
517
+ lineUpDoubleDownDoubleRightDouble: "╠",
518
+ lineUpDoubleDownDoubleRight: "╟",
519
+ lineUpDownRightDouble: "╞",
520
+ lineDownLeftRight: "┬",
521
+ lineDownBoldLeftBoldRightBold: "┳",
522
+ lineDownLeftBoldRightBold: "┯",
523
+ lineDownBoldLeftRight: "┰",
524
+ lineDownBoldLeftBoldRight: "┱",
525
+ lineDownBoldLeftRightBold: "┲",
526
+ lineDownLeftRightBold: "┮",
527
+ lineDownLeftBoldRight: "┭",
528
+ lineDownDoubleLeftDoubleRightDouble: "╦",
529
+ lineDownDoubleLeftRight: "╥",
530
+ lineDownLeftDoubleRightDouble: "╤",
531
+ lineUpLeftRight: "┴",
532
+ lineUpBoldLeftBoldRightBold: "┻",
533
+ lineUpLeftBoldRightBold: "┷",
534
+ lineUpBoldLeftRight: "┸",
535
+ lineUpBoldLeftBoldRight: "┹",
536
+ lineUpBoldLeftRightBold: "┺",
537
+ lineUpLeftRightBold: "┶",
538
+ lineUpLeftBoldRight: "┵",
539
+ lineUpDoubleLeftDoubleRightDouble: "╩",
540
+ lineUpDoubleLeftRight: "╨",
541
+ lineUpLeftDoubleRightDouble: "╧",
542
+ lineUpDownLeftRight: "┼",
543
+ lineUpBoldDownBoldLeftBoldRightBold: "╋",
544
+ lineUpDownBoldLeftBoldRightBold: "╈",
545
+ lineUpBoldDownLeftBoldRightBold: "╇",
546
+ lineUpBoldDownBoldLeftRightBold: "╊",
547
+ lineUpBoldDownBoldLeftBoldRight: "╉",
548
+ lineUpBoldDownLeftRight: "╀",
549
+ lineUpDownBoldLeftRight: "╁",
550
+ lineUpDownLeftBoldRight: "┽",
551
+ lineUpDownLeftRightBold: "┾",
552
+ lineUpBoldDownBoldLeftRight: "╂",
553
+ lineUpDownLeftBoldRightBold: "┿",
554
+ lineUpBoldDownLeftBoldRight: "╃",
555
+ lineUpBoldDownLeftRightBold: "╄",
556
+ lineUpDownBoldLeftBoldRight: "╅",
557
+ lineUpDownBoldLeftRightBold: "╆",
558
+ lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
559
+ lineUpDoubleDownDoubleLeftRight: "╫",
560
+ lineUpDownLeftDoubleRightDouble: "╪",
561
+ lineCross: "╳",
562
+ lineBackslash: "╲",
563
+ lineSlash: "╱"
564
+ };
565
+ var specialMainSymbols = {
566
+ tick: "✔",
567
+ info: "ℹ",
568
+ warning: "⚠",
569
+ cross: "✘",
570
+ squareSmall: "◻",
571
+ squareSmallFilled: "◼",
572
+ circle: "◯",
573
+ circleFilled: "◉",
574
+ circleDotted: "◌",
575
+ circleDouble: "◎",
576
+ circleCircle: "ⓞ",
577
+ circleCross: "ⓧ",
578
+ circlePipe: "Ⓘ",
579
+ radioOn: "◉",
580
+ radioOff: "◯",
581
+ checkboxOn: "☒",
582
+ checkboxOff: "☐",
583
+ checkboxCircleOn: "ⓧ",
584
+ checkboxCircleOff: "Ⓘ",
585
+ pointer: "❯",
586
+ triangleUpOutline: "△",
587
+ triangleLeft: "◀",
588
+ triangleRight: "▶",
589
+ lozenge: "◆",
590
+ lozengeOutline: "◇",
591
+ hamburger: "☰",
592
+ smiley: "㋡",
593
+ mustache: "෴",
594
+ star: "★",
595
+ play: "▶",
596
+ nodejs: "⬢",
597
+ oneSeventh: "⅐",
598
+ oneNinth: "⅑",
599
+ oneTenth: "⅒"
600
+ };
601
+ var specialFallbackSymbols = {
602
+ tick: "√",
603
+ info: "i",
604
+ warning: "‼",
605
+ cross: "×",
606
+ squareSmall: "□",
607
+ squareSmallFilled: "■",
608
+ circle: "( )",
609
+ circleFilled: "(*)",
610
+ circleDotted: "( )",
611
+ circleDouble: "( )",
612
+ circleCircle: "(○)",
613
+ circleCross: "(×)",
614
+ circlePipe: "(│)",
615
+ radioOn: "(*)",
616
+ radioOff: "( )",
617
+ checkboxOn: "[×]",
618
+ checkboxOff: "[ ]",
619
+ checkboxCircleOn: "(×)",
620
+ checkboxCircleOff: "( )",
621
+ pointer: ">",
622
+ triangleUpOutline: "∆",
623
+ triangleLeft: "◄",
624
+ triangleRight: "►",
625
+ lozenge: "♦",
626
+ lozengeOutline: "◊",
627
+ hamburger: "≡",
628
+ smiley: "☺",
629
+ mustache: "┌─┐",
630
+ star: "✶",
631
+ play: "►",
632
+ nodejs: "♦",
633
+ oneSeventh: "1/7",
634
+ oneNinth: "1/9",
635
+ oneTenth: "1/10"
636
+ };
637
+ var mainSymbols = {
638
+ ...common,
639
+ ...specialMainSymbols
640
+ };
641
+ var fallbackSymbols = {
642
+ ...common,
643
+ ...specialFallbackSymbols
644
+ };
645
+ var shouldUseMain = isUnicodeSupported();
646
+ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
647
+ var dist_default = figures;
648
+ var replacements = Object.entries(specialMainSymbols);
649
+
650
+ // node_modules/@inquirer/core/dist/lib/theme.js
651
+ var defaultTheme = {
652
+ prefix: {
653
+ idle: styleText("blue", "?"),
654
+ done: styleText("green", dist_default.tick)
655
+ },
656
+ spinner: {
657
+ interval: 80,
658
+ frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => styleText("yellow", frame))
659
+ },
660
+ style: {
661
+ answer: (text) => styleText("cyan", text),
662
+ message: (text) => styleText("bold", text),
663
+ error: (text) => styleText("red", `> ${text}`),
664
+ defaultAnswer: (text) => styleText("dim", `(${text})`),
665
+ help: (text) => styleText("dim", text),
666
+ highlight: (text) => styleText("cyan", text),
667
+ key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
668
+ }
669
+ };
670
+
671
+ // node_modules/@inquirer/core/dist/lib/make-theme.js
672
+ function isPlainObject(value) {
673
+ if (typeof value !== "object" || value === null)
674
+ return false;
675
+ let proto = value;
676
+ while (Object.getPrototypeOf(proto) !== null) {
677
+ proto = Object.getPrototypeOf(proto);
678
+ }
679
+ return Object.getPrototypeOf(value) === proto;
680
+ }
681
+ function deepMerge(...objects) {
682
+ const output = {};
683
+ for (const obj of objects) {
684
+ for (const [key, value] of Object.entries(obj)) {
685
+ const prevValue = output[key];
686
+ output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
687
+ }
688
+ }
689
+ return output;
690
+ }
691
+ function makeTheme(...themes) {
692
+ const themesToMerge = [
693
+ defaultTheme,
694
+ ...themes.filter((theme) => theme != null)
695
+ ];
696
+ return deepMerge(...themesToMerge);
697
+ }
698
+
699
+ // node_modules/@inquirer/core/dist/lib/use-prefix.js
700
+ function usePrefix({ status = "idle", theme }) {
701
+ const [showLoader, setShowLoader] = useState(false);
702
+ const [tick, setTick] = useState(0);
703
+ const { prefix, spinner } = makeTheme(theme);
704
+ useEffect(() => {
705
+ if (status === "loading") {
706
+ let tickInterval;
707
+ let inc = -1;
708
+ const delayTimeout = setTimeout(() => {
709
+ setShowLoader(true);
710
+ tickInterval = setInterval(() => {
711
+ inc = inc + 1;
712
+ setTick(inc % spinner.frames.length);
713
+ }, spinner.interval);
714
+ }, 300);
715
+ return () => {
716
+ clearTimeout(delayTimeout);
717
+ clearInterval(tickInterval);
718
+ };
719
+ } else {
720
+ setShowLoader(false);
721
+ }
722
+ }, [status]);
723
+ if (showLoader) {
724
+ return spinner.frames[tick];
725
+ }
726
+ const iconName = status === "loading" ? "idle" : status;
727
+ return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
728
+ }
729
+ // node_modules/@inquirer/core/dist/lib/use-memo.js
730
+ function useMemo(fn, dependencies) {
731
+ return withPointer((pointer) => {
732
+ const prev = pointer.get();
733
+ if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
734
+ const value = fn();
735
+ pointer.set({ value, dependencies });
736
+ return value;
737
+ }
738
+ return prev.value;
739
+ });
740
+ }
741
+ // node_modules/@inquirer/core/dist/lib/use-ref.js
742
+ function useRef(val) {
743
+ return useState({ current: val })[0];
744
+ }
745
+
746
+ // node_modules/@inquirer/core/dist/lib/use-keypress.js
747
+ function useKeypress(userHandler) {
748
+ const signal = useRef(userHandler);
749
+ signal.current = userHandler;
750
+ useEffect((rl) => {
751
+ let ignore = false;
752
+ const handler = withUpdates((_input, event) => {
753
+ if (ignore)
754
+ return;
755
+ signal.current(event, rl);
756
+ });
757
+ rl.input.on("keypress", handler);
758
+ return () => {
759
+ ignore = true;
760
+ rl.input.removeListener("keypress", handler);
761
+ };
762
+ }, []);
763
+ }
764
+ // node_modules/@inquirer/core/dist/lib/utils.js
765
+ var import_cli_width = __toESM(require_cli_width(), 1);
766
+
767
+ // node_modules/ansi-regex/index.js
768
+ function ansiRegex({ onlyFirst = false } = {}) {
769
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
770
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
771
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
772
+ const pattern = `${osc}|${csi}`;
773
+ return new RegExp(pattern, onlyFirst ? undefined : "g");
774
+ }
775
+
776
+ // node_modules/strip-ansi/index.js
777
+ var regex = ansiRegex();
778
+ function stripAnsi(string) {
779
+ if (typeof string !== "string") {
780
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
781
+ }
782
+ return string.replace(regex, "");
783
+ }
784
+
785
+ // node_modules/get-east-asian-width/lookup.js
786
+ function isAmbiguous(x) {
787
+ return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
788
+ }
789
+ function isFullWidth(x) {
790
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
791
+ }
792
+ function isWide(x) {
793
+ return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
794
+ }
795
+
796
+ // node_modules/get-east-asian-width/index.js
797
+ function validate(codePoint) {
798
+ if (!Number.isSafeInteger(codePoint)) {
799
+ throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
800
+ }
801
+ }
802
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
803
+ validate(codePoint);
804
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
805
+ return 2;
806
+ }
807
+ return 1;
808
+ }
809
+
810
+ // node_modules/string-width/index.js
811
+ var import_emoji_regex = __toESM(require_emoji_regex(), 1);
812
+ var segmenter = new Intl.Segmenter;
813
+ var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
814
+ function stringWidth(string, options = {}) {
815
+ if (typeof string !== "string" || string.length === 0) {
816
+ return 0;
817
+ }
818
+ const {
819
+ ambiguousIsNarrow = true,
820
+ countAnsiEscapeCodes = false
821
+ } = options;
822
+ if (!countAnsiEscapeCodes) {
823
+ string = stripAnsi(string);
824
+ }
825
+ if (string.length === 0) {
826
+ return 0;
827
+ }
828
+ let width = 0;
829
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
830
+ for (const { segment: character } of segmenter.segment(string)) {
831
+ const codePoint = character.codePointAt(0);
832
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
833
+ continue;
834
+ }
835
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
836
+ continue;
837
+ }
838
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
839
+ continue;
840
+ }
841
+ if (codePoint >= 55296 && codePoint <= 57343) {
842
+ continue;
843
+ }
844
+ if (codePoint >= 65024 && codePoint <= 65039) {
845
+ continue;
846
+ }
847
+ if (defaultIgnorableCodePointRegex.test(character)) {
848
+ continue;
849
+ }
850
+ if (import_emoji_regex.default().test(character)) {
851
+ width += 2;
852
+ continue;
853
+ }
854
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
855
+ }
856
+ return width;
857
+ }
858
+
859
+ // node_modules/ansi-styles/index.js
860
+ var ANSI_BACKGROUND_OFFSET = 10;
861
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
862
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
863
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
864
+ var styles = {
865
+ modifier: {
866
+ reset: [0, 0],
867
+ bold: [1, 22],
868
+ dim: [2, 22],
869
+ italic: [3, 23],
870
+ underline: [4, 24],
871
+ overline: [53, 55],
872
+ inverse: [7, 27],
873
+ hidden: [8, 28],
874
+ strikethrough: [9, 29]
875
+ },
876
+ color: {
877
+ black: [30, 39],
878
+ red: [31, 39],
879
+ green: [32, 39],
880
+ yellow: [33, 39],
881
+ blue: [34, 39],
882
+ magenta: [35, 39],
883
+ cyan: [36, 39],
884
+ white: [37, 39],
885
+ blackBright: [90, 39],
886
+ gray: [90, 39],
887
+ grey: [90, 39],
888
+ redBright: [91, 39],
889
+ greenBright: [92, 39],
890
+ yellowBright: [93, 39],
891
+ blueBright: [94, 39],
892
+ magentaBright: [95, 39],
893
+ cyanBright: [96, 39],
894
+ whiteBright: [97, 39]
895
+ },
896
+ bgColor: {
897
+ bgBlack: [40, 49],
898
+ bgRed: [41, 49],
899
+ bgGreen: [42, 49],
900
+ bgYellow: [43, 49],
901
+ bgBlue: [44, 49],
902
+ bgMagenta: [45, 49],
903
+ bgCyan: [46, 49],
904
+ bgWhite: [47, 49],
905
+ bgBlackBright: [100, 49],
906
+ bgGray: [100, 49],
907
+ bgGrey: [100, 49],
908
+ bgRedBright: [101, 49],
909
+ bgGreenBright: [102, 49],
910
+ bgYellowBright: [103, 49],
911
+ bgBlueBright: [104, 49],
912
+ bgMagentaBright: [105, 49],
913
+ bgCyanBright: [106, 49],
914
+ bgWhiteBright: [107, 49]
915
+ }
916
+ };
917
+ var modifierNames = Object.keys(styles.modifier);
918
+ var foregroundColorNames = Object.keys(styles.color);
919
+ var backgroundColorNames = Object.keys(styles.bgColor);
920
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
921
+ function assembleStyles() {
922
+ const codes = new Map;
923
+ for (const [groupName, group] of Object.entries(styles)) {
924
+ for (const [styleName, style] of Object.entries(group)) {
925
+ styles[styleName] = {
926
+ open: `\x1B[${style[0]}m`,
927
+ close: `\x1B[${style[1]}m`
928
+ };
929
+ group[styleName] = styles[styleName];
930
+ codes.set(style[0], style[1]);
931
+ }
932
+ Object.defineProperty(styles, groupName, {
933
+ value: group,
934
+ enumerable: false
935
+ });
936
+ }
937
+ Object.defineProperty(styles, "codes", {
938
+ value: codes,
939
+ enumerable: false
940
+ });
941
+ styles.color.close = "\x1B[39m";
942
+ styles.bgColor.close = "\x1B[49m";
943
+ styles.color.ansi = wrapAnsi16();
944
+ styles.color.ansi256 = wrapAnsi256();
945
+ styles.color.ansi16m = wrapAnsi16m();
946
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
947
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
948
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
949
+ Object.defineProperties(styles, {
950
+ rgbToAnsi256: {
951
+ value(red, green, blue) {
952
+ if (red === green && green === blue) {
953
+ if (red < 8) {
954
+ return 16;
955
+ }
956
+ if (red > 248) {
957
+ return 231;
958
+ }
959
+ return Math.round((red - 8) / 247 * 24) + 232;
960
+ }
961
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
962
+ },
963
+ enumerable: false
964
+ },
965
+ hexToRgb: {
966
+ value(hex) {
967
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
968
+ if (!matches) {
969
+ return [0, 0, 0];
970
+ }
971
+ let [colorString] = matches;
972
+ if (colorString.length === 3) {
973
+ colorString = [...colorString].map((character) => character + character).join("");
974
+ }
975
+ const integer = Number.parseInt(colorString, 16);
976
+ return [
977
+ integer >> 16 & 255,
978
+ integer >> 8 & 255,
979
+ integer & 255
980
+ ];
981
+ },
982
+ enumerable: false
983
+ },
984
+ hexToAnsi256: {
985
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
986
+ enumerable: false
987
+ },
988
+ ansi256ToAnsi: {
989
+ value(code) {
990
+ if (code < 8) {
991
+ return 30 + code;
992
+ }
993
+ if (code < 16) {
994
+ return 90 + (code - 8);
995
+ }
996
+ let red;
997
+ let green;
998
+ let blue;
999
+ if (code >= 232) {
1000
+ red = ((code - 232) * 10 + 8) / 255;
1001
+ green = red;
1002
+ blue = red;
1003
+ } else {
1004
+ code -= 16;
1005
+ const remainder = code % 36;
1006
+ red = Math.floor(code / 36) / 5;
1007
+ green = Math.floor(remainder / 6) / 5;
1008
+ blue = remainder % 6 / 5;
1009
+ }
1010
+ const value = Math.max(red, green, blue) * 2;
1011
+ if (value === 0) {
1012
+ return 30;
1013
+ }
1014
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1015
+ if (value === 2) {
1016
+ result += 60;
1017
+ }
1018
+ return result;
1019
+ },
1020
+ enumerable: false
1021
+ },
1022
+ rgbToAnsi: {
1023
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
1024
+ enumerable: false
1025
+ },
1026
+ hexToAnsi: {
1027
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
1028
+ enumerable: false
1029
+ }
1030
+ });
1031
+ return styles;
1032
+ }
1033
+ var ansiStyles = assembleStyles();
1034
+ var ansi_styles_default = ansiStyles;
1035
+
1036
+ // node_modules/wrap-ansi/index.js
1037
+ var ESCAPES = new Set([
1038
+ "\x1B",
1039
+ "›"
1040
+ ]);
1041
+ var END_CODE = 39;
1042
+ var ANSI_ESCAPE_BELL = "\x07";
1043
+ var ANSI_CSI = "[";
1044
+ var ANSI_OSC = "]";
1045
+ var ANSI_SGR_TERMINATOR = "m";
1046
+ var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
1047
+ var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
1048
+ var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
1049
+ var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
1050
+ var wrapWord = (rows, word, columns) => {
1051
+ const characters = [...word];
1052
+ let isInsideEscape = false;
1053
+ let isInsideLinkEscape = false;
1054
+ let visible = stringWidth(stripAnsi(rows.at(-1)));
1055
+ for (const [index, character] of characters.entries()) {
1056
+ const characterLength = stringWidth(character);
1057
+ if (visible + characterLength <= columns) {
1058
+ rows[rows.length - 1] += character;
1059
+ } else {
1060
+ rows.push(character);
1061
+ visible = 0;
1062
+ }
1063
+ if (ESCAPES.has(character)) {
1064
+ isInsideEscape = true;
1065
+ const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
1066
+ isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
1067
+ }
1068
+ if (isInsideEscape) {
1069
+ if (isInsideLinkEscape) {
1070
+ if (character === ANSI_ESCAPE_BELL) {
1071
+ isInsideEscape = false;
1072
+ isInsideLinkEscape = false;
1073
+ }
1074
+ } else if (character === ANSI_SGR_TERMINATOR) {
1075
+ isInsideEscape = false;
1076
+ }
1077
+ continue;
1078
+ }
1079
+ visible += characterLength;
1080
+ if (visible === columns && index < characters.length - 1) {
1081
+ rows.push("");
1082
+ visible = 0;
1083
+ }
1084
+ }
1085
+ if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
1086
+ rows[rows.length - 2] += rows.pop();
1087
+ }
1088
+ };
1089
+ var stringVisibleTrimSpacesRight = (string) => {
1090
+ const words = string.split(" ");
1091
+ let last = words.length;
1092
+ while (last > 0) {
1093
+ if (stringWidth(words[last - 1]) > 0) {
1094
+ break;
1095
+ }
1096
+ last--;
1097
+ }
1098
+ if (last === words.length) {
1099
+ return string;
1100
+ }
1101
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
1102
+ };
1103
+ var exec = (string, columns, options = {}) => {
1104
+ if (options.trim !== false && string.trim() === "") {
1105
+ return "";
1106
+ }
1107
+ let returnValue = "";
1108
+ let escapeCode;
1109
+ let escapeUrl;
1110
+ const lengths = wordLengths(string);
1111
+ let rows = [""];
1112
+ for (const [index, word] of string.split(" ").entries()) {
1113
+ if (options.trim !== false) {
1114
+ rows[rows.length - 1] = rows.at(-1).trimStart();
1115
+ }
1116
+ let rowLength = stringWidth(rows.at(-1));
1117
+ if (index !== 0) {
1118
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
1119
+ rows.push("");
1120
+ rowLength = 0;
1121
+ }
1122
+ if (rowLength > 0 || options.trim === false) {
1123
+ rows[rows.length - 1] += " ";
1124
+ rowLength++;
1125
+ }
1126
+ }
1127
+ if (options.hard && lengths[index] > columns) {
1128
+ const remainingColumns = columns - rowLength;
1129
+ const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
1130
+ const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
1131
+ if (breaksStartingNextLine < breaksStartingThisLine) {
1132
+ rows.push("");
1133
+ }
1134
+ wrapWord(rows, word, columns);
1135
+ continue;
1136
+ }
1137
+ if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
1138
+ if (options.wordWrap === false && rowLength < columns) {
1139
+ wrapWord(rows, word, columns);
1140
+ continue;
1141
+ }
1142
+ rows.push("");
1143
+ }
1144
+ if (rowLength + lengths[index] > columns && options.wordWrap === false) {
1145
+ wrapWord(rows, word, columns);
1146
+ continue;
1147
+ }
1148
+ rows[rows.length - 1] += word;
1149
+ }
1150
+ if (options.trim !== false) {
1151
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
1152
+ }
1153
+ const preString = rows.join(`
1154
+ `);
1155
+ const pre = [...preString];
1156
+ let preStringIndex = 0;
1157
+ for (const [index, character] of pre.entries()) {
1158
+ returnValue += character;
1159
+ if (ESCAPES.has(character)) {
1160
+ const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
1161
+ if (groups.code !== undefined) {
1162
+ const code2 = Number.parseFloat(groups.code);
1163
+ escapeCode = code2 === END_CODE ? undefined : code2;
1164
+ } else if (groups.uri !== undefined) {
1165
+ escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
1166
+ }
1167
+ }
1168
+ const code = ansi_styles_default.codes.get(Number(escapeCode));
1169
+ if (pre[index + 1] === `
1170
+ `) {
1171
+ if (escapeUrl) {
1172
+ returnValue += wrapAnsiHyperlink("");
1173
+ }
1174
+ if (escapeCode && code) {
1175
+ returnValue += wrapAnsiCode(code);
1176
+ }
1177
+ } else if (character === `
1178
+ `) {
1179
+ if (escapeCode && code) {
1180
+ returnValue += wrapAnsiCode(escapeCode);
1181
+ }
1182
+ if (escapeUrl) {
1183
+ returnValue += wrapAnsiHyperlink(escapeUrl);
1184
+ }
1185
+ }
1186
+ preStringIndex += character.length;
1187
+ }
1188
+ return returnValue;
1189
+ };
1190
+ function wrapAnsi(string, columns, options) {
1191
+ return String(string).normalize().replaceAll(`\r
1192
+ `, `
8
1193
  `).split(`
9
- `).map((C)=>VF(C,u,F)).join(`
10
- `)}function FD(D,u){return D.split(`
11
- `).flatMap((F)=>PD(F,u,{trim:!1,hard:!0}).split(`
12
- `).map((C)=>C.trimEnd())).join(`
13
- `)}function GD(){return Mu.default({defaultWidth:80,output:TD().output})}function LF({active:D,renderedItems:u,pageSize:F,loop:C}){let E=QD({lastPointer:D,lastActive:void 0}),{lastPointer:B,lastActive:A}=E.current,$=Math.floor(F/2),Z=u.reduce((G,Y)=>G+Y.length,0),Q=u.slice(0,D).reduce((G,Y)=>G+Y.length,0),X=Q;if(Z>F)if(C){if(X=B,A!=null&&A<D&&D-A<F)X=Math.min($,Math.abs(D-A)===1?Math.min(B+(u[A]?.length??0),Math.max(Q,B)):B+D-A)}else{let G=u.slice(D).reduce((Y,q)=>Y+q.length,0);X=G<F-$?F-G:Math.min(Q,$)}return E.current.lastPointer=X,E.current.lastActive=D,X}function SD({items:D,active:u,renderItem:F,pageSize:C,loop:E=!0}){let B=GD(),A=(O)=>(O%D.length+D.length)%D.length,$=D.map((O,W)=>{if(O==null)return[];return FD(F({item:O,index:W,isActive:W===u}),B).split(`
14
- `)}),Z=$.reduce((O,W)=>O+W.length,0),Q=(O)=>$[O]??[],X=LF({active:u,renderedItems:$,pageSize:C,loop:E}),G=Q(u).slice(0,C),Y=X+G.length<=C?X:C-G.length,q=Array.from({length:C});q.splice(Y,G.length,...G);let K=new Set([u]),U=Y+G.length,_=A(u+1);while(U<C&&!K.has(_)&&(E&&Z>C?_!==u:_>u)){let W=Q(_).slice(0,C-U);q.splice(U,W.length,...W),K.add(_),U+=W.length,_=A(_+1)}U=Y-1,_=A(u-1);while(U>=0&&!K.has(_)&&(E&&Z>C?_!==u:_<u)){let O=Q(_),W=O.slice(Math.max(0,O.length-U-1));q.splice(U-W.length+1,W.length,...W),K.add(_),U-=W.length,_=A(_-1)}return q.filter((O)=>typeof O==="string").join(`
15
- `)}var Pu=zD(Ju(),1);import*as ju from"node:readline";import{AsyncResource as PF}from"node:async_hooks";var l=[];l.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")l.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")l.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var YD=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",bD=Symbol.for("signal-exit emitter"),vD=globalThis,fF=Object.defineProperty.bind(Object);class Vu{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vD[bD])return vD[bD];fF(vD,bD,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,u){this.listeners[D].push(u)}removeListener(D,u){let F=this.listeners[D],C=F.indexOf(u);if(C===-1)return;if(C===0&&F.length===1)F.length=0;else F.splice(C,1)}emit(D,u,F){if(this.emitted[D])return!1;this.emitted[D]=!0;let C=!1;for(let E of this.listeners[D])C=E(u,F)===!0||C;if(D==="exit")C=this.emit("afterExit",u,F)||C;return C}}class wD{}var xF=(D)=>{return{onExit(u,F){return D.onExit(u,F)},load(){return D.load()},unload(){return D.unload()}}};class Lu extends wD{onExit(){return()=>{}}load(){}unload(){}}class Tu extends wD{#F=yD.platform==="win32"?"SIGINT":"SIGHUP";#u=new Vu;#D;#B;#A;#E={};#C=!1;constructor(D){super();this.#D=D,this.#E={};for(let u of l)this.#E[u]=()=>{let F=this.#D.listeners(u),{count:C}=this.#u,E=D;if(typeof E.__signal_exit_emitter__==="object"&&typeof E.__signal_exit_emitter__.count==="number")C+=E.__signal_exit_emitter__.count;if(F.length===C){this.unload();let B=this.#u.emit("exit",null,u),A=u==="SIGHUP"?this.#F:u;if(!B)D.kill(D.pid,A)}};this.#A=D.reallyExit,this.#B=D.emit}onExit(D,u){if(!YD(this.#D))return()=>{};if(this.#C===!1)this.load();let F=u?.alwaysLast?"afterExit":"exit";return this.#u.on(F,D),()=>{if(this.#u.removeListener(F,D),this.#u.listeners.exit.length===0&&this.#u.listeners.afterExit.length===0)this.unload()}}load(){if(this.#C)return;this.#C=!0,this.#u.count+=1;for(let D of l)try{let u=this.#E[D];if(u)this.#D.on(D,u)}catch(u){}this.#D.emit=(D,...u)=>{return this.#Q(D,...u)},this.#D.reallyExit=(D)=>{return this.#$(D)}}unload(){if(!this.#C)return;this.#C=!1,l.forEach((D)=>{let u=this.#E[D];if(!u)throw Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,u)}catch(F){}}),this.#D.emit=this.#B,this.#D.reallyExit=this.#A,this.#u.count-=1}#$(D){if(!YD(this.#D))return 0;return this.#D.exitCode=D||0,this.#u.emit("exit",this.#D.exitCode,null),this.#A.call(this.#D,this.#D.exitCode)}#Q(D,...u){let F=this.#B;if(D==="exit"&&YD(this.#D)){if(typeof u[0]==="number")this.#D.exitCode=u[0];let C=F.call(this.#D,D,...u);return this.#u.emit("exit",this.#D.exitCode,null),C}else return F.call(this.#D,D,...u)}}var yD=globalThis.process,{onExit:fu,load:W2,unload:K2}=xF(YD(yD)?new Tu(yD):new Lu);import{stripVTControlCharacters as IF}from"node:util";var HF="\x1B[G";var Hu="\x1B[?25h",kD=(D=1)=>D>0?`\x1B[${D}A`:"",hD=(D=1)=>D>0?`\x1B[${D}B`:"",gD=(D,u)=>{if(typeof u==="number"&&!Number.isNaN(u))return`\x1B[${u+1};${D+1}H`;return`\x1B[${D+1}G`},xu="\x1B[2K",mD=(D)=>D>0?(xu+kD(1)).repeat(D-1)+xu+HF:"";var Iu=(D)=>D.split(`
16
- `).length,jF=(D)=>D.split(`
17
- `).pop()??"";class qD{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(D){this.rl=D,this.cursorPos=D.getCursorPos()}write(D){this.rl.output.unmute(),this.rl.output.write(D),this.rl.output.mute()}render(D,u=""){let F=jF(D),C=IF(F),E=C;if(this.rl.line.length>0)E=E.slice(0,-this.rl.line.length);this.rl.setPrompt(E),this.cursorPos=this.rl.getCursorPos();let B=GD();if(D=FD(D,B),u=FD(u,B),C.length%B===0)D+=`
18
- `;let A=D+(u?`
19
- `+u:""),Z=Math.floor(C.length/B)-this.cursorPos.rows+(u?Iu(u):0);if(Z>0)A+=kD(Z);A+=gD(this.cursorPos.cols),this.write(hD(this.extraLinesUnderPrompt)+mD(this.height)+A),this.extraLinesUnderPrompt=Z,this.height=Iu(A)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(gD(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let u=hD(this.extraLinesUnderPrompt);u+=D?mD(this.height):`
20
- `,u+=Hu,this.write(u),this.rl.close()}}class pD extends Promise{static withResolver(){let D,u;return{promise:new Promise((C,E)=>{D=C,u=E}),resolve:D,reject:u}}}function SF(){let D=Error.prepareStackTrace,u=[];try{Error.prepareStackTrace=(F,C)=>{let E=C.slice(1);return u=E,E},Error().stack}catch{return u}return Error.prepareStackTrace=D,u}function n(D){let u=SF();return(C,E={})=>{let{input:B=process.stdin,signal:A}=E,$=new Set,Z=new Pu.default;Z.pipe(E.output??process.stdout);let Q=ju.createInterface({terminal:!0,input:B,output:Z}),X=new qD(Q),{promise:G,resolve:Y,reject:q}=pD.withResolver(),K=()=>q(new JD);if(A){let O=()=>q(new RD({cause:A.reason}));if(A.aborted)return O(),Object.assign(G,{cancel:K});A.addEventListener("abort",O),$.add(()=>A.removeEventListener("abort",O))}$.add(fu((O,W)=>{q(new $D(`User force closed the prompt with ${O} ${W}`))}));let U=()=>q(new $D("User force closed the prompt with SIGINT"));Q.on("SIGINT",U),$.add(()=>Q.removeListener("SIGINT",U));let _=()=>X.checkCursorPos();return Q.input.on("keypress",_),$.add(()=>Q.input.removeListener("keypress",_)),rD(Q,(O)=>{let W=PF.bind(()=>g.clearAll());return Q.on("close",W),$.add(()=>Q.removeListener("close",W)),O(()=>{try{let M=D(C,(I)=>{setImmediate(()=>Y(I))});if(M===void 0){let I=u[1]?.getFileName();throw Error(`Prompt functions must return a string.
21
- at ${I}`)}let[z,R]=typeof M==="string"?[M]:M;X.render(z,R),g.run()}catch(M){q(M)}}),Object.assign(G.then((M)=>{return g.clearAll(),M},(M)=>{throw g.clearAll(),M}).finally(()=>{$.forEach((M)=>M()),X.done({clearContent:Boolean(E.clearPromptOnDone)}),Z.end()}).then(()=>G),{cancel:K})})}}import{styleText as bF}from"node:util";class s{separator=bF("dim",Array.from({length:15}).join(o.line));type="separator";constructor(D){if(D)this.separator=D}static isSeparator(D){return Boolean(D&&typeof D==="object"&&"type"in D&&D.type==="separator")}}function Su(D,u){let F=u!==!1;if(/^(y|yes)/i.test(D))F=!0;else if(/^(n|no)/i.test(D))F=!1;return F}function bu(D){return D?"Yes":"No"}var dD=n((D,u)=>{let{transformer:F=bu}=D,[C,E]=L("idle"),[B,A]=L(""),$=b(D.theme),Z=m({status:C,theme:$});p((Y,q)=>{if(C!=="idle")return;if(k(Y)){let K=Su(B,D.default);A(F(K)),E("done"),u(K)}else if(w(Y)){let K=bu(!Su(B,D.default));q.clearLine(0),q.write(K),A(K)}else A(q.line)});let Q=B,X="";if(C==="done")Q=$.style.answer(B);else X=` ${$.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let G=$.style.message(D.message,C);return`${Z} ${G}${X} ${Q}`});var vF={validationFailureMode:"keep"},OD=n((D,u)=>{let{prefill:F="tab"}=D,C=b(vF,D.theme),[E,B]=L("idle"),[A="",$]=L(D.default),[Z,Q]=L(),[X,G]=L(""),Y=m({status:E,theme:C});async function q(W){let{required:M,pattern:z,patternError:R="Invalid input"}=D;if(M&&!W)return"You must provide a value";if(z&&!z.test(W))return R;if(typeof D.validate==="function")return await D.validate(W)||"You must provide a valid value";return!0}p(async(W,M)=>{if(E!=="idle")return;if(k(W)){let z=X||A;B("loading");let R=await q(z);if(R===!0)G(z),B("done"),u(z);else{if(C.validationFailureMode==="clear")G("");else M.write(X);Q(R),B("idle")}}else if(ND(W)&&!X)$(void 0);else if(w(W)&&!X)$(void 0),M.clearLine(0),M.write(A),G(A);else G(M.line),Q(void 0)}),S((W)=>{if(F==="editable"&&A)W.write(A),G(A)},[]);let K=C.style.message(D.message,E),U=X;if(typeof D.transformer==="function")U=D.transformer(X,{isFinal:E==="done"});else if(E==="done")U=C.style.answer(X);let _;if(A&&E!=="done"&&!X)_=C.style.defaultAnswer(A);let O="";if(Z)O=C.style.error(Z);return[[Y,K,_,U].filter((W)=>W!==void 0).join(" "),O]});import{styleText as e}from"node:util";var yF={icon:{cursor:o.pointer},style:{disabled:(D)=>e("dim",`- ${D}`),searchTerm:(D)=>e("cyan",D),description:(D)=>e("cyan",D),keysHelpTip:(D)=>D.map(([u,F])=>`${e("bold",u)} ${e("dim",F)}`).join(e("dim"," • "))}};function lD(D){return!s.isSeparator(D)&&!D.disabled}function wF(D){return D.map((u)=>{if(s.isSeparator(u))return u;if(typeof u==="string")return{value:u,name:u,short:u,disabled:!1};let F=u.name??String(u.value),C={value:u.value,name:F,short:u.short??F,disabled:u.disabled??!1};if(u.description)C.description=u.description;return C})}var CD=n((D,u)=>{let{pageSize:F=7,validate:C=()=>!0}=D,E=b(yF,D.theme),[B,A]=L("loading"),[$,Z]=L(""),[Q,X]=L([]),[G,Y]=L(),q=m({status:B,theme:E}),K=xD(()=>{let J=Q.findIndex(lD),T=Q.findLastIndex(lD);return{first:J,last:T}},[Q]),[U=K.first,_]=L();S(()=>{let J=new AbortController;return A("loading"),Y(void 0),(async()=>{try{let f=await D.source($||void 0,{signal:J.signal});if(!J.signal.aborted)_(void 0),Y(void 0),X(wF(f)),A("idle")}catch(f){if(!J.signal.aborted&&f instanceof Error)Y(f.message)}})(),()=>{J.abort()}},[$]);let O=Q[U];p(async(J,T)=>{if(k(J))if(O){A("loading");let f=await C(O.value);if(A("idle"),f===!0)A("done"),u(O.value);else if(O.name===$)Y(f||"You must provide a valid value");else T.write(O.name),Z(O.name)}else T.write($);else if(w(J)&&O)T.clearLine(0),T.write(O.name),Z(O.name);else if(B!=="loading"&&(DD(J)||AD(J))){if(T.clearLine(0),DD(J)&&U!==K.first||AD(J)&&U!==K.last){let f=DD(J)?-1:1,t=U;do t=(t+f+Q.length)%Q.length;while(!lD(Q[t]));_(t)}}else Z(T.line)});let W=E.style.message(D.message,B),M=E.style.keysHelpTip([["↑↓","navigate"],["⏎","select"]]),z=SD({items:Q,active:U,renderItem({item:J,isActive:T}){if(s.isSeparator(J))return` ${J.separator}`;if(J.disabled){let _D=typeof J.disabled==="string"?J.disabled:"(disabled)";return E.style.disabled(`${J.name} ${_D}`)}let f=T?E.style.highlight:(_D)=>_D,t=T?E.icon.cursor:" ";return f(`${t} ${J.name}`)},pageSize:F,loop:!1}),R;if(G)R=E.style.error(G);else if(Q.length===0&&$!==""&&B==="idle")R=E.style.error("No results found");let I;if(B==="done"&&O)return[q,W,E.style.answer(O.short)].filter(Boolean).join(" ").trimEnd();else I=E.style.searchTerm($);let i=O?.description,ED=[q,W,I].filter(Boolean).join(" ").trimEnd(),BD=[R??z," ",i?E.style.description(i):"",M].filter(Boolean).join(`
22
- `).trimEnd();return[ED,BD]});import{mkdir as kF}from"node:fs/promises";function V(...D){let u=D.filter(Boolean).map((B,A)=>{let $=B.trim();if(A===0)$=$.replace(/\/+$/g,"");else $=$.replace(/^\/+/g,"").replace(/\/+$/g,"");return $}).filter((B)=>B.length>0);if(u.length===0)return"";let F=u.join("/");return(D.find((B)=>(B??"").trim().length>0)??"").trim().startsWith("/")?F.startsWith("/")?F:`/${F}`:F}function hF(D){let u=Bun.env.HOME||Bun.env.USERPROFILE||"";if(!u)return D;if(D==="~")return u;if(D.startsWith("~/"))return`${u}/${D.slice(2)}`;return D}function vu(D){if(typeof D==="string"&&D.trim())return hF(D.trim());let u=Bun.env.HOME||Bun.env.USERPROFILE||".";return V(u,".work")}async function c(D){await kF(D,{recursive:!0})}async function v(D){await c(D),await c(V(D,"data"))}async function H(D,u){try{let F=Bun.file(D);if(!await F.exists())return u;let E=await F.text();return JSON.parse(E)}catch{return u}}async function y(D,u){let F=JSON.stringify(u,null,2)+`
23
- `;await Bun.write(D,F)}function P(){return new Date().toISOString()}function yu(D){let u={},F=[];for(let B=0;B<D.length;B++){let A=D[B];if(A.startsWith("--")){let $=A.slice(2),Z=D[B+1];if(!Z||Z.startsWith("-"))u[$]=!0;else u[$]=Z,B++}else F.push(A)}let C=F[0],E=F.slice(1);return{cmd:C,rest:E,flags:u}}import{appendFile as gF,readFile as mF,writeFile as pF,access as dF}from"node:fs/promises";import{constants as lF}from"node:fs";var wu=`id,startAt,endAt,task,note,createdAt,updatedAt,deletedAt
24
- `;function nF(D){let u=(D??"").toString();if(/[,"\n\r]/.test(u))return`"${u.replace(/"/g,'""')}"`;return u}async function ku(D){try{return await dF(D,lF.F_OK),!0}catch{return!1}}async function hu(D){if(!await ku(D))await pF(D,wu,"utf-8")}async function gu(D,u){let F=[u.id,u.startAt,u.endAt,u.task,u.note,u.createdAt,u.updatedAt,u.deletedAt].map(nF).join(",")+`
25
- `;await gF(D,F,"utf-8")}function cF(D){if(D.startsWith('"')&&D.endsWith('"'))return D.slice(1,-1).replace(/""/g,'"');return D}function aF(D){let u=[],F="",C=!1;for(let E=0;E<D.length;E++){let B=D[E];if(B==='"'){let A=D[E+1];if(C&&A==='"')F+='"',E++;else C=!C;continue}if(B===","&&!C){u.push(F),F="";continue}F+=B}return u.push(F),u.map(cF)}async function mu(D){if(!await ku(D))return[];let F=(await mF(D,"utf-8")).split(/\r?\n/).filter((B)=>B.trim().length>0);if(F.length<=1)return[];if(F[0]?.trim()!==wu.trim())throw Error(`Unexpected CSV header in ${D}`);let E=[];for(let B=1;B<F.length;B++){let A=aF(F[B]||"");if(A.length<8)continue;E.push({id:A[0]??"",startAt:A[1]??"",endAt:A[2]??"",task:A[3]??"",note:A[4]??"",createdAt:A[5]??"",updatedAt:A[6]??"",deletedAt:A[7]??""})}return E}function WD(D){let u=Math.max(0,Math.floor(D/1000)),F=Math.floor(u/3600),C=Math.floor(u%3600/60),E=u%60;return`${String(F).padStart(2,"0")}:${String(C).padStart(2,"0")}:${String(E).padStart(2,"0")}`}function pu(){console.log(`
1194
+ `).map((line) => exec(line, columns, options)).join(`
1195
+ `);
1196
+ }
1197
+
1198
+ // node_modules/@inquirer/core/dist/lib/utils.js
1199
+ function breakLines(content, width) {
1200
+ return content.split(`
1201
+ `).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
1202
+ `).map((str) => str.trimEnd())).join(`
1203
+ `);
1204
+ }
1205
+ function readlineWidth() {
1206
+ return import_cli_width.default({ defaultWidth: 80, output: readline().output });
1207
+ }
1208
+
1209
+ // node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
1210
+ function usePointerPosition({ active, renderedItems, pageSize, loop }) {
1211
+ const state = useRef({
1212
+ lastPointer: active,
1213
+ lastActive: undefined
1214
+ });
1215
+ const { lastPointer, lastActive } = state.current;
1216
+ const middle = Math.floor(pageSize / 2);
1217
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
1218
+ const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
1219
+ let pointer = defaultPointerPosition;
1220
+ if (renderedLength > pageSize) {
1221
+ if (loop) {
1222
+ pointer = lastPointer;
1223
+ if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
1224
+ pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
1225
+ }
1226
+ } else {
1227
+ const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
1228
+ pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
1229
+ }
1230
+ }
1231
+ state.current.lastPointer = pointer;
1232
+ state.current.lastActive = active;
1233
+ return pointer;
1234
+ }
1235
+ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
1236
+ const width = readlineWidth();
1237
+ const bound = (num) => (num % items.length + items.length) % items.length;
1238
+ const renderedItems = items.map((item, index) => {
1239
+ if (item == null)
1240
+ return [];
1241
+ return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
1242
+ `);
1243
+ });
1244
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
1245
+ const renderItemAtIndex = (index) => renderedItems[index] ?? [];
1246
+ const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
1247
+ const activeItem = renderItemAtIndex(active).slice(0, pageSize);
1248
+ const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
1249
+ const pageBuffer = Array.from({ length: pageSize });
1250
+ pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
1251
+ const itemVisited = new Set([active]);
1252
+ let bufferPointer = activeItemPosition + activeItem.length;
1253
+ let itemPointer = bound(active + 1);
1254
+ while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
1255
+ const lines = renderItemAtIndex(itemPointer);
1256
+ const linesToAdd = lines.slice(0, pageSize - bufferPointer);
1257
+ pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
1258
+ itemVisited.add(itemPointer);
1259
+ bufferPointer += linesToAdd.length;
1260
+ itemPointer = bound(itemPointer + 1);
1261
+ }
1262
+ bufferPointer = activeItemPosition - 1;
1263
+ itemPointer = bound(active - 1);
1264
+ while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
1265
+ const lines = renderItemAtIndex(itemPointer);
1266
+ const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
1267
+ pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
1268
+ itemVisited.add(itemPointer);
1269
+ bufferPointer -= linesToAdd.length;
1270
+ itemPointer = bound(itemPointer - 1);
1271
+ }
1272
+ return pageBuffer.filter((line) => typeof line === "string").join(`
1273
+ `);
1274
+ }
1275
+ // node_modules/@inquirer/core/dist/lib/create-prompt.js
1276
+ var import_mute_stream = __toESM(require_lib(), 1);
1277
+ import * as readline2 from "node:readline";
1278
+ import { AsyncResource as AsyncResource3 } from "node:async_hooks";
1279
+
1280
+ // node_modules/signal-exit/dist/mjs/signals.js
1281
+ var signals = [];
1282
+ signals.push("SIGHUP", "SIGINT", "SIGTERM");
1283
+ if (process.platform !== "win32") {
1284
+ signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
1285
+ }
1286
+ if (process.platform === "linux") {
1287
+ signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1288
+ }
1289
+
1290
+ // node_modules/signal-exit/dist/mjs/index.js
1291
+ var processOk = (process3) => !!process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
1292
+ var kExitEmitter = Symbol.for("signal-exit emitter");
1293
+ var global = globalThis;
1294
+ var ObjectDefineProperty = Object.defineProperty.bind(Object);
1295
+
1296
+ class Emitter {
1297
+ emitted = {
1298
+ afterExit: false,
1299
+ exit: false
1300
+ };
1301
+ listeners = {
1302
+ afterExit: [],
1303
+ exit: []
1304
+ };
1305
+ count = 0;
1306
+ id = Math.random();
1307
+ constructor() {
1308
+ if (global[kExitEmitter]) {
1309
+ return global[kExitEmitter];
1310
+ }
1311
+ ObjectDefineProperty(global, kExitEmitter, {
1312
+ value: this,
1313
+ writable: false,
1314
+ enumerable: false,
1315
+ configurable: false
1316
+ });
1317
+ }
1318
+ on(ev, fn) {
1319
+ this.listeners[ev].push(fn);
1320
+ }
1321
+ removeListener(ev, fn) {
1322
+ const list = this.listeners[ev];
1323
+ const i = list.indexOf(fn);
1324
+ if (i === -1) {
1325
+ return;
1326
+ }
1327
+ if (i === 0 && list.length === 1) {
1328
+ list.length = 0;
1329
+ } else {
1330
+ list.splice(i, 1);
1331
+ }
1332
+ }
1333
+ emit(ev, code, signal) {
1334
+ if (this.emitted[ev]) {
1335
+ return false;
1336
+ }
1337
+ this.emitted[ev] = true;
1338
+ let ret = false;
1339
+ for (const fn of this.listeners[ev]) {
1340
+ ret = fn(code, signal) === true || ret;
1341
+ }
1342
+ if (ev === "exit") {
1343
+ ret = this.emit("afterExit", code, signal) || ret;
1344
+ }
1345
+ return ret;
1346
+ }
1347
+ }
1348
+
1349
+ class SignalExitBase {
1350
+ }
1351
+ var signalExitWrap = (handler) => {
1352
+ return {
1353
+ onExit(cb, opts) {
1354
+ return handler.onExit(cb, opts);
1355
+ },
1356
+ load() {
1357
+ return handler.load();
1358
+ },
1359
+ unload() {
1360
+ return handler.unload();
1361
+ }
1362
+ };
1363
+ };
1364
+
1365
+ class SignalExitFallback extends SignalExitBase {
1366
+ onExit() {
1367
+ return () => {};
1368
+ }
1369
+ load() {}
1370
+ unload() {}
1371
+ }
1372
+
1373
+ class SignalExit extends SignalExitBase {
1374
+ #hupSig = process3.platform === "win32" ? "SIGINT" : "SIGHUP";
1375
+ #emitter = new Emitter;
1376
+ #process;
1377
+ #originalProcessEmit;
1378
+ #originalProcessReallyExit;
1379
+ #sigListeners = {};
1380
+ #loaded = false;
1381
+ constructor(process3) {
1382
+ super();
1383
+ this.#process = process3;
1384
+ this.#sigListeners = {};
1385
+ for (const sig of signals) {
1386
+ this.#sigListeners[sig] = () => {
1387
+ const listeners = this.#process.listeners(sig);
1388
+ let { count } = this.#emitter;
1389
+ const p = process3;
1390
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
1391
+ count += p.__signal_exit_emitter__.count;
1392
+ }
1393
+ if (listeners.length === count) {
1394
+ this.unload();
1395
+ const ret = this.#emitter.emit("exit", null, sig);
1396
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
1397
+ if (!ret)
1398
+ process3.kill(process3.pid, s);
1399
+ }
1400
+ };
1401
+ }
1402
+ this.#originalProcessReallyExit = process3.reallyExit;
1403
+ this.#originalProcessEmit = process3.emit;
1404
+ }
1405
+ onExit(cb, opts) {
1406
+ if (!processOk(this.#process)) {
1407
+ return () => {};
1408
+ }
1409
+ if (this.#loaded === false) {
1410
+ this.load();
1411
+ }
1412
+ const ev = opts?.alwaysLast ? "afterExit" : "exit";
1413
+ this.#emitter.on(ev, cb);
1414
+ return () => {
1415
+ this.#emitter.removeListener(ev, cb);
1416
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
1417
+ this.unload();
1418
+ }
1419
+ };
1420
+ }
1421
+ load() {
1422
+ if (this.#loaded) {
1423
+ return;
1424
+ }
1425
+ this.#loaded = true;
1426
+ this.#emitter.count += 1;
1427
+ for (const sig of signals) {
1428
+ try {
1429
+ const fn = this.#sigListeners[sig];
1430
+ if (fn)
1431
+ this.#process.on(sig, fn);
1432
+ } catch (_) {}
1433
+ }
1434
+ this.#process.emit = (ev, ...a) => {
1435
+ return this.#processEmit(ev, ...a);
1436
+ };
1437
+ this.#process.reallyExit = (code) => {
1438
+ return this.#processReallyExit(code);
1439
+ };
1440
+ }
1441
+ unload() {
1442
+ if (!this.#loaded) {
1443
+ return;
1444
+ }
1445
+ this.#loaded = false;
1446
+ signals.forEach((sig) => {
1447
+ const listener = this.#sigListeners[sig];
1448
+ if (!listener) {
1449
+ throw new Error("Listener not defined for signal: " + sig);
1450
+ }
1451
+ try {
1452
+ this.#process.removeListener(sig, listener);
1453
+ } catch (_) {}
1454
+ });
1455
+ this.#process.emit = this.#originalProcessEmit;
1456
+ this.#process.reallyExit = this.#originalProcessReallyExit;
1457
+ this.#emitter.count -= 1;
1458
+ }
1459
+ #processReallyExit(code) {
1460
+ if (!processOk(this.#process)) {
1461
+ return 0;
1462
+ }
1463
+ this.#process.exitCode = code || 0;
1464
+ this.#emitter.emit("exit", this.#process.exitCode, null);
1465
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1466
+ }
1467
+ #processEmit(ev, ...args) {
1468
+ const og = this.#originalProcessEmit;
1469
+ if (ev === "exit" && processOk(this.#process)) {
1470
+ if (typeof args[0] === "number") {
1471
+ this.#process.exitCode = args[0];
1472
+ }
1473
+ const ret = og.call(this.#process, ev, ...args);
1474
+ this.#emitter.emit("exit", this.#process.exitCode, null);
1475
+ return ret;
1476
+ } else {
1477
+ return og.call(this.#process, ev, ...args);
1478
+ }
1479
+ }
1480
+ }
1481
+ var process3 = globalThis.process;
1482
+ var {
1483
+ onExit,
1484
+ load,
1485
+ unload
1486
+ } = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
1487
+
1488
+ // node_modules/@inquirer/core/dist/lib/screen-manager.js
1489
+ import { stripVTControlCharacters } from "node:util";
1490
+
1491
+ // node_modules/@inquirer/ansi/dist/index.js
1492
+ var ESC = "\x1B[";
1493
+ var cursorLeft = ESC + "G";
1494
+ var cursorHide = ESC + "?25l";
1495
+ var cursorShow = ESC + "?25h";
1496
+ var cursorUp = (rows = 1) => rows > 0 ? `${ESC}${rows}A` : "";
1497
+ var cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : "";
1498
+ var cursorTo = (x, y) => {
1499
+ if (typeof y === "number" && !Number.isNaN(y)) {
1500
+ return `${ESC}${y + 1};${x + 1}H`;
1501
+ }
1502
+ return `${ESC}${x + 1}G`;
1503
+ };
1504
+ var eraseLine = ESC + "2K";
1505
+ var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
1506
+
1507
+ // node_modules/@inquirer/core/dist/lib/screen-manager.js
1508
+ var height = (content) => content.split(`
1509
+ `).length;
1510
+ var lastLine = (content) => content.split(`
1511
+ `).pop() ?? "";
1512
+
1513
+ class ScreenManager {
1514
+ height = 0;
1515
+ extraLinesUnderPrompt = 0;
1516
+ cursorPos;
1517
+ rl;
1518
+ constructor(rl) {
1519
+ this.rl = rl;
1520
+ this.cursorPos = rl.getCursorPos();
1521
+ }
1522
+ write(content) {
1523
+ this.rl.output.unmute();
1524
+ this.rl.output.write(content);
1525
+ this.rl.output.mute();
1526
+ }
1527
+ render(content, bottomContent = "") {
1528
+ const promptLine = lastLine(content);
1529
+ const rawPromptLine = stripVTControlCharacters(promptLine);
1530
+ let prompt = rawPromptLine;
1531
+ if (this.rl.line.length > 0) {
1532
+ prompt = prompt.slice(0, -this.rl.line.length);
1533
+ }
1534
+ this.rl.setPrompt(prompt);
1535
+ this.cursorPos = this.rl.getCursorPos();
1536
+ const width = readlineWidth();
1537
+ content = breakLines(content, width);
1538
+ bottomContent = breakLines(bottomContent, width);
1539
+ if (rawPromptLine.length % width === 0) {
1540
+ content += `
1541
+ `;
1542
+ }
1543
+ let output = content + (bottomContent ? `
1544
+ ` + bottomContent : "");
1545
+ const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
1546
+ const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
1547
+ if (bottomContentHeight > 0)
1548
+ output += cursorUp(bottomContentHeight);
1549
+ output += cursorTo(this.cursorPos.cols);
1550
+ this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
1551
+ this.extraLinesUnderPrompt = bottomContentHeight;
1552
+ this.height = height(output);
1553
+ }
1554
+ checkCursorPos() {
1555
+ const cursorPos = this.rl.getCursorPos();
1556
+ if (cursorPos.cols !== this.cursorPos.cols) {
1557
+ this.write(cursorTo(cursorPos.cols));
1558
+ this.cursorPos = cursorPos;
1559
+ }
1560
+ }
1561
+ done({ clearContent }) {
1562
+ this.rl.setPrompt("");
1563
+ let output = cursorDown(this.extraLinesUnderPrompt);
1564
+ output += clearContent ? eraseLines(this.height) : `
1565
+ `;
1566
+ output += cursorShow;
1567
+ this.write(output);
1568
+ this.rl.close();
1569
+ }
1570
+ }
1571
+
1572
+ // node_modules/@inquirer/core/dist/lib/promise-polyfill.js
1573
+ class PromisePolyfill extends Promise {
1574
+ static withResolver() {
1575
+ let resolve;
1576
+ let reject;
1577
+ const promise = new Promise((res, rej) => {
1578
+ resolve = res;
1579
+ reject = rej;
1580
+ });
1581
+ return { promise, resolve, reject };
1582
+ }
1583
+ }
1584
+
1585
+ // node_modules/@inquirer/core/dist/lib/create-prompt.js
1586
+ function getCallSites() {
1587
+ const _prepareStackTrace = Error.prepareStackTrace;
1588
+ let result = [];
1589
+ try {
1590
+ Error.prepareStackTrace = (_, callSites) => {
1591
+ const callSitesWithoutCurrent = callSites.slice(1);
1592
+ result = callSitesWithoutCurrent;
1593
+ return callSitesWithoutCurrent;
1594
+ };
1595
+ new Error().stack;
1596
+ } catch {
1597
+ return result;
1598
+ }
1599
+ Error.prepareStackTrace = _prepareStackTrace;
1600
+ return result;
1601
+ }
1602
+ function createPrompt(view) {
1603
+ const callSites = getCallSites();
1604
+ const prompt = (config, context = {}) => {
1605
+ const { input = process.stdin, signal } = context;
1606
+ const cleanups = new Set;
1607
+ const output = new import_mute_stream.default;
1608
+ output.pipe(context.output ?? process.stdout);
1609
+ const rl = readline2.createInterface({
1610
+ terminal: true,
1611
+ input,
1612
+ output
1613
+ });
1614
+ const screen = new ScreenManager(rl);
1615
+ const { promise, resolve, reject } = PromisePolyfill.withResolver();
1616
+ const cancel = () => reject(new CancelPromptError);
1617
+ if (signal) {
1618
+ const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
1619
+ if (signal.aborted) {
1620
+ abort();
1621
+ return Object.assign(promise, { cancel });
1622
+ }
1623
+ signal.addEventListener("abort", abort);
1624
+ cleanups.add(() => signal.removeEventListener("abort", abort));
1625
+ }
1626
+ cleanups.add(onExit((code, signal2) => {
1627
+ reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
1628
+ }));
1629
+ const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
1630
+ rl.on("SIGINT", sigint);
1631
+ cleanups.add(() => rl.removeListener("SIGINT", sigint));
1632
+ const checkCursorPos = () => screen.checkCursorPos();
1633
+ rl.input.on("keypress", checkCursorPos);
1634
+ cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
1635
+ return withHooks(rl, (cycle) => {
1636
+ const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
1637
+ rl.on("close", hooksCleanup);
1638
+ cleanups.add(() => rl.removeListener("close", hooksCleanup));
1639
+ cycle(() => {
1640
+ try {
1641
+ const nextView = view(config, (value) => {
1642
+ setImmediate(() => resolve(value));
1643
+ });
1644
+ if (nextView === undefined) {
1645
+ const callerFilename = callSites[1]?.getFileName();
1646
+ throw new Error(`Prompt functions must return a string.
1647
+ at ${callerFilename}`);
1648
+ }
1649
+ const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
1650
+ screen.render(content, bottomContent);
1651
+ effectScheduler.run();
1652
+ } catch (error) {
1653
+ reject(error);
1654
+ }
1655
+ });
1656
+ return Object.assign(promise.then((answer) => {
1657
+ effectScheduler.clearAll();
1658
+ return answer;
1659
+ }, (error) => {
1660
+ effectScheduler.clearAll();
1661
+ throw error;
1662
+ }).finally(() => {
1663
+ cleanups.forEach((cleanup) => cleanup());
1664
+ screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
1665
+ output.end();
1666
+ }).then(() => promise), { cancel });
1667
+ });
1668
+ };
1669
+ return prompt;
1670
+ }
1671
+ // node_modules/@inquirer/core/dist/lib/Separator.js
1672
+ import { styleText as styleText2 } from "node:util";
1673
+ class Separator {
1674
+ separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
1675
+ type = "separator";
1676
+ constructor(separator) {
1677
+ if (separator) {
1678
+ this.separator = separator;
1679
+ }
1680
+ }
1681
+ static isSeparator(choice) {
1682
+ return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
1683
+ }
1684
+ }
1685
+ // node_modules/@inquirer/confirm/dist/index.js
1686
+ function getBooleanValue(value, defaultValue) {
1687
+ let answer = defaultValue !== false;
1688
+ if (/^(y|yes)/i.test(value))
1689
+ answer = true;
1690
+ else if (/^(n|no)/i.test(value))
1691
+ answer = false;
1692
+ return answer;
1693
+ }
1694
+ function boolToString(value) {
1695
+ return value ? "Yes" : "No";
1696
+ }
1697
+ var dist_default2 = createPrompt((config, done) => {
1698
+ const { transformer = boolToString } = config;
1699
+ const [status, setStatus] = useState("idle");
1700
+ const [value, setValue] = useState("");
1701
+ const theme = makeTheme(config.theme);
1702
+ const prefix = usePrefix({ status, theme });
1703
+ useKeypress((key, rl) => {
1704
+ if (status !== "idle")
1705
+ return;
1706
+ if (isEnterKey(key)) {
1707
+ const answer = getBooleanValue(value, config.default);
1708
+ setValue(transformer(answer));
1709
+ setStatus("done");
1710
+ done(answer);
1711
+ } else if (isTabKey(key)) {
1712
+ const answer = boolToString(!getBooleanValue(value, config.default));
1713
+ rl.clearLine(0);
1714
+ rl.write(answer);
1715
+ setValue(answer);
1716
+ } else {
1717
+ setValue(rl.line);
1718
+ }
1719
+ });
1720
+ let formattedValue = value;
1721
+ let defaultValue = "";
1722
+ if (status === "done") {
1723
+ formattedValue = theme.style.answer(value);
1724
+ } else {
1725
+ defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
1726
+ }
1727
+ const message = theme.style.message(config.message, status);
1728
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
1729
+ });
1730
+ // node_modules/@inquirer/input/dist/index.js
1731
+ var inputTheme = {
1732
+ validationFailureMode: "keep"
1733
+ };
1734
+ var dist_default3 = createPrompt((config, done) => {
1735
+ const { prefill = "tab" } = config;
1736
+ const theme = makeTheme(inputTheme, config.theme);
1737
+ const [status, setStatus] = useState("idle");
1738
+ const [defaultValue = "", setDefaultValue] = useState(config.default);
1739
+ const [errorMsg, setError] = useState();
1740
+ const [value, setValue] = useState("");
1741
+ const prefix = usePrefix({ status, theme });
1742
+ async function validate2(value2) {
1743
+ const { required, pattern, patternError = "Invalid input" } = config;
1744
+ if (required && !value2) {
1745
+ return "You must provide a value";
1746
+ }
1747
+ if (pattern && !pattern.test(value2)) {
1748
+ return patternError;
1749
+ }
1750
+ if (typeof config.validate === "function") {
1751
+ return await config.validate(value2) || "You must provide a valid value";
1752
+ }
1753
+ return true;
1754
+ }
1755
+ useKeypress(async (key, rl) => {
1756
+ if (status !== "idle") {
1757
+ return;
1758
+ }
1759
+ if (isEnterKey(key)) {
1760
+ const answer = value || defaultValue;
1761
+ setStatus("loading");
1762
+ const isValid = await validate2(answer);
1763
+ if (isValid === true) {
1764
+ setValue(answer);
1765
+ setStatus("done");
1766
+ done(answer);
1767
+ } else {
1768
+ if (theme.validationFailureMode === "clear") {
1769
+ setValue("");
1770
+ } else {
1771
+ rl.write(value);
1772
+ }
1773
+ setError(isValid);
1774
+ setStatus("idle");
1775
+ }
1776
+ } else if (isBackspaceKey(key) && !value) {
1777
+ setDefaultValue(undefined);
1778
+ } else if (isTabKey(key) && !value) {
1779
+ setDefaultValue(undefined);
1780
+ rl.clearLine(0);
1781
+ rl.write(defaultValue);
1782
+ setValue(defaultValue);
1783
+ } else {
1784
+ setValue(rl.line);
1785
+ setError(undefined);
1786
+ }
1787
+ });
1788
+ useEffect((rl) => {
1789
+ if (prefill === "editable" && defaultValue) {
1790
+ rl.write(defaultValue);
1791
+ setValue(defaultValue);
1792
+ }
1793
+ }, []);
1794
+ const message = theme.style.message(config.message, status);
1795
+ let formattedValue = value;
1796
+ if (typeof config.transformer === "function") {
1797
+ formattedValue = config.transformer(value, { isFinal: status === "done" });
1798
+ } else if (status === "done") {
1799
+ formattedValue = theme.style.answer(value);
1800
+ }
1801
+ let defaultStr;
1802
+ if (defaultValue && status !== "done" && !value) {
1803
+ defaultStr = theme.style.defaultAnswer(defaultValue);
1804
+ }
1805
+ let error = "";
1806
+ if (errorMsg) {
1807
+ error = theme.style.error(errorMsg);
1808
+ }
1809
+ return [
1810
+ [prefix, message, defaultStr, formattedValue].filter((v) => v !== undefined).join(" "),
1811
+ error
1812
+ ];
1813
+ });
1814
+ // node_modules/@inquirer/search/dist/index.js
1815
+ import { styleText as styleText3 } from "node:util";
1816
+ var searchTheme = {
1817
+ icon: { cursor: dist_default.pointer },
1818
+ style: {
1819
+ disabled: (text) => styleText3("dim", `- ${text}`),
1820
+ searchTerm: (text) => styleText3("cyan", text),
1821
+ description: (text) => styleText3("cyan", text),
1822
+ keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " • "))
1823
+ }
1824
+ };
1825
+ function isSelectable(item) {
1826
+ return !Separator.isSeparator(item) && !item.disabled;
1827
+ }
1828
+ function normalizeChoices(choices) {
1829
+ return choices.map((choice) => {
1830
+ if (Separator.isSeparator(choice))
1831
+ return choice;
1832
+ if (typeof choice === "string") {
1833
+ return {
1834
+ value: choice,
1835
+ name: choice,
1836
+ short: choice,
1837
+ disabled: false
1838
+ };
1839
+ }
1840
+ const name = choice.name ?? String(choice.value);
1841
+ const normalizedChoice = {
1842
+ value: choice.value,
1843
+ name,
1844
+ short: choice.short ?? name,
1845
+ disabled: choice.disabled ?? false
1846
+ };
1847
+ if (choice.description) {
1848
+ normalizedChoice.description = choice.description;
1849
+ }
1850
+ return normalizedChoice;
1851
+ });
1852
+ }
1853
+ var dist_default4 = createPrompt((config, done) => {
1854
+ const { pageSize = 7, validate: validate2 = () => true } = config;
1855
+ const theme = makeTheme(searchTheme, config.theme);
1856
+ const [status, setStatus] = useState("loading");
1857
+ const [searchTerm, setSearchTerm] = useState("");
1858
+ const [searchResults, setSearchResults] = useState([]);
1859
+ const [searchError, setSearchError] = useState();
1860
+ const prefix = usePrefix({ status, theme });
1861
+ const bounds = useMemo(() => {
1862
+ const first = searchResults.findIndex(isSelectable);
1863
+ const last = searchResults.findLastIndex(isSelectable);
1864
+ return { first, last };
1865
+ }, [searchResults]);
1866
+ const [active = bounds.first, setActive] = useState();
1867
+ useEffect(() => {
1868
+ const controller = new AbortController;
1869
+ setStatus("loading");
1870
+ setSearchError(undefined);
1871
+ const fetchResults = async () => {
1872
+ try {
1873
+ const results = await config.source(searchTerm || undefined, {
1874
+ signal: controller.signal
1875
+ });
1876
+ if (!controller.signal.aborted) {
1877
+ setActive(undefined);
1878
+ setSearchError(undefined);
1879
+ setSearchResults(normalizeChoices(results));
1880
+ setStatus("idle");
1881
+ }
1882
+ } catch (error2) {
1883
+ if (!controller.signal.aborted && error2 instanceof Error) {
1884
+ setSearchError(error2.message);
1885
+ }
1886
+ }
1887
+ };
1888
+ fetchResults();
1889
+ return () => {
1890
+ controller.abort();
1891
+ };
1892
+ }, [searchTerm]);
1893
+ const selectedChoice = searchResults[active];
1894
+ useKeypress(async (key, rl) => {
1895
+ if (isEnterKey(key)) {
1896
+ if (selectedChoice) {
1897
+ setStatus("loading");
1898
+ const isValid = await validate2(selectedChoice.value);
1899
+ setStatus("idle");
1900
+ if (isValid === true) {
1901
+ setStatus("done");
1902
+ done(selectedChoice.value);
1903
+ } else if (selectedChoice.name === searchTerm) {
1904
+ setSearchError(isValid || "You must provide a valid value");
1905
+ } else {
1906
+ rl.write(selectedChoice.name);
1907
+ setSearchTerm(selectedChoice.name);
1908
+ }
1909
+ } else {
1910
+ rl.write(searchTerm);
1911
+ }
1912
+ } else if (isTabKey(key) && selectedChoice) {
1913
+ rl.clearLine(0);
1914
+ rl.write(selectedChoice.name);
1915
+ setSearchTerm(selectedChoice.name);
1916
+ } else if (status !== "loading" && (isUpKey(key) || isDownKey(key))) {
1917
+ rl.clearLine(0);
1918
+ if (isUpKey(key) && active !== bounds.first || isDownKey(key) && active !== bounds.last) {
1919
+ const offset = isUpKey(key) ? -1 : 1;
1920
+ let next = active;
1921
+ do {
1922
+ next = (next + offset + searchResults.length) % searchResults.length;
1923
+ } while (!isSelectable(searchResults[next]));
1924
+ setActive(next);
1925
+ }
1926
+ } else {
1927
+ setSearchTerm(rl.line);
1928
+ }
1929
+ });
1930
+ const message = theme.style.message(config.message, status);
1931
+ const helpLine = theme.style.keysHelpTip([
1932
+ ["↑↓", "navigate"],
1933
+ ["⏎", "select"]
1934
+ ]);
1935
+ const page = usePagination({
1936
+ items: searchResults,
1937
+ active,
1938
+ renderItem({ item, isActive }) {
1939
+ if (Separator.isSeparator(item)) {
1940
+ return ` ${item.separator}`;
1941
+ }
1942
+ if (item.disabled) {
1943
+ const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
1944
+ return theme.style.disabled(`${item.name} ${disabledLabel}`);
1945
+ }
1946
+ const color = isActive ? theme.style.highlight : (x) => x;
1947
+ const cursor = isActive ? theme.icon.cursor : ` `;
1948
+ return color(`${cursor} ${item.name}`);
1949
+ },
1950
+ pageSize,
1951
+ loop: false
1952
+ });
1953
+ let error;
1954
+ if (searchError) {
1955
+ error = theme.style.error(searchError);
1956
+ } else if (searchResults.length === 0 && searchTerm !== "" && status === "idle") {
1957
+ error = theme.style.error("No results found");
1958
+ }
1959
+ let searchStr;
1960
+ if (status === "done" && selectedChoice) {
1961
+ return [prefix, message, theme.style.answer(selectedChoice.short)].filter(Boolean).join(" ").trimEnd();
1962
+ } else {
1963
+ searchStr = theme.style.searchTerm(searchTerm);
1964
+ }
1965
+ const description = selectedChoice?.description;
1966
+ const header = [prefix, message, searchStr].filter(Boolean).join(" ").trimEnd();
1967
+ const body = [
1968
+ error ?? page,
1969
+ " ",
1970
+ description ? theme.style.description(description) : "",
1971
+ helpLine
1972
+ ].filter(Boolean).join(`
1973
+ `).trimEnd();
1974
+ return [header, body];
1975
+ });
1976
+ // src/lib/fs.ts
1977
+ import { mkdir } from "node:fs/promises";
1978
+ import { readFile, writeFile } from "node:fs/promises";
1979
+ import { homedir } from "node:os";
1980
+ function pathJoin(...parts) {
1981
+ const cleaned = parts.filter(Boolean).map((p, i) => {
1982
+ let s = String(p).trim();
1983
+ if (i === 0)
1984
+ s = s.replace(/\/+$/g, "");
1985
+ else
1986
+ s = s.replace(/^\/+/g, "").replace(/\/+$/g, "");
1987
+ return s;
1988
+ }).filter((p) => p.length > 0);
1989
+ if (cleaned.length === 0)
1990
+ return "";
1991
+ const joined = cleaned.join("/");
1992
+ const first = parts.find((p) => String(p ?? "").trim().length > 0) ?? "";
1993
+ const isAbs = String(first).trim().startsWith("/");
1994
+ return isAbs ? joined.startsWith("/") ? joined : `/${joined}` : joined;
1995
+ }
1996
+ function expandHome(p) {
1997
+ const home = process.env.HOME || process.env.USERPROFILE || homedir() || "";
1998
+ if (!home)
1999
+ return p;
2000
+ if (p === "~")
2001
+ return home;
2002
+ if (p.startsWith("~/"))
2003
+ return `${home}/${p.slice(2)}`;
2004
+ return p;
2005
+ }
2006
+ function getWorkHome(dirFlag) {
2007
+ if (typeof dirFlag === "string" && dirFlag.trim())
2008
+ return expandHome(dirFlag.trim());
2009
+ const home = process.env.HOME || process.env.USERPROFILE || homedir() || ".";
2010
+ return pathJoin(home, ".work");
2011
+ }
2012
+ async function ensureDir(dir) {
2013
+ await mkdir(dir, { recursive: true });
2014
+ }
2015
+ async function ensureWorkHome(workHome) {
2016
+ await ensureDir(workHome);
2017
+ await ensureDir(pathJoin(workHome, "data"));
2018
+ }
2019
+ async function loadJson(path, fallback) {
2020
+ try {
2021
+ const txt = await readFile(path, "utf8");
2022
+ return JSON.parse(txt);
2023
+ } catch {
2024
+ return fallback;
2025
+ }
2026
+ }
2027
+ async function saveJson(path, data) {
2028
+ const txt = JSON.stringify(data, null, 2) + `
2029
+ `;
2030
+ await writeFile(path, txt, "utf8");
2031
+ }
2032
+ async function writeTextFile(path, content) {
2033
+ await writeFile(path, content, "utf8");
2034
+ }
2035
+ function nowIso() {
2036
+ return new Date().toISOString();
2037
+ }
2038
+ function parseArgs(argv) {
2039
+ const flags = {};
2040
+ const positional = [];
2041
+ for (let i = 0;i < argv.length; i++) {
2042
+ const a = String(argv[i] ?? "");
2043
+ if (a.startsWith("--")) {
2044
+ const key = a.slice(2);
2045
+ const next = argv[i + 1];
2046
+ if (!next || String(next).startsWith("-")) {
2047
+ flags[key] = true;
2048
+ } else {
2049
+ flags[key] = String(next);
2050
+ i++;
2051
+ }
2052
+ } else {
2053
+ positional.push(a);
2054
+ }
2055
+ }
2056
+ const cmd = positional[0];
2057
+ const rest = positional.slice(1);
2058
+ return { cmd, rest, flags };
2059
+ }
2060
+
2061
+ // src/lib/csv.ts
2062
+ import { appendFile, readFile as readFile2, writeFile as writeFile2, access } from "node:fs/promises";
2063
+ import { constants as FS } from "node:fs";
2064
+ var HEADER = `id,startAt,endAt,task,note,createdAt,updatedAt,deletedAt
2065
+ `;
2066
+ function esc(v) {
2067
+ const s = (v ?? "").toString();
2068
+ if (/[,"\n\r]/.test(s))
2069
+ return `"${s.replace(/"/g, '""')}"`;
2070
+ return s;
2071
+ }
2072
+ async function exists(path) {
2073
+ try {
2074
+ await access(path, FS.F_OK);
2075
+ return true;
2076
+ } catch {
2077
+ return false;
2078
+ }
2079
+ }
2080
+ async function ensureCsvHeader(path) {
2081
+ if (!await exists(path)) {
2082
+ await writeFile2(path, HEADER, "utf-8");
2083
+ }
2084
+ }
2085
+ async function appendCsvRow(path, row) {
2086
+ const line = [
2087
+ row.id,
2088
+ row.startAt,
2089
+ row.endAt,
2090
+ row.task,
2091
+ row.note,
2092
+ row.createdAt,
2093
+ row.updatedAt,
2094
+ row.deletedAt
2095
+ ].map(esc).join(",") + `
2096
+ `;
2097
+ await appendFile(path, line, "utf-8");
2098
+ }
2099
+ function unquoteCsvCell(s) {
2100
+ if (s.startsWith('"') && s.endsWith('"')) {
2101
+ return s.slice(1, -1).replace(/""/g, '"');
2102
+ }
2103
+ return s;
2104
+ }
2105
+ function splitCsvLine(line) {
2106
+ const out = [];
2107
+ let cur = "";
2108
+ let inQ = false;
2109
+ for (let i = 0;i < line.length; i++) {
2110
+ const ch = line[i];
2111
+ if (ch === '"') {
2112
+ const next = line[i + 1];
2113
+ if (inQ && next === '"') {
2114
+ cur += '"';
2115
+ i++;
2116
+ } else {
2117
+ inQ = !inQ;
2118
+ }
2119
+ continue;
2120
+ }
2121
+ if (ch === "," && !inQ) {
2122
+ out.push(cur);
2123
+ cur = "";
2124
+ continue;
2125
+ }
2126
+ cur += ch;
2127
+ }
2128
+ out.push(cur);
2129
+ return out.map(unquoteCsvCell);
2130
+ }
2131
+ async function readCsvRows(path) {
2132
+ if (!await exists(path))
2133
+ return [];
2134
+ const txt = await readFile2(path, "utf-8");
2135
+ const lines = txt.split(/\r?\n/).filter((l) => l.trim().length > 0);
2136
+ if (lines.length <= 1)
2137
+ return [];
2138
+ const header = lines[0]?.trim();
2139
+ if (header !== HEADER.trim()) {
2140
+ throw new Error(`Unexpected CSV header in ${path}`);
2141
+ }
2142
+ const rows = [];
2143
+ for (let i = 1;i < lines.length; i++) {
2144
+ const cols = splitCsvLine(lines[i] || "");
2145
+ if (cols.length < 8)
2146
+ continue;
2147
+ rows.push({
2148
+ id: cols[0] ?? "",
2149
+ startAt: cols[1] ?? "",
2150
+ endAt: cols[2] ?? "",
2151
+ task: cols[3] ?? "",
2152
+ note: cols[4] ?? "",
2153
+ createdAt: cols[5] ?? "",
2154
+ updatedAt: cols[6] ?? "",
2155
+ deletedAt: cols[7] ?? ""
2156
+ });
2157
+ }
2158
+ return rows;
2159
+ }
2160
+
2161
+ // src/lib/time.ts
2162
+ function fmtElapsed(ms) {
2163
+ const total = Math.max(0, Math.floor(ms / 1000));
2164
+ const h = Math.floor(total / 3600);
2165
+ const m = Math.floor(total % 3600 / 60);
2166
+ const s = total % 60;
2167
+ return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
2168
+ }
2169
+
2170
+ // src/cli.ts
2171
+ function usage() {
2172
+ console.log(`
26
2173
  work - minimal time tracking (monthly CSV per project)
27
2174
 
28
2175
  USAGE:
@@ -38,19 +2185,459 @@ OPTIONS:
38
2185
  --dir <path> Data directory (default ~/.work)
39
2186
  --yes Skip confirmations (auto-switch)
40
2187
  --export Export summary CSV (work info)
41
- `)}async function iF(){let{cmd:D,rest:u,flags:F}=yu(process.argv.slice(2));if(!D||D==="--help"||D==="-h")pu(),process.exit(0);let C=vu(F.dir);switch(D){case"init":await tF(C);return;case"on":await sF(C,u,F);return;case"off":await eF(C);return;case"status":await D0(C);return;case"info":await u0(C,u,F);return;case"projects":await rF(C);return;case"tasks":await oF(C,u);return;default:console.error(`Unknown command: ${D}`),pu(),process.exit(1)}}async function tF(D){await v(D);let u=V(D,"projects.json"),F=V(D,"running.json"),C=await H(u,{projects:[]}),E=await H(F,{session:null});await y(u,C),await y(F,E),console.log(`Initialized: ${D}`)}async function rF(D){await v(D);let u=V(D,"projects.json"),F=await H(u,{projects:[]});if(!F.projects.length){console.log("No projects yet. Use: work on (create one)");return}let C=[...F.projects].sort((E,B)=>E.name.localeCompare(B.name));console.log("Projects"),console.log("--------");for(let E of C)console.log(`${E.name} (${E.id})`)}async function oF(D,u){await v(D);let F=V(D,"projects.json"),C=await H(F,{projects:[]}),E=u[0]?.trim(),B=E?du(C,E):await lu(C);if(!B)console.error("Project not found."),process.exit(1);let A=await UD(D,B.id);if(!A.tasks.length){console.log(`No tasks for project "${B.name}" yet.`);return}let $=[...A.tasks].sort((Q,X)=>{let G=Q.count??0,Y=X.count??0;if(Y!==G)return Y-G;let q=Q.lastUsedAt?Date.parse(Q.lastUsedAt):0,K=X.lastUsedAt?Date.parse(X.lastUsedAt):0;if(K!==q)return K-q;return Q.name.localeCompare(X.name)});console.log(`Tasks for ${B.name}`),console.log("-".repeat(`Tasks for ${B.name}`.length));let Z=$.map((Q)=>[Q.name,String(Q.count??0),Q.lastUsedAt??""]);cD(["Task","Count","Last used"],Z)}async function sF(D,u,F){await v(D);let C=V(D,"projects.json"),E=V(D,"running.json"),B=await H(C,{projects:[]}),A=await H(E,{session:null}),$=u[0]?.trim(),Z=u.slice(1).join(" ").trim(),Q=$?await F0(B,C,$):await C0(B,C),X=Z?await cu(D,Q.id,Z):await E0(D,Q.id,Q.name);if(A.session){let Y=A.session;if(Y.projectId===Q.id&&Y.task===X){let q=WD(Date.now()-Date.parse(Y.startAt)-(Y.pausedMs??0));console.log(`Already working on ${Q.name}${X?" \u2022 "+X:""} (${q})`);return}if(!F.yes){let q=WD(Date.now()-Date.parse(Y.startAt)-(Y.pausedMs??0));if(console.log(`You are already working on:
42
- ${Y.projectName}${Y.task?" \u2022 "+Y.task:""}
43
- started: ${Y.startAt}
44
- elapsed: ${q}
45
-
46
- Switch to:
47
- ${Q.name}${X?" \u2022 "+X:""}
48
- `),!await dD({message:"Stop current and start the new one now?",default:!1}))console.log("Cancelled."),process.exit(2)}await au(D,Y,P()),A.session=null}let G={id:crypto.randomUUID(),projectId:Q.id,projectName:Q.name,task:X,startAt:P(),pausedAt:null,pausedMs:0,note:""};await y(E,{session:G}),console.log(`Working on ${Q.name}${X?" \u2022 "+X:""}`)}async function eF(D){await v(D);let u=V(D,"running.json"),F=await H(u,{session:null});if(!F.session)console.error("No active session."),process.exit(1);await au(D,F.session,P()),await y(u,{session:null}),console.log("Stopped.")}async function D0(D){await v(D);let u=V(D,"running.json"),F=await H(u,{session:null});if(!F.session){console.log("No active session.");return}let C=F.session,E=C.pausedMs??0,B=WD(Date.now()-Date.parse(C.startAt)-E);console.log(`Running: ${C.projectName}${C.task?" \u2022 "+C.task:""}
49
- Started: ${C.startAt}
50
- Elapsed: ${B}${C.pausedAt?" (paused)":""}`)}async function u0(D,u,F){await v(D);let C=V(D,"projects.json"),E=await H(C,{projects:[]}),B=u[0]?.trim(),A=u[1]?.trim(),$=null,Z=null;if(B&&/^\d{4}-\d{2}$/.test(B))Z=B;else if(B)$=B;if(A&&/^\d{4}-\d{2}$/.test(A))Z=A;let Q=Z??iu(new Date),X=$!=null?du(E,$):await lu(E);if(!X)console.error("Project not found."),process.exit(1);let G=V(D,"data",X.id),Y=V(G,`${Q}.csv`),K=(await mu(Y)).filter((z)=>!z.deletedAt),U=new Map,_=new Map,O=0;for(let z of K){let R=Date.parse(z.startAt),I=Date.parse(z.endAt);if(!Number.isFinite(R)||!Number.isFinite(I)||I<=R)continue;let i=I-R;O+=i;let ED=B0(new Date(R));U.set(ED,(U.get(ED)??0)+i);let BD=(z.task??"").trim()||"(no task)";_.set(BD,(_.get(BD)??0)+i)}let W=A0(U).map(([z,R])=>({key:z,ms:R,pretty:KD(R)})),M=$0(_).map(([z,R])=>({key:z,ms:R,pretty:KD(R)}));if(console.log(`
51
- Project: ${X.name}`),console.log(`Month: ${Q}`),console.log(`Total: ${KD(O)}
52
- `),console.log("By day"),cD(["Day","Time"],W.map((z)=>[z.key,z.pretty])),console.log(`
53
- By task`),cD(["Task","Time"],M.map((z)=>[z.key,z.pretty])),F.export){await c(G);let z=V(G,`${Q}-info.csv`),R=Q0(X.name,Q,O,W,M);await Bun.write(z,R),console.log(`
54
- Exported: ${z}`)}}function du(D,u){let F=u.trim().toLowerCase();return D.projects.find((C)=>C.id.toLowerCase()===F)??D.projects.find((C)=>C.name.toLowerCase()===F)??null}async function lu(D){if(!D.projects.length)console.error("No projects found. Use: work on (create one)"),process.exit(1);let u=await CD({message:"Select a project",source:async(F)=>{let C=(F??"").toLowerCase();return D.projects.filter((E)=>E.name.toLowerCase().includes(C)).map((E)=>({name:E.name,value:E.id,description:E.id}))}});return D.projects.find((F)=>F.id===u)??null}async function F0(D,u,F){let C=F.trim(),E=D.projects.find((A)=>A.name.toLowerCase()===C.toLowerCase());if(E)return E;let B={id:crypto.randomUUID(),name:C,createdAt:P()};return D.projects.push(B),await y(u,D),B}async function C0(D,u){let F=await CD({message:"Select a project",source:async(E)=>{let B=(E??"").toLowerCase();return[...D.projects.filter(($)=>$.name.toLowerCase().includes(B)).map(($)=>({name:$.name,value:$.id,description:$.id})),{name:"\u2795 Create new project\u2026",value:"__create__"}]}});if(F==="__create__"){let E=(await OD({message:"New project name",validate:(A)=>A.trim().length?!0:"Required"})).trim(),B={id:crypto.randomUUID(),name:E,createdAt:P()};return D.projects.push(B),await y(u,D),B}let C=D.projects.find((E)=>E.id===F);if(!C)throw Error("Project selection failed");return C}async function UD(D,u){let F=V(D,"data",u);await c(F);let C=V(F,"tasks.json");return await H(C,{tasks:[]})}async function nu(D,u,F){let C=V(D,"data",u);await c(C);let E=V(C,"tasks.json");await y(E,F)}async function cu(D,u,F){let C=await UD(D,u),E=F.trim(),B=C.tasks.find((A)=>A.name.toLowerCase()===E.toLowerCase());if(B)return B.name;return C.tasks.push({name:E,count:0,lastUsedAt:null,createdAt:P()}),await nu(D,u,C),E}async function E0(D,u,F){let C=await UD(D,u),E=await CD({message:`Select a task for "${F}"`,source:async(B)=>{let A=(B??"").toLowerCase();return[...[...C.tasks].sort((Z,Q)=>{let X=Z.lastUsedAt?Date.parse(Z.lastUsedAt):0,G=Q.lastUsedAt?Date.parse(Q.lastUsedAt):0;if(G!==X)return G-X;return Z.name.localeCompare(Q.name)}).filter((Z)=>Z.name.toLowerCase().includes(A)).map((Z)=>({name:Z.name,value:Z.name})),{name:"\u2795 Create new task\u2026",value:"__create__"}]}});if(E==="__create__"){let B=(await OD({message:"New task name",validate:(A)=>A.trim().length?!0:"Required"})).trim();return await cu(D,u,B),B}return E}async function au(D,u,F){let C=V(D,"data",u.projectId);await c(C);let E=await UD(D,u.projectId),B=E.tasks.find((X)=>X.name.toLowerCase()===u.task.toLowerCase());if(B)B.count=(B.count??0)+1,B.lastUsedAt=P();else if(u.task.trim())E.tasks.push({name:u.task,count:1,lastUsedAt:P(),createdAt:P()});await nu(D,u.projectId,E);let A=new Date(Date.parse(F)),$=iu(A),Z=V(C,`${$}.csv`);await hu(Z);let Q={id:u.id,startAt:u.startAt,endAt:F,task:u.task,note:u.note??"",createdAt:u.startAt,updatedAt:F,deletedAt:""};await gu(Z,Q)}function nD(D){return String(D).padStart(2,"0")}function iu(D){return`${D.getFullYear()}-${nD(D.getMonth()+1)}`}function B0(D){return`${D.getFullYear()}-${nD(D.getMonth()+1)}-${nD(D.getDate())}`}function KD(D){let u=Math.round(D/60000),F=Math.floor(u/60),C=u%60;if(F===0)return`${C}m`;if(C===0)return`${F}h`;return`${F}h ${String(C).padStart(2,"0")}m`}function A0(D){return[...D.entries()].sort((u,F)=>u[0].localeCompare(F[0]))}function $0(D){return[...D.entries()].sort((u,F)=>F[1]-u[1])}function cD(D,u){let F=D.map((E,B)=>Math.max(E.length,...u.map((A)=>(A[B]??"").length))),C=(E)=>E.map((B,A)=>(B??"").padEnd(F[A]||0)).join(" ").trimEnd();console.log(C(D)),console.log(F.map((E)=>"-".repeat(E)).join(" "));for(let E of u)console.log(C(E))}function Q0(D,u,F,C,E){let B=[];B.push(`meta,project,${a(D)}`),B.push(`meta,month,${a(u)}`),B.push(`meta,total,${a(KD(F))}`),B.push(""),B.push("type,key,durationMinutes,duration");for(let A of C)B.push(`day,${a(A.key)},${Math.round(A.ms/60000)},${a(A.pretty)}`);for(let A of E)B.push(`task,${a(A.key)},${Math.round(A.ms/60000)},${a(A.pretty)}`);return B.join(`
55
- `)+`
56
- `}function a(D){if(/[,"\n\r]/.test(D))return`"${D.replace(/"/g,'""')}"`;return D}process.on("uncaughtException",(D)=>{if(D instanceof Error&&D.name==="ExitPromptError")console.log("\uD83D\uDC4B until next time!");else throw D});await iF();
2188
+ `);
2189
+ }
2190
+ async function main() {
2191
+ const { cmd, rest, flags } = parseArgs(process.argv.slice(2));
2192
+ if (!cmd || cmd === "--help" || cmd === "-h") {
2193
+ usage();
2194
+ process.exit(0);
2195
+ }
2196
+ const workHome = getWorkHome(flags.dir);
2197
+ switch (cmd) {
2198
+ case "init":
2199
+ await cmdInit(workHome);
2200
+ return;
2201
+ case "on":
2202
+ await cmdOn(workHome, rest, flags);
2203
+ return;
2204
+ case "off":
2205
+ await cmdOff(workHome);
2206
+ return;
2207
+ case "status":
2208
+ await cmdStatus(workHome);
2209
+ return;
2210
+ case "info":
2211
+ await cmdInfo(workHome, rest, flags);
2212
+ return;
2213
+ case "projects":
2214
+ await cmdProjects(workHome);
2215
+ return;
2216
+ case "tasks":
2217
+ await cmdTasks(workHome, rest);
2218
+ return;
2219
+ default:
2220
+ console.error(`Unknown command: ${cmd}`);
2221
+ usage();
2222
+ process.exit(1);
2223
+ }
2224
+ }
2225
+ async function cmdInit(workHome) {
2226
+ await ensureWorkHome(workHome);
2227
+ const projectsPath = pathJoin(workHome, "projects.json");
2228
+ const runningPath = pathJoin(workHome, "running.json");
2229
+ const projects = await loadJson(projectsPath, { projects: [] });
2230
+ const running = await loadJson(runningPath, { session: null });
2231
+ await saveJson(projectsPath, projects);
2232
+ await saveJson(runningPath, running);
2233
+ console.log(`Initialized: ${workHome}`);
2234
+ }
2235
+ async function cmdProjects(workHome) {
2236
+ await ensureWorkHome(workHome);
2237
+ const projectsPath = pathJoin(workHome, "projects.json");
2238
+ const projects = await loadJson(projectsPath, { projects: [] });
2239
+ if (!projects.projects.length) {
2240
+ console.log("No projects yet. Use: work on (create one)");
2241
+ return;
2242
+ }
2243
+ const rows = [...projects.projects].sort((a, b) => a.name.localeCompare(b.name));
2244
+ console.log("Projects");
2245
+ console.log("--------");
2246
+ for (const p of rows) {
2247
+ console.log(`${p.name} (${p.id})`);
2248
+ }
2249
+ }
2250
+ async function cmdTasks(workHome, rest) {
2251
+ await ensureWorkHome(workHome);
2252
+ const projectsPath = pathJoin(workHome, "projects.json");
2253
+ const projects = await loadJson(projectsPath, { projects: [] });
2254
+ const arg = rest[0]?.trim();
2255
+ const project = arg ? findProjectByNameOrId(projects, arg) : await pickProjectOnly(projects);
2256
+ if (!project) {
2257
+ console.error("Project not found.");
2258
+ process.exit(1);
2259
+ }
2260
+ const idx = await loadTaskIndex(workHome, project.id);
2261
+ if (!idx.tasks.length) {
2262
+ console.log(`No tasks for project "${project.name}" yet.`);
2263
+ return;
2264
+ }
2265
+ const tasks = [...idx.tasks].sort((a, b) => {
2266
+ const ca = a.count ?? 0;
2267
+ const cb = b.count ?? 0;
2268
+ if (cb !== ca)
2269
+ return cb - ca;
2270
+ const la = a.lastUsedAt ? Date.parse(a.lastUsedAt) : 0;
2271
+ const lb = b.lastUsedAt ? Date.parse(b.lastUsedAt) : 0;
2272
+ if (lb !== la)
2273
+ return lb - la;
2274
+ return a.name.localeCompare(b.name);
2275
+ });
2276
+ console.log(`Tasks for ${project.name}`);
2277
+ console.log("-".repeat(`Tasks for ${project.name}`.length));
2278
+ const rows = tasks.map((t) => [t.name, String(t.count ?? 0), t.lastUsedAt ?? ""]);
2279
+ printTable(["Task", "Count", "Last used"], rows);
2280
+ }
2281
+ async function cmdOn(workHome, rest, flags) {
2282
+ await ensureWorkHome(workHome);
2283
+ const projectsPath = pathJoin(workHome, "projects.json");
2284
+ const runningPath = pathJoin(workHome, "running.json");
2285
+ const projects = await loadJson(projectsPath, { projects: [] });
2286
+ const running = await loadJson(runningPath, { session: null });
2287
+ const argProject = rest[0]?.trim();
2288
+ const argTask = rest.slice(1).join(" ").trim();
2289
+ const project = argProject ? await resolveProjectByNameOrCreate(projects, projectsPath, argProject) : await pickProjectOrCreate(projects, projectsPath);
2290
+ const task = argTask ? await resolveTaskByNameOrCreate(workHome, project.id, argTask) : await pickTaskOrCreate(workHome, project.id, project.name);
2291
+ if (running.session) {
2292
+ const cur = running.session;
2293
+ if (cur.projectId === project.id && cur.task === task) {
2294
+ const elapsed = fmtElapsed(Date.now() - Date.parse(cur.startAt) - (cur.pausedMs ?? 0));
2295
+ console.log(`Already working on ${project.name}${task ? " • " + task : ""} (${elapsed})`);
2296
+ return;
2297
+ }
2298
+ if (!flags.yes) {
2299
+ const elapsed = fmtElapsed(Date.now() - Date.parse(cur.startAt) - (cur.pausedMs ?? 0));
2300
+ console.log(`You are already working on:
2301
+ ` + ` ${cur.projectName}${cur.task ? " • " + cur.task : ""}
2302
+ ` + ` started: ${cur.startAt}
2303
+ ` + ` elapsed: ${elapsed}
2304
+
2305
+ ` + `Switch to:
2306
+ ` + ` ${project.name}${task ? " • " + task : ""}
2307
+ `);
2308
+ const ok = await dist_default2({
2309
+ message: "Stop current and start the new one now?",
2310
+ default: false
2311
+ });
2312
+ if (!ok) {
2313
+ console.log("Cancelled.");
2314
+ process.exit(2);
2315
+ }
2316
+ }
2317
+ await stopAndPersist(workHome, cur, nowIso());
2318
+ running.session = null;
2319
+ }
2320
+ const session = {
2321
+ id: globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : randomUuidFallback(),
2322
+ projectId: project.id,
2323
+ projectName: project.name,
2324
+ task,
2325
+ startAt: nowIso(),
2326
+ pausedAt: null,
2327
+ pausedMs: 0,
2328
+ note: ""
2329
+ };
2330
+ await saveJson(runningPath, { session });
2331
+ console.log(`Working on ${project.name}${task ? " • " + task : ""}`);
2332
+ }
2333
+ async function cmdOff(workHome) {
2334
+ await ensureWorkHome(workHome);
2335
+ const runningPath = pathJoin(workHome, "running.json");
2336
+ const running = await loadJson(runningPath, { session: null });
2337
+ if (!running.session) {
2338
+ console.error("No active session.");
2339
+ process.exit(1);
2340
+ }
2341
+ await stopAndPersist(workHome, running.session, nowIso());
2342
+ await saveJson(runningPath, { session: null });
2343
+ console.log("Stopped.");
2344
+ }
2345
+ async function cmdStatus(workHome) {
2346
+ await ensureWorkHome(workHome);
2347
+ const runningPath = pathJoin(workHome, "running.json");
2348
+ const running = await loadJson(runningPath, { session: null });
2349
+ if (!running.session) {
2350
+ console.log("No active session.");
2351
+ return;
2352
+ }
2353
+ const s = running.session;
2354
+ const pausedMs = s.pausedMs ?? 0;
2355
+ const elapsed = fmtElapsed(Date.now() - Date.parse(s.startAt) - pausedMs);
2356
+ console.log(`Running: ${s.projectName}${s.task ? " • " + s.task : ""}
2357
+ ` + `Started: ${s.startAt}
2358
+ ` + `Elapsed: ${elapsed}${s.pausedAt ? " (paused)" : ""}`);
2359
+ }
2360
+ async function cmdInfo(workHome, rest, flags) {
2361
+ await ensureWorkHome(workHome);
2362
+ const projectsPath = pathJoin(workHome, "projects.json");
2363
+ const projects = await loadJson(projectsPath, { projects: [] });
2364
+ const a1 = rest[0]?.trim();
2365
+ const a2 = rest[1]?.trim();
2366
+ let projectArg = null;
2367
+ let monthArg = null;
2368
+ if (a1 && /^\d{4}-\d{2}$/.test(a1)) {
2369
+ monthArg = a1;
2370
+ } else if (a1) {
2371
+ projectArg = a1;
2372
+ }
2373
+ if (a2 && /^\d{4}-\d{2}$/.test(a2)) {
2374
+ monthArg = a2;
2375
+ }
2376
+ const month = monthArg ?? localYearMonth(new Date);
2377
+ const project = projectArg != null ? findProjectByNameOrId(projects, projectArg) : await pickProjectOnly(projects);
2378
+ if (!project) {
2379
+ console.error(`Project not found.`);
2380
+ process.exit(1);
2381
+ }
2382
+ const projectDir = pathJoin(workHome, "data", project.id);
2383
+ const csvPath = pathJoin(projectDir, `${month}.csv`);
2384
+ const rows = await readCsvRows(csvPath);
2385
+ const active = rows.filter((r) => !r.deletedAt);
2386
+ const byDayMs = new Map;
2387
+ const byTaskMs = new Map;
2388
+ let totalMs = 0;
2389
+ for (const r of active) {
2390
+ const start = Date.parse(r.startAt);
2391
+ const end = Date.parse(r.endAt);
2392
+ if (!Number.isFinite(start) || !Number.isFinite(end) || end <= start)
2393
+ continue;
2394
+ const ms = end - start;
2395
+ totalMs += ms;
2396
+ const dayKey = localDateKey(new Date(start));
2397
+ byDayMs.set(dayKey, (byDayMs.get(dayKey) ?? 0) + ms);
2398
+ const taskKey = (r.task ?? "").trim() || "(no task)";
2399
+ byTaskMs.set(taskKey, (byTaskMs.get(taskKey) ?? 0) + ms);
2400
+ }
2401
+ const dayRows = sortMapByKey(byDayMs).map(([k, ms]) => ({
2402
+ key: k,
2403
+ ms,
2404
+ pretty: fmtHours(ms)
2405
+ }));
2406
+ const taskRows = sortMapByValueDesc(byTaskMs).map(([k, ms]) => ({
2407
+ key: k,
2408
+ ms,
2409
+ pretty: fmtHours(ms)
2410
+ }));
2411
+ console.log(`
2412
+ Project: ${project.name}`);
2413
+ console.log(`Month: ${month}`);
2414
+ console.log(`Total: ${fmtHours(totalMs)}
2415
+ `);
2416
+ console.log("By day");
2417
+ printTable(["Day", "Time"], dayRows.map((r) => [r.key, r.pretty]));
2418
+ console.log(`
2419
+ By task`);
2420
+ printTable(["Task", "Time"], taskRows.map((r) => [r.key, r.pretty]));
2421
+ if (flags.export) {
2422
+ await ensureDir(projectDir);
2423
+ const outPath = pathJoin(projectDir, `${month}-info.csv`);
2424
+ const out = buildInfoExportCsv(project.name, month, totalMs, dayRows, taskRows);
2425
+ await writeTextFile(outPath, out);
2426
+ console.log(`
2427
+ Exported: ${outPath}`);
2428
+ }
2429
+ }
2430
+ function findProjectByNameOrId(projects, arg) {
2431
+ const a = arg.trim().toLowerCase();
2432
+ return projects.projects.find((p) => p.id.toLowerCase() === a) ?? projects.projects.find((p) => p.name.toLowerCase() === a) ?? null;
2433
+ }
2434
+ async function pickProjectOnly(projects) {
2435
+ if (!projects.projects.length) {
2436
+ console.error("No projects found. Use: work on (create one)");
2437
+ process.exit(1);
2438
+ }
2439
+ const picked = await dist_default4({
2440
+ message: "Select a project",
2441
+ source: async (term) => {
2442
+ const q = (term ?? "").toLowerCase();
2443
+ return projects.projects.filter((p) => p.name.toLowerCase().includes(q)).map((p) => ({ name: p.name, value: p.id, description: p.id }));
2444
+ }
2445
+ });
2446
+ return projects.projects.find((p) => p.id === picked) ?? null;
2447
+ }
2448
+ async function resolveProjectByNameOrCreate(projects, projectsPath, name) {
2449
+ const n = name.trim();
2450
+ const found = projects.projects.find((p) => p.name.toLowerCase() === n.toLowerCase());
2451
+ if (found)
2452
+ return found;
2453
+ const created = {
2454
+ id: globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : randomUuidFallback(),
2455
+ name: n,
2456
+ createdAt: nowIso()
2457
+ };
2458
+ projects.projects.push(created);
2459
+ await saveJson(projectsPath, projects);
2460
+ return created;
2461
+ }
2462
+ async function pickProjectOrCreate(projects, projectsPath) {
2463
+ const picked = await dist_default4({
2464
+ message: "Select a project",
2465
+ source: async (term) => {
2466
+ const q = (term ?? "").toLowerCase();
2467
+ const items = projects.projects.filter((p) => p.name.toLowerCase().includes(q)).map((p) => ({
2468
+ name: p.name,
2469
+ value: p.id,
2470
+ description: p.id
2471
+ }));
2472
+ return [...items, { name: "➕ Create new project…", value: "__create__" }];
2473
+ }
2474
+ });
2475
+ if (picked === "__create__") {
2476
+ const name = (await dist_default3({
2477
+ message: "New project name",
2478
+ validate: (v) => v.trim().length ? true : "Required"
2479
+ })).trim();
2480
+ const created = {
2481
+ id: globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : randomUuidFallback(),
2482
+ name,
2483
+ createdAt: nowIso()
2484
+ };
2485
+ projects.projects.push(created);
2486
+ await saveJson(projectsPath, projects);
2487
+ return created;
2488
+ }
2489
+ const found = projects.projects.find((p) => p.id === picked);
2490
+ if (!found)
2491
+ throw new Error("Project selection failed");
2492
+ return found;
2493
+ }
2494
+ async function loadTaskIndex(workHome, projectId) {
2495
+ const dir = pathJoin(workHome, "data", projectId);
2496
+ await ensureDir(dir);
2497
+ const path = pathJoin(dir, "tasks.json");
2498
+ return await loadJson(path, { tasks: [] });
2499
+ }
2500
+ async function saveTaskIndex(workHome, projectId, idx) {
2501
+ const dir = pathJoin(workHome, "data", projectId);
2502
+ await ensureDir(dir);
2503
+ const path = pathJoin(dir, "tasks.json");
2504
+ await saveJson(path, idx);
2505
+ }
2506
+ async function resolveTaskByNameOrCreate(workHome, projectId, task) {
2507
+ const idx = await loadTaskIndex(workHome, projectId);
2508
+ const t = task.trim();
2509
+ const found = idx.tasks.find((x) => x.name.toLowerCase() === t.toLowerCase());
2510
+ if (found)
2511
+ return found.name;
2512
+ idx.tasks.push({ name: t, count: 0, lastUsedAt: null, createdAt: nowIso() });
2513
+ await saveTaskIndex(workHome, projectId, idx);
2514
+ return t;
2515
+ }
2516
+ async function pickTaskOrCreate(workHome, projectId, projectName) {
2517
+ const idx = await loadTaskIndex(workHome, projectId);
2518
+ const picked = await dist_default4({
2519
+ message: `Select a task for "${projectName}"`,
2520
+ source: async (term) => {
2521
+ const q = (term ?? "").toLowerCase();
2522
+ const tasks = [...idx.tasks].sort((a, b) => {
2523
+ const la = a.lastUsedAt ? Date.parse(a.lastUsedAt) : 0;
2524
+ const lb = b.lastUsedAt ? Date.parse(b.lastUsedAt) : 0;
2525
+ if (lb !== la)
2526
+ return lb - la;
2527
+ return a.name.localeCompare(b.name);
2528
+ }).filter((t) => t.name.toLowerCase().includes(q)).map((t) => ({ name: t.name, value: t.name }));
2529
+ return [...tasks, { name: "➕ Create new task…", value: "__create__" }];
2530
+ }
2531
+ });
2532
+ if (picked === "__create__") {
2533
+ const name = (await dist_default3({
2534
+ message: "New task name",
2535
+ validate: (v) => v.trim().length ? true : "Required"
2536
+ })).trim();
2537
+ await resolveTaskByNameOrCreate(workHome, projectId, name);
2538
+ return name;
2539
+ }
2540
+ return picked;
2541
+ }
2542
+ async function stopAndPersist(workHome, s, endAtIso) {
2543
+ const projectDir = pathJoin(workHome, "data", s.projectId);
2544
+ await ensureDir(projectDir);
2545
+ const idx = await loadTaskIndex(workHome, s.projectId);
2546
+ const entry = idx.tasks.find((t) => t.name.toLowerCase() === s.task.toLowerCase());
2547
+ if (entry) {
2548
+ entry.count = (entry.count ?? 0) + 1;
2549
+ entry.lastUsedAt = nowIso();
2550
+ } else if (s.task.trim()) {
2551
+ idx.tasks.push({
2552
+ name: s.task,
2553
+ count: 1,
2554
+ lastUsedAt: nowIso(),
2555
+ createdAt: nowIso()
2556
+ });
2557
+ }
2558
+ await saveTaskIndex(workHome, s.projectId, idx);
2559
+ const endAt = new Date(Date.parse(endAtIso));
2560
+ const ym = localYearMonth(endAt);
2561
+ const csvPath = pathJoin(projectDir, `${ym}.csv`);
2562
+ await ensureCsvHeader(csvPath);
2563
+ const row = {
2564
+ id: s.id,
2565
+ startAt: s.startAt,
2566
+ endAt: endAtIso,
2567
+ task: s.task,
2568
+ note: s.note ?? "",
2569
+ createdAt: s.startAt,
2570
+ updatedAt: endAtIso,
2571
+ deletedAt: ""
2572
+ };
2573
+ await appendCsvRow(csvPath, row);
2574
+ }
2575
+ function pad2(n) {
2576
+ return String(n).padStart(2, "0");
2577
+ }
2578
+ function localYearMonth(d) {
2579
+ return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}`;
2580
+ }
2581
+ function localDateKey(d) {
2582
+ return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
2583
+ }
2584
+ function fmtHours(ms) {
2585
+ const totalMin = Math.round(ms / 60000);
2586
+ const h = Math.floor(totalMin / 60);
2587
+ const m = totalMin % 60;
2588
+ if (h === 0)
2589
+ return `${m}m`;
2590
+ if (m === 0)
2591
+ return `${h}h`;
2592
+ return `${h}h ${String(m).padStart(2, "0")}m`;
2593
+ }
2594
+ function sortMapByKey(m) {
2595
+ return [...m.entries()].sort((a, b) => a[0].localeCompare(b[0]));
2596
+ }
2597
+ function sortMapByValueDesc(m) {
2598
+ return [...m.entries()].sort((a, b) => b[1] - a[1]);
2599
+ }
2600
+ function printTable(headers, rows) {
2601
+ const widths = headers.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] ?? "").length)));
2602
+ const line = (cols) => cols.map((c, i) => (c ?? "").padEnd(widths[i] || 0)).join(" ").trimEnd();
2603
+ console.log(line(headers));
2604
+ console.log(widths.map((w) => "-".repeat(w)).join(" "));
2605
+ for (const r of rows)
2606
+ console.log(line(r));
2607
+ }
2608
+ function buildInfoExportCsv(projectName, month, totalMs, dayRows, taskRows) {
2609
+ const lines = [];
2610
+ lines.push(`meta,project,${csvEsc(projectName)}`);
2611
+ lines.push(`meta,month,${csvEsc(month)}`);
2612
+ lines.push(`meta,total,${csvEsc(fmtHours(totalMs))}`);
2613
+ lines.push("");
2614
+ lines.push("type,key,durationMinutes,duration");
2615
+ for (const r of dayRows) {
2616
+ lines.push(`day,${csvEsc(r.key)},${Math.round(r.ms / 60000)},${csvEsc(r.pretty)}`);
2617
+ }
2618
+ for (const r of taskRows) {
2619
+ lines.push(`task,${csvEsc(r.key)},${Math.round(r.ms / 60000)},${csvEsc(r.pretty)}`);
2620
+ }
2621
+ return lines.join(`
2622
+ `) + `
2623
+ `;
2624
+ }
2625
+ function csvEsc(v) {
2626
+ if (/[,"\n\r]/.test(v))
2627
+ return `"${v.replace(/"/g, '""')}"`;
2628
+ return v;
2629
+ }
2630
+ process.on("uncaughtException", (error) => {
2631
+ if (error && typeof error === "object" && error.name === "ExitPromptError") {
2632
+ console.log("\uD83D\uDC4B until next time!");
2633
+ } else {
2634
+ throw error;
2635
+ }
2636
+ });
2637
+ function randomUuidFallback() {
2638
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
2639
+ const r = Math.random() * 16 | 0, v = c === "x" ? r : r & 3 | 8;
2640
+ return v.toString(16);
2641
+ });
2642
+ }
2643
+ await main();