import{Wma as Q,Xma as U}from"./cli-0.5.3-0df3r78b.mjs";var w={};Q(w,{default:()=>x,createSupportsColor:()=>K});import M from"node:process";import V from"node:os";import O from"node:tty";function z(q,B=globalThis.Deno?globalThis.Deno.args:M.argv){let D=q.startsWith("-")?"":q.length===1?"-":"--",E=B.indexOf(D+q),G=B.indexOf("--");return E!==-1&&(G===-1||E<G)}function X(){if(!("FORCE_COLOR"in j))return;if(j.FORCE_COLOR==="true")return 1;if(j.FORCE_COLOR==="false")return 0;if(j.FORCE_COLOR.length===0)return 1;let q=Math.min(Number.parseInt(j.FORCE_COLOR,10),3);if(![0,1,2,3].includes(q))return;return q}function Z(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function $(q,{streamIsTTY:B,sniffFlags:D=!0}={}){let E=X();if(E!==void 0)H=E;let G=D?H:E;if(G===0)return 0;if(D){if(z("color=16m")||z("color=full")||z("color=truecolor"))return 3;if(z("color=256"))return 2}if("TF_BUILD"in j&&"AGENT_NAME"in j)return 1;if(q&&!B&&G===void 0)return 0;let J=G||0;if(j.TERM==="dumb")return J;if(M.platform==="win32"){let A=V.release().split(".");if(Number(A[0])>=10&&Number(A[2])>=10586)return Number(A[2])>=14931?3:2;return 1}if("CI"in j){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((A)=>(A in j)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((A)=>(A in j))||j.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in j)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(j.TEAMCITY_VERSION)?1:0;if(j.COLORTERM==="truecolor")return 3;if(j.TERM==="xterm-kitty")return 3;if(j.TERM==="xterm-ghostty")return 3;if(j.TERM==="wezterm")return 3;if("TERM_PROGRAM"in j){let A=Number.parseInt((j.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(j.TERM_PROGRAM){case"iTerm.app":return A>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(j.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(j.TERM))return 1;if("COLORTERM"in j)return 1;return J}function K(q,B={}){let D=$(q,{streamIsTTY:q&&q.isTTY,...B});return Z(D)}var j,H,b,x;var L=U(()=>{({env:j}=M);if(z("no-color")||z("no-colors")||z("color=false")||z("color=never"))H=0;else if(z("color")||z("colors")||z("color=true")||z("color=always"))H=1;b={stdout:K({isTTY:O.isatty(1)}),stderr:K({isTTY:O.isatty(2)})},x=b});
export{K as $5,w as a6,L as b6};
