
    [Fi                     N    d dl mZ d dlZ ed      dedefd       ZdedefdZy)	    )	lru_cacheNd   creturnc                     t        |       }d|cxk  rdk  ry |dk(  s(d|cxk  rdk  sn d|cxk  rdk  sn d	|cxk  rd
k  ry nyt        j                  |       }|dk(  ry|dv ryt        j                  |       dv ryy)zDetermine how many columns are needed to display a character in a terminal.

    Returns -1 if the character is not printable.
    Returns 0, 1 or 2 for other characters.
              r   i   i   i(   i.   i`   ic   Cc)MeMn)FW   )ordunicodedatacategoryeast_asian_width)r   or   s      e/var/www/html/BankruptcyAI-uat/bankruptcy-ai/venv/lib/python3.12/site-packages/_pytest/_io/wcwidth.pywcwidthr      s     	AA q5 
 	
VQ & Q & Q &  !##A&H 4 < ##A&*4    sc                 n    d}t        j                  d|       D ]  }t        |      }|dk  r y||z  } |S )zDetermine how many columns are needed to display a string in a terminal.

    Returns -1 if the string contains non-printable characters.
    r   NFCr   )r   	normalizer   )r   widthr   wcs       r   wcswidthr    ,   sH    
 E""5!, QZ6	
 Lr   )	functoolsr   r   strintr   r     r   r   <module>r%      sE      3#s #s # #L  r   