"""
Formatter Utilities
===================
Helper functions for text formatting.
"""

def format_hotkey(sequence: str) -> str:
    """
    Formats a hotkey sequence string (e.g. 'ctrl+alt+f9') 
    into a pretty readable string (e.g. 'Ctrl + Alt + F9').
    """
    if not sequence:
        return "None"
    
    parts = sequence.split('+')
    formatted_parts = []
    
    for p in parts:
        p = p.strip().lower()
        if p == 'ctrl': formatted_parts.append('Ctrl')
        elif p == 'alt': formatted_parts.append('Alt')
        elif p == 'shift': formatted_parts.append('Shift')
        elif p == 'win': formatted_parts.append('Win')
        elif p == 'esc': formatted_parts.append('Esc')
        else:
            # Capitalize first letter
            if len(p) > 0:
                formatted_parts.append(p[0].upper() + p[1:])
            else:
                formatted_parts.append(p)
                
    return " + ".join(formatted_parts)
