tako-cli 0.1.33 → 0.1.35
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/index.js +34 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
var Gr=Object.create;var{getPrototypeOf:Zr,defineProperty:Q$,getOwnPropertyNames:zr}=Object;var Qr=Object.prototype.hasOwnProperty;var p=(r,m,b)=>{b=r!=null?Gr(Zr(r)):{};let h=m||!r||!r.__esModule?Q$(b,"default",{value:r,enumerable:!0}):b;for(let v of zr(r))if(!Qr.call(h,v))Q$(h,v,{get:()=>r[v],enumerable:!0});return h};var Y$=(r,m)=>()=>(m||r((m={exports:{}}).exports,m),m.exports);var z=import.meta.require;var o$=Y$((S1,n$)=>{var c$={to(r,m){if(!m)return`\x1B[${r+1}G`;return`\x1B[${m+1};${r+1}H`},move(r,m){let b="";if(r<0)b+=`\x1B[${-r}D`;else if(r>0)b+=`\x1B[${r}C`;if(m<0)b+=`\x1B[${-m}A`;else if(m>0)b+=`\x1B[${m}B`;return b},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},nr={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},Er={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let m="";for(let b=0;b<r;b++)m+=this.line+(b<r-1?c$.up():"");if(r)m+=c$.left;return m}};n$.exports={cursor:c$,scroll:nr,erase:Er,beep:"\x07"}});var s$=Y$((i1,g$)=>{var C=process||{},E$=C.argv||[],R=C.env||{},Ur=!(!!R.NO_COLOR||E$.includes("--no-color"))&&(!!R.FORCE_COLOR||E$.includes("--color")||C.platform==="win32"||(C.stdout||{}).isTTY&&R.TERM!=="dumb"||!!R.CI),Tr=(r,m,b=r)=>(h)=>{let v=""+h,x=v.indexOf(m,r.length);return~x?r+Pr(v,m,b,x)+m:r+v+m},Pr=(r,m,b,h)=>{let v="",x=0;do v+=r.substring(x,h)+b,x=h+m.length,h=r.indexOf(m,x);while(~h);return v+r.substring(x)},U$=(r=Ur)=>{let m=r?Tr:()=>String;return{isColorSupported:r,reset:m("\x1B[0m","\x1B[0m"),bold:m("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:m("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:m("\x1B[3m","\x1B[23m"),underline:m("\x1B[4m","\x1B[24m"),inverse:m("\x1B[7m","\x1B[27m"),hidden:m("\x1B[8m","\x1B[28m"),strikethrough:m("\x1B[9m","\x1B[29m"),black:m("\x1B[30m","\x1B[39m"),red:m("\x1B[31m","\x1B[39m"),green:m("\x1B[32m","\x1B[39m"),yellow:m("\x1B[33m","\x1B[39m"),blue:m("\x1B[34m","\x1B[39m"),magenta:m("\x1B[35m","\x1B[39m"),cyan:m("\x1B[36m","\x1B[39m"),white:m("\x1B[37m","\x1B[39m"),gray:m("\x1B[90m","\x1B[39m"),bgBlack:m("\x1B[40m","\x1B[49m"),bgRed:m("\x1B[41m","\x1B[49m"),bgGreen:m("\x1B[42m","\x1B[49m"),bgYellow:m("\x1B[43m","\x1B[49m"),bgBlue:m("\x1B[44m","\x1B[49m"),bgMagenta:m("\x1B[45m","\x1B[49m"),bgCyan:m("\x1B[46m","\x1B[49m"),bgWhite:m("\x1B[47m","\x1B[49m"),blackBright:m("\x1B[90m","\x1B[39m"),redBright:m("\x1B[91m","\x1B[39m"),greenBright:m("\x1B[92m","\x1B[39m"),yellowBright:m("\x1B[93m","\x1B[39m"),blueBright:m("\x1B[94m","\x1B[39m"),magentaBright:m("\x1B[95m","\x1B[39m"),cyanBright:m("\x1B[96m","\x1B[39m"),whiteBright:m("\x1B[97m","\x1B[39m"),bgBlackBright:m("\x1B[100m","\x1B[49m"),bgRedBright:m("\x1B[101m","\x1B[49m"),bgGreenBright:m("\x1B[102m","\x1B[49m"),bgYellowBright:m("\x1B[103m","\x1B[49m"),bgBlueBright:m("\x1B[104m","\x1B[49m"),bgMagentaBright:m("\x1B[105m","\x1B[49m"),bgCyanBright:m("\x1B[106m","\x1B[49m"),bgWhiteBright:m("\x1B[107m","\x1B[49m")}};g$.exports=U$();g$.exports.createColors=U$});import{join as N}from"path";import{homedir as Yr}from"os";import{join as B}from"path";var W=B(Yr(),".tako"),H$=B(W,"config.json"),m$=B(W,"tools"),G=B(W,"cli"),X=B(W,"bun"),M=B(X,"bin",process.platform==="win32"?"bun.exe":"bun");var Q="https://claude-proxy.shiroha.tech",J$={apiKey:"",apiId:"",installedClients:{}};async function X$(){let r=await import("fs/promises");try{await r.mkdir(W,{recursive:!0}),await r.mkdir(m$,{recursive:!0})}catch{}}async function V(){await X$();try{let r=Bun.file(H$);if(await r.exists()){let m=await r.json();return{...J$,...m}}}catch{}return{...J$}}async function Jr(r){await X$(),await Bun.write(H$,JSON.stringify(r,null,2))}async function I(r){let b={...await V(),...r};return await Jr(b),b}async function V$(){return!!(await V()).apiKey}async function j$(){return(await V()).apiKey}async function L$(){return(await V()).apiId}function b$(r,m){if(!r.startsWith(W))throw Error(`\u5B89\u5168\u68C0\u67E5\u5931\u8D25: ${m} \u8DEF\u5F84 "${r}" \u4E0D\u5728 Tako \u76EE\u5F55\u4E0B`)}function E(r){let m=N(m$,r);return b$(m,"\u5BA2\u6237\u7AEF\u5B89\u88C5\u76EE\u5F55"),m}async function f$(r){let m=E(r.id),b=N(m,"node_modules",r.package,"package.json");try{let h=Bun.file(b);if(!await h.exists())return null;let x=(await h.json()).bin;if(!x)return null;let $=null;if(typeof x==="string")$=x;else if(typeof x==="object"&&x[r.command])$=x[r.command];if(!$)return null;let a=N(m,"node_modules",r.package,$);return b$(a,"\u5BA2\u6237\u7AEF\u5165\u53E3\u6587\u4EF6"),a}catch{return null}}function B$(r){let m=E(r.id),b=N(m,"node_modules",".bin",r.command);return b$(b,"\u5BA2\u6237\u7AEF\u53EF\u6267\u884C\u6587\u4EF6"),b}var h$=new Map;function A(r){h$.set(r.id,r)}function k$(){return Array.from(h$.values())}function v$(r){return h$.get(r)}var Hr={id:"claude-code",name:"Claude Code",package:"@anthropic-ai/claude-code",command:"claude",runtime:"bun",getEnvVars(r){return{ANTHROPIC_BASE_URL:`${Q}/api`,ANTHROPIC_AUTH_TOKEN:r}}};A(Hr);import{homedir as Xr}from"os";import{join as x$}from"path";var a$=x$(Xr(),".codex"),Vr=x$(a$,"config.toml"),jr=x$(a$,"auth.json"),Lr=`model_provider = "crs"
|
|
2
4
|
model = "gpt-5-codex"
|
|
3
5
|
model_reasoning_effort = "high"
|
|
4
6
|
disable_response_storage = true
|
|
@@ -13,43 +15,49 @@ env_key = "CRS_OAI_KEY"
|
|
|
13
15
|
`,fr=`{
|
|
14
16
|
"OPENAI_API_KEY": null
|
|
15
17
|
}
|
|
16
|
-
`,kr={id:"codex",name:"Codex",package:"@openai/codex",command:"codex",runtime:"bun",getEnvVars(r){return{CRS_OAI_KEY:r}},setupConfigFiles:Br};R(kr);var p=O(o$(),1),u=O(s$(),1);import{stdin as C$,stdout as u$} from"process";import*as Y from"readline";import T$ from"readline";import{WriteStream as Kr} from"tty";var Or=function({onlyFirst:r=!1}={}){const m=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(m,r?void 0:"g")},F$=function(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Nr,"")},D$=function(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r},E=function(r,m={}){if(typeof r!="string"||r.length===0||(m={ambiguousIsNarrow:!0,...m},r=F$(r),r.length===0))return 0;r=r.replace(_r()," ");const b=m.ambiguousIsNarrow?1:2;let h=0;for(let v of r){const x=v.codePointAt(0);if(x<=31||x>=127&&x<=159||x>=768&&x<=879)continue;switch(Rr.eastAsianWidth(v)){case"F":case"W":h+=2;break;case"A":h+=b;break;default:h+=1}}return h},Fr=function(){const r=new Map;for(let[m,b]of Object.entries(y)){for(let[h,v]of Object.entries(b))y[h]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},b[h]=y[h],r.set(v[0],v[1]);Object.defineProperty(y,m,{value:b,enumerable:!1})}return Object.defineProperty(y,"codes",{value:r,enumerable:!1}),y.color.close="\x1B[39m",y.bgColor.close="\x1B[49m",y.color.ansi=P$(),y.color.ansi256=K$(),y.color.ansi16m=O$(),y.bgColor.ansi=P$(d$),y.bgColor.ansi256=K$(d$),y.bgColor.ansi16m=O$(d$),Object.defineProperties(y,{rgbToAnsi256:{value:(m,b,h)=>m===b&&b===h?m<8?16:m>248?231:Math.round((m-8)/247*24)+232:16+36*Math.round(m/255*5)+6*Math.round(b/255*5)+Math.round(h/255*5),enumerable:!1},hexToRgb:{value:(m)=>{const b=/[a-f\d]{6}|[a-f\d]{3}/i.exec(m.toString(16));if(!b)return[0,0,0];let[h]=b;h.length===3&&(h=[...h].map((x)=>x+x).join(""));const v=Number.parseInt(h,16);return[v>>16&255,v>>8&255,v&255]},enumerable:!1},hexToAnsi256:{value:(m)=>y.rgbToAnsi256(...y.hexToRgb(m)),enumerable:!1},ansi256ToAnsi:{value:(m)=>{if(m<8)return 30+m;if(m<16)return 90+(m-8);let b,h,v;if(m>=232)b=((m-232)*10+8)/255,h=b,v=b;else{m-=16;const a=m%36;b=Math.floor(m/36)/5,h=Math.floor(a/6)/5,v=a%6/5}const x=Math.max(b,h,v)*2;if(x===0)return 30;let $=30+(Math.round(v)<<2|Math.round(h)<<1|Math.round(b));return x===2&&($+=60),$},enumerable:!1},rgbToAnsi:{value:(m,b,h)=>y.ansi256ToAnsi(y.rgbToAnsi256(m,b,h)),enumerable:!1},hexToAnsi:{value:(m)=>y.ansi256ToAnsi(y.hexToAnsi256(m)),enumerable:!1}}),y},R$=function(r,m,b){return String(r).normalize().replace(/\r\n/g,`
|
|
18
|
+
`;async function Br(r){let m=await import("fs/promises");try{await m.mkdir(a$,{recursive:!0})}catch{}await Bun.write(Vr,Lr),await Bun.write(jr,fr)}var kr={id:"codex",name:"Codex",package:"@openai/codex",command:"codex",runtime:"bun",getEnvVars(r){return{CRS_OAI_KEY:r}},setupConfigFiles:Br};A(kr);var i=p(o$(),1),u=p(s$(),1);import{stdin as _$,stdout as u$}from"process";import*as J from"readline";import T$ from"readline";import{WriteStream as Kr}from"tty";function Or({onlyFirst:r=!1}={}){let m=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(m,r?void 0:"g")}var Ir=Or();function F$(r){if(typeof r!="string")throw TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Ir,"")}function D$(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $r={exports:{}};(function(r){var m={};r.exports=m,m.eastAsianWidth=function(h){var v=h.charCodeAt(0),x=h.length==2?h.charCodeAt(1):0,$=v;return 55296<=v&&v<=56319&&56320<=x&&x<=57343&&(v&=1023,x&=1023,$=v<<10|x,$+=65536),$==12288||65281<=$&&$<=65376||65504<=$&&$<=65510?"F":$==8361||65377<=$&&$<=65470||65474<=$&&$<=65479||65482<=$&&$<=65487||65490<=$&&$<=65495||65498<=$&&$<=65500||65512<=$&&$<=65518?"H":4352<=$&&$<=4447||4515<=$&&$<=4519||4602<=$&&$<=4607||9001<=$&&$<=9002||11904<=$&&$<=11929||11931<=$&&$<=12019||12032<=$&&$<=12245||12272<=$&&$<=12283||12289<=$&&$<=12350||12353<=$&&$<=12438||12441<=$&&$<=12543||12549<=$&&$<=12589||12593<=$&&$<=12686||12688<=$&&$<=12730||12736<=$&&$<=12771||12784<=$&&$<=12830||12832<=$&&$<=12871||12880<=$&&$<=13054||13056<=$&&$<=19903||19968<=$&&$<=42124||42128<=$&&$<=42182||43360<=$&&$<=43388||44032<=$&&$<=55203||55216<=$&&$<=55238||55243<=$&&$<=55291||63744<=$&&$<=64255||65040<=$&&$<=65049||65072<=$&&$<=65106||65108<=$&&$<=65126||65128<=$&&$<=65131||110592<=$&&$<=110593||127488<=$&&$<=127490||127504<=$&&$<=127546||127552<=$&&$<=127560||127568<=$&&$<=127569||131072<=$&&$<=194367||177984<=$&&$<=196605||196608<=$&&$<=262141?"W":32<=$&&$<=126||162<=$&&$<=163||165<=$&&$<=166||$==172||$==175||10214<=$&&$<=10221||10629<=$&&$<=10630?"Na":$==161||$==164||167<=$&&$<=168||$==170||173<=$&&$<=174||176<=$&&$<=180||182<=$&&$<=186||188<=$&&$<=191||$==198||$==208||215<=$&&$<=216||222<=$&&$<=225||$==230||232<=$&&$<=234||236<=$&&$<=237||$==240||242<=$&&$<=243||247<=$&&$<=250||$==252||$==254||$==257||$==273||$==275||$==283||294<=$&&$<=295||$==299||305<=$&&$<=307||$==312||319<=$&&$<=322||$==324||328<=$&&$<=331||$==333||338<=$&&$<=339||358<=$&&$<=359||$==363||$==462||$==464||$==466||$==468||$==470||$==472||$==474||$==476||$==593||$==609||$==708||$==711||713<=$&&$<=715||$==717||$==720||728<=$&&$<=731||$==733||$==735||768<=$&&$<=879||913<=$&&$<=929||931<=$&&$<=937||945<=$&&$<=961||963<=$&&$<=969||$==1025||1040<=$&&$<=1103||$==1105||$==8208||8211<=$&&$<=8214||8216<=$&&$<=8217||8220<=$&&$<=8221||8224<=$&&$<=8226||8228<=$&&$<=8231||$==8240||8242<=$&&$<=8243||$==8245||$==8251||$==8254||$==8308||$==8319||8321<=$&&$<=8324||$==8364||$==8451||$==8453||$==8457||$==8467||$==8470||8481<=$&&$<=8482||$==8486||$==8491||8531<=$&&$<=8532||8539<=$&&$<=8542||8544<=$&&$<=8555||8560<=$&&$<=8569||$==8585||8592<=$&&$<=8601||8632<=$&&$<=8633||$==8658||$==8660||$==8679||$==8704||8706<=$&&$<=8707||8711<=$&&$<=8712||$==8715||$==8719||$==8721||$==8725||$==8730||8733<=$&&$<=8736||$==8739||$==8741||8743<=$&&$<=8748||$==8750||8756<=$&&$<=8759||8764<=$&&$<=8765||$==8776||$==8780||$==8786||8800<=$&&$<=8801||8804<=$&&$<=8807||8810<=$&&$<=8811||8814<=$&&$<=8815||8834<=$&&$<=8835||8838<=$&&$<=8839||$==8853||$==8857||$==8869||$==8895||$==8978||9312<=$&&$<=9449||9451<=$&&$<=9547||9552<=$&&$<=9587||9600<=$&&$<=9615||9618<=$&&$<=9621||9632<=$&&$<=9633||9635<=$&&$<=9641||9650<=$&&$<=9651||9654<=$&&$<=9655||9660<=$&&$<=9661||9664<=$&&$<=9665||9670<=$&&$<=9672||$==9675||9678<=$&&$<=9681||9698<=$&&$<=9701||$==9711||9733<=$&&$<=9734||$==9737||9742<=$&&$<=9743||9748<=$&&$<=9749||$==9756||$==9758||$==9792||$==9794||9824<=$&&$<=9825||9827<=$&&$<=9829||9831<=$&&$<=9834||9836<=$&&$<=9837||$==9839||9886<=$&&$<=9887||9918<=$&&$<=9919||9924<=$&&$<=9933||9935<=$&&$<=9953||$==9955||9960<=$&&$<=9983||$==10045||$==10071||10102<=$&&$<=10111||11093<=$&&$<=11097||12872<=$&&$<=12879||57344<=$&&$<=63743||65024<=$&&$<=65039||$==65533||127232<=$&&$<=127242||127248<=$&&$<=127277||127280<=$&&$<=127337||127344<=$&&$<=127386||917760<=$&&$<=917999||983040<=$&&$<=1048573||1048576<=$&&$<=1114109?"A":"N"},m.characterLength=function(h){var v=this.eastAsianWidth(h);return v=="F"||v=="W"||v=="A"?2:1};function b(h){return h.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}m.length=function(h){for(var v=b(h),x=0,$=0;$<v.length;$++)x=x+this.characterLength(v[$]);return x},m.slice=function(h,v,x){textLen=m.length(h),v=v||0,x=x||1,v<0&&(v=textLen+v),x<0&&(x=textLen+x);for(var $="",a=0,s=b(h),o=0;o<s.length;o++){var w=s[o],g=m.length(w);if(a>=v-(g==2?1:0))if(a+g<=x)$+=w;else break;a+=g}return $}})($r);var Nr=$r.exports,Ar=D$(Nr),Rr=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB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27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uD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30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\u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uDDCF\uDDD1-\uDDDD])/g},Cr=D$(Rr);function U(r,m={}){if(typeof r!="string"||r.length===0||(m={ambiguousIsNarrow:!0,...m},r=F$(r),r.length===0))return 0;r=r.replace(Cr()," ");let b=m.ambiguousIsNarrow?1:2,h=0;for(let v of r){let x=v.codePointAt(0);if(x<=31||x>=127&&x<=159||x>=768&&x<=879)continue;switch(Ar.eastAsianWidth(v)){case"F":case"W":h+=2;break;case"A":h+=b;break;default:h+=1}}return h}var d$=10,P$=(r=0)=>(m)=>`\x1B[${m+r}m`,K$=(r=0)=>(m)=>`\x1B[${38+r};5;${m}m`,O$=(r=0)=>(m,b,h)=>`\x1B[${38+r};2;${m};${b};${h}m`,y={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]}};Object.keys(y.modifier);var _r=Object.keys(y.color),ur=Object.keys(y.bgColor);[..._r,...ur];function Fr(){let r=new Map;for(let[m,b]of Object.entries(y)){for(let[h,v]of Object.entries(b))y[h]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},b[h]=y[h],r.set(v[0],v[1]);Object.defineProperty(y,m,{value:b,enumerable:!1})}return Object.defineProperty(y,"codes",{value:r,enumerable:!1}),y.color.close="\x1B[39m",y.bgColor.close="\x1B[49m",y.color.ansi=P$(),y.color.ansi256=K$(),y.color.ansi16m=O$(),y.bgColor.ansi=P$(d$),y.bgColor.ansi256=K$(d$),y.bgColor.ansi16m=O$(d$),Object.defineProperties(y,{rgbToAnsi256:{value:(m,b,h)=>m===b&&b===h?m<8?16:m>248?231:Math.round((m-8)/247*24)+232:16+36*Math.round(m/255*5)+6*Math.round(b/255*5)+Math.round(h/255*5),enumerable:!1},hexToRgb:{value:(m)=>{let b=/[a-f\d]{6}|[a-f\d]{3}/i.exec(m.toString(16));if(!b)return[0,0,0];let[h]=b;h.length===3&&(h=[...h].map((x)=>x+x).join(""));let v=Number.parseInt(h,16);return[v>>16&255,v>>8&255,v&255]},enumerable:!1},hexToAnsi256:{value:(m)=>y.rgbToAnsi256(...y.hexToRgb(m)),enumerable:!1},ansi256ToAnsi:{value:(m)=>{if(m<8)return 30+m;if(m<16)return 90+(m-8);let b,h,v;if(m>=232)b=((m-232)*10+8)/255,h=b,v=b;else{m-=16;let a=m%36;b=Math.floor(m/36)/5,h=Math.floor(a/6)/5,v=a%6/5}let x=Math.max(b,h,v)*2;if(x===0)return 30;let $=30+(Math.round(v)<<2|Math.round(h)<<1|Math.round(b));return x===2&&($+=60),$},enumerable:!1},rgbToAnsi:{value:(m,b,h)=>y.ansi256ToAnsi(y.rgbToAnsi256(m,b,h)),enumerable:!1},hexToAnsi:{value:(m)=>y.ansi256ToAnsi(y.hexToAnsi256(m)),enumerable:!1}}),y}var Dr=Fr(),F=new Set(["\x1B","\x9B"]),$m=39,y$="\x07",rr="[",rm="]",mr="m",e$=`${rm}8;;`,I$=(r)=>`${F.values().next().value}${rr}${r}${mr}`,N$=(r)=>`${F.values().next().value}${e$}${r}${y$}`,mm=(r)=>r.split(" ").map((m)=>U(m)),w$=(r,m,b)=>{let h=[...m],v=!1,x=!1,$=U(F$(r[r.length-1]));for(let[a,s]of h.entries()){let o=U(s);if($+o<=b?r[r.length-1]+=s:(r.push(s),$=0),F.has(s)&&(v=!0,x=h.slice(a+1).join("").startsWith(e$)),v){x?s===y$&&(v=!1,x=!1):s===mr&&(v=!1);continue}$+=o,$===b&&a<h.length-1&&(r.push(""),$=0)}!$&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},bm=(r)=>{let m=r.split(" "),b=m.length;for(;b>0&&!(U(m[b-1])>0);)b--;return b===m.length?r:m.slice(0,b).join(" ")+m.slice(b).join("")},hm=(r,m,b={})=>{if(b.trim!==!1&&r.trim()==="")return"";let h="",v,x,$=mm(r),a=[""];for(let[o,w]of r.split(" ").entries()){b.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let g=U(a[a.length-1]);if(o!==0&&(g>=m&&(b.wordWrap===!1||b.trim===!1)&&(a.push(""),g=0),(g>0||b.trim===!1)&&(a[a.length-1]+=" ",g++)),b.hard&&$[o]>m){let t=m-g,H=1+Math.floor(($[o]-t-1)/m);Math.floor(($[o]-1)/m)<H&&a.push(""),w$(a,w,m);continue}if(g+$[o]>m&&g>0&&$[o]>0){if(b.wordWrap===!1&&g<m){w$(a,w,m);continue}a.push("")}if(g+$[o]>m&&b.wordWrap===!1){w$(a,w,m);continue}a[a.length-1]+=w}b.trim!==!1&&(a=a.map((o)=>bm(o)));let s=[...a.join(`
|
|
19
|
+
`)];for(let[o,w]of s.entries()){if(h+=w,F.has(w)){let{groups:t}=new RegExp(`(?:\\${rr}(?<code>\\d+)m|\\${e$}(?<uri>.*)${y$})`).exec(s.slice(o).join(""))||{groups:{}};if(t.code!==void 0){let H=Number.parseFloat(t.code);v=H===$m?void 0:H}else t.uri!==void 0&&(x=t.uri.length===0?void 0:t.uri)}let g=Dr.codes.get(Number(v));s[o+1]===`
|
|
20
|
+
`?(x&&(h+=N$("")),v&&g&&(h+=I$(g))):w===`
|
|
21
|
+
`&&(v&&g&&(h+=I$(v)),x&&(h+=N$(x)))}return h};function A$(r,m,b){return String(r).normalize().replace(/\r\n/g,`
|
|
17
22
|
`).split(`
|
|
18
23
|
`).map((h)=>hm(h,m,b)).join(`
|
|
19
|
-
`)},
|
|
24
|
+
`)}var vm=Object.defineProperty,xm=(r,m,b)=>(m in r)?vm(r,m,{enumerable:!0,configurable:!0,writable:!0,value:b}):r[m]=b,l=(r,m,b)=>(xm(r,typeof m!="symbol"?m+"":m,b),b);function am(r,m){if(r===m)return;let b=r.split(`
|
|
20
25
|
`),h=m.split(`
|
|
21
|
-
`),v=[];for(let x=0;x<Math.max(b.length,h.length);x++)b[x]!==h[x]&&v.push(x);return v},U=function(r){return r===br},C=function(r,m){r.isTTY&&r.setRawMode(m)},vr=function({input:r=C$,output:m=u$,overwrite:b=!0,hideCursor:h=!0}={}){const v=Y.createInterface({input:r,output:m,prompt:"",tabSize:1});Y.emitKeypressEvents(r,v),r.isTTY&&r.setRawMode(!0);const x=($,{name:a})=>{if(String($)===""){h&&m.write(p.cursor.show),process.exit(0);return}if(!b)return;Y.moveCursor(m,a==="return"?0:-1,a==="return"?-1:0,()=>{Y.clearLine(m,1,()=>{r.once("keypress",x)})})};return h&&m.write(p.cursor.hide),r.once("keypress",x),()=>{r.off("keypress",x),h&&m.write(p.cursor.show),r.isTTY&&!ym&&r.setRawMode(!1),v.terminal=!1,v.close()}},Nr=Or(),$r={exports:{}};(function(r){var m={};r.exports=m,m.eastAsianWidth=function(h){var v=h.charCodeAt(0),x=h.length==2?h.charCodeAt(1):0,$=v;return 55296<=v&&v<=56319&&56320<=x&&x<=57343&&(v&=1023,x&=1023,$=v<<10|x,$+=65536),$==12288||65281<=$&&$<=65376||65504<=$&&$<=65510?"F":$==8361||65377<=$&&$<=65470||65474<=$&&$<=65479||65482<=$&&$<=65487||65490<=$&&$<=65495||65498<=$&&$<=65500||65512<=$&&$<=65518?"H":4352<=$&&$<=4447||4515<=$&&$<=4519||4602<=$&&$<=4607||9001<=$&&$<=9002||11904<=$&&$<=11929||11931<=$&&$<=12019||12032<=$&&$<=12245||12272<=$&&$<=12283||12289<=$&&$<=12350||12353<=$&&$<=12438||12441<=$&&$<=12543||12549<=$&&$<=12589||12593<=$&&$<=12686||12688<=$&&$<=12730||12736<=$&&$<=12771||12784<=$&&$<=12830||12832<=$&&$<=12871||12880<=$&&$<=13054||13056<=$&&$<=19903||19968<=$&&$<=42124||42128<=$&&$<=42182||43360<=$&&$<=43388||44032<=$&&$<=55203||55216<=$&&$<=55238||55243<=$&&$<=55291||63744<=$&&$<=64255||65040<=$&&$<=65049||65072<=$&&$<=65106||65108<=$&&$<=65126||65128<=$&&$<=65131||110592<=$&&$<=110593||127488<=$&&$<=127490||127504<=$&&$<=127546||127552<=$&&$<=127560||127568<=$&&$<=127569||131072<=$&&$<=194367||177984<=$&&$<=196605||196608<=$&&$<=262141?"W":32<=$&&$<=126||162<=$&&$<=163||165<=$&&$<=166||$==172||$==175||10214<=$&&$<=10221||10629<=$&&$<=10630?"Na":$==161||$==164||167<=$&&$<=168||$==170||173<=$&&$<=174||176<=$&&$<=180||182<=$&&$<=186||188<=$&&$<=191||$==198||$==208||215<=$&&$<=216||222<=$&&$<=225||$==230||232<=$&&$<=234||236<=$&&$<=237||$==240||242<=$&&$<=243||247<=$&&$<=250||$==252||$==254||$==257||$==273||$==275||$==283||294<=$&&$<=295||$==299||305<=$&&$<=307||$==312||319<=$&&$<=322||$==324||328<=$&&$<=331||$==333||338<=$&&$<=339||358<=$&&$<=359||$==363||$==462||$==464||$==466||$==468||$==470||$==472||$==474||$==476||$==593||$==609||$==708||$==711||713<=$&&$<=715||$==717||$==720||728<=$&&$<=731||$==733||$==735||768<=$&&$<=879||913<=$&&$<=929||931<=$&&$<=937||945<=$&&$<=961||963<=$&&$<=969||$==1025||1040<=$&&$<=1103||$==1105||$==8208||8211<=$&&$<=8214||8216<=$&&$<=8217||8220<=$&&$<=8221||8224<=$&&$<=8226||8228<=$&&$<=8231||$==8240||8242<=$&&$<=8243||$==8245||$==8251||$==8254||$==8308||$==8319||8321<=$&&$<=8324||$==8364||$==8451||$==8453||$==8457||$==8467||$==8470||8481<=$&&$<=8482||$==8486||$==8491||8531<=$&&$<=8532||8539<=$&&$<=8542||8544<=$&&$<=8555||8560<=$&&$<=8569||$==8585||8592<=$&&$<=8601||8632<=$&&$<=8633||$==8658||$==8660||$==8679||$==8704||8706<=$&&$<=8707||8711<=$&&$<=8712||$==8715||$==8719||$==8721||$==8725||$==8730||8733<=$&&$<=8736||$==8739||$==8741||8743<=$&&$<=8748||$==8750||8756<=$&&$<=8759||8764<=$&&$<=8765||$==8776||$==8780||$==8786||8800<=$&&$<=8801||8804<=$&&$<=8807||8810<=$&&$<=8811||8814<=$&&$<=8815||8834<=$&&$<=8835||8838<=$&&$<=8839||$==8853||$==8857||$==8869||$==8895||$==8978||9312<=$&&$<=9449||9451<=$&&$<=9547||9552<=$&&$<=9587||9600<=$&&$<=9615||9618<=$&&$<=9621||9632<=$&&$<=9633||9635<=$&&$<=9641||9650<=$&&$<=9651||9654<=$&&$<=9655||9660<=$&&$<=9661||9664<=$&&$<=9665||9670<=$&&$<=9672||$==9675||9678<=$&&$<=9681||9698<=$&&$<=9701||$==9711||9733<=$&&$<=9734||$==9737||9742<=$&&$<=9743||9748<=$&&$<=9749||$==9756||$==9758||$==9792||$==9794||9824<=$&&$<=9825||9827<=$&&$<=9829||9831<=$&&$<=9834||9836<=$&&$<=9837||$==9839||9886<=$&&$<=9887||9918<=$&&$<=9919||9924<=$&&$<=9933||9935<=$&&$<=9953||$==9955||9960<=$&&$<=9983||$==10045||$==10071||10102<=$&&$<=10111||11093<=$&&$<=11097||12872<=$&&$<=12879||57344<=$&&$<=63743||65024<=$&&$<=65039||$==65533||127232<=$&&$<=127242||127248<=$&&$<=127277||127280<=$&&$<=127337||127344<=$&&$<=127386||917760<=$&&$<=917999||983040<=$&&$<=1048573||1048576<=$&&$<=1114109?"A":"N"},m.characterLength=function(h){var v=this.eastAsianWidth(h);return v=="F"||v=="W"||v=="A"?2:1};function b(h){return h.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}m.length=function(h){for(var v=b(h),x=0,$=0;$<v.length;$++)x=x+this.characterLength(v[$]);return x},m.slice=function(h,v,x){textLen=m.length(h),v=v||0,x=x||1,v<0&&(v=textLen+v),x<0&&(x=textLen+x);for(var $="",a=0,s=b(h),o=0;o<s.length;o++){var w=s[o],g=m.length(w);if(a>=v-(g==2?1:0))if(a+g<=x)$+=w;else break;a+=g}return $}})($r);var Ar=$r.exports,Rr=D$(Ar),Ir=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92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B\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uD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C7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},_r=D$(Ir),d$=10,P$=(r=0)=>(m)=>`\x1B[${m+r}m`,K$=(r=0)=>(m)=>`\x1B[${38+r};5;${m}m`,O$=(r=0)=>(m,b,h)=>`\x1B[${38+r};2;${m};${b};${h}m`,y={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]}};Object.keys(y.modifier);var Cr=Object.keys(y.color),ur=Object.keys(y.bgColor);[...Cr];var Dr=Fr(),F=new Set(["\x1B","\x9B"]),$m=39,y$="\x07",rr="[",rm="]",mr="m",e$=`${rm}8;;`,N$=(r)=>`${F.values().next().value}${rr}${r}${mr}`,A$=(r)=>`${F.values().next().value}${e$}${r}${y$}`,mm=(r)=>r.split(" ").map((m)=>E(m)),w$=(r,m,b)=>{const h=[...m];let v=!1,x=!1,$=E(F$(r[r.length-1]));for(let[a,s]of h.entries()){const o=E(s);if($+o<=b?r[r.length-1]+=s:(r.push(s),$=0),F.has(s)&&(v=!0,x=h.slice(a+1).join("").startsWith(e$)),v){x?s===y$&&(v=!1,x=!1):s===mr&&(v=!1);continue}$+=o,$===b&&a<h.length-1&&(r.push(""),$=0)}!$&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},bm=(r)=>{const m=r.split(" ");let b=m.length;for(;b>0&&!(E(m[b-1])>0);)b--;return b===m.length?r:m.slice(0,b).join(" ")+m.slice(b).join("")},hm=(r,m,b={})=>{if(b.trim!==!1&&r.trim()==="")return"";let h="",v,x;const $=mm(r);let a=[""];for(let[o,w]of r.split(" ").entries()){b.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let g=E(a[a.length-1]);if(o!==0&&(g>=m&&(b.wordWrap===!1||b.trim===!1)&&(a.push(""),g=0),(g>0||b.trim===!1)&&(a[a.length-1]+=" ",g++)),b.hard&&$[o]>m){const i=m-g,J=1+Math.floor(($[o]-i-1)/m);Math.floor(($[o]-1)/m)<J&&a.push(""),w$(a,w,m);continue}if(g+$[o]>m&&g>0&&$[o]>0){if(b.wordWrap===!1&&g<m){w$(a,w,m);continue}a.push("")}if(g+$[o]>m&&b.wordWrap===!1){w$(a,w,m);continue}a[a.length-1]+=w}b.trim!==!1&&(a=a.map((o)=>bm(o)));const s=[...a.join(`
|
|
22
|
-
`)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`),C(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const r=R$(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
26
|
-
`).length-1;this.output.write(p.cursor.move(-999,r*-1))}render(){const r=R$(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(p.cursor.hide);else{const m=am(this._prevFrame,r);if(this.restoreCursor(),m&&m?.length===1){const b=m[0];this.output.write(p.cursor.move(0,b)),this.output.write(p.erase.lines(1));const h=r.split(`
|
|
27
|
-
`);this.output.write(h[b]),this._prevFrame=r,this.output.write(p.cursor.move(0,h.length-b-1));return}else if(m&&m?.length>1){const b=m[0];this.output.write(p.cursor.move(0,b)),this.output.write(p.erase.down());const h=r.split(`
|
|
26
|
+
`),v=[];for(let x=0;x<Math.max(b.length,h.length);x++)b[x]!==h[x]&&v.push(x);return v}var br=Symbol("clack:cancel");function T(r){return r===br}function _(r,m){r.isTTY&&r.setRawMode(m)}var R$=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),cm=new Set(["up","down","left","right","space","enter"]);class t${constructor({render:r,input:m=_$,output:b=u$,...h},v=!0){l(this,"input"),l(this,"output"),l(this,"rl"),l(this,"opts"),l(this,"_track",!1),l(this,"_render"),l(this,"_cursor",0),l(this,"state","initial"),l(this,"value"),l(this,"error",""),l(this,"subscribers",new Map),l(this,"_prevFrame",""),this.opts=h,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=v,this.input=m,this.output=b}prompt(){let r=new Kr(0);return r._write=(m,b,h)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),h()},this.input.pipe(r),this.rl=T$.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),T$.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),_(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((m,b)=>{this.once("submit",()=>{this.output.write(i.cursor.show),this.output.off("resize",this.render),_(this.input,!1),m(this.value)}),this.once("cancel",()=>{this.output.write(i.cursor.show),this.output.off("resize",this.render),_(this.input,!1),m(br)})})}on(r,m){let b=this.subscribers.get(r)??[];b.push({cb:m}),this.subscribers.set(r,b)}once(r,m){let b=this.subscribers.get(r)??[];b.push({cb:m,once:!0}),this.subscribers.set(r,b)}emit(r,...m){let b=this.subscribers.get(r)??[],h=[];for(let v of b)v.cb(...m),v.once&&h.push(()=>b.splice(b.indexOf(v),1));for(let v of h)v()}unsubscribe(){this.subscribers.clear()}onKeypress(r,m){if(this.state==="error"&&(this.state="active"),m?.name&&!this._track&&R$.has(m.name)&&this.emit("cursor",R$.get(m.name)),m?.name&&cm.has(m.name)&&this.emit("cursor",m.name),r&&(r.toLowerCase()==="y"||r.toLowerCase()==="n")&&this.emit("confirm",r.toLowerCase()==="y"),r==="\t"&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),r&&this.emit("key",r.toLowerCase()),m?.name==="return"){if(this.opts.validate){let b=this.opts.validate(this.value);b&&(this.error=b,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}r==="\x03"&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
27
|
+
`),_(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=A$(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
28
|
+
`).length-1;this.output.write(i.cursor.move(-999,r*-1))}render(){let r=A$(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(i.cursor.hide);else{let m=am(this._prevFrame,r);if(this.restoreCursor(),m&&m?.length===1){let b=m[0];this.output.write(i.cursor.move(0,b)),this.output.write(i.erase.lines(1));let h=r.split(`
|
|
29
|
+
`);this.output.write(h[b]),this._prevFrame=r,this.output.write(i.cursor.move(0,h.length-b-1));return}else if(m&&m?.length>1){let b=m[0];this.output.write(i.cursor.move(0,b)),this.output.write(i.erase.down());let h=r.split(`
|
|
28
30
|
`).slice(b);this.output.write(h.join(`
|
|
29
|
-
`)),this._prevFrame=r;return}this.output.write(
|
|
31
|
+
`)),this._prevFrame=r;return}this.output.write(i.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}}var om=Object.defineProperty,gm=(r,m,b)=>(m in r)?om(r,m,{enumerable:!0,configurable:!0,writable:!0,value:b}):r[m]=b,C$=(r,m,b)=>(gm(r,typeof m!="symbol"?m+"":m,b),b),hr=class extends t${constructor(r){super(r,!1),C$(this,"options"),C$(this,"cursor",0),this.options=r.options,this.cursor=this.options.findIndex(({value:m})=>m===r.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(m)=>{switch(m){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()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var sm=Object.defineProperty,dm=(r,m,b)=>(m in r)?sm(r,m,{enumerable:!0,configurable:!0,writable:!0,value:b}):r[m]=b,wm=(r,m,b)=>(dm(r,typeof m!="symbol"?m+"":m,b),b);class S$ extends t${constructor(r){super(r),wm(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=r.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${u.default.inverse(u.default.hidden("_"))}`;else{let m=this.value.slice(0,this.cursor),b=this.value.slice(this.cursor);this.valueWithCursor=`${m}${u.default.inverse(b[0])}${b.slice(1)}`}})}get cursor(){return this._cursor}}var ym=globalThis.process.platform.startsWith("win");function vr({input:r=_$,output:m=u$,overwrite:b=!0,hideCursor:h=!0}={}){let v=J.createInterface({input:r,output:m,prompt:"",tabSize:1});J.emitKeypressEvents(r,v),r.isTTY&&r.setRawMode(!0);let x=($,{name:a})=>{if(String($)==="\x03"){h&&m.write(i.cursor.show),process.exit(0);return}if(!b)return;J.moveCursor(m,a==="return"?0:-1,a==="return"?-1:0,()=>{J.clearLine(m,1,()=>{r.once("keypress",x)})})};return h&&m.write(i.cursor.hide),r.once("keypress",x),()=>{r.off("keypress",x),h&&m.write(i.cursor.show),r.isTTY&&!ym&&r.setRawMode(!1),v.terminal=!1,v.close()}}var c=p(s$(),1),k=p(o$(),1);import q from"process";function em(){return q.platform!=="win32"?q.env.TERM!=="linux":Boolean(q.env.CI)||Boolean(q.env.WT_SESSION)||Boolean(q.env.TERMINUS_SUBLIME)||q.env.ConEmuTask==="{cmd::Cmder}"||q.env.TERM_PROGRAM==="Terminus-Sublime"||q.env.TERM_PROGRAM==="vscode"||q.env.TERM==="xterm-256color"||q.env.TERM==="alacritty"||q.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var i$=em(),e=(r,m)=>i$?r:m,tm=e("\u25C6","*"),xr=e("\u25A0","x"),ar=e("\u25B2","x"),M$=e("\u25C7","o"),X1=e("\u250C","T"),S=e("\u2502","|"),D=e("\u2514","\u2014"),Sm=e("\u25CF",">"),im=e("\u25CB"," "),V1=e("\u25FB","[\u2022]"),j1=e("\u25FC","[+]"),L1=e("\u25FB","[ ]"),f1=e("\u25AA","\u2022"),B1=e("\u2500","-"),k1=e("\u256E","+"),n1=e("\u251C","+"),E1=e("\u256F","+"),Mm=e("\u25CF","\u2022"),pm=e("\u25C6","*"),lm=e("\u25B2","!"),qm=e("\u25A0","x"),cr=(r)=>{switch(r){case"initial":case"active":return c.default.cyan(tm);case"cancel":return c.default.red(xr);case"error":return c.default.yellow(ar);case"submit":return c.default.green(M$)}},or=(r)=>new S$({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){let m=`${c.default.gray(S)}
|
|
30
32
|
${cr(this.state)} ${r.message}
|
|
31
33
|
`,b=r.placeholder?c.default.inverse(r.placeholder[0])+c.default.dim(r.placeholder.slice(1)):c.default.inverse(c.default.hidden("_")),h=this.value?this.valueWithCursor:b;switch(this.state){case"error":return`${m.trim()}
|
|
32
|
-
${c.default.yellow(
|
|
34
|
+
${c.default.yellow(S)} ${h}
|
|
33
35
|
${c.default.yellow(D)} ${c.default.yellow(this.error)}
|
|
34
|
-
`;case"submit":return`${m}${c.default.gray(
|
|
35
|
-
`+c.default.gray(
|
|
36
|
+
`;case"submit":return`${m}${c.default.gray(S)} ${c.default.dim(this.value||r.placeholder)}`;case"cancel":return`${m}${c.default.gray(S)} ${c.default.strikethrough(c.default.dim(this.value??""))}${this.value?.trim()?`
|
|
37
|
+
`+c.default.gray(S):""}`;default:return`${m}${c.default.cyan(S)} ${h}
|
|
36
38
|
${c.default.cyan(D)}
|
|
37
|
-
`}}}).prompt();var gr=(r)=>{
|
|
39
|
+
`}}}).prompt();var gr=(r)=>{let m=(h,v)=>{let x=h.label??String(h.value);return v==="active"?`${c.default.green(Sm)} ${x} ${h.hint?c.default.dim(`(${h.hint})`):""}`:v==="selected"?`${c.default.dim(x)}`:v==="cancelled"?`${c.default.strikethrough(c.default.dim(x))}`:`${c.default.dim(im)} ${c.default.dim(x)}`},b=0;return new hr({options:r.options,initialValue:r.initialValue,render(){let h=`${c.default.gray(S)}
|
|
38
40
|
${cr(this.state)} ${r.message}
|
|
39
|
-
`;switch(this.state){case"submit":return`${h}${c.default.gray(
|
|
40
|
-
${c.default.gray(
|
|
41
|
-
${c.default.cyan(
|
|
41
|
+
`;switch(this.state){case"submit":return`${h}${c.default.gray(S)} ${m(this.options[this.cursor],"selected")}`;case"cancel":return`${h}${c.default.gray(S)} ${m(this.options[this.cursor],"cancelled")}
|
|
42
|
+
${c.default.gray(S)}`;default:{let v=r.maxItems===void 0?1/0:Math.max(r.maxItems,5);this.cursor>=b+v-3?b=Math.max(Math.min(this.cursor-v+3,this.options.length-v),0):this.cursor<b+2&&(b=Math.max(this.cursor-2,0));let x=v<this.options.length&&b>0,$=v<this.options.length&&b+v<this.options.length;return`${h}${c.default.cyan(S)} ${this.options.slice(b,b+v).map((a,s,o)=>s===0&&x?c.default.dim("..."):s===o.length-1&&$?c.default.dim("..."):m(a,s+b===this.cursor?"active":"inactive")).join(`
|
|
43
|
+
${c.default.cyan(S)} `)}
|
|
42
44
|
${c.default.cyan(D)}
|
|
43
|
-
`}}}}).prompt()};var
|
|
45
|
+
`}}}}).prompt()};var p$=(r="")=>{process.stdout.write(`${c.default.gray(S)}
|
|
44
46
|
${c.default.gray(D)} ${r}
|
|
45
47
|
|
|
46
|
-
`)},d={message:(r="",{symbol:m=c.default.gray(
|
|
47
|
-
`);b.push(`${m} ${h}`,...v.map((x)=>`${c.default.gray(
|
|
48
|
+
`)},d={message:(r="",{symbol:m=c.default.gray(S)}={})=>{let b=[`${c.default.gray(S)}`];if(r){let[h,...v]=r.split(`
|
|
49
|
+
`);b.push(`${m} ${h}`,...v.map((x)=>`${c.default.gray(S)} ${x}`))}process.stdout.write(`${b.join(`
|
|
48
50
|
`)}
|
|
49
|
-
`)},info:(r)=>{d.message(r,{symbol:c.default.blue(
|
|
50
|
-
`);let g=0,
|
|
51
|
-
`),b()},s=(w="")=>{x=w??x},o=(w)=>{const g=w>1?"Something went wrong":"Canceled";v&&a(g,w)};return process.on("uncaughtExceptionMonitor",()=>o(2)),process.on("unhandledRejection",()=>o(2)),process.on("SIGINT",()=>o(1)),process.on("SIGTERM",()=>o(1)),process.on("exit",o),{start:$,stop:a,message:s}};function Zm(r){return r.startsWith("cr_")&&r.length>10}async function zm(r){try{const b=await(await fetch(`${Q}/apiStats/api/get-key-id`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r})})).json();if(b.success&&b.data?.id)return{valid:!0,apiId:b.data.id};return{valid:!1,error:b.error||"Key \u9A8C\u8BC1\u5931\u8D25"}}catch(m){return{valid:!1,error:m instanceof Error?m.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}async function sr(r){if(!Zm(r))return{success:!1,error:"Key \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4EE5 cr_ \u5F00\u5934"};const m=await zm(r);if(!m.valid)return{success:!1,error:m.error};return await N({apiKey:r,apiId:m.apiId}),{success:!0}}import{join as W$} from"path";async function T(){if($$)return $$;const r=[Qm,Sm,Ym];for(let m of r)try{const b=await Promise.race([m(),new Promise((h,v)=>setTimeout(()=>v(new Error("timeout")),3000))]);if(b)return $$=b,b}catch{}return $$="cn","cn"}async function Qm(){try{const r=await fetch("http://ip-api.com/json/?fields=countryCode",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).countryCode==="CN"?"cn":"global"}catch{return null}}async function Sm(){try{const r=await fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country==="CN"?"cn":"global"}catch{return null}}async function Ym(){try{const r=await fetch("https://api.ip.sb/geoip",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country_code==="CN"?"cn":"global"}catch{return null}}async function Jm(){const r=await T();return q$[r]}async function V(){return(await Jm()).npm}async function dr(){if(await T()==="cn")return`curl -fsSL https://bun.sh/install | BUN_INSTALL_MIRROR="${q$.cn.bunMirror}" bash`;return"curl -fsSL https://bun.sh/install | bash"}async function wr(){const r=await T(),m=q$[r];if(r==="cn")d.info("\u68C0\u6D4B\u5230\u4E2D\u56FD\u5927\u9646\u7F51\u7EDC\uFF0C\u4F7F\u7528\u56FD\u5185\u955C\u50CF\u6E90"),d.message(` npm: ${m.npm}`);else d.info("\u4F7F\u7528\u56FD\u9645\u6E90")}var $$=null,q$={cn:{npm:"https://registry.npmmirror.com",bun:"https://bun.sh/install",bunMirror:"https://registry.npmmirror.com/-/binary/bun"},global:{npm:"https://registry.npmjs.org",bun:"https://bun.sh/install",bunMirror:null}};var Hm=function(r){return r.startsWith(H)};async function er(){try{if(!await Bun.file(l).exists())return!1;const m=Bun.spawn([l,"--version"],{stdout:"pipe",stderr:"pipe"});return await m.exited,m.exitCode===0}catch{return!1}}async function Xm(){if(process.platform==="win32")return!0;try{const m=Bun.spawn(["which","unzip"],{stdout:"pipe",stderr:"pipe"});if(await m.exited,m.exitCode===0)return!0}catch{}d.warn("\u6B63\u5728\u5B89\u88C5\u7CFB\u7EDF\u4F9D\u8D56 (unzip)...");const r=["apt-get update -qq && apt-get install -y -qq unzip","yum install -y -q unzip","dnf install -y -q unzip","pacman -S --noconfirm unzip","apk add --quiet unzip"];for(let m of r)try{const b=Bun.spawn(["bash","-c",`sudo ${m} 2>/dev/null || ${m}`],{stdout:"pipe",stderr:"pipe"});if(await b.exited,b.exitCode===0)return!0}catch{}return!1}async function Vm(){const r=S();if(!await Xm())return d.error("\u8BF7\u5148\u624B\u52A8\u5B89\u88C5 unzip: apt install unzip / yum install unzip"),!1;await wr(),r.start("\u6B63\u5728\u5B89\u88C5 Tako \u4E13\u5C5E Bun \u8FD0\u884C\u65F6...");try{await(await import("fs/promises")).mkdir(H,{recursive:!0});let b;if(process.platform==="win32"){const v=await T()==="cn"?'$env:BUN_INSTALL_MIRROR="https://registry.npmmirror.com/-/binary/bun"; ':"",x=`\$env:BUN_INSTALL="${H}"; ${v}irm bun.sh/install.ps1 | iex`;b=await Bun.spawn(["powershell","-Command",x],{stdout:"inherit",stderr:"inherit"}).exited}else{const h=await dr(),v=`BUN_INSTALL="${H}" ${h}`;b=await Bun.spawn(["bash","-c",v],{stdout:"inherit",stderr:"inherit"}).exited}if(b!==0)return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1;return j=l,r.stop("Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5B8C\u6210"),d.info(`\u5B89\u88C5\u4F4D\u7F6E: ${H}`),!0}catch(m){return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1}}async function jm(){if(await er())return j=l,!0;return d.warn("\u672A\u68C0\u6D4B\u5230 Tako \u4E13\u5C5E Bun\uFF0C\u6B63\u5728\u81EA\u52A8\u5B89\u88C5..."),d.info("\uFF08\u4E0D\u4F1A\u5F71\u54CD\u60A8\u7CFB\u7EDF\u4E2D\u5DF2\u5B89\u88C5\u7684 Node.js \u6216 Bun\uFF09"),await Vm()}async function G$(){if(j){if(!Hm(j))j=l;return j}if(await er())return j=l,l;return l}async function tr(r){try{const m=await V(),b=await fetch(`${m}/${r}/latest`);if(!b.ok)return null;return(await b.json()).version}catch{return null}}async function Lm(r){return(await X()).installedClients[r.id]?.version||null}async function ir(r){const m=n(r.id),b=W$(m,"package.json");try{return await Bun.file(b).exists()}catch{return!1}}async function Mr(r){const m=await Lm(r);if(!m)return!0;const b=await tr(r.package);if(!b)return!1;return m!==b}async function yr(r,m=!1){const b=S(),h=n(r.id);try{if(!await jm())return{success:!1,error:"Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u624B\u52A8\u5220\u9664 ~/.tako/bun \u76EE\u5F55\u540E\u91CD\u8BD5"};const v=await ir(r),x=m||await Mr(r);if(v&&!x)return{success:!0};const $=v?"\u66F4\u65B0":"\u5B89\u88C5";b.start(`\u6B63\u5728${$} ${r.name}...`);const a=await import("fs/promises");await a.mkdir(h,{recursive:!0});const s=W$(h,"package.json");if(!await Bun.file(s).exists())await Bun.write(s,JSON.stringify({name:`tako-${r.id}`,private:!0,dependencies:{}},null,2));const w=await G$(),g=await V();if(v){const L=W$(h,"bun.lock");try{await a.unlink(L)}catch{}}const i=Bun.spawn([w,"add",`${r.package}@latest`],{cwd:h,stdout:"pipe",stderr:"pipe",env:{...process.env,BUN_CONFIG_REGISTRY:g}});if(await i.exited!==0){const L=await new Response(i.stderr).text();return b.stop(`${$} ${r.name} \u5931\u8D25`),{success:!1,error:L}}const K=await tr(r.package);if(K){const L=await X();L.installedClients[r.id]={version:K,installedAt:(new Date()).toISOString()},await N(L)}return b.stop(`${r.name} ${$}\u5B8C\u6210`),{success:!0}}catch(v){return b.stop("\u64CD\u4F5C\u5931\u8D25"),{success:!1,error:v instanceof Error?v.message:"\u672A\u77E5\u9519\u8BEF"}}}async function pr(r){if(!await ir(r))return await yr(r);if(await Mr(r))return await yr(r,!0);return{success:!0}}var j=null;async function P(r){try{const m=await pr(r);if(!m.success)return m;const b=await j$();if(!b)return{success:!1,error:"\u672A\u914D\u7F6E API Key"};if(r.setupConfigFiles)await r.setupConfigFiles(b);let h=await f$(r);if(!h)h=B$(r);if(!await Bun.file(h).exists())return{success:!1,error:`\u627E\u4E0D\u5230\u53EF\u6267\u884C\u6587\u4EF6: ${h}`};const x=r.getEnvVars(b),$={...process.env,...x};d.info(`\u542F\u52A8 ${r.name}...`);let a;if(r.runtime==="native")a=[h];else a=[await G$(),h];return await Bun.spawn(a,{env:$,stdio:["inherit","inherit","inherit"],cwd:process.cwd()}).exited,{success:!0}}catch(m){return{success:!1,error:m instanceof Error?m.message:"\u542F\u52A8\u5931\u8D25"}}}async function Z$(){try{const r=await L$();if(!r)return{success:!1,error:"\u672A\u627E\u5230 API ID\uFF0C\u8BF7\u91CD\u65B0\u914D\u7F6E Key"};const b=await(await fetch(`${Q}/apiStats/api/user-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r})})).json(),v=await(await fetch(`${Q}/apiStats/api/user-model-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r,period:"daily"})})).json();if(!b.success)return{success:!1,error:b.error||b.message||"\u83B7\u53D6\u7EDF\u8BA1\u5931\u8D25"};const x=(v.data||[]).map(($)=>({model:$.model,requests:$.requests,cost:$.formatted?.total||"$0.00"}));return{success:!0,data:{totalRequests:b.data?.usage?.total?.requests||0,totalCost:b.data?.usage?.total?.formattedCost||"$0.00",todayCost:`\$${(b.data?.limits?.currentDailyCost||0).toFixed(2)}`,modelStats:x}}}catch(r){return{success:!1,error:r instanceof Error?r.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}function z$(r){return r.toLocaleString("en-US")}import{join as z} from"path";var fm=function(r,m){const b=r.split(".").map(Number),h=m.split(".").map(Number);for(let v=0;v<3;v++){const x=b[v]||0,$=h[v]||0;if(x>$)return 1;if(x<$)return-1}return 0};async function Bm(){try{const r=await V(),m=await fetch(`${r}/${Q$}/latest`,{signal:AbortSignal.timeout(5000)});if(!m.ok)return null;return(await m.json()).version||null}catch{return null}}async function km(){const r=await Bm();if(!r)return{hasUpdate:!1,currentVersion:k};return{hasUpdate:fm(r,k)>0,latestVersion:r,currentVersion:k}}async function lr(){const r=await import("fs/promises"),m=z(G,"bin"),b=z(m,"tako"),h=z(Z,"node_modules/tako-cli/dist/index.js");if(await r.mkdir(m,{recursive:!0}),process.platform==="win32"){const x=`@echo off\r\n"${l}" "${h}" %*\r\n`;await r.writeFile(z(m,"tako.cmd"),x)}else{const x=`#!/bin/bash\nexec "${l}" "${h}" "\$@"\n`;await r.writeFile(b,x,{mode:493})}}async function nm(r){const m=S();m.start(`\u6B63\u5728\u66F4\u65B0\u5230 v${r}...`);try{const b=await V(),h=await import("fs/promises");await h.mkdir(Z,{recursive:!0});const v=z(Z,"package.json");try{await h.access(v)}catch{await h.writeFile(v,JSON.stringify({name:"tako-local",private:!0},null,2))}const x=Bun.spawn([l,"update",Q$,"--latest"],{cwd:Z,stdout:"pipe",stderr:"pipe",env:{...process.env,BUN_CONFIG_REGISTRY:b}});if(await x.exited,x.exitCode===0)return await lr(),m.stop(`\u66F4\u65B0\u6210\u529F\uFF01\u5DF2\u66F4\u65B0\u5230 v${r}`),!0;else{const $=await new Response(x.stderr).text();return m.stop(`\u66F4\u65B0\u5931\u8D25: ${$||"\u672A\u77E5\u9519\u8BEF"}`),!1}}catch(b){return m.stop(`\u66F4\u65B0\u5931\u8D25: ${b instanceof Error?b.message:"\u672A\u77E5\u9519\u8BEF"}`),!1}}async function Em(){const r=await import("fs/promises"),m=z(Z,"bun.lock");try{await r.unlink(m)}catch{}}async function Um(){const r=await import("fs/promises");try{const m=await V();await r.mkdir(Z,{recursive:!0});const b=z(Z,"package.json");try{await r.access(b)}catch{await r.writeFile(b,JSON.stringify({name:"tako-local",private:!0},null,2))}await Em();const h=Bun.spawn([l,"add",`${Q$}@latest`],{cwd:Z,stdout:"pipe",stderr:"pipe",env:{...process.env,BUN_CONFIG_REGISTRY:m}});return await h.exited,h.exitCode===0}catch{return!1}}async function Tm(){const r=await import("fs/promises"),m=z(G,"bin"),b=z(m,"tako"),h=z(Z,"node_modules/tako-cli/dist/index.js");try{const v=await r.readFile(b,"utf-8");if(v.includes("bun run tako-cli")||v.includes("run tako-cli")){d.info("\u68C0\u6D4B\u5230\u65E7\u7248\u5B89\u88C5\u65B9\u5F0F\uFF0C\u6B63\u5728\u8FC1\u79FB...");let x=!1;try{await r.access(h),x=!0}catch{x=!1}if(!x){const $=S();if($.start("\u6B63\u5728\u5B89\u88C5\u5230\u672C\u5730\u76EE\u5F55..."),!await Um())return $.stop("\u672C\u5730\u5B89\u88C5\u5931\u8D25\uFF0C\u8DF3\u8FC7\u8FC1\u79FB"),!1;$.stop("\u672C\u5730\u5B89\u88C5\u5B8C\u6210")}return await lr(),!0}}catch{}return!1}async function r$(){try{if(await Tm())d.info("\u68C0\u6D4B\u5230\u65E7\u7248\u5B89\u88C5\uFF0C\u5DF2\u5B8C\u6210\u8FC1\u79FB\uFF0C\u8BF7\u91CD\u65B0\u542F\u52A8 Tako CLI"),process.exit(0);const m=await km();if(m.hasUpdate&&m.latestVersion){if(d.warn(`\u53D1\u73B0\u65B0\u7248\u672C v${m.latestVersion}\uFF08\u5F53\u524D v${k}\uFF09`),await nm(m.latestVersion))d.info("\u8BF7\u91CD\u65B0\u542F\u52A8 Tako CLI \u4EE5\u4F7F\u7528\u65B0\u7248\u672C"),process.exit(0)}}catch{}}var Q$="tako-cli",k="0.1.33";var Pm=function(){console.log(),console.log(` \uD83D\uDC19 Tako CLI v${k}`),console.log(" \x1B[90m\u6B22\u8FCE\u4F7F\u7528\uFF01\x1B[0m"),console.log()};async function qr(r=!1){if(!r)d.warn("\u672A\u68C0\u6D4B\u5230 API Key"),console.log();const m=await or({message:r?"\u8BF7\u8F93\u5165\u65B0\u7684 API Key (cr_xxx):":"\u8BF7\u8F93\u5165\u4F60\u7684 API Key (cr_xxx):",placeholder:"cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",validate(v){if(!v)return"\u8BF7\u8F93\u5165 API Key";if(!v.startsWith("cr_"))return"Key \u5FC5\u987B\u4EE5 cr_ \u5F00\u5934";if(v.length<10)return"Key \u683C\u5F0F\u4E0D\u6B63\u786E"}});if(U(m))return!1;const b=S();b.start("\u9A8C\u8BC1 Key \u4E2D...");const h=await sr(m);if(h.success)return b.stop("Key \u9A8C\u8BC1\u6210\u529F\uFF01\u5DF2\u4FDD\u5B58\u5230\u914D\u7F6E\u6587\u4EF6"),!0;else return b.stop(`\u9A8C\u8BC1\u5931\u8D25: ${h.error}`),!1}var Km=function(r,m){const b=[];if(b.push(""),b.push(" \uD83D\uDCCA \u7528\u91CF\u7EDF\u8BA1"),b.push(""),b.push(` \u603B\u8C03\u7528\u6B21\u6570: ${z$(r.totalRequests)} \u6B21`),b.push(` \u603B\u6D88\u8D39: ${r.totalCost}`),b.push(` \u4ECA\u65E5\u6D88\u8D39: ${r.todayCost}`),r.modelStats.length>0)b.push(""),b.push(" \u6A21\u578B\u4F7F\u7528\u5206\u5E03 (\u4ECA\u65E5):"),r.modelStats.forEach((h,v)=>{const x=v===r.modelStats.length-1?"\u2514\u2500":"\u251C\u2500",$=h.model.length>25?h.model.slice(0,22)+"...":h.model;b.push(` ${x} ${$.padEnd(25)} ${z$(h.requests).padStart(6)} \u6B21 ${h.cost.padStart(8)}`)});return b.push(""),b.push(` \x1B[90m${m}s \u540E\u5237\u65B0 | \u6309\u4EFB\u610F\u952E\u8FD4\u56DE\x1B[0m`),b.join("\n")};async function Om(){const m=S();m.start("\u83B7\u53D6\u7528\u91CF\u7EDF\u8BA1...");let b=await Z$();if(!b.success){m.stop(`\u83B7\u53D6\u5931\u8D25: ${b.error}`);return}m.stop("");let h=10,v="";const x=()=>{if(v){const a=v.split("\n").length;process.stdout.write(`\x1B[${a}A\x1B[0J`)}v=Km(b.data,h),console.log(v)};x();const $=process.stdin.isRaw;if(process.stdin.isTTY)process.stdin.setRawMode(!0);return process.stdin.resume(),new Promise((a)=>{let s=!0;const o=()=>{if(!s)return;s=!1,g(),a()},w=setInterval(async()=>{if(!s)return;if(h--,h<=0){h=10;const i=await Z$();if(i.success)b=i}x()},1000),g=()=>{if(clearInterval(w),process.stdin.removeListener("data",o),process.stdin.isTTY)process.stdin.setRawMode($??!1);process.stdin.pause()};process.stdin.on("data",o)})}async function Nm(){const m=[...k$().map((h)=>({value:{type:"launch",client:h},label:`\u542F\u52A8 ${h.name}`,hint:h.package})),{value:{type:"stats"},label:"\u67E5\u770B\u7528\u91CF\u7EDF\u8BA1"},{value:{type:"config"},label:"\u914D\u7F6E API Key"},{value:{type:"exit"},label:"\u9000\u51FA"}],b=await gr({message:"\u8BF7\u9009\u62E9\u64CD\u4F5C:",options:m});if(U(b))return null;return b}async function Am(r){switch(r.type){case"launch":const m=await P(r.client);if(!m.success)d.error(m.error||"\u542F\u52A8\u5931\u8D25");return!0;case"stats":return await Om(),!0;case"config":return await qr(!0),!0;case"exit":return!1}}async function Wr(){if(Pm(),!await V$()){if(!await qr()){l$("\u518D\u89C1\uFF01");return}}while(!0){const m=await Nm();if(m===null)break;if(!await Am(m))break}l$("\u518D\u89C1\uFF01")}var Rm=function(){console.log(`
|
|
52
|
-
|
|
51
|
+
`)},info:(r)=>{d.message(r,{symbol:c.default.blue(Mm)})},success:(r)=>{d.message(r,{symbol:c.default.green(pm)})},step:(r)=>{d.message(r,{symbol:c.default.green(M$)})},warn:(r)=>{d.message(r,{symbol:c.default.yellow(lm)})},warning:(r)=>{d.warn(r)},error:(r)=>{d.message(r,{symbol:c.default.red(qm)})}},Y=()=>{let r=i$?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],m=i$?80:120,b,h,v=!1,x="",$=(w="")=>{v=!0,b=vr(),x=w.replace(/\.+$/,""),process.stdout.write(`${c.default.gray(S)}
|
|
52
|
+
`);let g=0,t=0;h=setInterval(()=>{let H=c.default.magenta(r[g]),O=".".repeat(Math.floor(t)).slice(0,3);process.stdout.write(k.cursor.move(-999,0)),process.stdout.write(k.erase.down(1)),process.stdout.write(`${H} ${x}${O}`),g=g+1<r.length?g+1:0,t=t<r.length?t+0.125:0},m)},a=(w="",g=0)=>{x=w??x,v=!1,clearInterval(h);let t=g===0?c.default.green(M$):g===1?c.default.red(xr):c.default.red(ar);process.stdout.write(k.cursor.move(-999,0)),process.stdout.write(k.erase.down(1)),process.stdout.write(`${t} ${x}
|
|
53
|
+
`),b()},s=(w="")=>{x=w??x},o=(w)=>{let g=w>1?"Something went wrong":"Canceled";v&&a(g,w)};return process.on("uncaughtExceptionMonitor",()=>o(2)),process.on("unhandledRejection",()=>o(2)),process.on("SIGINT",()=>o(1)),process.on("SIGTERM",()=>o(1)),process.on("exit",o),{start:$,stop:a,message:s}};function Gm(r){return r.startsWith("cr_")&&r.length>10}async function Zm(r){try{let b=await(await fetch(`${Q}/apiStats/api/get-key-id`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:r})})).json();if(b.success&&b.data?.id)return{valid:!0,apiId:b.data.id};return{valid:!1,error:b.error||"Key \u9A8C\u8BC1\u5931\u8D25"}}catch(m){return{valid:!1,error:m instanceof Error?m.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}async function sr(r){if(!Gm(r))return{success:!1,error:"Key \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u4EE5 cr_ \u5F00\u5934"};let m=await Zm(r);if(!m.valid)return{success:!1,error:m.error};return await I({apiKey:r,apiId:m.apiId}),{success:!0}}import{join as q$}from"path";var $$=null,l$={cn:{npm:"https://registry.npmmirror.com",bun:"https://bun.sh/install",bunMirror:"https://registry.npmmirror.com/-/binary/bun"},global:{npm:"https://registry.npmjs.org",bun:"https://bun.sh/install",bunMirror:null}};async function P(){if($$)return $$;let r=[zm,Qm,Ym];for(let m of r)try{let b=await Promise.race([m(),new Promise((h,v)=>setTimeout(()=>v(Error("timeout")),3000))]);if(b)return $$=b,b}catch{}return $$="cn","cn"}async function zm(){try{let r=await fetch("http://ip-api.com/json/?fields=countryCode",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).countryCode==="CN"?"cn":"global"}catch{return null}}async function Qm(){try{let r=await fetch("https://ipinfo.io/json",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country==="CN"?"cn":"global"}catch{return null}}async function Ym(){try{let r=await fetch("https://api.ip.sb/geoip",{signal:AbortSignal.timeout(2000)});if(!r.ok)return null;return(await r.json()).country_code==="CN"?"cn":"global"}catch{return null}}async function Jm(){let r=await P();return l$[r]}async function j(){return(await Jm()).npm}async function dr(){if(await P()==="cn")return`curl -fsSL https://bun.sh/install | BUN_INSTALL_MIRROR="${l$.cn.bunMirror}" bash`;return"curl -fsSL https://bun.sh/install | bash"}async function wr(){let r=await P(),m=l$[r];if(r==="cn")d.info("\u68C0\u6D4B\u5230\u4E2D\u56FD\u5927\u9646\u7F51\u7EDC\uFF0C\u4F7F\u7528\u56FD\u5185\u955C\u50CF\u6E90"),d.message(` npm: ${m.npm}`);else d.info("\u4F7F\u7528\u56FD\u9645\u6E90")}var L=null;function Hm(r){return r.startsWith(X)}async function er(){try{if(!await Bun.file(M).exists())return!1;let m=Bun.spawn([M,"--version"],{stdout:"pipe",stderr:"pipe"});return await m.exited,m.exitCode===0}catch{return!1}}async function Xm(){if(process.platform==="win32")return!0;try{let m=Bun.spawn(["which","unzip"],{stdout:"pipe",stderr:"pipe"});if(await m.exited,m.exitCode===0)return!0}catch{}d.warn("\u6B63\u5728\u5B89\u88C5\u7CFB\u7EDF\u4F9D\u8D56 (unzip)...");let r=["apt-get update -qq && apt-get install -y -qq unzip","yum install -y -q unzip","dnf install -y -q unzip","pacman -S --noconfirm unzip","apk add --quiet unzip"];for(let m of r)try{let b=Bun.spawn(["bash","-c",`sudo ${m} 2>/dev/null || ${m}`],{stdout:"pipe",stderr:"pipe"});if(await b.exited,b.exitCode===0)return!0}catch{}return!1}async function Vm(){let r=Y();if(!await Xm())return d.error("\u8BF7\u5148\u624B\u52A8\u5B89\u88C5 unzip: apt install unzip / yum install unzip"),!1;await wr(),r.start("\u6B63\u5728\u5B89\u88C5 Tako \u4E13\u5C5E Bun \u8FD0\u884C\u65F6...");try{await(await import("fs/promises")).mkdir(X,{recursive:!0});let b;if(process.platform==="win32"){let v=await P()==="cn"?'$env:BUN_INSTALL_MIRROR="https://registry.npmmirror.com/-/binary/bun"; ':"",x=`$env:BUN_INSTALL="${X}"; ${v}irm bun.sh/install.ps1 | iex`;b=await Bun.spawn(["powershell","-Command",x],{stdout:"inherit",stderr:"inherit"}).exited}else{let h=await dr(),v=`BUN_INSTALL="${X}" ${h}`;b=await Bun.spawn(["bash","-c",v],{stdout:"inherit",stderr:"inherit"}).exited}if(b!==0)return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1;return L=M,r.stop("Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5B8C\u6210"),d.info(`\u5B89\u88C5\u4F4D\u7F6E: ${X}`),!0}catch(m){return r.stop("Bun \u5B89\u88C5\u5931\u8D25"),!1}}async function jm(){if(await er())return L=M,!0;return d.warn("\u672A\u68C0\u6D4B\u5230 Tako \u4E13\u5C5E Bun\uFF0C\u6B63\u5728\u81EA\u52A8\u5B89\u88C5..."),d.info("\uFF08\u4E0D\u4F1A\u5F71\u54CD\u60A8\u7CFB\u7EDF\u4E2D\u5DF2\u5B89\u88C5\u7684 Node.js \u6216 Bun\uFF09"),await Vm()}async function W$(){if(L){if(!Hm(L))L=M;return L}if(await er())return L=M,M;return M}async function tr(r){try{let m=await j(),b=await fetch(`${m}/${r}/latest`);if(!b.ok)return null;return(await b.json()).version}catch{return null}}async function Lm(r){return(await V()).installedClients[r.id]?.version||null}async function Sr(r){let m=E(r.id),b=q$(m,"package.json");try{return await Bun.file(b).exists()}catch{return!1}}async function ir(r){let m=await Lm(r);if(!m)return!0;let b=await tr(r.package);if(!b)return!1;return m!==b}async function yr(r,m=!1){let b=Y(),h=E(r.id);try{if(!await jm())return{success:!1,error:"Tako \u4E13\u5C5E Bun \u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u624B\u52A8\u5220\u9664 ~/.tako/bun \u76EE\u5F55\u540E\u91CD\u8BD5"};let v=await Sr(r),x=m||await ir(r);if(v&&!x)return{success:!0};let $=v?"\u66F4\u65B0":"\u5B89\u88C5";b.start(`\u6B63\u5728${$} ${r.name}...`);let a=await import("fs/promises");await a.mkdir(h,{recursive:!0});let s=q$(h,"package.json");if(!await Bun.file(s).exists())await Bun.write(s,JSON.stringify({name:`tako-${r.id}`,private:!0,dependencies:{}},null,2));let w=await W$(),g=await j();if(v){let f=q$(h,"bun.lock");try{await a.unlink(f)}catch{}}let t=Bun.spawn([w,"add",`${r.package}@latest`],{cwd:h,stdout:"pipe",stderr:"pipe",env:{...process.env,BUN_CONFIG_REGISTRY:g}});if(await t.exited!==0){let f=await new Response(t.stderr).text();return b.stop(`${$} ${r.name} \u5931\u8D25`),{success:!1,error:f}}let O=await tr(r.package);if(O){let f=await V();f.installedClients[r.id]={version:O,installedAt:new Date().toISOString()},await I(f)}return b.stop(`${r.name} ${$}\u5B8C\u6210`),{success:!0}}catch(v){return b.stop("\u64CD\u4F5C\u5931\u8D25"),{success:!1,error:v instanceof Error?v.message:"\u672A\u77E5\u9519\u8BEF"}}}async function Mr(r){if(!await Sr(r))return await yr(r);if(await ir(r))return await yr(r,!0);return{success:!0}}async function K(r){try{let m=await Mr(r);if(!m.success)return m;let b=await j$();if(!b)return{success:!1,error:"\u672A\u914D\u7F6E API Key"};if(r.setupConfigFiles)await r.setupConfigFiles(b);let h=await f$(r);if(!h)h=B$(r);if(!await Bun.file(h).exists())return{success:!1,error:`\u627E\u4E0D\u5230\u53EF\u6267\u884C\u6587\u4EF6: ${h}`};let x=r.getEnvVars(b),$={...process.env,...x};d.info(`\u542F\u52A8 ${r.name}...`);let a;if(r.runtime==="native")a=[h];else a=[await W$(),h];return await Bun.spawn(a,{env:$,stdio:["inherit","inherit","inherit"],cwd:process.cwd()}).exited,{success:!0}}catch(m){return{success:!1,error:m instanceof Error?m.message:"\u542F\u52A8\u5931\u8D25"}}}async function G$(){try{let r=await L$();if(!r)return{success:!1,error:"\u672A\u627E\u5230 API ID\uFF0C\u8BF7\u91CD\u65B0\u914D\u7F6E Key"};let b=await(await fetch(`${Q}/apiStats/api/user-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r})})).json(),v=await(await fetch(`${Q}/apiStats/api/user-model-stats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiId:r,period:"daily"})})).json();if(!b.success)return{success:!1,error:b.error||b.message||"\u83B7\u53D6\u7EDF\u8BA1\u5931\u8D25"};let x=(v.data||[]).map(($)=>({model:$.model,requests:$.requests,cost:$.formatted?.total||"$0.00"}));return{success:!0,data:{totalRequests:b.data?.usage?.total?.requests||0,totalCost:b.data?.usage?.total?.formattedCost||"$0.00",todayCost:`$${(b.data?.limits?.currentDailyCost||0).toFixed(2)}`,modelStats:x}}}catch(r){return{success:!1,error:r instanceof Error?r.message:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25"}}}function Z$(r){return r.toLocaleString("en-US")}import{join as Z}from"path";var z$="tako-cli",n="0.1.35";function fm(r,m){let b=r.split(".").map(Number),h=m.split(".").map(Number);for(let v=0;v<3;v++){let x=b[v]||0,$=h[v]||0;if(x>$)return 1;if(x<$)return-1}return 0}async function Bm(){try{let r=await j(),m=await fetch(`${r}/${z$}/latest`,{signal:AbortSignal.timeout(5000)});if(!m.ok)return null;return(await m.json()).version||null}catch{return null}}async function km(){let r=await Bm();if(!r)return{hasUpdate:!1,currentVersion:n};return{hasUpdate:fm(r,n)>0,latestVersion:r,currentVersion:n}}async function pr(){let r=await import("fs/promises"),m=Z(W,"bin"),b=Z(m,"tako"),h=Z(G,"node_modules/tako-cli/dist/index.js");if(await r.mkdir(m,{recursive:!0}),process.platform==="win32"){let x=`@echo off\r
|
|
54
|
+
"${M}" "${h}" %*\r
|
|
55
|
+
`;await r.writeFile(Z(m,"tako.cmd"),x)}else{let x=`#!/bin/bash
|
|
56
|
+
exec "${M}" "${h}" "$@"
|
|
57
|
+
`;await r.writeFile(b,x,{mode:493})}}async function nm(r){let m=Y();m.start(`\u6B63\u5728\u66F4\u65B0\u5230 v${r}...`);try{let b=await j(),h=await import("fs/promises");await h.mkdir(G,{recursive:!0});let v=Z(G,"package.json");try{await h.access(v)}catch{await h.writeFile(v,JSON.stringify({name:"tako-local",private:!0},null,2))}let x=Bun.spawn([M,"update",z$,"--latest"],{cwd:G,stdout:"pipe",stderr:"pipe",env:{...process.env,BUN_CONFIG_REGISTRY:b}});if(await x.exited,x.exitCode===0)return await pr(),m.stop(`\u66F4\u65B0\u6210\u529F\uFF01\u5DF2\u66F4\u65B0\u5230 v${r}`),!0;else{let $=await new Response(x.stderr).text();return m.stop(`\u66F4\u65B0\u5931\u8D25: ${$||"\u672A\u77E5\u9519\u8BEF"}`),!1}}catch(b){return m.stop(`\u66F4\u65B0\u5931\u8D25: ${b instanceof Error?b.message:"\u672A\u77E5\u9519\u8BEF"}`),!1}}async function Em(){let r=await import("fs/promises"),m=Z(G,"bun.lock");try{await r.unlink(m)}catch{}}async function Um(){let r=await import("fs/promises");try{let m=await j();await r.mkdir(G,{recursive:!0});let b=Z(G,"package.json");try{await r.access(b)}catch{await r.writeFile(b,JSON.stringify({name:"tako-local",private:!0},null,2))}await Em();let h=Bun.spawn([M,"add",`${z$}@latest`],{cwd:G,stdout:"pipe",stderr:"pipe",env:{...process.env,BUN_CONFIG_REGISTRY:m}});return await h.exited,h.exitCode===0}catch{return!1}}async function Tm(){let r=await import("fs/promises"),m=Z(W,"bin"),b=Z(m,"tako"),h=Z(G,"node_modules/tako-cli/dist/index.js");try{let v=await r.readFile(b,"utf-8");if(v.includes("bun run tako-cli")||v.includes("run tako-cli")){d.info("\u68C0\u6D4B\u5230\u65E7\u7248\u5B89\u88C5\u65B9\u5F0F\uFF0C\u6B63\u5728\u8FC1\u79FB...");let x=!1;try{await r.access(h),x=!0}catch{x=!1}if(!x){let $=Y();if($.start("\u6B63\u5728\u5B89\u88C5\u5230\u672C\u5730\u76EE\u5F55..."),!await Um())return $.stop("\u672C\u5730\u5B89\u88C5\u5931\u8D25\uFF0C\u8DF3\u8FC7\u8FC1\u79FB"),!1;$.stop("\u672C\u5730\u5B89\u88C5\u5B8C\u6210")}return await pr(),!0}}catch{}return!1}async function r$(){try{if(await Tm())d.info("\u68C0\u6D4B\u5230\u65E7\u7248\u5B89\u88C5\uFF0C\u5DF2\u5B8C\u6210\u8FC1\u79FB\uFF0C\u8BF7\u91CD\u65B0\u542F\u52A8 Tako CLI"),process.exit(0);let m=await km();if(m.hasUpdate&&m.latestVersion){if(d.warn(`\u53D1\u73B0\u65B0\u7248\u672C v${m.latestVersion}\uFF08\u5F53\u524D v${n}\uFF09`),await nm(m.latestVersion))d.info("\u8BF7\u91CD\u65B0\u542F\u52A8 Tako CLI \u4EE5\u4F7F\u7528\u65B0\u7248\u672C"),process.exit(0)}}catch{}}function Pm(){console.log(),console.log(` \uD83D\uDC19 Tako CLI v${n}`),console.log(" \x1B[90m\u6B22\u8FCE\u4F7F\u7528\uFF01\x1B[0m"),console.log()}async function lr(r=!1){if(!r)d.warn("\u672A\u68C0\u6D4B\u5230 API Key"),console.log();let m=await or({message:r?"\u8BF7\u8F93\u5165\u65B0\u7684 API Key (cr_xxx):":"\u8BF7\u8F93\u5165\u4F60\u7684 API Key (cr_xxx):",placeholder:"cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",validate(v){if(!v)return"\u8BF7\u8F93\u5165 API Key";if(!v.startsWith("cr_"))return"Key \u5FC5\u987B\u4EE5 cr_ \u5F00\u5934";if(v.length<10)return"Key \u683C\u5F0F\u4E0D\u6B63\u786E"}});if(T(m))return!1;let b=Y();b.start("\u9A8C\u8BC1 Key \u4E2D...");let h=await sr(m);if(h.success)return b.stop("Key \u9A8C\u8BC1\u6210\u529F\uFF01\u5DF2\u4FDD\u5B58\u5230\u914D\u7F6E\u6587\u4EF6"),!0;else return b.stop(`\u9A8C\u8BC1\u5931\u8D25: ${h.error}`),!1}function Km(r,m){let b=[];if(b.push(""),b.push(" \uD83D\uDCCA \u7528\u91CF\u7EDF\u8BA1"),b.push(""),b.push(` \u603B\u8C03\u7528\u6B21\u6570: ${Z$(r.totalRequests)} \u6B21`),b.push(` \u603B\u6D88\u8D39: ${r.totalCost}`),b.push(` \u4ECA\u65E5\u6D88\u8D39: ${r.todayCost}`),r.modelStats.length>0)b.push(""),b.push(" \u6A21\u578B\u4F7F\u7528\u5206\u5E03 (\u4ECA\u65E5):"),r.modelStats.forEach((h,v)=>{let x=v===r.modelStats.length-1?"\u2514\u2500":"\u251C\u2500",$=h.model.length>25?h.model.slice(0,22)+"...":h.model;b.push(` ${x} ${$.padEnd(25)} ${Z$(h.requests).padStart(6)} \u6B21 ${h.cost.padStart(8)}`)});return b.push(""),b.push(` \x1B[90m${m}s \u540E\u5237\u65B0 | \u6309\u4EFB\u610F\u952E\u8FD4\u56DE\x1B[0m`),b.join(`
|
|
58
|
+
`)}async function Om(){let m=Y();m.start("\u83B7\u53D6\u7528\u91CF\u7EDF\u8BA1...");let b=await G$();if(!b.success){m.stop(`\u83B7\u53D6\u5931\u8D25: ${b.error}`);return}m.stop("");let h=10,v="",x=()=>{if(v){let a=v.split(`
|
|
59
|
+
`).length;process.stdout.write(`\x1B[${a}A\x1B[0J`)}v=Km(b.data,h),console.log(v)};x();let $=process.stdin.isRaw;if(process.stdin.isTTY)process.stdin.setRawMode(!0);return process.stdin.resume(),new Promise((a)=>{let s=!0,o=()=>{if(!s)return;s=!1,g(),a()},w=setInterval(async()=>{if(!s)return;if(h--,h<=0){h=10;let t=await G$();if(t.success)b=t}x()},1000),g=()=>{if(clearInterval(w),process.stdin.removeListener("data",o),process.stdin.isTTY)process.stdin.setRawMode($??!1);process.stdin.pause()};process.stdin.on("data",o)})}async function Im(){let m=[...k$().map((h)=>({value:{type:"launch",client:h},label:`\u542F\u52A8 ${h.name}`,hint:h.package})),{value:{type:"stats"},label:"\u67E5\u770B\u7528\u91CF\u7EDF\u8BA1"},{value:{type:"config"},label:"\u914D\u7F6E API Key"},{value:{type:"exit"},label:"\u9000\u51FA"}],b=await gr({message:"\u8BF7\u9009\u62E9\u64CD\u4F5C:",options:m});if(T(b))return null;return b}async function Nm(r){switch(r.type){case"launch":let m=await K(r.client);if(!m.success)d.error(m.error||"\u542F\u52A8\u5931\u8D25");return!0;case"stats":return await Om(),!0;case"config":return await lr(!0),!0;case"exit":return!1}}async function qr(){if(Pm(),!await V$()){if(!await lr()){p$("\u518D\u89C1\uFF01");return}}while(!0){let m=await Im();if(m===null)break;if(!await Nm(m))break}p$("\u518D\u89C1\uFF01")}var Wr="0.1.35";function Am(){console.log(`
|
|
60
|
+
Tako CLI v${Wr}
|
|
53
61
|
|
|
54
62
|
\u7528\u6CD5: tako [\u9009\u9879] [\u547D\u4EE4]
|
|
55
63
|
|
|
@@ -65,4 +73,4 @@ Tako CLI v${Gr}
|
|
|
65
73
|
tako \u4EA4\u4E92\u5F0F\u9009\u62E9\u5DE5\u5177
|
|
66
74
|
tako --claude \u76F4\u63A5\u542F\u52A8 Claude Code
|
|
67
75
|
tako --codex \u76F4\u63A5\u542F\u52A8 Codex
|
|
68
|
-
`)}
|
|
76
|
+
`)}async function Rm(){let r=process.argv.slice(2);if(r.includes("-v")||r.includes("--version")){console.log(`Tako CLI v${Wr}`);return}if(r.includes("-h")||r.includes("--help")){Am();return}if(r.includes("--claude")){let m=v$("claude-code");if(!m)console.error("Claude Code \u5BA2\u6237\u7AEF\u672A\u627E\u5230"),process.exit(1);await r$();let b=await K(m);if(!b.success)console.error(b.error),process.exit(1);return}if(r.includes("--codex")){let m=v$("codex");if(!m)console.error("Codex \u5BA2\u6237\u7AEF\u672A\u627E\u5230"),process.exit(1);await r$();let b=await K(m);if(!b.success)console.error(b.error),process.exit(1);return}await r$(),await qr()}Rm().catch((r)=>{console.error("Tako CLI \u53D1\u751F\u9519\u8BEF:",r),process.exit(1)});
|