o Ec} @sddlmZmZmZmZmZddlZddlZddlm Z m Z e dZ Gdddej Z Gdd d ejZGd d d ejZGd d d e ejZGddde ejZddZdS))encodedecodealabelulabel IDNAErrorN)TupleOptionalu [.。.。]c@s eZdZdddZdddZdS)CodecstrictcC.|dkr td||sdSt|t|fS)Nr Unsupported error handling "{}")r)rformatrlenselfdataerrorsrI/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/idna/codec.pyr z Codec.encodecCr )Nr r r)rrrrrrrrrrz Codec.decodeN)r )__name__ __module__ __qualname__rrrrrrr s  r c@eZdZddZdS)IncrementalEncoderc C|dkr td||sdSt|}d}|r+|ds"d}|d=n |s+|d=|r+d}g}d}|D]}|t||r@|d7}|t|7}q1d||} |t|7}| |fS Nr r rr.rr)rr_unicode_dots_resplitappendrrjoin rrrfinallabelsZ trailing_dotresultsizeZlabelZ result_strrrr_buffer_encodes0  z!IncrementalEncoder._buffer_encodeN)rrrr,rrrrr rc@r)IncrementalDecoderc Crr )rrr#r$r%rrr&r'rrr_buffer_decodeAs0  z!IncrementalDecoder._buffer_decodeN)rrrr/rrrrr.@r-r.c@ eZdZdS) StreamWriterNrrrrrrrr1br1c@r0) StreamReaderNr2rrrrr4fr3r4c Cs tjdtjtjttttdS)NZidna)namerrincrementalencoderincrementaldecoder streamwriter streamreader) codecs CodecInfor rrrr.r1r4rrrr getregentryjsr<)Zcorerrrrrr:retypingrr compiler#r BufferedIncrementalEncoderrBufferedIncrementalDecoderr.r1r4r<rrrrs ""