@stacksjs/dtsx 0.9.19 → 0.9.20
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.
- package/dist/bin/cli.js +5 -5
- package/dist/{chunk-fg4cjy7w.js → chunk-0cfb4831.js} +1 -1
- package/dist/{chunk-w71syh0b.js → chunk-0d5r9n78.js} +1 -1
- package/dist/chunk-1b1j60g0.js +2 -0
- package/dist/{chunk-s30jnjb4.js → chunk-1hy2eypj.js} +1 -1
- package/dist/{chunk-1z1w3s0k.js → chunk-4mtbtmee.js} +11 -11
- package/dist/{chunk-nwvqfthk.js → chunk-5zt12z1t.js} +1 -1
- package/dist/chunk-7hy98p24.js +62 -0
- package/dist/{chunk-mr4jjsps.js → chunk-9e542zj7.js} +1 -1
- package/dist/{chunk-2qyt67jt.js → chunk-a0gah6hn.js} +1 -1
- package/dist/{chunk-kwmhsx3n.js → chunk-bymtns9a.js} +1 -1
- package/dist/chunk-c60qpa3j.js +2 -0
- package/dist/chunk-cdv5r51q.js +156 -0
- package/dist/chunk-dnbr0hke.js +2 -0
- package/dist/{chunk-fmhrt2ca.js → chunk-dymmh9x0.js} +1 -1
- package/dist/chunk-eqfegkc1.js +2 -0
- package/dist/{chunk-m68323h2.js → chunk-fqym6cgw.js} +1 -1
- package/dist/{chunk-69rnp3hs.js → chunk-ft0nf9jb.js} +1 -1
- package/dist/{chunk-9ycwkhxh.js → chunk-fvgc14nk.js} +1 -1
- package/dist/{chunk-ezrgnecm.js → chunk-h0dndwyc.js} +1 -1
- package/dist/chunk-m94gn6yx.js +2 -0
- package/dist/chunk-nmmv0nrk.js +2 -0
- package/dist/{chunk-x4jgc4bx.js → chunk-nqwz71ak.js} +1 -1
- package/dist/{chunk-gg6xh82k.js → chunk-r1yqh3qg.js} +1 -1
- package/dist/{chunk-fbradttj.js → chunk-rd7n0yj1.js} +1 -1
- package/dist/{chunk-7pwy4m0c.js → chunk-vx4a5crm.js} +1 -1
- package/dist/{chunk-dv8haj2p.js → chunk-wtqapt0n.js} +1 -1
- package/dist/chunk-xw9wfq8f.js +17 -0
- package/dist/{chunk-jjwwkrfk.js → chunk-y2pe3jq3.js} +1 -1
- package/dist/{chunk-7zsd1qqw.js → chunk-y4g1csn2.js} +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/plugins/bun.js +1 -1
- package/dist/src/plugins/esbuild.js +1 -1
- package/dist/src/plugins/index.js +1 -1
- package/dist/src/plugins/tsup.js +1 -1
- package/dist/src/plugins/vite.js +1 -1
- package/dist/src/plugins/webpack.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2n9mmg2c.js +0 -2
- package/dist/chunk-4jw8qvts.js +0 -16
- package/dist/chunk-7g7axw9t.js +0 -2
- package/dist/chunk-9qe2wx58.js +0 -2
- package/dist/chunk-a3txc27m.js +0 -33
- package/dist/chunk-q0k7xs9f.js +0 -2
- package/dist/chunk-sbmecr6t.js +0 -2
- package/dist/chunk-trm0gptj.js +0 -134
- package/dist/chunk-w1k33gyv.js +0 -2
package/dist/chunk-trm0gptj.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-mcdb3q06.js";import{EventEmitter as r0}from"events";import iZ from"process";import yZ from"process";import OZ from"process";import L0,{stdin as U$,stdout as q$}from"process";import*as ZZ from"readline";import{ReadStream as eZ,WriteStream as j$}from"tty";import tZ,{stdin as W$,stdout as L$}from"process";import M$ from"readline";import l$ from"process";import ZQ from"process";import{WriteStream as $Q}from"tty";import JQ from"process";import cZ from"process";import XQ from"process";import{stripVTControlCharacters as hZ}from"util";import{existsSync as qQ,lstatSync as U0,readdirSync as jQ}from"fs";import{dirname as q0,join as FQ}from"path";import GQ from"process";import x from"process";import jZ from"process";import{stripVTControlCharacters as vZ}from"util";import HQ from"process";import{Buffer as G0}from"buffer";import n from"fs/promises";import VQ from"os";import BZ from"path";import w from"process";import{Readable as DQ,Writable as WQ}from"stream";var{create:x0,getPrototypeOf:l0,defineProperty:pZ,getOwnPropertyNames:a0}=Object,n0=Object.prototype.hasOwnProperty,A=(Z,$,Q)=>{Q=Z!=null?x0(l0(Z)):{};let z=$||!Z||!Z.__esModule?pZ(Q,"default",{value:Z,enumerable:!0}):Q;for(let J of a0(Z))if(!n0.call(z,J))pZ(z,J,{get:()=>Z[J],enumerable:!0});return z},dZ=(Z,$)=>()=>($||Z(($={exports:{}}).exports,$),$.exports),c0=dZ((Z,$)=>{function Q(J){return J==null?[]:Array.isArray(J)?J:[J]}function z(J,Y,X,U){var q,j=J[Y],F=~U.string.indexOf(Y)?X==null||X===!0?"":String(X):typeof X==="boolean"?X:~U.boolean.indexOf(Y)?X==="false"?!1:X==="true"||(J._.push((q=+X,q*0===0)?q:X),!!X):(q=+X,q*0===0)?q:X;J[Y]=j==null?F:Array.isArray(j)?j.concat(F):[j,F]}$.exports=function(J,Y){J=J||[],Y=Y||{};var X,U,q,j,F,G={_:[]},K=0,H=0,D=0,N=J.length;let W=Y.alias!==void 0,O=Y.unknown!==void 0,P=Y.default!==void 0;if(Y.alias=Y.alias||{},Y.string=Q(Y.string),Y.boolean=Q(Y.boolean),W)for(X in Y.alias){U=Y.alias[X]=Q(Y.alias[X]);for(K=0;K<U.length;K++)(Y.alias[U[K]]=U.concat(X)).splice(K,1)}for(K=Y.boolean.length;K-- >0;){U=Y.alias[Y.boolean[K]]||[];for(H=U.length;H-- >0;)Y.boolean.push(U[H])}for(K=Y.string.length;K-- >0;){U=Y.alias[Y.string[K]]||[];for(H=U.length;H-- >0;)Y.string.push(U[H])}if(P){for(X in Y.default)if(j=typeof Y.default[X],U=Y.alias[X]=Y.alias[X]||[],Y[j]!==void 0){Y[j].push(X);for(K=0;K<U.length;K++)Y[j].push(U[K])}}let T=O?Object.keys(Y.alias):[];for(K=0;K<N;K++){if(q=J[K],q==="--"){G._=G._.concat(J.slice(++K));break}for(H=0;H<q.length;H++)if(q.charCodeAt(H)!==45)break;if(H===0)G._.push(q);else if(q.substring(H,H+3)==="no-"){if(j=q.substring(H+3),O&&!~T.indexOf(j))return Y.unknown(q);G[j]=!1}else{for(D=H+1;D<q.length;D++)if(q.charCodeAt(D)===61)break;j=q.substring(H,D),F=q.substring(++D)||(K+1===N||(""+J[K+1]).charCodeAt(0)===45||J[++K]),U=H===2?[j]:j;for(D=0;D<U.length;D++){if(j=U[D],O&&!~T.indexOf(j))return Y.unknown("-".repeat(H)+j);z(G,j,D+1<U.length||F,Y)}}}if(P){for(X in Y.default)if(G[X]===void 0)G[X]=Y.default[X]}if(W)for(X in G){U=Y.alias[X]||[];while(U.length>0)G[U.shift()]=G[X]}return G}}),k=dZ((Z,$)=>{var Q=process||{},z=Q.argv||[],J=Q.env||{},Y=!(!!J.NO_COLOR||z.includes("--no-color"))&&(!!J.FORCE_COLOR||z.includes("--color")||Q.platform==="win32"||(Q.stdout||{}).isTTY&&J.TERM!=="dumb"||!!J.CI),X=(j,F,G=j)=>(K)=>{let H=""+K,D=H.indexOf(F,j.length);return~D?j+U(H,F,G,D)+F:j+H+F},U=(j,F,G,K)=>{let H="",D=0;do H+=j.substring(D,K)+G,D=K+F.length,K=j.indexOf(F,D);while(~K);return H+j.substring(D)},q=(j=Y)=>{let F=j?X:()=>String;return{isColorSupported:j,reset:F("\x1B[0m","\x1B[0m"),bold:F("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:F("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:F("\x1B[3m","\x1B[23m"),underline:F("\x1B[4m","\x1B[24m"),inverse:F("\x1B[7m","\x1B[27m"),hidden:F("\x1B[8m","\x1B[28m"),strikethrough:F("\x1B[9m","\x1B[29m"),black:F("\x1B[30m","\x1B[39m"),red:F("\x1B[31m","\x1B[39m"),green:F("\x1B[32m","\x1B[39m"),yellow:F("\x1B[33m","\x1B[39m"),blue:F("\x1B[34m","\x1B[39m"),magenta:F("\x1B[35m","\x1B[39m"),cyan:F("\x1B[36m","\x1B[39m"),white:F("\x1B[37m","\x1B[39m"),gray:F("\x1B[90m","\x1B[39m"),bgBlack:F("\x1B[40m","\x1B[49m"),bgRed:F("\x1B[41m","\x1B[49m"),bgGreen:F("\x1B[42m","\x1B[49m"),bgYellow:F("\x1B[43m","\x1B[49m"),bgBlue:F("\x1B[44m","\x1B[49m"),bgMagenta:F("\x1B[45m","\x1B[49m"),bgCyan:F("\x1B[46m","\x1B[49m"),bgWhite:F("\x1B[47m","\x1B[49m"),blackBright:F("\x1B[90m","\x1B[39m"),redBright:F("\x1B[91m","\x1B[39m"),greenBright:F("\x1B[92m","\x1B[39m"),yellowBright:F("\x1B[93m","\x1B[39m"),blueBright:F("\x1B[94m","\x1B[39m"),magentaBright:F("\x1B[95m","\x1B[39m"),cyanBright:F("\x1B[96m","\x1B[39m"),whiteBright:F("\x1B[97m","\x1B[39m"),bgBlackBright:F("\x1B[100m","\x1B[49m"),bgRedBright:F("\x1B[101m","\x1B[49m"),bgGreenBright:F("\x1B[102m","\x1B[49m"),bgYellowBright:F("\x1B[103m","\x1B[49m"),bgBlueBright:F("\x1B[104m","\x1B[49m"),bgMagentaBright:F("\x1B[105m","\x1B[49m"),bgCyanBright:F("\x1B[106m","\x1B[49m"),bgWhiteBright:F("\x1B[107m","\x1B[49m")}};$.exports=q(),$.exports.createColors=q}),p0=dZ((Z,$)=>{$.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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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}}),i0=A(c0(),1);function K0(Z){return Z.replace(/[<[].+/,"").trim()}function s0(Z){let $=/<([^>]+)>/g,Q=/\[([^\]]+)\]/g,z=[],J=(U)=>{let q=!1,j=U[1];if(j.startsWith("..."))j=j.slice(3),q=!0;return{required:U[0].startsWith("<"),value:j,variadic:q}},Y;while(Y=$.exec(Z))z.push(J(Y));let X;while(X=Q.exec(Z))z.push(J(X));return z}function e0(Z){let $={alias:{},boolean:[]};for(let[Q,z]of Z.entries()){if(z.names.length>1)$.alias[z.names[0]]=z.names.slice(1);if(z.isBoolean)if(z.negated){if(!Z.some((Y,X)=>{return X!==Q&&Y.names.some((U)=>z.names.includes(U))&&typeof Y.required==="boolean"}))$.boolean.push(z.names[0])}else $.boolean.push(z.names[0])}return $}function rZ(Z){return Z.sort(($,Q)=>{return $.length>Q.length?-1:1})[0]}function sZ(Z,$){return Z.length>=$?Z:`${Z}${" ".repeat($-Z.length)}`}function t0(Z){return Z.replace(/([a-z])-([a-z])/g,($,Q,z)=>{return Q+z.toUpperCase()})}function o0(Z,$,Q){let z=0,J=$.length,Y=Z,X;for(;z<J;++z)X=Y[$[z]],Y=Y[$[z]]=z===J-1?Q:X!=null?X:!!~$[z+1].indexOf(".")||!(+$[z+1]>-1)?{}:[]}function Z$(Z,$){for(let Q of Object.keys($)){let z=$[Q];if(z.shouldTransform){if(Z[Q]=Array.prototype.concat.call([],Z[Q]),typeof z.transformFunction==="function")Z[Q]=Z[Q].map(z.transformFunction)}}}function $$(Z){let $=/([^\\/]+)$/.exec(Z);return $?$[1]:""}function H0(Z){return Z.split(".").map(($,Q)=>{return Q===0?t0($):$}).join(".")}class NZ extends Error{constructor(Z){super(Z);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=Error(Z).stack}}function Q$(){let{env:Z}=iZ,{TERM:$,TERM_PROGRAM:Q}=Z;if(iZ.platform!=="win32")return $!=="linux";return Boolean(Z.WT_SESSION)||Boolean(Z.TERMINUS_SUBLIME)||Z.ConEmuTask==="{cmd::Cmder}"||Q==="Terminus-Sublime"||Q==="vscode"||$==="xterm-256color"||$==="alacritty"||$==="rxvt-unicode"||$==="rxvt-unicode-256color"||Z.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var TZ="\x1B",E=`${TZ}[`,BQ="\x07",_={to(Z,$){if(!$)return`${E}${Z+1}G`;return`${E}${$+1};${Z+1}H`},move(Z,$){let Q="";if(Z<0)Q+=`${E}${-Z}D`;else if(Z>0)Q+=`${E}${Z}C`;if($<0)Q+=`${E}${-$}A`;else if($>0)Q+=`${E}${$}B`;return Q},up:(Z=1)=>`${E}${Z}A`,down:(Z=1)=>`${E}${Z}B`,forward:(Z=1)=>`${E}${Z}C`,backward:(Z=1)=>`${E}${Z}D`,nextLine:(Z=1)=>`${E}E`.repeat(Z),prevLine:(Z=1)=>`${E}F`.repeat(Z),left:`${E}G`,hide:`${E}?25l`,show:`${E}?25h`,save:`${TZ}7`,restore:`${TZ}8`},TQ={up:(Z=1)=>`${E}S`.repeat(Z),down:(Z=1)=>`${E}T`.repeat(Z)},FZ={screen:`${E}2J`,up:(Z=1)=>`${E}1J`.repeat(Z),down:(Z=1)=>`${E}J`.repeat(Z),line:`${E}2K`,lineEnd:`${E}K`,lineStart:`${E}1K`,lines(Z){let $="";for(let Q=0;Q<Z;Q++)$+=this.line+(Q<Z-1?_.up():"");if(Z)$+=_.left;return $}},wQ={screen:`${TZ}c`};class V0{rawName;description;name;names;isBoolean;required;config;negated;constructor(Z,$,Q){if(this.rawName=Z,this.description=$,this.config=Object.assign({},Q),Z=Z.replace(/\.\*/g,""),this.negated=!1,this.names=K0(Z).split(",").map((z)=>{let J=z.trim().replace(/^-{1,2}/,"");if(J.startsWith("no-"))this.negated=!0,J=J.replace(/^no-/,"");return H0(J)}).sort((z,J)=>z.length>J.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(Z.includes("<"))this.required=!0;else if(Z.includes("["))this.required=!1;else this.isBoolean=!0}}var IQ=yZ.argv,z$=`${yZ.platform}-${yZ.arch} bun-v${typeof Bun<"u"?Bun.version:"unknown"}`,J$=OZ.argv,Y$=`${OZ.platform}-${OZ.arch} node-${OZ.version}`;class uZ{rawName;description;config;cli;options;aliasNames;name;args;commandAction;usageText;versionNumber;examples;helpCallback;globalCommand;constructor(Z,$,Q,z){if(this.rawName=Z,this.description=$,this.config=Q,this.cli=z,this.options=[],this.aliasNames=[],this.name=K0(Z),this.args=s0(Z),this.examples=[],!Q)this.config={}}usage(Z){return this.usageText=Z,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(Z,$="-v, --version"){return this.versionNumber=Z,this.option($,"Display version number"),this}example(Z){return this.examples.push(Z),this}option(Z,$,Q){let z=new V0(Z,$,Q);return this.options.push(z),this}alias(Z){return this.aliasNames.push(Z),this}action(Z){return this.commandAction=Z,this}isMatched(Z){return this.name===Z||this.aliasNames.includes(Z)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof mZ}hasOption(Z){return Z=Z.split(".")[0],!!this.options.find(($)=>{return $.names.includes(Z)})}outputHelp(){let{name:Z,commands:$}=this.cli,{versionNumber:Q,options:z,helpCallback:J}=this.cli.globalCommand,Y=[{body:`${Z}${Q?`/${Q}`:""}`}];if(Y.push({title:"Usage",body:` $ ${Z} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&$.length>0){let q=rZ($.map((j)=>j.rawName));Y.push({title:"Commands",body:$.map((j)=>{return` ${sZ(j.rawName,q.length)} ${j.description}`}).join(`
|
|
3
|
-
`)}),Y.push({title:"For more info, run any command with the `--help` flag",body:$.map((j)=>` $ ${Z}${j.name===""?"":` ${j.name}`} --help`).join(`
|
|
4
|
-
`)})}let U=this.isGlobalCommand?z:[...this.options,...z||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)U=U.filter((q)=>q.name!=="version");if(U.length>0){let q=rZ(U.map((j)=>j.rawName));Y.push({title:"Options",body:U.map((j)=>{return` ${sZ(j.rawName,q.length)} ${j.description} ${j.config.default===void 0?"":`(default: ${j.config.default})`}`}).join(`
|
|
5
|
-
`)})}if(this.examples.length>0)Y.push({title:"Examples",body:this.examples.map((q)=>{if(typeof q==="function")return q(Z);return q}).join(`
|
|
6
|
-
`)});if(J)Y=J(Y)||Y;console.log(Y.map((q)=>{return q.title?`${q.title}:
|
|
7
|
-
${q.body}`:q.body}).join(`
|
|
8
|
-
|
|
9
|
-
`))}outputVersion(){let{name:Z}=this.cli,{versionNumber:$}=this.cli.globalCommand;if($){let Q;if(Bun)Q=z$;else Q=Y$;console.log(`${Z}/${$} ${Q}`)}}checkRequiredArgs(){let Z=this.args.filter(($)=>$.required).length;if(this.cli.args.length<Z)throw new NZ(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:Z,globalCommand:$}=this.cli;if(!this.config.allowUnknownOptions){for(let Q of Object.keys(Z))if(Q!=="--"&&!this.hasOption(Q)&&!$.hasOption(Q))throw new NZ(`Unknown option \`${Q.length>1?`--${Q}`:`-${Q}`}\``)}}checkOptionValue(){let{options:Z,globalCommand:$}=this.cli,Q=[...$.options,...this.options];for(let z of Q){let J=Z[z.name.split(".")[0]];if(z.required){let Y=Q.some((X)=>X.negated&&X.names.includes(z.name));if(J===!0||J===!1&&!Y)throw new NZ(`option \`${z.rawName}\` value is missing`)}}}}class mZ extends uZ{constructor(Z){super("@@global@@","",{},Z)}}var X$=uZ;class D0 extends r0{name;commands;globalCommand;matchedCommand;matchedCommandName;rawArgs;args;options;showHelpOnExit;showVersionOnExit;constructor(Z=""){super();this.name=Z,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new mZ(this),this.globalCommand.usage("<command> [options]")}usage(Z){return this.globalCommand.usage(Z),this}command(Z,$,Q){if(!Q)Q={};let z=new X$(Z,$||"",Q,this);return z.globalCommand=this.globalCommand,this.commands.push(z),z}option(Z,$,Q){return this.globalCommand.option(Z,$,Q),this}help(Z){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=Z,this.showHelpOnExit=!0,this}version(Z,$="-v, --version"){return this.globalCommand.version(Z,$),this.showVersionOnExit=!0,this}example(Z){return this.globalCommand.example(Z),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:Z,options:$},Q,z){if(this.args=Z,this.options=$,Q)this.matchedCommand=Q;if(z)this.matchedCommandName=z;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(Z=J$,{run:$=!0}={}){if(this.rawArgs=Z,!this.name)this.name=Z[1]?$$(Z[1]):"cli";let Q=!0;for(let J of this.commands){let Y=this.mri(Z.slice(2),J),X=Y.args[0];if(J.isMatched(X)){Q=!1;let U={...Y,args:Y.args.slice(1)};this.setParsedInfo(U,J,X),this.emit(`command:${X}`,J)}}if(Q){for(let J of this.commands)if(J.name===""){Q=!1;let Y=this.mri(Z.slice(2),J);this.setParsedInfo(Y,J),this.emit("command:!",J)}}if(Q){let J=this.mri(Z.slice(2));this.setParsedInfo(J)}if(this.options.help&&this.showHelpOnExit)this.outputHelp(),$=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),$=!1,this.unsetMatchedCommand();let z={args:this.args,options:this.options};if($)this.runMatchedCommand();if(!this.matchedCommand&&this.args[0])this.emit("command:*");return z}mri(Z,$){let Q=[...this.globalCommand.options,...$?$.options:[]],z=e0(Q),J=[],Y=Z.indexOf("--");if(Y>-1)J=Z.slice(Y+1),Z=Z.slice(0,Y);let X=i0.default(Z,z);X=Object.keys(X).reduce((G,K)=>{return{...G,[H0(K)]:X[K]}},{_:[]});let U=X._,q={"--":J},j=$&&$.config.ignoreOptionDefaultValue?$.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,F=Object.create(null);for(let G of Q){if(!j&&G.config.default!==void 0)for(let K of G.names)q[K]=G.config.default;if(Array.isArray(G.config.type)){if(F[G.name]===void 0)F[G.name]=Object.create(null),F[G.name].shouldTransform=!0,F[G.name].transformFunction=G.config.type[0]}}for(let G of Object.keys(X))if(G!=="_"){let K=G.split(".");o0(q,K,X[G]),Z$(q,F)}return{args:U,options:q}}runMatchedCommand(){let{args:Z,options:$,matchedCommand:Q}=this;if(!Q||!Q.commandAction)return;Q.checkUnknownOptions(),Q.checkOptionValue(),Q.checkRequiredArgs();let z=[];return Q.args.forEach((J,Y)=>{if(J.variadic)z.push(Z.slice(Y));else z.push(Z[Y])}),z.push($),Q.commandAction.apply(this,z)}}var W0=(Z="")=>new D0(Z),L=A(k(),1),F$=["up","down","left","right","space","enter","cancel"],l={actions:new Set(F$),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"}};function CQ(Z){if(Z.aliases!==void 0){let $=Z.aliases;for(let Q in $){if(!Object.hasOwn($,Q))continue;let z=$[Q];if(!l.actions.has(z))continue;if(!l.aliases.has(Q))l.aliases.set(Q,z)}}if(Z.messages!==void 0){let $=Z.messages;if($.cancel!==void 0)l.messages.cancel=$.cancel;if($.error!==void 0)l.messages.error=$.error}}function xZ(Z,$){if(typeof Z==="string")return l.aliases.get(Z)===$;for(let Q of Z){if(Q===void 0)continue;if(xZ(Q,$))return!0}return!1}function G$(Z,$){if(Z===$)return[];let Q=Z.split(`
|
|
10
|
-
`),z=$.split(`
|
|
11
|
-
`),J=[];for(let Y=0;Y<Math.max(Q.length,z.length);Y++)if(Q[Y]!==z[Y])J.push(Y);return J}var K$=L0.platform.startsWith("win"),fZ=Symbol("clapp:cancel");function H$(Z){return Z===fZ}function WZ(Z,$){let Q=Z;if(Q.isTTY)Q.setRawMode($)}function V$(Z){let{input:$=U$,output:Q=q$,overwrite:z=!0,hideCursor:J=!0}=Z||{},Y=ZZ.createInterface({input:$,output:Q,prompt:"",tabSize:1});if(ZZ.emitKeypressEvents($,Y),$ instanceof eZ&&$.isTTY)$.setRawMode(!0);let X=(U,{name:q,sequence:j})=>{let F=String(U);if(xZ([F,q,j],"cancel")){if(J)Q.write(_.show);L0.exit(0);return}if(!z)return;ZZ.moveCursor(Q,q==="return"?0:-1,q==="return"?-1:0,()=>{ZZ.clearLine(Q,1,()=>{$.once("keypress",X)})})};if(J)Q.write(_.hide);return $.once("keypress",X),()=>{if($.off("keypress",X),J)Q.write(_.show);if($ instanceof eZ&&$.isTTY&&!K$)$.setRawMode(!1);Y.terminal=!1,Y.close()}}function D$(Z){if(Z instanceof j$&&Z.columns)return Z.columns;return 80}var AZ=A(k(),1);function N$({onlyFirst:Z=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",Z?void 0:"g")}var O$=N$();function M0(Z){if(typeof Z!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof Z}\``);return Z.replace(O$,"")}function B$(Z){return Z===161||Z===164||Z===167||Z===168||Z===170||Z===173||Z===174||Z>=176&&Z<=180||Z>=182&&Z<=186||Z>=188&&Z<=191||Z===198||Z===208||Z===215||Z===216||Z>=222&&Z<=225||Z===230||Z>=232&&Z<=234||Z===236||Z===237||Z===240||Z===242||Z===243||Z>=247&&Z<=250||Z===252||Z===254||Z===257||Z===273||Z===275||Z===283||Z===294||Z===295||Z===299||Z>=305&&Z<=307||Z===312||Z>=319&&Z<=322||Z===324||Z>=328&&Z<=331||Z===333||Z===338||Z===339||Z===358||Z===359||Z===363||Z===462||Z===464||Z===466||Z===468||Z===470||Z===472||Z===474||Z===476||Z===593||Z===609||Z===708||Z===711||Z>=713&&Z<=715||Z===717||Z===720||Z>=728&&Z<=731||Z===733||Z===735||Z>=768&&Z<=879||Z>=913&&Z<=929||Z>=931&&Z<=937||Z>=945&&Z<=961||Z>=963&&Z<=969||Z===1025||Z>=1040&&Z<=1103||Z===1105||Z===8208||Z>=8211&&Z<=8214||Z===8216||Z===8217||Z===8220||Z===8221||Z>=8224&&Z<=8226||Z>=8228&&Z<=8231||Z===8240||Z===8242||Z===8243||Z===8245||Z===8251||Z===8254||Z===8308||Z===8319||Z>=8321&&Z<=8324||Z===8364||Z===8451||Z===8453||Z===8457||Z===8467||Z===8470||Z===8481||Z===8482||Z===8486||Z===8491||Z===8531||Z===8532||Z>=8539&&Z<=8542||Z>=8544&&Z<=8555||Z>=8560&&Z<=8569||Z===8585||Z>=8592&&Z<=8601||Z===8632||Z===8633||Z===8658||Z===8660||Z===8679||Z===8704||Z===8706||Z===8707||Z===8711||Z===8712||Z===8715||Z===8719||Z===8721||Z===8725||Z===8730||Z>=8733&&Z<=8736||Z===8739||Z===8741||Z>=8743&&Z<=8748||Z===8750||Z>=8756&&Z<=8759||Z===8764||Z===8765||Z===8776||Z===8780||Z===8786||Z===8800||Z===8801||Z>=8804&&Z<=8807||Z===8810||Z===8811||Z===8814||Z===8815||Z===8834||Z===8835||Z===8838||Z===8839||Z===8853||Z===8857||Z===8869||Z===8895||Z===8978||Z>=9312&&Z<=9449||Z>=9451&&Z<=9547||Z>=9552&&Z<=9587||Z>=9600&&Z<=9615||Z>=9618&&Z<=9621||Z===9632||Z===9633||Z>=9635&&Z<=9641||Z===9650||Z===9651||Z===9654||Z===9655||Z===9660||Z===9661||Z===9664||Z===9665||Z>=9670&&Z<=9672||Z===9675||Z>=9678&&Z<=9681||Z>=9698&&Z<=9701||Z===9711||Z===9733||Z===9734||Z===9737||Z===9742||Z===9743||Z===9756||Z===9758||Z===9792||Z===9794||Z===9824||Z===9825||Z>=9827&&Z<=9829||Z>=9831&&Z<=9834||Z===9836||Z===9837||Z===9839||Z===9886||Z===9887||Z===9919||Z>=9926&&Z<=9933||Z>=9935&&Z<=9939||Z>=9941&&Z<=9953||Z===9955||Z===9960||Z===9961||Z>=9963&&Z<=9969||Z===9972||Z>=9974&&Z<=9977||Z===9979||Z===9980||Z===9982||Z===9983||Z===10045||Z>=10102&&Z<=10111||Z>=11094&&Z<=11097||Z>=12872&&Z<=12879||Z>=57344&&Z<=63743||Z>=65024&&Z<=65039||Z===65533||Z>=127232&&Z<=127242||Z>=127248&&Z<=127277||Z>=127280&&Z<=127337||Z>=127344&&Z<=127373||Z===127375||Z===127376||Z>=127387&&Z<=127404||Z>=917760&&Z<=917999||Z>=983040&&Z<=1048573||Z>=1048576&&Z<=1114109}function T$(Z){return Z===12288||Z>=65281&&Z<=65376||Z>=65504&&Z<=65510}function w$(Z){return Z>=4352&&Z<=4447||Z===8986||Z===8987||Z===9001||Z===9002||Z>=9193&&Z<=9196||Z===9200||Z===9203||Z===9725||Z===9726||Z===9748||Z===9749||Z>=9776&&Z<=9783||Z>=9800&&Z<=9811||Z===9855||Z>=9866&&Z<=9871||Z===9875||Z===9889||Z===9898||Z===9899||Z===9917||Z===9918||Z===9924||Z===9925||Z===9934||Z===9940||Z===9962||Z===9970||Z===9971||Z===9973||Z===9978||Z===9981||Z===9989||Z===9994||Z===9995||Z===10024||Z===10060||Z===10062||Z>=10067&&Z<=10069||Z===10071||Z>=10133&&Z<=10135||Z===10160||Z===10175||Z===11035||Z===11036||Z===11088||Z===11093||Z>=11904&&Z<=11929||Z>=11931&&Z<=12019||Z>=12032&&Z<=12245||Z>=12272&&Z<=12287||Z>=12289&&Z<=12350||Z>=12353&&Z<=12438||Z>=12441&&Z<=12543||Z>=12549&&Z<=12591||Z>=12593&&Z<=12686||Z>=12688&&Z<=12773||Z>=12783&&Z<=12830||Z>=12832&&Z<=12871||Z>=12880&&Z<=42124||Z>=42128&&Z<=42182||Z>=43360&&Z<=43388||Z>=44032&&Z<=55203||Z>=63744&&Z<=64255||Z>=65040&&Z<=65049||Z>=65072&&Z<=65106||Z>=65108&&Z<=65126||Z>=65128&&Z<=65131||Z>=94176&&Z<=94180||Z===94192||Z===94193||Z>=94208&&Z<=100343||Z>=100352&&Z<=101589||Z>=101631&&Z<=101640||Z>=110576&&Z<=110579||Z>=110581&&Z<=110587||Z===110589||Z===110590||Z>=110592&&Z<=110882||Z===110898||Z>=110928&&Z<=110930||Z===110933||Z>=110948&&Z<=110951||Z>=110960&&Z<=111355||Z>=119552&&Z<=119638||Z>=119648&&Z<=119670||Z===126980||Z===127183||Z===127374||Z>=127377&&Z<=127386||Z>=127488&&Z<=127490||Z>=127504&&Z<=127547||Z>=127552&&Z<=127560||Z===127568||Z===127569||Z>=127584&&Z<=127589||Z>=127744&&Z<=127776||Z>=127789&&Z<=127797||Z>=127799&&Z<=127868||Z>=127870&&Z<=127891||Z>=127904&&Z<=127946||Z>=127951&&Z<=127955||Z>=127968&&Z<=127984||Z===127988||Z>=127992&&Z<=128062||Z===128064||Z>=128066&&Z<=128252||Z>=128255&&Z<=128317||Z>=128331&&Z<=128334||Z>=128336&&Z<=128359||Z===128378||Z===128405||Z===128406||Z===128420||Z>=128507&&Z<=128591||Z>=128640&&Z<=128709||Z===128716||Z>=128720&&Z<=128722||Z>=128725&&Z<=128727||Z>=128732&&Z<=128735||Z===128747||Z===128748||Z>=128756&&Z<=128764||Z>=128992&&Z<=129003||Z===129008||Z>=129292&&Z<=129338||Z>=129340&&Z<=129349||Z>=129351&&Z<=129535||Z>=129648&&Z<=129660||Z>=129664&&Z<=129673||Z>=129679&&Z<=129734||Z>=129742&&Z<=129756||Z>=129759&&Z<=129769||Z>=129776&&Z<=129784||Z>=131072&&Z<=196605||Z>=196608&&Z<=262141}function P$(Z){if(!Number.isSafeInteger(Z))throw TypeError(`Expected a code point, got \`${typeof Z}\`.`)}function I$(Z,{ambiguousAsWide:$=!1}={}){if(P$(Z),T$(Z)||w$(Z)||$&&B$(Z))return 2;return 1}var R$=A(p0(),1),E$=new Intl.Segmenter,A$=/^\p{Default_Ignorable_Code_Point}$/u;function GZ(Z,$={}){if(typeof Z!=="string"||Z.length===0)return 0;let{ambiguousIsNarrow:Q=!0,countAnsiEscapeCodes:z=!1}=$;if(!z)Z=M0(Z);if(Z.length===0)return 0;let J=0,Y={ambiguousAsWide:!Q};for(let{segment:X}of E$.segment(Z)){let U=X.codePointAt(0);if(U<=31||U>=127&&U<=159)continue;if(U>=8203&&U<=8207||U===65279)continue;if(U>=768&&U<=879||U>=6832&&U<=6911||U>=7616&&U<=7679||U>=8400&&U<=8447||U>=65056&&U<=65071)continue;if(U>=55296&&U<=57343)continue;if(U>=65024&&U<=65039)continue;if(A$.test(X))continue;if(R$.default().test(X)){J+=2;continue}J+=I$(U,Y)}return J}var CZ=10,oZ=(Z=0)=>($)=>`\x1B[${$+Z}m`,Z0=(Z=0)=>($)=>`\x1B[${38+Z};5;${$}m`,$0=(Z=0)=>($,Q,z)=>`\x1B[${38+Z};2;${$};${Q};${z}m`,I={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]}},hQ=Object.keys(I.modifier),C$=Object.keys(I.color),k$=Object.keys(I.bgColor),vQ=[...C$,...k$];function b$(){let Z=new Map;for(let[$,Q]of Object.entries(I)){for(let[z,J]of Object.entries(Q))I[z]={open:`\x1B[${J[0]}m`,close:`\x1B[${J[1]}m`},Q[z]=I[z],Z.set(J[0],J[1]);Object.defineProperty(I,$,{value:Q,enumerable:!1})}return Object.defineProperty(I,"codes",{value:Z,enumerable:!1}),I.color.close="\x1B[39m",I.bgColor.close="\x1B[49m",I.color.ansi=oZ(),I.color.ansi256=Z0(),I.color.ansi16m=$0(),I.bgColor.ansi=oZ(CZ),I.bgColor.ansi256=Z0(CZ),I.bgColor.ansi16m=$0(CZ),Object.defineProperties(I,{rgbToAnsi256:{value:($,Q,z)=>{if($===Q&&Q===z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(Q/255*5)+Math.round(z/255*5)},enumerable:!1},hexToRgb:{value:($)=>{let Q=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!Q)return[0,0,0];let[z]=Q;if(z.length===3)z=[...z].map((Y)=>Y+Y).join("");let J=Number.parseInt(z,16);return[J>>16&255,J>>8&255,J&255]},enumerable:!1},hexToAnsi256:{value:($)=>I.rgbToAnsi256(...I.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value:($)=>{if($<8)return 30+$;if($<16)return 90+($-8);let Q,z,J;if($>=232)Q=(($-232)*10+8)/255,z=Q,J=Q;else{$-=16;let U=$%36;Q=Math.floor($/36)/5,z=Math.floor(U/6)/5,J=U%6/5}let Y=Math.max(Q,z,J)*2;if(Y===0)return 30;let X=30+(Math.round(J)<<2|Math.round(z)<<1|Math.round(Q));if(Y===2)X+=60;return X},enumerable:!1},rgbToAnsi:{value:($,Q,z)=>I.ansi256ToAnsi(I.rgbToAnsi256($,Q,z)),enumerable:!1},hexToAnsi:{value:($)=>I.ansi256ToAnsi(I.hexToAnsi256($)),enumerable:!1}}),I}var h$=b$(),v$=h$,EZ=new Set(["\x1B","\x9B"]),y$=39,lZ="\x07",N0="[",f$="]",O0="m",wZ=`${f$}8;;`,Q0=(Z)=>`${EZ.values().next().value}${N0}${Z}${O0}`,z0=(Z)=>`${EZ.values().next().value}${wZ}${Z}${lZ}`,S$=(Z)=>Z.split(" ").map(($)=>GZ($)),kZ=(Z,$,Q)=>{let z=[...$],J=!1,Y=!1,X=GZ(M0(Z.at(-1)));for(let[U,q]of z.entries()){let j=GZ(q);if(X+j<=Q)Z[Z.length-1]+=q;else Z.push(q),X=0;if(EZ.has(q))J=!0,Y=z.slice(U+1,U+1+wZ.length).join("")===wZ;if(J){if(Y){if(q===lZ)J=!1,Y=!1}else if(q===O0)J=!1;continue}if(X+=j,X===Q&&U<z.length-1)Z.push(""),X=0}if(!X&&Z.at(-1).length>0&&Z.length>1)Z[Z.length-2]+=Z.pop()},g$=(Z)=>{let $=Z.split(" "),Q=$.length;while(Q>0){if(GZ($[Q-1])>0)break;Q--}if(Q===$.length)return Z;return $.slice(0,Q).join(" ")+$.slice(Q).join("")},_$=(Z,$,Q={})=>{if(Q.trim!==!1&&Z.trim()==="")return"";let z="",J,Y,X=S$(Z),U=[""];for(let[G,K]of Z.split(" ").entries()){if(Q.trim!==!1)U[U.length-1]=U.at(-1).trimStart();let H=GZ(U.at(-1));if(G!==0){if(H>=$&&(Q.wordWrap===!1||Q.trim===!1))U.push(""),H=0;if(H>0||Q.trim===!1)U[U.length-1]+=" ",H++}if(Q.hard&&X[G]>$){let D=$-H,N=1+Math.floor((X[G]-D-1)/$);if(Math.floor((X[G]-1)/$)<N)U.push("");kZ(U,K,$);continue}if(H+X[G]>$&&H>0&&X[G]>0){if(Q.wordWrap===!1&&H<$){kZ(U,K,$);continue}U.push("")}if(H+X[G]>$&&Q.wordWrap===!1){kZ(U,K,$);continue}U[U.length-1]+=K}if(Q.trim!==!1)U=U.map((G)=>g$(G));let q=U.join(`
|
|
12
|
-
`),j=[...q],F=0;for(let[G,K]of j.entries()){if(z+=K,EZ.has(K)){let{groups:D}=new RegExp(`(?:\\${N0}(?<code>\\d+)m|\\${wZ}(?<uri>.*)${lZ})`).exec(q.slice(F))||{groups:{}};if(D.code!==void 0){let N=Number.parseFloat(D.code);J=N===y$?void 0:N}else if(D.uri!==void 0)Y=D.uri.length===0?void 0:D.uri}let H=v$.codes.get(Number(J));if(j[G+1]===`
|
|
13
|
-
`){if(Y)z+=z0("");if(J&&H)z+=Q0(H)}else if(K===`
|
|
14
|
-
`){if(J&&H)z+=Q0(J);if(Y)z+=z0(Y)}F+=K.length}return z};function J0(Z,$,Q){return String(Z).normalize().replaceAll(`\r
|
|
15
|
-
`,`
|
|
16
|
-
`).split(`
|
|
17
|
-
`).map((z)=>_$(z,$,Q)).join(`
|
|
18
|
-
`)}class p{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;_manualLine="";state="initial";error="";value;userInput="";constructor(Z,$=!0){let{input:Q=W$,output:z=L$,render:J,signal:Y,...X}=Z;this.opts=X,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=J.bind(this),this._track=$,this._abortSignal=Y,this.input=Q,this.output=z}unsubscribe(){this._subscribers.clear()}setSubscriber(Z,$){let Q=this._subscribers.get(Z)??[];Q.push($),this._subscribers.set(Z,Q)}on(Z,$){return this.setSubscriber(Z,{cb:$}),this}once(Z,$){return this.setSubscriber(Z,{cb:$,once:!0}),this}emit(Z,...$){let Q=this._subscribers.get(Z)??[],z=[];for(let J of Q)if(J.cb(...$),J.once)z.push(()=>Q.splice(Q.indexOf(J),1));for(let J of z)J();return this}prompt(){return new Promise((Z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),Z(fZ);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}if(this.rl=M$.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0)this._setUserInput(this.opts.initialUserInput,!0);this.input.on("keypress",this.onKeypress),WZ(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(_.show),this.output.off("resize",this.render),WZ(this.input,!1),Z(this.value)}),this.once("cancel",()=>{this.output.write(_.show),this.output.off("resize",this.render),WZ(this.input,!1),Z(fZ)})})}_isActionKey(Z,$){return Z==="\t"}_setValue(Z){this.value=Z,this.emit("value",this.value)}_setUserInput(Z,$){if(this.userInput=Z??"",this.emit("userInput",this.userInput),$&&this._track&&this.rl)this.rl.write(this.userInput),this._cursor=this.rl.cursor}onKeypress(Z,$){if(this._track&&$.name!=="return"){if($.name&&this._isActionKey(Z,$))this.rl?.write(null,{ctrl:!0,name:"h"});this._cursor=this.rl?.cursor??0;let Q=$.name==="tab"||$.name==="escape"||$.name==="backspace"||$.name==="delete"||$.name==="enter"||$.name==="return"||$.name&&["up","down","left","right"].includes($.name);if(Z&&!Q&&Z.length===1&&Z>=" ")this._manualLine+=Z;else if($.name==="backspace"&&this._manualLine.length>0)this._manualLine=this._manualLine.slice(0,-1);let z=this._manualLine.length>=(this.rl?.line?.length||0)?this._manualLine:this.rl?.line;this._setUserInput(z)}if(this.state==="error")this.state="active",this.error="";if($?.name){if(!this._track&&l.aliases.has($.name))this.emit("cursor",l.aliases.get($.name));if(l.actions.has($.name))this.emit("cursor",$.name)}if(Z&&(Z.toLowerCase()==="y"||Z.toLowerCase()==="n"))this.emit("confirm",Z.toLowerCase()==="y");if(this.emit("key",Z?.toLowerCase(),$),$?.name==="return"){if(this.opts.validate){let Q=this.opts.validate(this.value);if(Q)this.error=Q instanceof Error?Q.message:Q,this.state="error"}if(this.state!=="error")this.state="submit"}if(xZ([Z,$?.name,$?.sequence],"cancel"))this.state="cancel";if(this.state==="submit"||this.state==="cancel")this.emit("finalize");if(this.render(),this.state==="submit"||this.state==="cancel")this.close()}close(){if(this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
19
|
-
`),WZ(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.state==="cancel")setTimeout(()=>{this.unsubscribe()},10);else this.unsubscribe()}restoreCursor(){let Z=J0(this._prevFrame,tZ.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
20
|
-
`).length-1;this.output.write(_.move(-999,Z*-1))}render(){let Z=J0(this._render(this)??"",tZ.stdout.columns,{hard:!0,trim:!1});if(Z===this._prevFrame)return;if(this.state==="initial")this.output.write(_.hide);else{let $=G$(this._prevFrame,Z);if(this.restoreCursor(),$&&$?.length===1){let Q=$[0];this.output.write(_.move(0,Q)),this.output.write(FZ.lines(1));let z=Z.split(`
|
|
21
|
-
`);this.output.write(z[Q]),this._prevFrame=Z,this.output.write(_.move(0,z.length-Q-1));return}if($&&$?.length>1){let Q=$[0];this.output.write(_.move(0,Q)),this.output.write(FZ.down());let J=Z.split(`
|
|
22
|
-
`).slice(Q);this.output.write(J.join(`
|
|
23
|
-
`)),this._prevFrame=Z;return}this.output.write(FZ.down())}if(this.output.write(Z),this.state==="initial")this.state="active";this._prevFrame=Z}}function d$(Z,$){if(Z===void 0)return 0;if($.length===0)return 0;let z=$.findIndex((J)=>J.value===Z);return z!==-1?z:0}function u$(Z,$){return($.label??String($.value)).toLowerCase().includes(Z.toLowerCase())}function m$(Z,$){if(!$)return;if(Z)return $;return $[0]}class aZ extends p{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#Z=0;#Q="";#z;#$;get cursor(){return this.#Z}get userInputWithCursor(){if(!this.userInput)return AZ.default.inverse(AZ.default.hidden("_"));if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let Z=this.userInput.slice(0,this._cursor),[$,...Q]=this.userInput.slice(this._cursor);return`${Z}${AZ.default.inverse($)}${Q.join("")}`}get options(){if(typeof this.#$==="function")return this.#$();return this.#$}constructor(Z){super(Z);this.#$=Z.options;let $=this.options;this.filteredOptions=[...$],this.multiple=Z.multiple===!0,this.#z=Z.filter??u$;let Q;if(Z.initialValue&&Array.isArray(Z.initialValue))if(this.multiple)Q=Z.initialValue;else Q=Z.initialValue.slice(0,1);else if(!this.multiple&&this.options.length>0)Q=[this.options[0].value];if(Q)for(let z of Q){let J=$.findIndex((Y)=>Y.value===z);if(J!==-1)this.toggleSelected(z),this.#Z=J}this.focusedValue=this.options[this.#Z]?.value,this.on("key",(z,J)=>this.#J(z,J)),this.on("userInput",(z)=>this.#Y(z))}_isActionKey(Z,$){return Z==="\t"||this.multiple&&this.isNavigating&&$.name==="space"&&Z!==void 0&&Z!==""}#J(Z,$){let Q=$.name==="up",z=$.name==="down",J=$.name==="return";if(Q||z){if(this.#Z=Math.max(0,Math.min(this.#Z+(Q?-1:1),this.filteredOptions.length-1)),this.focusedValue=this.filteredOptions[this.#Z]?.value,!this.multiple)this.selectedValues=[this.focusedValue];this.isNavigating=!0}else if(J)this.value=m$(this.multiple,this.selectedValues);else if(this.multiple)if(this.focusedValue!==void 0&&($.name==="tab"||this.isNavigating&&$.name==="space"))this.toggleSelected(this.focusedValue);else this.isNavigating=!1;else{if(this.focusedValue)this.selectedValues=[this.focusedValue];this.isNavigating=!1}}deselectAll(){this.selectedValues=[]}toggleSelected(Z){if(this.filteredOptions.length===0)return;if(this.multiple)if(this.selectedValues.includes(Z))this.selectedValues=this.selectedValues.filter(($)=>$!==Z);else this.selectedValues=[...this.selectedValues,Z];else this.selectedValues=[Z]}#Y(Z){if(Z!==this.#Q){this.#Q=Z;let $=this.options;if(Z)this.filteredOptions=$.filter((Q)=>this.#z(Z,Q));else this.filteredOptions=[...$];if(this.#Z=d$(this.focusedValue,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#Z]?.value,!this.multiple)if(this.focusedValue!==void 0)this.toggleSelected(this.focusedValue);else this.deselectAll()}}}class B0 extends p{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(Z){super(Z,!1);this.value=!!Z.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",($)=>{this.output.write(_.move(0,-1)),this.value=$,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}class T0 extends p{options;cursor=0;#Z;getGroupItems(Z){return this.options.filter(($)=>$.group===Z)}isGroupSelected(Z){let $=this.getGroupItems(Z),Q=this.value;if(Q===void 0)return!1;return $.every((z)=>Q.includes(z.value))}toggleValue(){let Z=this.options[this.cursor];if(this.value===void 0)this.value=[];if(Z.group===!0){let $=Z.value,Q=this.getGroupItems($);if(this.isGroupSelected($))this.value=this.value.filter((z)=>Q.findIndex((J)=>J.value===z)===-1);else this.value=[...this.value,...Q.map((z)=>z.value)];this.value=Array.from(new Set(this.value))}else{let $=this.value.includes(Z.value);this.value=$?this.value.filter((Q)=>Q!==Z.value):[...this.value,Z.value]}}constructor(Z){super(Z,!1);let{options:$}=Z;this.#Z=Z.selectableGroups!==!1,this.options=Object.entries($).flatMap(([Q,z])=>[{value:Q,group:!0,label:Q},...z.map((J)=>({...J,group:Q}))]),this.value=[...Z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:Q})=>Q===Z.cursorAt),this.#Z?0:1),this.on("cursor",(Q)=>{switch(Q){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let z=this.options[this.cursor]?.group===!0;if(!this.#Z&&z)this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let z=this.options[this.cursor]?.group===!0;if(!this.#Z&&z)this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}case"space":this.toggleValue();break}})}}class w0 extends p{options;cursor=0;get _value(){return this.options[this.cursor].value}toggleAll(){let Z=this.value!==void 0&&this.value.length===this.options.length;this.value=Z?[]:this.options.map(($)=>$.value)}toggleValue(){if(this.value===void 0)this.value=[];let Z=this.value.includes(this._value);this.value=Z?this.value.filter(($)=>$!==this._value):[...this.value,this._value]}constructor(Z){super(Z,!1);this.options=Z.options,this.value=[...Z.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:$})=>$===Z.cursorAt),0),this.on("key",($)=>{if($==="a")this.toggleAll()}),this.on("cursor",($)=>{switch($){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}}var bZ=A(k(),1);class P0 extends p{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let Z=this.userInput;if(this.cursor>=Z.length)return`${this.masked}${bZ.default.inverse(bZ.default.hidden("_"))}`;let $=this.masked,Q=$.slice(0,this.cursor),z=$.slice(this.cursor);return`${Q}${bZ.default.inverse(z[0])}${z.slice(1)}`}constructor({mask:Z,...$}){super($);this._mask=Z??"\u2022",this.on("userInput",(Q)=>{this._setValue(Q)})}}class I0 extends p{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(Z){super(Z,!1);if(this.options=Z.options,this.cursor=this.options.findIndex(({value:$})=>$===Z.initialValue),this.cursor===-1)this.cursor=0;this.changeValue(),this.on("cursor",($)=>{switch($){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}}class R0 extends p{options;cursor=0;constructor(Z){super(Z,!1);this.options=Z.options;let $=this.options.map(({value:[Q]})=>Q?.toLowerCase());this.cursor=Math.max($.indexOf(Z.initialValue),0),this.on("key",(Q)=>{if(!Q||!$.includes(Q))return;let z=this.options.find(({value:[J]})=>J?.toLowerCase()===Q);if(z)this.value=z.value,this.state="submit",this.emit("submit")})}}var x$=A(k(),1);class E0 extends p{placeholder;get userInputWithCursor(){if(this.state==="submit")return this.userInput;let Z=this.userInput;if(this.cursor>=Z.length)return`${this.userInput}\u2588`;let $=Z.slice(0,this.cursor),[Q,...z]=Z.slice(this.cursor);return`${$}${x$.default.inverse(Q)}${z.join("")}`}get cursor(){return this._cursor}constructor(Z){super({...Z,initialUserInput:Z.initialUserInput??Z.initialValue});this.placeholder=Z.placeholder,this.on("key",($)=>{if($==="\t"&&this.placeholder){if(!this.value)this._setValue(this.placeholder),this._setUserInput(this.placeholder,!0)}}),this.on("userInput",($)=>{this._setValue($)}),this.on("finalize",()=>{if(!this.userInput&&this.placeholder)this.value=this.placeholder;if(!this.value)this.value=Z.defaultValue;if(this.value===void 0)this.value=""})}}var LZ=A(k(),1),r={red:["\x1B[31m","\x1B[39m"],green:["\x1B[32m","\x1B[39m"],blue:["\x1B[34m","\x1B[39m"],yellow:["\x1B[33m","\x1B[39m"],cyan:["\x1B[36m","\x1B[39m"],magenta:["\x1B[35m","\x1B[39m"],white:["\x1B[37m","\x1B[39m"],gray:["\x1B[90m","\x1B[39m"],bgRed:["\x1B[41m","\x1B[49m"],bgGreen:["\x1B[42m","\x1B[49m"],bgBlue:["\x1B[44m","\x1B[49m"],bgYellow:["\x1B[43m","\x1B[49m"],bgCyan:["\x1B[46m","\x1B[49m"],bgMagenta:["\x1B[45m","\x1B[49m"],bold:["\x1B[1m","\x1B[22m"],italic:["\x1B[3m","\x1B[23m"],underline:["\x1B[4m","\x1B[24m"],dim:["\x1B[2m","\x1B[22m"],inverse:["\x1B[7m","\x1B[27m"],hidden:["\x1B[8m","\x1B[28m"],strikethrough:["\x1B[9m","\x1B[29m"]},JZ={primary:"blue",secondary:"cyan",success:"green",warning:"yellow",error:"red",info:"magenta",muted:"gray"};function a$(){return!0}function n$(){let Z={};Z.supportsColor=a$();function $(z,J=[]){let Y=z===""?[]:[...J,z],X=function(q){if(!Z.supportsColor)return q;let j="",F="";for(let G of Y)if(G in JZ&&JZ[G]in r){let K=JZ[G];j+=r[K][0],F=r[K][1]+F}else if(G in r)j+=r[G][0],F=r[G][1]+F;return j+q+F},U=[...Object.keys(r),...Object.keys(JZ)];for(let q of U)if(!(q in X))Object.defineProperty(X,q,{get(){return $(q,Y)}});return X}let Q=[...Object.keys(r),...Object.keys(JZ)];for(let z of Q)if(!(z in Z))Object.defineProperty(Z,z,{get(){return $(z)}});return Z}var A0=n$();function fQ(Z){for(let $ in Z)if(Z[$]!==void 0)JZ[$]=Z[$]}function SQ(Z){if(Z.colors!==void 0)A0.supportsColor=Z.colors}function gQ(Z,$){let Q=$?.title?` ${$.title} `:"",z=$?.padding||0,J=" ".repeat(z),Y=Z.split(`
|
|
24
|
-
`),U=Math.max(...Y.map((j)=>j.length))+z*2,q=U;console.log(`\u250C${Q?"\u2500".repeat(Math.floor((q-Q.length)/2))+Q+"\u2500".repeat(Math.ceil((q-Q.length)/2)):"\u2500".repeat(q)}\u2510`),console.log(`\u2502${" ".repeat(q)}\u2502`);for(let j of Y){let F=U-j.length-z;console.log(`\u2502${J}${j}${" ".repeat(F)}\u2502`)}console.log(`\u2502${" ".repeat(q)}\u2502`),console.log(`\u2514${"\u2500".repeat(q)}\u2518`)}function _Q(Z){let $=Z?.title?` ${Z.title} `:"",z=Z.content.split(`
|
|
25
|
-
`),Y=Math.max(...z.map((X)=>X.length))+2;console.log(`\u2554${$?"\u2550".repeat(Math.floor((Y-$.length)/2))+$+"\u2550".repeat(Math.ceil((Y-$.length)/2)):"\u2550".repeat(Y)}\u2557`),console.log(`\u2551${" ".repeat(Y)}\u2551`);for(let X of z){let U=Y-X.length-1;console.log(`\u2551 ${X}${" ".repeat(U)}\u2551`)}console.log(`\u2551${" ".repeat(Y)}\u2551`),console.log(`\u255A${"\u2550".repeat(Y)}\u255D`)}function dQ(Z,$){if(!Z||Z.length===0)return;let Q=Array.from({length:Z[0].length},()=>0);for(let J of Z)for(let Y=0;Y<J.length;Y++)Q[Y]=Math.max(Q[Y],String(J[Y]).length);if($?.border)console.log(`\u250C${Q.map((J)=>"\u2500".repeat(J+2)).join("\u252C")}\u2510`);if($?.header&&Z.length>0)if(console.log(($.border?"\u2502 ":"")+Z[0].map((J,Y)=>`${J}${" ".repeat(Q[Y]-String(J).length)}`).join(" \u2502 ")+($.border?" \u2502":"")),$.border)console.log(`\u251C${Q.map((J)=>"\u2500".repeat(J+2)).join("\u253C")}\u2524`);else console.log(`${Q.map((J)=>"\u2500".repeat(J)).join("\u2500\u253C\u2500")}`);let z=$?.header?1:0;for(let J=z;J<Z.length;J++)console.log(($?.border?"\u2502 ":"")+Z[J].map((Y,X)=>`${Y}${" ".repeat(Q[X]-String(Y).length)}`).join(" \u2502 ")+($?.border?" \u2502":""));if($?.border)console.log(`\u2514${Q.map((J)=>"\u2500".repeat(J+2)).join("\u2534")}\u2518`)}var SZ=Q$(),C0=()=>l$.env.CI==="true";function c$(Z){return Z.isTTY===!0}var R=(Z,$)=>SZ?Z:$,p$=R("\u25C6","*"),k0=R("\u25A0","x"),b0=R("\u25B2","x"),XZ=R("\u25C7","o"),i$=R("\u250C","T"),V=R("\u2502","|"),S=R("\u2514","\u2014"),PZ=R("\u25CF",">"),IZ=R("\u25CB"," "),gZ=R("\u25FB","[\u2022]"),YZ=R("\u25FC","[+]"),nZ=R("\u25FB","[ ]"),r$=R("\u25AA","\u2022"),Y0=R("\u2500","-"),s$=R("\u256E","+"),e$=R("\u251C","+"),t$=R("\u256F","+"),h0=R("\u25CF","\u2022"),v0=R("\u25C6","*"),y0=R("\u25B2","!"),f0=R("\u25A0","x");function i(Z){switch(Z){case"initial":case"active":return LZ.default.cyan(p$);case"cancel":return LZ.default.red(k0);case"error":return LZ.default.yellow(b0);case"submit":return LZ.default.green(XZ)}}function $Z(Z){return Z.replace(/_([^_]+)_/g,($,Q)=>A0.italic(Q))}var o$=A(k(),1);function KZ(Z){let{cursor:$,options:Q,style:z}=Z,J=Z.output??ZQ.stdout,Y=J instanceof $Q&&J.rows!==void 0?J.rows:10,X=o$.default.dim("..."),U=Z.maxItems??Number.POSITIVE_INFINITY,q=Math.max(Y-4,0),j=Math.min(q,Math.max(U,5)),F=0;if($>=F+j-3)F=Math.max(Math.min($-j+3,Q.length-j),0);else if($<F+2)F=Math.max($-2,0);let G=j<Q.length&&F>0,K=j<Q.length&&F+j<Q.length;return Q.slice(F,F+j).map((H,D,N)=>{let W=D===0&&G,O=D===N.length-1&&K;return W||O?X:z(H,D+F===$)})}function X0(Z){return Z.label??String(Z.value??"")}function S0(Z,$){if(!Z)return!0;let Q=($.label??String($.value??"")).toLowerCase(),z=($.hint??"").toLowerCase(),J=String($.value).toLowerCase(),Y=Z.toLowerCase();return Q.includes(Y)||z.includes(Y)||J.includes(Y)}function QQ(Z,$){let Q=[];for(let z of $)if(Z.includes(z.value))Q.push(z);return Q}function zQ(Z){return new aZ({options:Z.options,initialValue:Z.initialValue?[Z.initialValue]:void 0,initialUserInput:Z.initialUserInput,filter:(Q,z)=>{return S0(Q,z)},signal:Z.signal,input:Z.input,output:Z.output,validate:Z.validate,render(){let Q=`${L.default.gray(V)}
|
|
26
|
-
${i(this.state)} ${Z.message}
|
|
27
|
-
`,z=this.userInput,J=String(this.value??""),Y=this.options,X=Z.placeholder,U=J===""&&X!==void 0;switch(this.state){case"submit":{let q=QQ(this.selectedValues,Y),j=q.length>0?` ${L.default.dim(q.map(X0).join(", "))}`:"";return`${Q}${L.default.gray(V)}${j}`}case"cancel":{let q=z?` ${L.default.strikethrough(L.default.dim(z))}`:"";return`${Q}${L.default.gray(V)}${q}`}default:{let q="";if(this.isNavigating||U){let D=U?X:z;q=D!==""?` ${L.default.dim(D)}`:""}else q=` ${this.userInputWithCursor}`;let j=this.filteredOptions.length!==Y.length?L.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",F=this.filteredOptions.length===0?[]:KZ({cursor:this.cursor,options:this.filteredOptions,style:(D,N)=>{let W=X0(D),O=D.hint&&D.value===this.focusedValue?L.default.dim(` (${D.hint})`):"";return N?`${L.default.green(PZ)} ${W}${O}`:`${L.default.dim(IZ)} ${L.default.dim(W)}${O}`},maxItems:Z.maxItems,output:Z.output}),G=[`${L.default.dim("\u2191/\u2193")} to select`,`${L.default.dim("Enter:")} confirm`,`${L.default.dim("Type:")} to search`],K=this.filteredOptions.length===0&&z?[`${L.default.cyan(V)} ${L.default.yellow("No matches found")}`]:[],H=this.state==="error"?[`${L.default.yellow(V)} ${L.default.yellow(this.error)}`]:[];return[`${Q}${L.default.cyan(V)}`,`${L.default.cyan(V)} ${L.default.dim("Search:")}${q}${j}`,...K,...H,...F.map((D)=>`${L.default.cyan(V)} ${D}`),`${L.default.cyan(V)} ${L.default.dim(G.join(" \u2022 "))}`,`${L.default.cyan(S)}`].join(`
|
|
28
|
-
`)}}}}).prompt()}function xQ(Z){let $=(z,J,Y,X)=>{let U=Y.includes(z.value),q=z.label??String(z.value??""),j=z.hint&&X!==void 0&&z.value===X?L.default.dim(` (${z.hint})`):"",F=U?L.default.green(YZ):L.default.dim(nZ);if(J)return`${F} ${q}${j}`;return`${F} ${L.default.dim(q)}`},Q=new aZ({options:Z.options,multiple:!0,filter:(z,J)=>{return S0(z,J)},validate:()=>{if(Z.required&&Q.selectedValues.length===0)return"Please select at least one item";return},initialValue:Z.initialValues,signal:Z.signal,input:Z.input,output:Z.output,render(){let z=`${L.default.gray(V)}
|
|
29
|
-
${i(this.state)} ${Z.message}
|
|
30
|
-
`,J=this.userInput,Y=Z.placeholder,X=J===""&&Y!==void 0,U=this.isNavigating||X?L.default.dim(X?Y:J):this.userInputWithCursor,q=this.options,j=this.filteredOptions.length!==q.length?L.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${z}${L.default.gray(V)} ${L.default.dim(`${this.selectedValues.length} items selected`)}`;case"cancel":return`${z}${L.default.gray(V)} ${L.default.strikethrough(L.default.dim(J))}`;default:{let F=[`${L.default.dim("\u2191/\u2193")} to navigate`,`${L.default.dim("Space:")} select`,`${L.default.dim("Enter:")} confirm`,`${L.default.dim("Type:")} to search`],G=this.filteredOptions.length===0&&J?[`${L.default.cyan(V)} ${L.default.yellow("No matches found")}`]:[],K=this.state==="error"?[`${L.default.cyan(V)} ${L.default.yellow(this.error)}`]:[],H=KZ({cursor:this.cursor,options:this.filteredOptions,style:(D,N)=>$(D,N,this.selectedValues,this.focusedValue),maxItems:Z.maxItems,output:Z.output});return[z,`${L.default.cyan(V)} ${L.default.dim("Search:")} ${U}${j}`,...G,...K,...H.map((D)=>`${L.default.cyan(V)} ${D}`),`${L.default.cyan(V)} ${L.default.dim(F.join(" \u2022 "))}`,`${L.default.cyan(S)}`].join(`
|
|
31
|
-
`)}}}});return Q.prompt()}var y=A(k(),1);function lQ(Z){let $=Z.active??"Yes",Q=Z.inactive??"No",z=$Z(Z.message);return new B0({active:$,inactive:Q,signal:Z.signal,input:Z.input,output:Z.output,initialValue:Z.initialValue??!0,render(){let J=`${y.default.gray(V)}
|
|
32
|
-
${i(this.state)} ${z}
|
|
33
|
-
`,Y=this.value?$:Q;switch(this.state){case"submit":return`${J}${y.default.gray(V)} ${y.default.dim(Y)}`;case"cancel":return`${J}${y.default.gray(V)} ${y.default.strikethrough(y.default.dim(Y))}
|
|
34
|
-
${y.default.gray(V)}`;default:return`${J}${y.default.cyan(V)} ${this.value?`${y.default.green(PZ)} ${$}`:`${y.default.dim(IZ)} ${y.default.dim($)}`} ${y.default.dim("/")} ${!this.value?`${y.default.green(PZ)} ${Q}`:`${y.default.dim(IZ)} ${y.default.dim(Q)}`}
|
|
35
|
-
${y.default.cyan(S)}
|
|
36
|
-
`}}}).prompt()}async function aQ(Z,$){let Q={},z=Object.keys(Z);for(let J of z){let Y=Z[J],X=await Y({results:Q})?.catch((U)=>{throw U});if(typeof $?.onCancel==="function"&&H$(X)){Q[J]="canceled",$.onCancel({results:Q});continue}Q[J]=X}return Q}var M=A(k(),1);function nQ(Z){let{selectableGroups:$=!0,groupSpacing:Q=0}=Z,z=(Y,X,U=[])=>{let q=Y.label??String(Y.value),j=typeof Y.group==="string",F=j&&(U[U.indexOf(Y)+1]??{group:!0}),G=j&&F.group===!0,K=j?$?`${G?S:V} `:" ":"",H="";if(Q>0&&!j){let N=`
|
|
37
|
-
${M.default.cyan(V)}`;H=`${N.repeat(Q-1)}${N} `}if(X==="active")return`${H}${M.default.dim(K)}${M.default.cyan(gZ)} ${q}${Y.hint?` ${M.default.dim(`(${Y.hint})`)}`:""}`;if(X==="group-active")return`${H}${K}${M.default.cyan(gZ)} ${M.default.dim(q)}`;if(X==="group-active-selected")return`${H}${K}${M.default.green(YZ)} ${M.default.dim(q)}`;if(X==="selected"){let N=j||$?M.default.green(YZ):"";return`${H}${M.default.dim(K)}${N} ${M.default.dim(q)}${Y.hint?` ${M.default.dim(`(${Y.hint})`)}`:""}`}if(X==="cancelled")return`${M.default.strikethrough(M.default.dim(q))}`;if(X==="active-selected")return`${H}${M.default.dim(K)}${M.default.green(YZ)} ${q}${Y.hint?` ${M.default.dim(`(${Y.hint})`)}`:""}`;if(X==="submitted")return`${M.default.dim(q)}`;let D=j||$?M.default.dim(nZ):"";return`${H}${M.default.dim(K)}${D} ${M.default.dim(q)}`},J=Z.required??!0;return new T0({options:Z.options,signal:Z.signal,input:Z.input,output:Z.output,initialValues:Z.initialValues,required:J,cursorAt:Z.cursorAt,selectableGroups:$,validate(Y){if(J&&(Y===void 0||Y.length===0))return`Please select at least one option.
|
|
38
|
-
${M.default.reset(M.default.dim(`Press ${M.default.gray(M.default.bgWhite(M.default.inverse(" space ")))} to select, ${M.default.gray(M.default.bgWhite(M.default.inverse(" enter ")))} to submit`))}`},render(){let Y=`${M.default.gray(V)}
|
|
39
|
-
${i(this.state)} ${Z.message}
|
|
40
|
-
`,X=this.value??[];switch(this.state){case"submit":{let U=this.options.filter(({value:j})=>X.includes(j)).map((j)=>z(j,"submitted")),q=U.length===0?"":` ${U.join(M.default.dim(", "))}`;return`${Y}${M.default.gray(V)}${q}`}case"cancel":{let U=this.options.filter(({value:q})=>X.includes(q)).map((q)=>z(q,"cancelled")).join(M.default.dim(", "));return`${Y}${M.default.gray(V)} ${U.trim()?`${U}
|
|
41
|
-
${M.default.gray(V)}`:""}`}case"error":{let U=this.error.split(`
|
|
42
|
-
`).map((q,j)=>j===0?`${M.default.yellow(S)} ${M.default.yellow(q)}`:` ${q}`).join(`
|
|
43
|
-
`);return`${Y}${M.default.yellow(V)} ${this.options.map((q,j,F)=>{let G=X.includes(q.value)||q.group===!0&&this.isGroupSelected(`${q.value}`),K=j===this.cursor;if(!K&&typeof q.group==="string"&&this.options[this.cursor].value===q.group)return z(q,G?"group-active-selected":"group-active",F);if(K&&G)return z(q,"active-selected",F);if(G)return z(q,"selected",F);return z(q,K?"active":"inactive",F)}).join(`
|
|
44
|
-
${M.default.yellow(V)} `)}
|
|
45
|
-
${U}
|
|
46
|
-
`}default:{let U=this.options.map((j,F,G)=>{let K=X.includes(j.value)||j.group===!0&&this.isGroupSelected(`${j.value}`),H=F===this.cursor,D=!H&&typeof j.group==="string"&&this.options[this.cursor].value===j.group,N="";if(D)N=z(j,K?"group-active-selected":"group-active",G);else if(H&&K)N=z(j,"active-selected",G);else if(K)N=z(j,"selected",G);else N=z(j,H?"active":"inactive",G);return`${F!==0&&!N.startsWith(`
|
|
47
|
-
`)?" ":""}${N}`}).join(`
|
|
48
|
-
${M.default.cyan(V)}`),q=U.startsWith(`
|
|
49
|
-
`)?"":" ";return`${Y}${M.default.cyan(V)}${q}${U}
|
|
50
|
-
${M.default.cyan(S)}
|
|
51
|
-
`}}}}).prompt()}var s=A(k(),1);function YQ(Z){if(Array.isArray(Z))return Z.map(($)=>$Z($));return $Z(Z)}var d={message:(Z=[],{symbol:$=s.default.gray(V),secondarySymbol:Q=s.default.gray(V),output:z=JQ.stdout,spacing:J=1}={})=>{let Y=[];for(let q=0;q<J;q++)Y.push(`${Q}`);let X=YQ(Z),U=Array.isArray(X)?X:X.split(`
|
|
52
|
-
`);if(U.length>0){let[q,...j]=U;if(q.length>0)Y.push(`${$} ${q}`);else Y.push($);for(let F of j)if(F.length>0)Y.push(`${Q} ${F}`);else Y.push(Q)}z.write(`${Y.join(`
|
|
53
|
-
`)}
|
|
54
|
-
`)},info:(Z,$)=>{d.message(Z,{...$,symbol:s.default.blue(h0)})},success:(Z,$)=>{d.message(Z,{...$,symbol:s.default.green(v0)})},step:(Z,$)=>{d.message(Z,{...$,symbol:s.default.green(XZ)})},warn:(Z,$)=>{d.message(Z,{...$,symbol:s.default.yellow(y0)})},warning:(Z,$)=>{d.warn(Z,$)},error:(Z,$)=>{d.message(Z,{...$,symbol:s.default.red(f0)})},custom:(Z,$,Q,z)=>{let J=typeof Q==="string"?(Y)=>s.default[Q]?.(Y)||Y:Q;d.message($,{...z,symbol:J(Z),secondarySymbol:J(Z)})}},HZ=A(k(),1);function iQ(Z="",$){($?.output??cZ.stdout).write(`${HZ.default.gray(S)} ${HZ.default.red(Z)}
|
|
55
|
-
|
|
56
|
-
`)}function rQ(Z="",$){($?.output??cZ.stdout).write(`${HZ.default.gray(i$)} ${Z}
|
|
57
|
-
`)}function sQ(Z="",$){($?.output??cZ.stdout).write(`${HZ.default.gray(V)}
|
|
58
|
-
${HZ.default.gray(S)} ${Z}
|
|
59
|
-
|
|
60
|
-
`)}var B=A(k(),1);function eQ(Z){let $=(z,J)=>{let Y=z.label??String(z.value);if(J==="active")return`${B.default.cyan(gZ)} ${Y}${z.hint?` ${B.default.dim(`(${z.hint})`)}`:""}`;if(J==="selected")return`${B.default.green(YZ)} ${B.default.dim(Y)}${z.hint?` ${B.default.dim(`(${z.hint})`)}`:""}`;if(J==="cancelled")return`${B.default.strikethrough(B.default.dim(Y))}`;if(J==="active-selected")return`${B.default.green(YZ)} ${Y}${z.hint?` ${B.default.dim(`(${z.hint})`)}`:""}`;if(J==="submitted")return`${B.default.dim(Y)}`;return`${B.default.dim(nZ)} ${B.default.dim(Y)}`},Q=Z.required??!0;return new w0({options:Z.options,input:Z.input,output:Z.output,initialValues:Z.initialValues,required:Q,cursorAt:Z.cursorAt,validate(z){if(Q&&(z===void 0||z.length===0))return`Please select at least one option.
|
|
61
|
-
${B.default.reset(B.default.dim(`Press ${B.default.gray(B.default.bgWhite(B.default.inverse(" space ")))} to select, ${B.default.gray(B.default.bgWhite(B.default.inverse(" enter ")))} to submit`))}`},render(){let z=`${B.default.gray(V)}
|
|
62
|
-
${i(this.state)} ${Z.message}
|
|
63
|
-
`,J=this.value??[],Y=(X,U)=>{let q=J.includes(X.value);if(U&&q)return $(X,"active-selected");if(q)return $(X,"selected");return $(X,U?"active":"inactive")};switch(this.state){case"submit":return`${z}${B.default.gray(V)} ${this.options.filter(({value:X})=>J.includes(X)).map((X)=>$(X,"submitted")).join(B.default.dim(", "))||B.default.dim("none")}`;case"cancel":{let X=this.options.filter(({value:U})=>J.includes(U)).map((U)=>$(U,"cancelled")).join(B.default.dim(", "));return`${z}${B.default.gray(V)}${X.trim()?` ${X}
|
|
64
|
-
${B.default.gray(V)}`:""}`}case"error":{let X=this.error.split(`
|
|
65
|
-
`).map((U,q)=>q===0?`${B.default.yellow(S)} ${B.default.yellow(U)}`:` ${U}`).join(`
|
|
66
|
-
`);return`${z+B.default.yellow(V)} ${KZ({output:Z.output,options:this.options,cursor:this.cursor,maxItems:Z.maxItems,style:Y}).join(`
|
|
67
|
-
${B.default.yellow(V)} `)}
|
|
68
|
-
${X}
|
|
69
|
-
`}default:return`${z}${B.default.cyan(V)} ${KZ({output:Z.output,options:this.options,cursor:this.cursor,maxItems:Z.maxItems,style:Y}).join(`
|
|
70
|
-
${B.default.cyan(V)} `)}
|
|
71
|
-
${B.default.cyan(S)}
|
|
72
|
-
`}}}).prompt()}var e=A(k(),1),UQ=(Z)=>e.default.dim(Z);function Zz(Z="",$="",Q){let z=Q?.format??UQ,J=$Z(Z),Y=$Z($),X=["",...J.split(`
|
|
73
|
-
`).map(z),""],U=hZ(Y).length,q=Q?.output??XQ.stdout,j=Math.max(X.reduce((G,K)=>{let H=hZ(K);return H.length>G?H.length:G},0),U)+2,F=X.map((G)=>`${e.default.gray(V)} ${G}${" ".repeat(j-hZ(G).length)}${e.default.gray(V)}`).join(`
|
|
74
|
-
`);q.write(`${e.default.gray(V)}
|
|
75
|
-
${e.default.green(XZ)} ${e.default.reset(Y)} ${e.default.gray(Y0.repeat(Math.max(j-U-1,1))+s$)}
|
|
76
|
-
${F}
|
|
77
|
-
${e.default.gray(e$+Y0.repeat(j+2)+t$)}
|
|
78
|
-
`)}var m=A(k(),1);function $z(Z){return new P0({validate:Z.validate,mask:Z.mask??r$,signal:Z.signal,input:Z.input,output:Z.output,render(){let $=`${m.default.gray(V)}
|
|
79
|
-
${i(this.state)} ${Z.message}
|
|
80
|
-
`,Q=this.userInputWithCursor,z=this.masked;switch(this.state){case"error":{let J=z?` ${z}`:"";return`${$.trim()}
|
|
81
|
-
${m.default.yellow(V)}${J}
|
|
82
|
-
${m.default.yellow(S)} ${m.default.yellow(this.error)}
|
|
83
|
-
`}case"submit":{let J=z?` ${m.default.dim(z)}`:"";return`${$}${m.default.gray(V)}${J}`}case"cancel":{let J=z?` ${m.default.strikethrough(m.default.dim(z))}`:"";return`${$}${m.default.gray(V)}${J}${z?`
|
|
84
|
-
${m.default.gray(V)}`:""}`}default:return`${$}${m.default.cyan(V)} ${Q}
|
|
85
|
-
${m.default.cyan(S)}
|
|
86
|
-
`}}}).prompt()}function Yz(Z){let $=Z.validate;return zQ({...Z,initialUserInput:Z.initialValue??Z.root??GQ.cwd(),maxItems:5,validate(Q){if(Array.isArray(Q))return;if(!Q)return"Please select a path";if($)return $(Q);return},options(){let Q=this.userInput;if(Q==="")return[];try{let z;if(!qQ(Q))z=q0(Q);else if(U0(Q).isDirectory())z=Q;else z=q0(Q);return jQ(z).map((Y)=>{let X=FQ(z,Y),U=U0(X);return{name:Y,path:X,isDirectory:U.isDirectory()}}).filter(({path:Y,isDirectory:X})=>Y.startsWith(Q)&&(Z.directory||!X)).map((Y)=>({value:Y.path}))}catch{return[]}}})}var UZ=A(k(),1),qZ=A(k(),1);function g0({indicator:Z="dots",onCancel:$,output:Q=x.stdout,cancelMessage:z,errorMessage:J,frames:Y=SZ?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:X=SZ?80:120,signal:U}={}){let q=C0(),j,F,G=!1,K=!1,H="",D,N=performance.now();function W(){if(D===void 0)return;if(q)Q.write(`
|
|
87
|
-
`);let v=D.split(`
|
|
88
|
-
`);Q.write(_.move(-999,v.length-1)),Q.write(FZ.down(v.length))}function O(v){return v.replace(/\.+$/,"")}function P(v){let u=(performance.now()-v)/1000,a=Math.floor(u/60),QZ=Math.floor(u%60);return a>0?`[${a}m ${QZ}s]`:`[${QZ}s]`}function T(v="",u=0){G=!1,clearInterval(F),W();let a=u===0?qZ.default.green(XZ):u===1?qZ.default.red(k0):qZ.default.red(b0);if(H=v??H,Z==="timer")Q.write(`${a} ${H} ${P(N)}
|
|
89
|
-
`);else Q.write(`${a} ${H}
|
|
90
|
-
`);DZ(),j()}function C(v){let u=v>1?J??l.messages.error:z??l.messages.cancel;if(K=v===1,G){if(T(u,v),K&&typeof $==="function")$()}}function h(){C(2)}function c(){C(1)}function VZ(){x.on("uncaughtExceptionMonitor",h),x.on("unhandledRejection",h),x.on("SIGINT",c),x.on("SIGTERM",c),x.on("exit",C)}function DZ(){if(x.removeListener("uncaughtExceptionMonitor",h),x.removeListener("unhandledRejection",h),x.removeListener("SIGINT",c),x.removeListener("SIGTERM",c),x.removeListener("exit",C),U)U.removeEventListener("abort",c)}function d0(v=""){G=!0,j=V$({output:Q}),H=O(v),N=performance.now(),Q.write(`${qZ.default.gray(V)}
|
|
91
|
-
`);let u=0,a=0;VZ(),F=setInterval(()=>{if(q&&H===D)return;W(),D=H;let QZ=qZ.default.magenta(Y[u]);if(q)Q.write(`${QZ} ${H}...`);else if(Z==="timer")Q.write(`${QZ} ${H} ${P(N)}`);else{let m0=".".repeat(Math.floor(a)).slice(0,3);Q.write(`${QZ} ${H}${m0}`)}u=u+1<Y.length?u+1:0,a=a<4?a+0.125:0},X)}function u0(v=""){H=O(v??H)}return{start:d0,stop:T,message:u0,get isCancelled(){return K}}}var j0={light:R("\u2500","-"),heavy:R("\u2501","="),block:R("\u2588","#")};function Uz(Z={}){let{style:$="heavy",max:Q=100,size:z=40,...J}=Z,Y=g0(J),X=0,U="",q=Math.max(1,Q),j=Math.max(1,z),F=(D)=>{switch(D){case"initial":case"active":return UZ.default.magenta;case"error":case"cancel":return UZ.default.red;case"submit":return UZ.default.green;default:return UZ.default.magenta}},G=(D,N)=>{let W=Math.floor(X/q*j);return`${F(D)(j0[$].repeat(W))}${UZ.default.dim(j0[$].repeat(j-W))} ${N}`},K=(D="")=>{return U=D,Y.start(G("initial",D))},H=(D=1,N)=>{X=Math.min(q,D+X),Y.message(G("active",N??U)),U=N??U};return{start:K,stop:Y.stop,advance:H,isCancelled:Y.isCancelled,message:(D)=>H(0,D)}}var g=A(k(),1);function qz(Z){let $=$Z(Z.message),Q=(z,J)=>{let Y=z.label??String(z.value);switch(J){case"selected":return`${g.default.dim(Y)}`;case"active":return`${g.default.green(PZ)} ${Y}${z.hint?` ${g.default.dim(`(${z.hint})`)}`:""}`;case"cancelled":return`${g.default.strikethrough(g.default.dim(Y))}`;default:return`${g.default.dim(IZ)} ${g.default.dim(Y)}`}};return new I0({options:Z.options,signal:Z.signal,input:Z.input,output:Z.output,initialValue:Z.initialValue,render(){let z=`${g.default.gray(V)}
|
|
92
|
-
${i(this.state)} ${$}
|
|
93
|
-
`;switch(this.state){case"submit":return`${z}${g.default.gray(V)} ${Q(this.options[this.cursor],"selected")}`;case"cancel":return`${z}${g.default.gray(V)} ${Q(this.options[this.cursor],"cancelled")}
|
|
94
|
-
${g.default.gray(V)}`;default:return`${z}${g.default.cyan(V)} ${KZ({output:Z.output,cursor:this.cursor,options:this.options,maxItems:Z.maxItems,style:(J,Y)=>Q(J,Y?"active":"inactive")}).join(`
|
|
95
|
-
${g.default.cyan(V)} `)}
|
|
96
|
-
${g.default.cyan(S)}
|
|
97
|
-
`}}}).prompt()}var b=A(k(),1);function jz(Z){let $=(Q,z="inactive")=>{let J=Q.label??String(Q.value);if(z==="selected")return`${b.default.dim(J)}`;if(z==="cancelled")return`${b.default.strikethrough(b.default.dim(J))}`;if(z==="active")return`${b.default.bgCyan(b.default.gray(` ${Q.value} `))} ${J} ${Q.hint?b.default.dim(`(${Q.hint})`):""}`;return`${b.default.gray(b.default.bgWhite(b.default.inverse(` ${Q.value} `)))} ${J} ${Q.hint?b.default.dim(`(${Q.hint})`):""}`};return new R0({options:Z.options,signal:Z.signal,input:Z.input,output:Z.output,initialValue:Z.initialValue,render(){let Q=`${b.default.gray(V)}
|
|
98
|
-
${i(this.state)} ${Z.message}
|
|
99
|
-
`;switch(this.state){case"submit":return`${Q}${b.default.gray(V)} ${$(this.options.find((z)=>z.value===this.value)??Z.options[0],"selected")}`;case"cancel":return`${Q}${b.default.gray(V)} ${$(this.options[0],"cancelled")}
|
|
100
|
-
${b.default.gray(V)}`;default:return`${Q}${b.default.cyan(V)} ${this.options.map((z,J)=>$(z,J===this.cursor?"active":"inactive")).join(`
|
|
101
|
-
${b.default.cyan(V)} `)}
|
|
102
|
-
${b.default.cyan(S)}
|
|
103
|
-
`}}}).prompt()}var t=A(k(),1);function KQ(){return`${t.default.gray(V)} `}var F0=KQ(),zZ={message:async(Z,{symbol:$=t.default.gray(V)}={})=>{jZ.stdout.write(`${t.default.gray(V)}
|
|
104
|
-
${$} `);let Q=3;for await(let z of Z){if(z=z.replace(/\n/g,`
|
|
105
|
-
${F0}`),z.includes(`
|
|
106
|
-
`))Q=3+vZ(z.slice(z.lastIndexOf(`
|
|
107
|
-
`))).length;let J=vZ(z).length;if(Q+J<jZ.stdout.columns)Q+=J,jZ.stdout.write(z);else jZ.stdout.write(`
|
|
108
|
-
${F0}${z.trimStart()}`),Q=3+vZ(z.trimStart()).length}jZ.stdout.write(`
|
|
109
|
-
`)},info:(Z)=>{return zZ.message(Z,{symbol:t.default.blue(h0)})},success:(Z)=>{return zZ.message(Z,{symbol:t.default.green(v0)})},step:(Z)=>{return zZ.message(Z,{symbol:t.default.green(XZ)})},warn:(Z)=>{return zZ.message(Z,{symbol:t.default.yellow(y0)})},warning:(Z)=>{return zZ.warn(Z)},error:(Z)=>{return zZ.message(Z,{symbol:t.default.red(f0)})}};async function Kz(Z,$){for(let Q of Z){if(Q.enabled===!1)continue;let z=g0($);z.start(Q.title);let J=await Q.task(z.message);z.stop(J||Q.title)}}var MZ=A(k(),1);function Vz(Z){let $=Z.output??HQ.stdout,Q=D$($),z=MZ.gray(V),J=Z.spacing??1,Y=3,X=Z.retainLog===!0,U=!C0()&&c$($);$.write(`${z}
|
|
110
|
-
`),$.write(`${MZ.green(XZ)} ${Z.title}
|
|
111
|
-
`);for(let W=0;W<J;W++)$.write(`${z}
|
|
112
|
-
`);let q=[{value:"",full:""}],j=!1,F=(W)=>{if(q.length===0)return;let O=0;if(W)O+=J+2;for(let P of q){let{value:T,result:C}=P,h=C?.message??T;if(h.length===0)continue;if(C===void 0&&P.header!==void 0&&P.header!=="")h+=`
|
|
113
|
-
${P.header}`;let c=h.split(`
|
|
114
|
-
`).reduce((VZ,DZ)=>{if(DZ==="")return VZ+1;return VZ+Math.ceil((DZ.length+3)/Q)},0);O+=c}if(O>0)O+=1,$.write(FZ.lines(O))},G=(W,O,P)=>{let T=P?`${W.full}
|
|
115
|
-
${W.value}`:W.value;if(W.header!==void 0&&W.header!=="")d.message(W.header.split(`
|
|
116
|
-
`).map(MZ.bold),{output:$,secondarySymbol:z,symbol:z,spacing:0});d.message(T.split(`
|
|
117
|
-
`).map(MZ.dim),{output:$,secondarySymbol:z,symbol:z,spacing:O??J})},K=()=>{for(let W of q){let{header:O,value:P,full:T}=W;if((O===void 0||O.length===0)&&P.length===0)continue;G(W,void 0,X===!0&&T.length>0)}},H=()=>{for(let W of q)if(W.result)if(W.result.status==="error")d.error(W.result.message,{output:$,secondarySymbol:z,spacing:0});else d.success(W.result.message,{output:$,secondarySymbol:z,spacing:0});else if(W.value!=="")G(W,0)},D=(W,O,P)=>{if(F(!1),(P?.raw!==!0||!j)&&W.value!=="")W.value+=`
|
|
118
|
-
`;if(W.value+=O,j=P?.raw===!0,Z.limit!==void 0){let T=W.value.split(`
|
|
119
|
-
`),C=T.length-Z.limit;if(C>0){let h=T.splice(0,C);if(X)W.full+=(W.full===""?"":`
|
|
120
|
-
`)+h.join(`
|
|
121
|
-
`)}W.value=T.join(`
|
|
122
|
-
`)}if(U)H()},N=(W,O)=>{if(F(!1),W.result=O,U)H()};return{message(W,O){D(q[0],W,O)},group(W){let O={header:W,value:"",full:""};return q.push(O),{message(P,T){D(O,P,T)},error(P){N(O,{status:"error",message:P})},success(P){N(O,{status:"success",message:P})}}},error(W,O){if(F(!0),d.error(W,{output:$,secondarySymbol:z,spacing:1}),O?.showLog!==!1)K();q.splice(1,q.length-1),q[0].value="",q[0].full=""},success(W,O){if(F(!0),d.success(W,{output:$,secondarySymbol:z,spacing:1}),O?.showLog===!0)K();q.splice(1,q.length-1),q[0].value="",q[0].full=""}}}var f=A(k(),1);function Dz(Z){let $=$Z(Z.message);return new E0({validate:Z.validate,placeholder:Z.placeholder,defaultValue:Z.defaultValue,initialValue:Z.initialValue,output:Z.output,signal:Z.signal,input:Z.input,render(){let Q=`${f.default.gray(V)}
|
|
123
|
-
${i(this.state)} ${$}
|
|
124
|
-
`,z=Z.placeholder?f.default.inverse(Z.placeholder[0])+f.default.dim(Z.placeholder.slice(1)):f.default.inverse(f.default.hidden("_")),J=!this.userInput?z:this.userInputWithCursor,Y=this.value??"";switch(this.state){case"error":{let X=this.error?` ${f.default.yellow(this.error)}`:"";return`${Q.trim()}
|
|
125
|
-
${f.default.yellow(V)} ${J}
|
|
126
|
-
${f.default.yellow(S)}${X}
|
|
127
|
-
`}case"submit":{let U=(this.userInput||Y!==Z.placeholder)&&Y?` ${f.default.dim(Y)}`:"";return`${Q}${f.default.gray(V)}${U}`}case"cancel":{let X=Y?` ${f.default.strikethrough(f.default.dim(Y))}`:"";return`${Q}${f.default.gray(V)}${X}${Y.trim()?`
|
|
128
|
-
${f.default.gray(V)}`:""}`}default:return`${Q}${f.default.cyan(V)} ${J}
|
|
129
|
-
${f.default.cyan(S)}
|
|
130
|
-
`}}}).prompt()}class _Z extends WQ{buffer=[];_write(Z,$,Q){this.buffer.push(Z.toString()),Q()}}class _0 extends DQ{_buffer=[];_read(){if(this._buffer===null){this.push(null);return}for(let Z of this._buffer)this.push(Z);this._buffer=[]}pushValue(Z){this._buffer?.push(Z)}close(){this._buffer=null}}function Tz(Z={}){return W0(Z.name||"")}function LQ(){let Z=new _Z,$=new _Z,Q=new _0,z=w.exit,J=w.stdout,Y=w.stderr,X=w.stdin,U=console.log;return w.exit=(q)=>{throw Error(`Process exit with code: ${q||0}`)},Object.defineProperty(w,"stdout",{value:Z,writable:!0}),Object.defineProperty(w,"stderr",{value:$,writable:!0}),Object.defineProperty(w,"stdin",{value:Q,writable:!0}),{stdout:Z,stderr:$,stdin:Q,originalExit:z,originalStdout:J,originalStderr:Y,originalStdin:X,originalConsoleLog:U}}function MQ(Z){w.exit=Z.originalExit,Object.defineProperty(w,"stdout",{value:Z.originalStdout,writable:!0}),Object.defineProperty(w,"stderr",{value:Z.originalStderr,writable:!0}),Object.defineProperty(w,"stdin",{value:Z.originalStdin,writable:!0}),console.log=Z.originalConsoleLog}async function wz(Z,$,Q={}){let z=Date.now(),{inputs:J=[],env:Y={},cwd:X=w.cwd(),timeout:U=5000}=Q,q=LQ(),{stdin:j,stdout:F,stderr:G}=q,K=$.includes("--help")||$.includes("-h"),H=[];if(w.stdout.write=function(T){let C=T.toString();return H.push(C),F.write(C),!0},console.log=function(...T){let C=T.map((h)=>String(h)).join(" ");H.push(`${C}
|
|
131
|
-
`),F.write(`${C}
|
|
132
|
-
`);return},J.length>0)for(let T of J)j.pushValue(`${T}
|
|
133
|
-
`);let D={...w.env},N=w.cwd();if(Object.entries(Y).forEach(([T,C])=>{w.env[T]=C}),X!==N)w.chdir(X);let W,O=0;try{let T=new Promise((h,c)=>{setTimeout(()=>c(Error("Command execution timed out")),U)}),C=Promise.resolve().then(async()=>{try{if(Z.showHelpOnExit=!1,Z.showVersionOnExit=!1,Z.parse(["node","cli",...$]),K)Z.outputHelp();return W=Z.runMatchedCommand(),W}catch(h){throw O=1,G.write(`${h}
|
|
134
|
-
`),h}});await Promise.race([C,T])}catch(T){if(T.message==="Command execution timed out")throw T}finally{if(w.env=D,X!==N)w.chdir(N);MQ(q)}let P=Date.now()-z;if(K)O=0;return{stdout:H.join(""),stderr:G.buffer.join(""),exitCode:O,duration:P,outputs:[...H],result:W}}var o=null;function Pz(Z){o=Z}function Iz(Z){if(!o)return;if(Z in o)return o[Z];for(let[$,Q]of Object.entries(o))if($.startsWith("/")&&$.endsWith("/i")){let z=$.slice(1,-2);if(new RegExp(z,"i").test(Z))return Q}else if($.startsWith("/")&&$.endsWith("/")){let z=$.slice(1,-1);if(new RegExp(z).test(Z))return Q}if("*"in o)return o["*"];return}function Rz(){o=null}var RZ=null;function Ez(){let Z=[],$=[],Q=w.stdout.write,z=w.stderr.write;w.stdout.write=function(Y){return Z.push(Y.toString()),!0},w.stderr.write=function(Y){return $.push(Y.toString()),!0};let J={stdout:Z,stderr:$,stop:()=>{return w.stdout.write=Q,w.stderr.write=z,RZ=null,{stdout:Z.join(""),stderr:$.join("")}}};return RZ=J,J}function Az(){if(!RZ)throw Error("No output capture in progress. Call captureOutput() first.");return RZ.stdout.join("")}async function Cz(Z){let $=await n.mkdtemp(BZ.join(VQ.tmpdir(),"clapp-test-")),Q=async(z,J)=>{for(let[Y,X]of Object.entries(J)){let U=BZ.join(z,Y);if(typeof X==="object"&&!G0.isBuffer(X))if(Y.endsWith("/"))await n.mkdir(U,{recursive:!0}),await Q(U,X);else await n.mkdir(U,{recursive:!0}),await Q(U,X);else{let q=BZ.dirname(U);if(await n.mkdir(q,{recursive:!0}),G0.isBuffer(X))await n.writeFile(U,X);else if(typeof X==="string")await n.writeFile(U,X,"utf8");else await n.writeFile(U,JSON.stringify(X),"utf8")}}};return await Q($,Z),$}async function kz(Z){let $=async(Q)=>{let z=await n.readdir(Q,{withFileTypes:!0});for(let J of z){let Y=BZ.join(Q,J.name);if(J.isDirectory())await $(Y);else await n.unlink(Y)}await n.rmdir(Q)};await $(Z)}var bz=W0;export{CQ as updateSettings,R as unicodeOr,SZ as unicode,Dz as text,MQ as teardownTest,Kz as tasks,Vz as taskLog,dQ as table,i as symbol,A0 as style,zZ as stream,g0 as spinner,LQ as setupTest,l as settings,fQ as setTheme,WZ as setRawMode,o0 as setDotProp,Z$ as setByType,SQ as setAccessibility,jz as selectKey,qz as select,TQ as scroll,Rz as resetMockPrompts,K0 as removeBrackets,Uz as progress,$Z as processMarkdown,Yz as path,$z as password,_Q as panel,sZ as padRight,sQ as outro,Zz as note,eQ as multiselect,Pz as mockPrompt,d as log,KZ as limitOptions,Q$ as isUnicodeSupported,c$ as isTTY,H$ as isCancel,C0 as isCI,xZ as isActionKey,rQ as intro,nQ as groupMultiselect,aQ as group,e0 as getMriOptions,Iz as getMockResponse,Az as getLastOutput,$$ as getFileName,D$ as getColumns,rZ as findLongest,s0 as findAllBrackets,wz as execCommand,FZ as erase,G$ as diffLines,bz as default,_ as cursor,Cz as createTestFS,Tz as createTestCLI,lQ as confirm,r as codes,W0 as cli,wQ as clear,kz as cleanupTestFS,Ez as captureOutput,iQ as cancel,H0 as camelcaseOptionName,t0 as camelcase,gQ as box,V$ as block,BQ as beep,xQ as autocompleteMultiselect,zQ as autocomplete,y0 as S_WARN,v0 as S_SUCCESS,XZ as S_STEP_SUBMIT,b0 as S_STEP_ERROR,k0 as S_STEP_CANCEL,p$ as S_STEP_ACTIVE,IZ as S_RADIO_INACTIVE,PZ as S_RADIO_ACTIVE,r$ as S_PASSWORD_MASK,h0 as S_INFO,f0 as S_ERROR,s$ as S_CORNER_TOP_RIGHT,t$ as S_CORNER_BOTTOM_RIGHT,e$ as S_CONNECT_LEFT,YZ as S_CHECKBOX_SELECTED,nZ as S_CHECKBOX_INACTIVE,gZ as S_CHECKBOX_ACTIVE,i$ as S_BAR_START,Y0 as S_BAR_H,S as S_BAR_END,V as S_BAR,mZ as GlobalCommand,TZ as ESC,uZ as Command,NZ as ClappError,E as CSI,D0 as CLI,fZ as CANCEL_SYMBOL};
|
package/dist/chunk-w1k33gyv.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ic as a,jc as b,kc as c}from"./chunk-kwmhsx3n.js";import"./chunk-jjwwkrfk.js";import"./chunk-1z1w3s0k.js";import"./chunk-7pwy4m0c.js";import"./chunk-4jw8qvts.js";import"./chunk-mcdb3q06.js";export{c as processSourceDirect,a as processSource,b as clearResultCache};
|