"use strict";require("../../../../ansi-styles@4.3.0/node_modules/ansi-styles/index.js");const _=require("../../../../supports-color@7.2.0/node_modules/supports-color/browser.js"),w=require("./util.js"),C=require("./templates.js"),g=require("../../../../../../_virtual/index20.js"),c=g.ansiStyles.exports,{stdout:h,stderr:y}=_,{stringReplaceAll:x,stringEncaseCRLFWithFirstIndex:k}=w,{isArray:i}=Array,b=["ansi","ansi","ansi256","ansi16m"],n=Object.create(null),A=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=h?h.level:0;t.level=e.level===void 0?r:e.level};class E{constructor(e){return m(e)}}const m=t=>{const e={};return A(e,t),e.template=(...r)=>O(e.template,...r),Object.setPrototypeOf(e,u.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=E,e.template};function u(t){return m(t)}for(const[t,e]of Object.entries(c))n[t]={get(){const r=a(this,f(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};n.visible={get(){const t=a(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const j=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of j)n[t]={get(){const{level:e}=this;return function(...r){const l=f(c.color[b[e]][t](...r),c.color.close,this._styler);return a(this,l,this._isEmpty)}}};for(const t of j){const e="bg"+t[0].toUpperCase()+t.slice(1);n[e]={get(){const{level:r}=this;return function(...l){const s=f(c.bgColor[b[r]][t](...l),c.bgColor.close,this._styler);return a(this,s,this._isEmpty)}}}}const P=Object.defineProperties(()=>{},{...n,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),f=(t,e,r)=>{let l,s;return r===void 0?(l=t,s=e):(l=r.openAll+t,s=e+r.closeAll),{open:t,close:e,openAll:l,closeAll:s,parent:r}},a=(t,e,r)=>{const l=(...s)=>i(s[0])&&i(s[0].raw)?v(l,O(l,...s)):v(l,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(l,P),l._generator=t,l._styler=e,l._isEmpty=r,l},v=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;const{openAll:l,closeAll:s}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=x(e,r.close,r.open),r=r.parent;const o=e.indexOf(`
`);return o!==-1&&(e=k(e,s,l,o)),l+e+s};let d;const O=(t,...e)=>{const[r]=e;if(!i(r)||!i(r.raw))return e.join(" ");const l=e.slice(1),s=[r.raw[0]];for(let o=1;o<r.length;o++)s.push(String(l[o-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[o]));return d===void 0&&(d=C.__require()),d(t,s.join(""))};Object.defineProperties(u.prototype,n);const p=u();p.supportsColor=h;p.stderr=u({level:y?y.level:0});p.stderr.supportsColor=y;var S=p;module.exports=S;
//# sourceMappingURL=index.js.map
