@stacksjs/rpx
Version:
A modern and smart reverse proxy.
38 lines (37 loc) • 367 kB
JavaScript
import{G as Kr,H as le,I as ur,M as Ki}from"./chunk-ny83tnrp.js";import{N as Bi,O as Is,P as pn}from"./chunk-7am1svx0.js";var ca=Is((cc,xr)=>{var gr=process||{},sa=gr.argv||[],yr=gr.env||{},As=!(!!yr.NO_COLOR||sa.includes("--no-color"))&&(!!yr.FORCE_COLOR||sa.includes("--color")||gr.platform==="win32"||(gr.stdout||{}).isTTY&&yr.TERM!=="dumb"||!!yr.CI),Bs=(r,S,t=r)=>(e)=>{let a=""+e,y=a.indexOf(S,r.length);return~y?r+bs(a,S,t,y)+S:r+a+S},bs=(r,S,t,e)=>{let a="",y=0;do a+=r.substring(y,e)+t,y=e+S.length,e=r.indexOf(S,y);while(~e);return a+r.substring(y)},oa=(r=As)=>{let S=r?Bs:()=>String;return{isColorSupported:r,reset:S("\x1B[0m","\x1B[0m"),bold:S("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:S("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:S("\x1B[3m","\x1B[23m"),underline:S("\x1B[4m","\x1B[24m"),inverse:S("\x1B[7m","\x1B[27m"),hidden:S("\x1B[8m","\x1B[28m"),strikethrough:S("\x1B[9m","\x1B[29m"),black:S("\x1B[30m","\x1B[39m"),red:S("\x1B[31m","\x1B[39m"),green:S("\x1B[32m","\x1B[39m"),yellow:S("\x1B[33m","\x1B[39m"),blue:S("\x1B[34m","\x1B[39m"),magenta:S("\x1B[35m","\x1B[39m"),cyan:S("\x1B[36m","\x1B[39m"),white:S("\x1B[37m","\x1B[39m"),gray:S("\x1B[90m","\x1B[39m"),bgBlack:S("\x1B[40m","\x1B[49m"),bgRed:S("\x1B[41m","\x1B[49m"),bgGreen:S("\x1B[42m","\x1B[49m"),bgYellow:S("\x1B[43m","\x1B[49m"),bgBlue:S("\x1B[44m","\x1B[49m"),bgMagenta:S("\x1B[45m","\x1B[49m"),bgCyan:S("\x1B[46m","\x1B[49m"),bgWhite:S("\x1B[47m","\x1B[49m"),blackBright:S("\x1B[90m","\x1B[39m"),redBright:S("\x1B[91m","\x1B[39m"),greenBright:S("\x1B[92m","\x1B[39m"),yellowBright:S("\x1B[93m","\x1B[39m"),blueBright:S("\x1B[94m","\x1B[39m"),magentaBright:S("\x1B[95m","\x1B[39m"),cyanBright:S("\x1B[96m","\x1B[39m"),whiteBright:S("\x1B[97m","\x1B[39m"),bgBlackBright:S("\x1B[100m","\x1B[49m"),bgRedBright:S("\x1B[101m","\x1B[49m"),bgGreenBright:S("\x1B[102m","\x1B[49m"),bgYellowBright:S("\x1B[103m","\x1B[49m"),bgBlueBright:S("\x1B[104m","\x1B[49m"),bgMagentaBright:S("\x1B[105m","\x1B[49m"),bgCyanBright:S("\x1B[106m","\x1B[49m"),bgWhiteBright:S("\x1B[107m","\x1B[49m")}};xr.exports=oa();xr.exports.createColors=oa});var ti="0.10.0";import{homedir as Sr}from"node:os";import{join as Tr,resolve as Qa}from"node:path";var{create:La,defineProperty:ai,getOwnPropertyDescriptor:Va,getOwnPropertyNames:Ka,getPrototypeOf:Pa}=Object,Ma=Object.prototype.hasOwnProperty,Oa=(r,S)=>()=>(S||r((S={exports:{}}).exports,S),S.exports),Fa=(r,S,t,e)=>{if(S&&typeof S=="object"||typeof S=="function")for(let a of Ka(S))!Ma.call(r,a)&&a!==t&&ai(r,a,{get:()=>S[a],enumerable:!(e=Va(S,a))||e.enumerable});return r},Ga=(r,S,t)=>(t=r!=null?La(Pa(r)):{},Fa(S||!r||!r.__esModule?ai(t,"default",{value:r,enumerable:!0}):t,r)),qa=Oa((r,S)=>{function t(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function e(l,p){for(var c="",i=0,v=-1,f=0,B,_=0;_<=l.length;++_){if(_<l.length)B=l.charCodeAt(_);else{if(B===47)break;B=47}if(B===47){if(!(v===_-1||f===1))if(v!==_-1&&f===2){if(c.length<2||i!==2||c.charCodeAt(c.length-1)!==46||c.charCodeAt(c.length-2)!==46){if(c.length>2){var I=c.lastIndexOf("/");if(I!==c.length-1){I===-1?(c="",i=0):(c=c.slice(0,I),i=c.length-1-c.lastIndexOf("/")),v=_,f=0;continue}}else if(c.length===2||c.length===1){c="",i=0,v=_,f=0;continue}}p&&(c.length>0?c+="/..":c="..",i=2)}else c.length>0?c+="/"+l.slice(v+1,_):c=l.slice(v+1,_),i=_-v-1;v=_,f=0}else B===46&&f!==-1?++f:f=-1}return c}function a(l,p){var c=p.dir||p.root,i=p.base||(p.name||"")+(p.ext||"");return c?c===p.root?c+i:c+l+i:i}var y={resolve:function(){for(var l="",p=!1,c,i=arguments.length-1;i>=-1&&!p;i--){var v;i>=0?v=arguments[i]:(c===void 0&&(c=process.cwd()),v=c),t(v),v.length!==0&&(l=v+"/"+l,p=v.charCodeAt(0)===47)}return l=e(l,!p),p?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(l){if(t(l),l.length===0)return".";var p=l.charCodeAt(0)===47,c=l.charCodeAt(l.length-1)===47;return l=e(l,!p),l.length===0&&!p&&(l="."),l.length>0&&c&&(l+="/"),p?"/"+l:l},isAbsolute:function(l){return t(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,p=0;p<arguments.length;++p){var c=arguments[p];t(c),c.length>0&&(l===void 0?l=c:l+="/"+c)}return l===void 0?".":y.normalize(l)},relative:function(l,p){if(t(l),t(p),l===p||(l=y.resolve(l),p=y.resolve(p),l===p))return"";for(var c=1;c<l.length&&l.charCodeAt(c)===47;++c);for(var i=l.length,v=i-c,f=1;f<p.length&&p.charCodeAt(f)===47;++f);for(var B=p.length,_=B-f,I=v<_?v:_,h=-1,C=0;C<=I;++C){if(C===I){if(_>I){if(p.charCodeAt(f+C)===47)return p.slice(f+C+1);if(C===0)return p.slice(f+C)}else v>I&&(l.charCodeAt(c+C)===47?h=C:C===0&&(h=0));break}var A=l.charCodeAt(c+C),T=p.charCodeAt(f+C);if(A!==T)break;A===47&&(h=C)}var s="";for(C=c+h+1;C<=i;++C)(C===i||l.charCodeAt(C)===47)&&(s.length===0?s+="..":s+="/..");return s.length>0?s+p.slice(f+h):(f+=h,p.charCodeAt(f)===47&&++f,p.slice(f))},_makeLong:function(l){return l},dirname:function(l){if(t(l),l.length===0)return".";for(var p=l.charCodeAt(0),c=p===47,i=-1,v=!0,f=l.length-1;f>=1;--f)if(p=l.charCodeAt(f),p===47){if(!v){i=f;break}}else v=!1;return i===-1?c?"/":".":c&&i===1?"//":l.slice(0,i)},basename:function(l,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');t(l);var c=0,i=-1,v=!0,f;if(p!==void 0&&p.length>0&&p.length<=l.length){if(p.length===l.length&&p===l)return"";var B=p.length-1,_=-1;for(f=l.length-1;f>=0;--f){var I=l.charCodeAt(f);if(I===47){if(!v){c=f+1;break}}else _===-1&&(v=!1,_=f+1),B>=0&&(I===p.charCodeAt(B)?--B===-1&&(i=f):(B=-1,i=_))}return c===i?i=_:i===-1&&(i=l.length),l.slice(c,i)}else{for(f=l.length-1;f>=0;--f)if(l.charCodeAt(f)===47){if(!v){c=f+1;break}}else i===-1&&(v=!1,i=f+1);return i===-1?"":l.slice(c,i)}},extname:function(l){t(l);for(var p=-1,c=0,i=-1,v=!0,f=0,B=l.length-1;B>=0;--B){var _=l.charCodeAt(B);if(_===47){if(!v){c=B+1;break}continue}i===-1&&(v=!1,i=B+1),_===46?p===-1?p=B:f!==1&&(f=1):p!==-1&&(f=-1)}return p===-1||i===-1||f===0||f===1&&p===i-1&&p===c+1?"":l.slice(p,i)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return a("/",l)},parse:function(l){t(l);var p={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return p;var c=l.charCodeAt(0),i=c===47,v;i?(p.root="/",v=1):v=0;for(var f=-1,B=0,_=-1,I=!0,h=l.length-1,C=0;h>=v;--h){if(c=l.charCodeAt(h),c===47){if(!I){B=h+1;break}continue}_===-1&&(I=!1,_=h+1),c===46?f===-1?f=h:C!==1&&(C=1):f!==-1&&(C=-1)}return f===-1||_===-1||C===0||C===1&&f===_-1&&f===B+1?_!==-1&&(B===0&&i?p.base=p.name=l.slice(1,_):p.base=p.name=l.slice(B,_)):(B===0&&i?(p.name=l.slice(1,f),p.base=l.slice(1,_)):(p.name=l.slice(B,f),p.base=l.slice(B,_)),p.ext=l.slice(f,_)),B>0?p.dir=l.slice(0,B-1):i&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};y.posix=y,S.exports=y}),ni=Ga(qa()),Re=ni,Ha=ni,ri=function(r){return r},si=function(){throw new Error("Not implemented")};Re.parse??=si;Ha.parse??=si;var Mt={resolve:Re.resolve.bind(Re),normalize:Re.normalize.bind(Re),isAbsolute:Re.isAbsolute.bind(Re),join:Re.join.bind(Re),relative:Re.relative.bind(Re),toNamespacedPath:ri,dirname:Re.dirname.bind(Re),basename:Re.basename.bind(Re),extname:Re.extname.bind(Re),format:Re.format.bind(Re),parse:Re.parse.bind(Re),sep:"/",delimiter:":",win32:void 0,posix:void 0,_makeLong:ri},ii={sep:"\\",delimiter:";",win32:void 0,...Mt,posix:Mt};Mt.win32=ii.win32=ii;Mt.posix=Mt;var{resolve:ja,normalize:Ds,isAbsolute:Us,join:Ls,relative:Vs,toNamespacedPath:Ks,dirname:Ps,basename:Ms,extname:Os,format:Fs,parse:Gs,sep:qs,delimiter:Hs}=Mt;function rr(r,S){if(Array.isArray(S)&&!Array.isArray(r))return S;if(Array.isArray(S)&&Array.isArray(r))return S.map((e,a)=>{let y=r[a];if(Pt(e)&&Pt(y))return rr(y,e);return e});if(!Pt(S)||!Pt(r))return S;let t={...r};for(let e in S)if(Object.prototype.hasOwnProperty.call(S,e)){let a=S[e],y=t[e];if(a===null||a===void 0)t[e]=a;else if(Pt(a)&&Pt(y))t[e]=rr(y,a);else t[e]=a}return t}function Pt(r){return Boolean(r&&typeof r==="object"&&!Array.isArray(r))}async function oi({name:r,cwd:S,defaultConfig:t,endpoint:e,headers:a={Accept:"application/json","Content-Type":"application/json"}}){if(typeof window==="undefined"){let y=ja(S||"../../../",`${r}.config`);try{let l=await import(y),p=l.default||l;return rr(t,p)}catch(l){return t}}if(!e)return console.warn("An API endpoint is required to load the client config."),t;try{let y=await fetch(e,{method:"GET",headers:a});if(!y.ok)throw new Error(`HTTP error! status: ${y.status}`);let l=await y.json();return rr(t,l)}catch(y){return console.error("Failed to load client config:",y),t}}var __dirname="/home/runner/work/rpx/rpx/src",za={from:"localhost:5173",to:"stacks.localhost",cleanUrls:!1,https:{basePath:"",caCertPath:Tr(Sr(),".stacks","ssl","stacks.localhost.ca.crt"),certPath:Tr(Sr(),".stacks","ssl","stacks.localhost.crt"),keyPath:Tr(Sr(),".stacks","ssl","stacks.localhost.crt.key")},cleanup:{certs:!1,hosts:!1},vitePluginUsage:!1,verbose:!0},jt=await oi({name:"rpx",cwd:Qa(__dirname,".."),defaultConfig:za});import*as ci from"node:fs/promises";function Y(r,S,t){if(t)console.debug(`[rpx:${r}] ${S}`)}function Ws(r){if(Qt(r))return r.proxies.map((S)=>{let t=S.to||"stacks.localhost";return t.startsWith("http")?new URL(t).hostname:t});if(ar(r)){let S=r.to||"stacks.localhost";return[S.startsWith("http")?new URL(S).hostname:S]}return["stacks.localhost"]}function ui(r){return typeof r==="object"&&r!==null&&"certificate"in r&&"privateKey"in r&&typeof r.certificate==="string"&&typeof r.privateKey==="string"}function ir(r){if(!r)return"stacks.localhost";if(Qt(r)&&r.proxies.length>0)return r.proxies[0].to||"stacks.localhost";if(ar(r))return r.to||"stacks.localhost";return"stacks.localhost"}function li(r){return!!(r&&("proxies"in r)&&Array.isArray(r.proxies))}function Qt(r){return"proxies"in r&&Array.isArray(r.proxies)}function ar(r){return"to"in r&&typeof r.to==="string"}function Zs(r){return!!(r&&("to"in r)&&!("proxies"in r))}async function fi(r,S){try{await ci.unlink(r),Y("certificates",`Successfully deleted: ${r}`,S)}catch(t){if(t.code!=="ENOENT")Y("certificates",`Warning: Could not delete ${r}: ${t}`,S)}}import{exec as xn}from"node:child_process";import _t from"node:fs";import ki from"node:os";import Dr from"node:path";import Yt from"node:process";import{promisify as Jn}from"node:util";var et={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},br={silent:{level:-1},fatal:{level:et.fatal},error:{level:et.error},warn:{level:et.warn},log:{level:et.log},info:{level:et.info},success:{level:et.success},fail:{level:et.fail},ready:{level:et.info},start:{level:et.info},box:{level:et.info},debug:{level:et.debug},trace:{level:et.trace},verbose:{level:et.verbose}};function Ir(r){if(r===null||typeof r!=="object")return!1;let S=Object.getPrototypeOf(r);if(S!==null&&S!==Object.prototype&&Object.getPrototypeOf(S)!==null)return!1;if(Symbol.iterator in r)return!1;if(Symbol.toStringTag in r)return Object.prototype.toString.call(r)==="[object Module]";return!0}function Nr(r,S,t=".",e){if(!Ir(S))return Nr(r,{},t,e);let a=Object.assign({},S);for(let y in r){if(y==="__proto__"||y==="constructor")continue;let l=r[y];if(l===null||l===void 0)continue;if(e&&e(a,y,l,t))continue;if(Array.isArray(l)&&Array.isArray(a[y]))a[y]=[...l,...a[y]];else if(Ir(l)&&Ir(a[y]))a[y]=Nr(l,a[y],(t?`${t}.`:"")+y.toString(),e);else a[y]=l}return a}function Ya(r){return(...S)=>S.reduce((t,e)=>Nr(t,e,"",r),{})}var Xa=Ya();function Wa(r){return Object.prototype.toString.call(r)==="[object Object]"}function Za(r){if(!Wa(r))return!1;if(!r.message&&!r.args)return!1;if(r.stack)return!1;return!0}var Ar=!1,hi=[];class Ze{options;_lastLog;_mockFn;constructor(r={}){let S=r.types||br;this.options=Xa({...r,defaults:{...r.defaults},level:Br(r.level,S),reporters:[...r.reporters||[]]},{types:br,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let t in S){let e={type:t,...this.options.defaults,...S[t]};this[t]=this._wrapLogFn(e),this[t].raw=this._wrapLogFn(e,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(r){this.options.level=Br(r,this.options.types,this.options.level)}prompt(r,S){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(r,S)}create(r){let S=new Ze({...this.options,...r});if(this._mockFn)S.mockTypes(this._mockFn);return S}withDefaults(r){return this.create({...this.options,defaults:{...this.options.defaults,...r}})}withTag(r){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+r:r})}addReporter(r){return this.options.reporters.push(r),this}removeReporter(r){if(r){let S=this.options.reporters.indexOf(r);if(S!==-1)return this.options.reporters.splice(S,1)}else this.options.reporters.splice(0);return this}setReporters(r){return this.options.reporters=Array.isArray(r)?r:[r],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let r in this.options.types){if(!console["__"+r])console["__"+r]=console[r];console[r]=this[r].raw}}restoreConsole(){for(let r in this.options.types)if(console["__"+r])console[r]=console["__"+r],delete console["__"+r]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(r,S){if(!r)return;if(!r.__write)r.__write=r.write;r.write=(t)=>{this[S].raw(String(t).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(r){if(!r)return;if(r.__write)r.write=r.__write,delete r.__write}pauseLogs(){Ar=!0}resumeLogs(){Ar=!1;let r=hi.splice(0);for(let S of r)S[0]._logFn(S[1],S[2])}mockTypes(r){let S=r||this.options.mockFn;if(this._mockFn=S,typeof S!=="function")return;for(let t in this.options.types)this[t]=S(t,this.options.types[t])||this[t],this[t].raw=this[t]}_wrapLogFn(r,S){return(...t)=>{if(Ar){hi.push([this,r,t,S]);return}return this._logFn(r,t,S)}}_logFn(r,S,t){if((r.level||0)>this.level)return!1;let e={date:new Date,args:[],...r,level:Br(r.level,this.options.types)};if(!t&&S.length===1&&Za(S[0]))Object.assign(e,S[0]);else e.args=[...S];if(e.message)e.args.unshift(e.message),delete e.message;if(e.additional){if(!Array.isArray(e.additional))e.additional=e.additional.split(`
`);e.args.push(`
`+e.additional.join(`
`)),delete e.additional}e.type=typeof e.type==="string"?e.type.toLowerCase():"log",e.tag=typeof e.tag==="string"?e.tag:"";let a=(l=!1)=>{let p=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&p>0){let c=[...this._lastLog.object.args];if(p>1)c.push(`(repeated ${p} times)`);this._log({...this._lastLog.object,args:c}),this._lastLog.count=1}if(l)this._lastLog.object=e,this._log(e)};clearTimeout(this._lastLog.timeout);let y=this._lastLog.time&&e.date?e.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=e.date,y<this.options.throttle)try{let l=JSON.stringify([e.type,e.tag,e.args]),p=this._lastLog.serialized===l;if(this._lastLog.serialized=l,p){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(a,this.options.throttle);return}}}catch{}a(!0)}_log(r){for(let S of this.options.reporters)S.log(r,{options:this.options})}}function Br(r,S={},t=3){if(r===void 0)return t;if(typeof r==="number")return r;if(S[r]&&S[r].level!==void 0)return S[r].level;return t}Ze.prototype.add=Ze.prototype.addReporter;Ze.prototype.remove=Ze.prototype.removeReporter;Ze.prototype.clear=Ze.prototype.removeReporter;Ze.prototype.withScope=Ze.prototype.withTag;Ze.prototype.mock=Ze.prototype.mockTypes;Ze.prototype.pause=Ze.prototype.pauseLogs;Ze.prototype.resume=Ze.prototype.resumeLogs;function pi(r={}){return new Ze(r)}import{formatWithOptions as di}from"node:util";import{sep as $a}from"node:path";function kr(r){let S=process.cwd()+$a;return r.split(`
`).splice(1).map((e)=>e.trim().replace("file://","").replace(S,""))}function xa(r,S){return(S.__write||S.write).call(S,r)}var wr=(r)=>r?`[${r}]`:"";class nr{formatStack(r,S){let t=" ".repeat((S?.errorLevel||0)+1);return t+kr(r).join(`
${t}`)}formatError(r,S){let t=r.message??di(S,r),e=r.stack?this.formatStack(r.stack,S):"",a=S?.errorLevel||0,y=a>0?`${" ".repeat(a)}[cause]: `:"",l=r.cause?`
`+this.formatError(r.cause,{...S,errorLevel:a+1}):"";return y+t+`
`+e+l}formatArgs(r,S){let t=r.map((e)=>{if(e&&typeof e.stack==="string")return this.formatError(e,S);return e});return di(S,...t)}formatDate(r,S){return S.date?r.toLocaleTimeString():""}filterAndJoin(r){return r.filter(Boolean).join(" ")}formatLogObj(r,S){let t=this.formatArgs(r.args,S);if(r.type==="box")return`
`+[wr(r.tag),r.title&&r.title,...t.split(`
`)].filter(Boolean).map((e)=>" > "+e).join(`
`)+`
`;return this.filterAndJoin([wr(r.type),wr(r.tag),t])}log(r,S){let t=this.formatLogObj(r,{columns:S.options.stdout.columns||0,...S.options.formatOptions});return xa(t+`
`,r.level<2?S.options.stderr||process.stderr:S.options.stdout||process.stdout)}}import Si from"node:process";import*as sr from"node:tty";var{env:At={},argv:vi=[],platform:Ja=""}=typeof process==="undefined"?{}:process,en="NO_COLOR"in At||vi.includes("--no-color"),tn="FORCE_COLOR"in At||vi.includes("--color"),rn=Ja==="win32",mi=At.TERM==="dumb",an=sr&&sr.isatty&&sr.isatty(1)&&At.TERM&&!mi,nn="CI"in At&&(("GITHUB_ACTIONS"in At)||("GITLAB_CI"in At)||("CIRCLECI"in At)),sn=!en&&(tn||rn&&!mi||an||nn);function Ci(r,S,t,e,a=S.slice(0,Math.max(0,r))+e,y=S.slice(Math.max(0,r+t.length)),l=y.indexOf(t)){return a+(l<0?y:Ci(l,y,t,e))}function on(r,S,t,e,a){return r<0?t+S+e:t+Ci(r,S,e,a)+e}function cn(r,S,t=r,e=r.length+1){return(a)=>a||!(a===""||a===void 0)?on((""+a).indexOf(S,e),a,r,S,t):""}function pe(r,S,t){return cn(`\x1B[${r}m`,`\x1B[${S}m`,t)}var yi={reset:pe(0,0),bold:pe(1,22,"\x1B[22m\x1B[1m"),dim:pe(2,22,"\x1B[22m\x1B[2m"),italic:pe(3,23),underline:pe(4,24),inverse:pe(7,27),hidden:pe(8,28),strikethrough:pe(9,29),black:pe(30,39),red:pe(31,39),green:pe(32,39),yellow:pe(33,39),blue:pe(34,39),magenta:pe(35,39),cyan:pe(36,39),white:pe(37,39),gray:pe(90,39),bgBlack:pe(40,49),bgRed:pe(41,49),bgGreen:pe(42,49),bgYellow:pe(43,49),bgBlue:pe(44,49),bgMagenta:pe(45,49),bgCyan:pe(46,49),bgWhite:pe(47,49),blackBright:pe(90,39),redBright:pe(91,39),greenBright:pe(92,39),yellowBright:pe(93,39),blueBright:pe(94,39),magentaBright:pe(95,39),cyanBright:pe(96,39),whiteBright:pe(97,39),bgBlackBright:pe(100,49),bgRedBright:pe(101,49),bgGreenBright:pe(102,49),bgYellowBright:pe(103,49),bgBlueBright:pe(104,49),bgMagentaBright:pe(105,49),bgCyanBright:pe(106,49),bgWhiteBright:pe(107,49)};function un(r=sn){return r?yi:Object.fromEntries(Object.keys(yi).map((S)=>[S,String]))}var it=un();function ln(r,S="reset"){return it[r]||it[S]}var fn=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function kt(r){return r.replace(new RegExp(fn,"g"),"")}var gi={solid:{tl:"┌",tr:"┐",bl:"└",br:"┘",h:"─",v:"│"},double:{tl:"╔",tr:"╗",bl:"╚",br:"╝",h:"═",v:"║"},doubleSingle:{tl:"╓",tr:"╖",bl:"╙",br:"╜",h:"─",v:"║"},doubleSingleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"║"},singleThick:{tl:"┏",tr:"┓",bl:"┗",br:"┛",h:"━",v:"┃"},singleDouble:{tl:"╒",tr:"╕",bl:"╘",br:"╛",h:"═",v:"│"},singleDoubleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"═",v:"│"},rounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"│"}},hn={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function Ei(r,S={}){let t={...S,style:{...hn,...S.style}},e=r.split(`
`),a=[],y=ln(t.style.borderColor),l={...typeof t.style.borderStyle==="string"?gi[t.style.borderStyle]||gi.solid:t.style.borderStyle};if(y)for(let _ in l)l[_]=y(l[_]);let p=t.style.padding%2===0?t.style.padding:t.style.padding+1,c=e.length+p,i=Math.max(...e.map((_)=>kt(_).length))+p,v=i+p,f=t.style.marginLeft>0?" ".repeat(t.style.marginLeft):"";if(t.style.marginTop>0)a.push("".repeat(t.style.marginTop));if(t.title){let _=y?y(t.title):t.title,I=l.h.repeat(Math.floor((i-kt(t.title).length)/2)),h=l.h.repeat(i-kt(t.title).length-kt(I).length+p);a.push(`${f}${l.tl}${I}${_}${h}${l.tr}`)}else a.push(`${f}${l.tl}${l.h.repeat(v)}${l.tr}`);let B=t.style.valign==="center"?Math.floor((c-e.length)/2):t.style.valign==="top"?c-e.length-p:c-e.length;for(let _=0;_<c;_++)if(_<B||_>=B+e.length)a.push(`${f}${l.v}${" ".repeat(v)}${l.v}`);else{let I=e[_-B],h=" ".repeat(p),C=" ".repeat(i-kt(I).length);a.push(`${f}${l.v}${h}${I}${C}${l.v}`)}if(a.push(`${f}${l.bl}${l.h.repeat(v)}${l.br}`),t.style.marginBottom>0)a.push("".repeat(t.style.marginBottom));return a.join(`
`)}var cr=Object.create(null),zt=(r)=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(r?cr:globalThis),Bt=new Proxy(cr,{get(r,S){return zt()[S]??cr[S]},has(r,S){let t=zt();return S in t||S in cr},set(r,S,t){let e=zt(!0);return e[S]=t,!0},deleteProperty(r,S){if(!S)return!1;let t=zt(!0);return delete t[S],!0},ownKeys(){let r=zt(!0);return Object.keys(r)}}),dn=typeof process<"u"&&process.env&&"development"||"",yn=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function gn(){if(globalThis.process?.env)for(let r of yn){let S=r[1]||r[0];if(globalThis.process?.env[S])return{name:r[0].toLowerCase(),...r[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}var bi=gn();bi.name;function Rt(r){return r?r!=="false":!1}var vn=globalThis.process?.platform||"",Rr=Rt(Bt.CI)||bi.ci!==!1,Ni=Rt(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),mn=Rt(Bt.DEBUG),_r=dn==="test"||Rt(Bt.TEST);Rt(Bt.MINIMAL);var Cn=/^win/i.test(vn);!Rt(Bt.NO_COLOR)&&(Rt(Bt.FORCE_COLOR)||(Ni||Cn)&&Bt.TERM);var En=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(En?.split(".")[0]);var Sn=globalThis.process||Object.create(null),Ti={versions:{}};new Proxy(Sn,{get(r,S){if(S==="env")return Bt;if(S in r)return r[S];if(S in Ti)return Ti[S]}});var Tn=globalThis.process?.release?.name==="node",In=!!globalThis.Bun||!!globalThis.process?.versions?.bun,An=!!globalThis.Deno,Bn=!!globalThis.fastly,bn=!!globalThis.Netlify,Nn=!!globalThis.EdgeRuntime,wn=globalThis.navigator?.userAgent==="Cloudflare-Workers",kn=[[bn,"netlify"],[Nn,"edge-light"],[wn,"workerd"],[Bn,"fastly"],[An,"deno"],[In,"bun"],[Tn,"node"]];function Rn(){let r=kn.find((S)=>S[0]);if(r)return{name:r[1]}}var _n=Rn();_n?.name;function Dn({onlyFirst:r=!1}={}){let t=["[\\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(t,r?void 0:"g")}var Un=Dn();function Ln(r){if(typeof r!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Un,"")}function Vn(r){return r===161||r===164||r===167||r===168||r===170||r===173||r===174||r>=176&&r<=180||r>=182&&r<=186||r>=188&&r<=191||r===198||r===208||r===215||r===216||r>=222&&r<=225||r===230||r>=232&&r<=234||r===236||r===237||r===240||r===242||r===243||r>=247&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||r===294||r===295||r===299||r>=305&&r<=307||r===312||r>=319&&r<=322||r===324||r>=328&&r<=331||r===333||r===338||r===339||r===358||r===359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||r>=713&&r<=715||r===717||r===720||r>=728&&r<=731||r===733||r===735||r>=768&&r<=879||r>=913&&r<=929||r>=931&&r<=937||r>=945&&r<=961||r>=963&&r<=969||r===1025||r>=1040&&r<=1103||r===1105||r===8208||r>=8211&&r<=8214||r===8216||r===8217||r===8220||r===8221||r>=8224&&r<=8226||r>=8228&&r<=8231||r===8240||r===8242||r===8243||r===8245||r===8251||r===8254||r===8308||r===8319||r>=8321&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||r===8481||r===8482||r===8486||r===8491||r===8531||r===8532||r>=8539&&r<=8542||r>=8544&&r<=8555||r>=8560&&r<=8569||r===8585||r>=8592&&r<=8601||r===8632||r===8633||r===8658||r===8660||r===8679||r===8704||r===8706||r===8707||r===8711||r===8712||r===8715||r===8719||r===8721||r===8725||r===8730||r>=8733&&r<=8736||r===8739||r===8741||r>=8743&&r<=8748||r===8750||r>=8756&&r<=8759||r===8764||r===8765||r===8776||r===8780||r===8786||r===8800||r===8801||r>=8804&&r<=8807||r===8810||r===8811||r===8814||r===8815||r===8834||r===8835||r===8838||r===8839||r===8853||r===8857||r===8869||r===8895||r===8978||r>=9312&&r<=9449||r>=9451&&r<=9547||r>=9552&&r<=9587||r>=9600&&r<=9615||r>=9618&&r<=9621||r===9632||r===9633||r>=9635&&r<=9641||r===9650||r===9651||r===9654||r===9655||r===9660||r===9661||r===9664||r===9665||r>=9670&&r<=9672||r===9675||r>=9678&&r<=9681||r>=9698&&r<=9701||r===9711||r===9733||r===9734||r===9737||r===9742||r===9743||r===9756||r===9758||r===9792||r===9794||r===9824||r===9825||r>=9827&&r<=9829||r>=9831&&r<=9834||r===9836||r===9837||r===9839||r===9886||r===9887||r===9919||r>=9926&&r<=9933||r>=9935&&r<=9939||r>=9941&&r<=9953||r===9955||r===9960||r===9961||r>=9963&&r<=9969||r===9972||r>=9974&&r<=9977||r===9979||r===9980||r===9982||r===9983||r===10045||r>=10102&&r<=10111||r>=11094&&r<=11097||r>=12872&&r<=12879||r>=57344&&r<=63743||r>=65024&&r<=65039||r===65533||r>=127232&&r<=127242||r>=127248&&r<=127277||r>=127280&&r<=127337||r>=127344&&r<=127373||r===127375||r===127376||r>=127387&&r<=127404||r>=917760&&r<=917999||r>=983040&&r<=1048573||r>=1048576&&r<=1114109}function Kn(r){return r===12288||r>=65281&&r<=65376||r>=65504&&r<=65510}function Pn(r){return r>=4352&&r<=4447||r===8986||r===8987||r===9001||r===9002||r>=9193&&r<=9196||r===9200||r===9203||r===9725||r===9726||r===9748||r===9749||r>=9776&&r<=9783||r>=9800&&r<=9811||r===9855||r>=9866&&r<=9871||r===9875||r===9889||r===9898||r===9899||r===9917||r===9918||r===9924||r===9925||r===9934||r===9940||r===9962||r===9970||r===9971||r===9973||r===9978||r===9981||r===9989||r===9994||r===9995||r===10024||r===10060||r===10062||r>=10067&&r<=10069||r===10071||r>=10133&&r<=10135||r===10160||r===10175||r===11035||r===11036||r===11088||r===11093||r>=11904&&r<=11929||r>=11931&&r<=12019||r>=12032&&r<=12245||r>=12272&&r<=12287||r>=12289&&r<=12350||r>=12353&&r<=12438||r>=12441&&r<=12543||r>=12549&&r<=12591||r>=12593&&r<=12686||r>=12688&&r<=12773||r>=12783&&r<=12830||r>=12832&&r<=12871||r>=12880&&r<=42124||r>=42128&&r<=42182||r>=43360&&r<=43388||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65106||r>=65108&&r<=65126||r>=65128&&r<=65131||r>=94176&&r<=94180||r===94192||r===94193||r>=94208&&r<=100343||r>=100352&&r<=101589||r>=101631&&r<=101640||r>=110576&&r<=110579||r>=110581&&r<=110587||r===110589||r===110590||r>=110592&&r<=110882||r===110898||r>=110928&&r<=110930||r===110933||r>=110948&&r<=110951||r>=110960&&r<=111355||r>=119552&&r<=119638||r>=119648&&r<=119670||r===126980||r===127183||r===127374||r>=127377&&r<=127386||r>=127488&&r<=127490||r>=127504&&r<=127547||r>=127552&&r<=127560||r===127568||r===127569||r>=127584&&r<=127589||r>=127744&&r<=127776||r>=127789&&r<=127797||r>=127799&&r<=127868||r>=127870&&r<=127891||r>=127904&&r<=127946||r>=127951&&r<=127955||r>=127968&&r<=127984||r===127988||r>=127992&&r<=128062||r===128064||r>=128066&&r<=128252||r>=128255&&r<=128317||r>=128331&&r<=128334||r>=128336&&r<=128359||r===128378||r===128405||r===128406||r===128420||r>=128507&&r<=128591||r>=128640&&r<=128709||r===128716||r>=128720&&r<=128722||r>=128725&&r<=128727||r>=128732&&r<=128735||r===128747||r===128748||r>=128756&&r<=128764||r>=128992&&r<=129003||r===129008||r>=129292&&r<=129338||r>=129340&&r<=129349||r>=129351&&r<=129535||r>=129648&&r<=129660||r>=129664&&r<=129673||r>=129679&&r<=129734||r>=129742&&r<=129756||r>=129759&&r<=129769||r>=129776&&r<=129784||r>=131072&&r<=196605||r>=196608&&r<=262141}function Mn(r){if(!Number.isSafeInteger(r))throw new TypeError(`Expected a code point, got \`${typeof r}\`.`)}function On(r,{ambiguousAsWide:S=!1}={}){if(Mn(r),Kn(r)||Pn(r)||S&&Vn(r))return 2;return 1}var Fn=()=>{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},Gn=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:(r)=>r.split("")},qn=/^\p{Default_Ignorable_Code_Point}$/u;function Hn(r,S={}){if(typeof r!=="string"||r.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:e=!1}=S;if(!e)r=Ln(r);if(r.length===0)return 0;let a=0,y={ambiguousAsWide:!t};for(let{segment:l}of Gn.segment(r)){let p=l.codePointAt(0);if(p<=31||p>=127&&p<=159)continue;if(p>=8203&&p<=8207||p===65279)continue;if(p>=768&&p<=879||p>=6832&&p<=6911||p>=7616&&p<=7679||p>=8400&&p<=8447||p>=65056&&p<=65071)continue;if(p>=55296&&p<=57343)continue;if(p>=65024&&p<=65039)continue;if(qn.test(l))continue;if(Fn().test(l)){a+=2;continue}a+=On(p,y)}return a}function jn(){let{env:r}=Si,{TERM:S,TERM_PROGRAM:t}=r;if(Si.platform!=="win32")return S!=="linux";return Boolean(r.WT_SESSION)||Boolean(r.TERMINUS_SUBLIME)||r.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||S==="xterm-256color"||S==="alacritty"||S==="rxvt-unicode"||S==="rxvt-unicode-256color"||r.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Qn={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},zn={0:"red",1:"yellow"},Yn=jn(),yt=(r,S)=>Yn?r:S,Ii={error:yt("✖","×"),fatal:yt("✖","×"),ready:yt("✔","√"),warn:yt("⚠","‼"),info:yt("ℹ","i"),success:yt("✔","√"),debug:yt("⚙","D"),trace:yt("→","→"),fail:yt("✖","×"),start:yt("◐","o"),log:""};function Ai(r){if(typeof Intl!=="object"||!Intl.Segmenter)return kt(r).length;return Hn(r)}class wi extends nr{formatStack(r,S){let t=" ".repeat((S?.errorLevel||0)+1);return`
${t}`+kr(r).map((e)=>" "+e.replace(/^at +/,(a)=>it.gray(a)).replace(/\((.+)\)/,(a,y)=>`(${it.cyan(y)})`)).join(`
${t}`)}formatType(r,S,t){let e=Qn[r.type]||zn[r.level]||"gray";if(S)return Wn(e)(it.black(` ${r.type.toUpperCase()} `));let a=typeof Ii[r.type]==="string"?Ii[r.type]:r.icon||r.type;return a?Xn(e)(a):""}formatLogObj(r,S){let[t,...e]=this.formatArgs(r.args,S).split(`
`);if(r.type==="box")return Ei(or(t+(e.length>0?`
`+e.join(`
`):"")),{title:r.title?or(r.title):void 0,style:r.style});let a=this.formatDate(r.date,S),y=a&&it.gray(a),l=r.badge??r.level<2,p=this.formatType(r,l,S),c=r.tag?it.gray(r.tag):"",i,v=this.filterAndJoin([p,or(t)]),f=this.filterAndJoin(S.columns?[c,y]:[c]),B=(S.columns||0)-Ai(v)-Ai(f)-2;if(i=B>0&&(S.columns||0)>=80?v+" ".repeat(B)+f:(f?`${it.gray(`[${f}]`)} `:"")+v,i+=or(e.length>0?`
`+e.join(`
`):""),r.type==="trace"){let _=new Error("Trace: "+r.message);i+=this.formatStack(_.stack||"")}return l?`
`+i+`
`:i}}function or(r){return r.replace(/`([^`]+)`/gm,(S,t)=>it.cyan(t)).replace(/\s+_([^_]+)_\s+/gm,(S,t)=>` ${it.underline(t)} `)}function Xn(r="white"){return it[r]||it.white}function Wn(r="bgWhite"){return it[`bg${r[0].toUpperCase()}${r.slice(1)}`]||it.bgWhite}function Zn(r={}){let S=$n();if(process.env.CONSOLA_LEVEL)S=Number.parseInt(process.env.CONSOLA_LEVEL)??S;return pi({level:S,defaults:{level:S},stdout:process.stdout,stderr:process.stderr,prompt:(...e)=>import("./chunk-zxymjc5f.js").then((a)=>a.prompt(...e)),reporters:r.reporters||[r.fancy??!(Rr||_r)?new wi:new nr],...r})}function $n(){if(mn)return et.debug;if(_r)return et.warn;return et.info}var ce=Zn();var es=Jn(xn),bt=Yt.platform==="win32"?Dr.join(Yt.env.windir||"C:\\Windows","System32","drivers","etc","hosts"):"/etc/hosts";async function Ri(r){if(Yt.platform==="win32")throw new Error("Administrator privileges required on Windows");try{await es(`sudo ${r}`)}catch(S){throw new Error(`Failed to execute sudo command: ${S.message}`)}}async function _i(r,S){Y("hosts",`Adding hosts: ${r.join(", ")}`,S),Y("hosts",`Using hosts file at: ${bt}`,S);try{let t=await _t.promises.readFile(bt,"utf-8"),e=r.filter((l)=>{let p=`127.0.0.1 ${l}`,c=`::1 ${l}`;return!t.includes(p)&&!t.includes(c)});if(e.length===0){Y("hosts","All hosts already exist in hosts file",S),ce.info("All hosts are already in the hosts file");return}let a=e.map((l)=>`
# Added by rpx
127.0.0.1 ${l}
::1 ${l}`).join(`
`),y=Dr.join(ki.tmpdir(),"hosts.tmp");await _t.promises.writeFile(y,t+a,"utf8");try{await Ri(`cp "${y}" "${bt}"`),ce.success(`Added new hosts: ${e.join(", ")}`)}catch(l){if(ce.error("Failed to modify hosts file automatically"),ce.warn("Please add these entries to your hosts file manually:"),a.split(`
`).forEach((p)=>ce.warn(p)),Yt.platform==="win32")ce.warn(`
On Windows:`),ce.warn("1. Run notepad as administrator"),ce.warn("2. Open C:\\Windows\\System32\\drivers\\etc\\hosts");else ce.warn(`
On Unix systems:`),ce.warn(`sudo nano ${bt}`);throw new Error("Failed to modify hosts file: manual intervention required")}finally{_t.unlinkSync(y)}}catch(t){let e=t;throw ce.error(`Failed to manage hosts file: ${e.message}`),e}}async function Di(r,S){Y("hosts",`Removing hosts: ${r.join(", ")}`,S);try{let e=(await _t.promises.readFile(bt,"utf-8")).split(`
`),a=e.filter((p,c)=>{if(p.trim()==="# Added by rpx")return e.splice(c+1,2),!1;return!0});while(a[a.length-1]?.trim()==="")a.pop();let y=`${a.join(`
`)}
`,l=Dr.join(ki.tmpdir(),"hosts.tmp");await _t.promises.writeFile(l,y,"utf8");try{await Ri(`cp "${l}" "${bt}"`),ce.success("Hosts removed successfully")}catch(p){if(ce.error("Failed to modify hosts file automatically"),ce.warn("Please remove these entries from your hosts file manually:"),r.forEach((c)=>{ce.warn("# Added by rpx"),ce.warn(`127.0.0.1 ${c}`),ce.warn(`::1 ${c}`)}),Yt.platform==="win32")ce.warn(`
On Windows:`),ce.warn("1. Run notepad as administrator"),ce.warn("2. Open C:\\Windows\\System32\\drivers\\etc\\hosts");else ce.warn(`
On Unix systems:`),ce.warn(`sudo nano ${bt}`);throw new Error("Failed to modify hosts file: manual intervention required")}finally{_t.unlinkSync(l)}}catch(t){let e=t;throw ce.error(`Failed to remove hosts: ${e.message}`),e}}async function Ui(r,S){Y("hosts",`Checking hosts: ${r}`,S);let t=await _t.promises.readFile(bt,"utf-8");return r.map((e)=>{let a=`127.0.0.1 ${e}`,y=`::1 ${e}`;return t.includes(a)||t.includes(y)})}import $t from"node:fs/promises";import{homedir as Ss}from"node:os";import{join as Lt}from"node:path";import Ur from"node:os";import Lr from"node:path";import{resolve as fs}from"path";import hs from"process";import{exec as ds}from"node:child_process";import Li from"node:fs";import ys from"node:path";import gs from"node:process";import{promisify as vs}from"node:util";import Et from"node:fs";import Vi from"node:os";import Ft from"node:path";var de=le((r,S)=>{S.exports={options:{usePureJavaScript:!1}}}),ts=le((r,S)=>{var t={};S.exports=t;var e={};t.encode=function(y,l,p){if(typeof l!=="string")throw new TypeError('"alphabet" must be a string.');if(p!==void 0&&typeof p!=="number")throw new TypeError('"maxline" must be a number.');var c="";if(!(y instanceof Uint8Array))c=a(y,l);else{var i=0,v=l.length,f=l.charAt(0),B=[0];for(i=0;i<y.length;++i){for(var _=0,I=y[i];_<B.length;++_)I+=B[_]<<8,B[_]=I%v,I=I/v|0;while(I>0)B.push(I%v),I=I/v|0}for(i=0;y[i]===0&&i<y.length-1;++i)c+=f;for(i=B.length-1;i>=0;--i)c+=l[B[i]]}if(p){var h=new RegExp(".{1,"+p+"}","g");c=c.match(h).join(`\r
`)}return c},t.decode=function(y,l){if(typeof y!=="string")throw new TypeError('"input" must be a string.');if(typeof l!=="string")throw new TypeError('"alphabet" must be a string.');var p=e[l];if(!p){p=e[l]=[];for(var c=0;c<l.length;++c)p[l.charCodeAt(c)]=c}y=y.replace(/\s/g,"");var i=l.length,v=l.charAt(0),f=[0];for(var c=0;c<y.length;c++){var B=p[y.charCodeAt(c)];if(B===void 0)return;for(var _=0,I=B;_<f.length;++_)I+=f[_]*i,f[_]=I&255,I>>=8;while(I>0)f.push(I&255),I>>=8}for(var h=0;y[h]===v&&h<y.length-1;++h)f.push(0);if(typeof Buffer!=="undefined")return Buffer.from(f.reverse());return new Uint8Array(f.reverse())};function a(y,l){var p=0