"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var a,m;function v(){if(m)return a;m=1;const E=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,c=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,d=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,w=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,y=new Map([["n",`
`],["r","\r"],["t","	"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function f(n){const l=n[0]==="u",e=n[1]==="{";return l&&!e&&n.length===5||n[0]==="x"&&n.length===3?String.fromCharCode(parseInt(n.slice(1),16)):l&&e?String.fromCodePoint(parseInt(n.slice(2,-1),16)):y.get(n)||n}function b(n,l){const e=[],s=l.trim().split(/\s*,\s*/g);let t;for(const r of s){const o=Number(r);if(!Number.isNaN(o))e.push(o);else if(t=r.match(d))e.push(t[2].replace(w,(p,u,i)=>u?f(u):i));else throw new Error(`Invalid Chalk template style argument: ${r} (in style '${n}')`)}return e}function S(n){c.lastIndex=0;const l=[];let e;for(;(e=c.exec(n))!==null;){const s=e[1];if(e[2]){const t=b(s,e[2]);l.push([s].concat(t))}else l.push([s])}return l}function h(n,l){const e={};for(const t of l)for(const r of t.styles)e[r[0]]=t.inverse?null:r.slice(1);let s=n;for(const[t,r]of Object.entries(e))if(!!Array.isArray(r)){if(!(t in s))throw new Error(`Unknown Chalk style: ${t}`);s=r.length>0?s[t](...r):s[t]}return s}return a=(n,l)=>{const e=[],s=[];let t=[];if(l.replace(E,(r,o,p,u,i,k)=>{if(o)t.push(f(o));else if(u){const g=t.join("");t=[],s.push(e.length===0?g:h(n,e)(g)),e.push({inverse:p,styles:S(u)})}else if(i){if(e.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(h(n,e)(t.join(""))),t=[],e.pop()}else t.push(k)}),s.push(t.join("")),e.length>0){const r=`Chalk template literal is missing ${e.length} closing bracket${e.length===1?"":"s"} (\`}\`)`;throw new Error(r)}return s.join("")},a}exports.__require=v;
//# sourceMappingURL=templates.js.map
