function e(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`\\`){if(n+1>=e.length){t+=`\\`;break}let r=e[n+1];switch(r){case`\\`:t+=`\\`,n+=2;break;case`n`:t+=`
`,n+=2;break;case`t`:t+=`	`,n+=2;break;case`r`:t+=`\r`,n+=2;break;case`a`:t+=`\x07`,n+=2;break;case`b`:t+=`\b`,n+=2;break;case`f`:t+=`\f`,n+=2;break;case`v`:t+=`\v`,n+=2;break;case`e`:case`E`:t+=`\x1B`,n+=2;break;case`c`:return{output:t,stop:!0};case`0`:{let r=``,i=n+2;for(;i<e.length&&i<n+5&&/[0-7]/.test(e[i]);)r+=e[i],i++;if(r.length===0)t+=`\0`;else{let e=parseInt(r,8)%256;t+=String.fromCharCode(e)}n=i;break}case`x`:{let r=``,i=n+2;for(;i<e.length&&i<n+4&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;if(r.length===0)t+=`\\x`,n+=2;else{let e=parseInt(r,16);t+=String.fromCharCode(e),n=i}break}case`u`:{let r=``,i=n+2;for(;i<e.length&&i<n+6&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;if(r.length===0)t+=`\\u`,n+=2;else{let e=parseInt(r,16);t+=String.fromCodePoint(e),n=i}break}case`U`:{let r=``,i=n+2;for(;i<e.length&&i<n+10&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;if(r.length===0)t+=`\\U`,n+=2;else{let e=parseInt(r,16);try{t+=String.fromCodePoint(e)}catch{t+=`\\U${r}`}n=i}break}default:t+=`\\${r}`,n+=2}}else t+=e[n],n++;return{output:t,stop:!1}}var t={name:`echo`,async execute(t,n){let r=!1,i=n.xpgEcho??!1,a=0;for(;a<t.length;){let e=t[a];if(e===`-n`)r=!0,a++;else if(e===`-e`)i=!0,a++;else if(e===`-E`)i=!1,a++;else if(e===`-ne`||e===`-en`)r=!0,i=!0,a++;else break}let o=t.slice(a).join(` `);if(i){let t=e(o);if(o=t.output,t.stop)return{stdout:o,stderr:``,exitCode:0}}return r||(o+=`
`),{stdout:o,stderr:``,exitCode:0}}},n={name:`echo`,flags:[{flag:`-n`,type:`boolean`},{flag:`-e`,type:`boolean`},{flag:`-E`,type:`boolean`}],stdinType:`none`,needsArgs:!0};export{n,t};
//# sourceMappingURL=chunk-GCTKCWKD-D3J1Ev9z.mjs.map