
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5ca89400-12ea-56fd-b95b-0510be865a42")}catch(e){}}();
export function stripAnsi(input) {
    let output = "";
    let mode = "text";
    for (const char of input) {
        if (mode === "text") {
            if (char === "\u001b") {
                mode = "escape";
                continue;
            }
            output += char;
            continue;
        }
        if (mode === "escape") {
            if (char === "[") {
                mode = "csi";
                continue;
            }
            if (char === "]") {
                mode = "osc";
                continue;
            }
            mode = "text";
            continue;
        }
        if (mode === "csi") {
            const code = char.charCodeAt(0);
            if (code >= 64 && code <= 126) {
                mode = "text";
            }
            continue;
        }
        if (mode === "osc") {
            if (char === "\u0007") {
                mode = "text";
            }
            else if (char === "\u001b") {
                mode = "osc_escape";
            }
            continue;
        }
        if (mode === "osc_escape") {
            mode = char === "\\" ? "text" : "osc";
        }
    }
    return output;
}
//# sourceMappingURL=output-utils.js.map
//# debugId=5ca89400-12ea-56fd-b95b-0510be865a42
