from typing import Optional
from typing import List
from typing import Dict


def parse_new_tab_name_mapper(args: Optional[List[str]]) -> Dict[str, str]:
    """
    Parse --map-new-tab-name argument.

    Args:
        args (Optional[List[str]]): arguments to parse, something like: ['<old_tab_1>=<new_tab_1>','<old_tab_2>=<new_tab_2>']

    Returns:
        Dict[str, str]: Return a dict mapping new tab names to old tab names, something like:
        {<old_tab_1>: <new_tab_1>, <old_tab_2>: <new_tab_2>}
    """

    if not args:
        return {}
    res = {}
    for a in args:
        old_tab_name, new_tab_name = a.split('=')
        res[new_tab_name] = old_tab_name
    return res