
    f3i              
       n    d dl Z d dlmZ d dlmZmZ d dlmZmZ de	fdZ
ddded	ed
edz  dee   fdZy)    N)Path)Anyget_args)resolvetoken_countreturnc                 f    | t         u ryt        |       D ]  }t        |      }t        |      s y y)NTF)r   r   r   _is_path)type_
inner_types     [/mnt/e/genesis-system/.venvs/voice-bridge/lib/python3.12/site-packages/cyclopts/_env_var.pyr
   r
      s9    }uo 
Z(
J
     )	delimiterr   valr   c                    t        |       } t        |       \  }}|dkD  s|r;t        |       r|j                  t        j
                        S |j                  |      S |gS )a2  Type-dependent environment variable value splitting.

    Converts a single string into a list of strings. Splits when:

    * The ``type_`` is some variant of ``Iterable[pathlib.Path]`` objects.
      If Windows, split on ``;``, otherwise split on ``:``.

    * Otherwise, if the ``type_`` is an ``Iterable``, split on whitespace.
      Leading/trailing whitespace of each output element will be stripped.

    This function is the default value for :attr:`cyclopts.App.env_var_split`.

    Parameters
    ----------
    type_: type
        Type hint that we will eventually coerce into.
    val: str
        String to split.
    delimiter: str | None
        Delimiter to split ``val`` on.
        If None, defaults to whitespace.

    Returns
    -------
    list[str]
        List of individual string tokens.
       )r   r   r
   splitospathsep)r   r   r   countconsume_alls        r   env_var_splitr      sT    B ENE$U+E;qyK(0syy$QSYYy=QQur   )r   pathlibr   typingr   r   cyclopts._convertr   r   boolr
   strlistr    r   r   <module>r       sS    	    2	t 	  !	''	' Tz	'
 
#Y'r   