
    g3fi&                         d Z ddlmZ ddddddZ	 dd
ee   ded	z  deeef   fdZdededefdZdedefdZ		 ddeded	z  deded	z  dd	f
dZ
y	)zHandle chained inputs.    )TextIOz36;1z33;1z38;5;200z32;1z31;1)blueyellowpinkgreenredNitemsexcluded_colorsreturnc           
          t        t        j                               }||D cg c]	  }||vs| }}|sd}t        |      t	        |       D ci c]  \  }}|||t        |      z      c}}S c c}w c c}}w )a!  Get mapping for items to a support color.

    Args:
        items: The items to map to colors.
        excluded_colors: The colors to exclude.

    Returns:
        The mapping of items to colors.

    Raises:
        ValueError: If no colors are available after applying exclusions.
    z.No colors available after applying exclusions.)list_TEXT_COLOR_MAPPINGkeys
ValueError	enumeratelen)r	   r
   colorscmsgiitems          X/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/langchain_core/utils/input.pyget_color_mappingr      s     %**,-F"#@q'?!@@>o9B59IJgaD&S[))JJ	 A Ks   	A1A1A6textcolorc                 &    t         |   }d| d|  dS )zGet colored text.

    Args:
        text: The text to color.
        color: The color to use.

    Returns:
        The colored text.
    z[zm[1;3m[0m)r   )r   r   	color_strs      r   get_colored_textr   &   s#     $E*IYKz$y99    c                     d|  dS )zgGet bolded text.

    Args:
        text: The text to bold.

    Returns:
        The bolded text.
    z[1mr    )r   s    r   get_bolded_textr#   4   s     TF'""r    endfilec                 f    |rt        | |      n| }t        |||       |r|j                          yy)aW  Print text with highlighting and no end characters.

    If a color is provided, the text will be printed in that color.
    If a file is provided, the text will be written to that file.

    Args:
        text: The text to print.
        color: The color to use.
        end: The end character to use.
        file: The file to write to.
    )r$   r%   N)r   printflush)r   r   r$   r%   text_to_prints        r   
print_textr*   @   s2     6;$T51M	-St,

 r    )N)N N)__doc__typingr   r   r   strdictr   r   r#   r*   r"   r    r   <module>r0      s        6:K9K'+d{K	#s(^K0:3 :s :s :	## 	## 	# OS
Dj.1>Dtm	r    