const idx = [           // 10 - (default)
    'Ended OK',         // 0 — completed successfully.
    'Ended Not OK',     // 1 — ended in failure.
    'Wait User',        // 2 — waiting for user confirmation.
    'Wait Resource',    // 3 — waiting on a resource to be available.
    'Wait Host',        // 4 — waiting on an agent or remote host to be available.
    'Wait Workload',    // 5 — waiting due to a workload limit.
    'Wait Condition',   // 6 — waiting for a condition.
    'Executing'         // 7 — currently executing.
].indexOf(value);
return idx !== -1 ? idx : 10;