a
    hbòf.  ã                   @   s¸   d dl mZmZmZmZmZ ddlZddlZddlm	Z	m
Z
 e d¡ZG dd„ dejƒZG dd	„ d	ejƒZG d
d„ dejƒZG dd„ deejƒZG dd„ deejƒZejdœdd„ZdS )é   )ÚencodeÚdecodeÚalabelÚulabelÚ	IDNAErroré    N)ÚTupleÚOptionalu   [.ã€‚ï¼Žï½¡]c                   @   sD   e Zd Zdeeeeef dœdd„Zd	eeeeef dœdd„ZdS )
ÚCodecÚstrict)ÚdataÚerrorsÚreturnc                 C   s.   |dkrt d |¡ƒ‚|sdS t|ƒt|ƒfS )Nr   úUnsupported error handling "{}")ó    r   )r   Úformatr   Úlen©Úselfr   r   © r   úS/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/pip/_vendor/idna/codec.pyr   
   s
    zCodec.encodec                 C   s.   |dkrt d |¡ƒ‚|sdS t|ƒt|ƒfS )Nr   r   ©Ú r   )r   r   r   r   r   r   r   r   r      s
    zCodec.decodeN)r   )r   )	Ú__name__Ú
__module__Ú__qualname__Ústrr   ÚbytesÚintr   r   r   r   r   r   r
      s   	r
   c                   @   s(   e Zd Zeeeeeef dœdd„ZdS )ÚIncrementalEncoder©r   r   Úfinalr   c           
      C   s°   |dkrt d |¡ƒ‚|sdS t |¡}d}|rV|d sDd}|d= n|sV|d= |rVd}g }d}|D ]*}| t|ƒ¡ |r€|d7 }|t|ƒ7 }qbd |¡| }	|t|ƒ7 }|	|fS ©	Nr   r   r   r   éÿÿÿÿÚ.r   r   )r   r   Ú_unicode_dots_reÚsplitÚappendr   r   Újoin©
r   r   r   r!   ÚlabelsÚtrailing_dotÚresultÚsizeÚlabelZ
result_strr   r   r   Ú_buffer_encode   s0    
z!IncrementalEncoder._buffer_encodeN)r   r   r   r   Úboolr   r   r/   r   r   r   r   r      s   r   c                   @   s(   e Zd Zeeeeeef dœdd„ZdS )ÚIncrementalDecoderr    c           
      C   s°   |dkrt d |¡ƒ‚|sdS t |¡}d}|rV|d sDd}|d= n|sV|d= |rVd}g }d}|D ]*}| t|ƒ¡ |r€|d7 }|t|ƒ7 }qbd |¡| }	|t|ƒ7 }|	|fS r"   )r   r   r%   r&   r'   r   r   r(   r)   r   r   r   Ú_buffer_decode>   s0    
z!IncrementalDecoder._buffer_decodeN)r   r   r   r   r0   r   r   r2   r   r   r   r   r1   =   s   r1   c                   @   s   e Zd ZdS )ÚStreamWriterN©r   r   r   r   r   r   r   r3   ^   s   r3   c                   @   s   e Zd ZdS )ÚStreamReaderNr4   r   r   r   r   r5   b   s   r5   )r   c                	   C   s    t jdtƒ jtƒ jttttd�S )NÚidna)Únamer   r   ÚincrementalencoderÚincrementaldecoderÚstreamwriterÚstreamreader)	ÚcodecsÚ	CodecInfor
   r   r   r   r1   r3   r5   r   r   r   r   Úgetregentryf   s    ùr>   )Úcorer   r   r   r   r   r<   ÚreÚtypingr   r	   Úcompiler%   r
   ÚBufferedIncrementalEncoderr   ÚBufferedIncrementalDecoderr1   r3   r5   r=   r>   r   r   r   r   Ú<module>   s   
!!