§
    
Á³g–#  ã                   óà  — d Z ddlZddlmZ  ej        d¦  «        Z ej        dej        ej        z  ej        z  ¦  «        Z	 ej        dej
        ej        z  ej        z  ¦  «        Z ej        dej        ¦  «        Z G d„ d	e¦  «        Z G d
„ de¦  «        Zd"d„Zd#d„Zd#d„Zd#d„Zd„ Zd„ Zd„ Zd„ Zd„ Zi Zd„ Zd„ Zd$d„Zd%d„Z G d„ d¦  «        Z d„ Z!d„ Z"d„ Z# G d „ d!e¦  «        Z$dS )&z±
    pygments.util
    ~~~~~~~~~~~~~

    Utility functions.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)ÚTextIOWrapperz[/\\ ]z”
    <!DOCTYPE\s+(
     [a-zA-Z_][a-zA-Z0-9]*
     (?: \s+      # optional in HTML5
     [a-zA-Z_][a-zA-Z0-9]*\s+
     "[^"]*")?
     )
     [^>]*>
z<(.+?)(\s.*?)?>.*?</.+?>z\s*<\?xml[^>]*\?>c                   ó   — e Zd ZdZdS )ÚClassNotFoundzCRaised if one of the lookup functions didn't find a matching class.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úW/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/pip/_vendor/pygments/util.pyr   r      s   € € € € € ØMÐMÐMÐMr   r   c                   ó   — e Zd ZdS )ÚOptionErrorN)r   r   r   r
   r   r   r   r   "   s   € € € € € Ø€Dr   r   Fc                 óÜ   — |                       ||¦  «        }|r|                     ¦   «         }||vr;t          d|›dd                     t	          t
          |¦  «        ¦  «        ›�¦  «        ‚|S )NzValue for option z must be one of z, )ÚgetÚlowerr   ÚjoinÚmapÚstr)ÚoptionsÚoptnameÚallowedÚdefaultÚnormcaseÚstrings         r   Úget_choice_optr   &   sy   € Ø�[Š[˜ 'Ñ*Ô*€FØð  Ø—’‘”ˆØ�WÐÐÝˆkØ"˜7˜7 D§I¢I­cµ#°wÑ.?Ô.?Ñ$@Ô$@Ð$@ðBñ Cô Cð 	Cà€Mr   c                 ó†  — |                       ||¦  «        }t          |t          ¦  «        r|S t          |t          ¦  «        rt          |¦  «        S t          |t          ¦  «        st          d|›d|›d�¦  «        ‚|                     ¦   «         dv rdS |                     ¦   «         dv rdS t          d|›d|›d�¦  «        ‚)	NúInvalid type ú for option z%; use 1/0, yes/no, true/false, on/off)Ú1ÚyesÚtrueÚonT)Ú0ÚnoÚfalseÚoffFúInvalid value )r   Ú
isinstanceÚboolÚintr   r   r   ©r   r   r   r   s       r   Úget_bool_optr,   0   sÜ   € Ø�[Š[˜ 'Ñ*Ô*€FÝ�&�$ÑÔð 0ØˆÝ	�F�CÑ	 Ô	 ð 0Ý�F‰|Œ|ÐÝ˜¥Ñ$Ô$ð 0Ýˆkà$˜f˜f g g gð/ñ 0ô 0ð 	0ð 
�Š‰ŒÐ5Ð	5Ð	5ØˆtØ	�Š‰ŒÐ6Ð	6Ð	6Øˆuåˆkà$˜f˜f g g gð/ñ 0ô 0ð 	0r   c                 óÔ   — |                       ||¦  «        }	 t          |¦  «        S # t          $ r t          d|›d|›d�¦  «        ‚t          $ r t          d|›d|›d�¦  «        ‚w xY w)Nr   r   z ; you must give an integer valuer'   )r   r*   Ú	TypeErrorr   Ú
ValueErrorr+   s       r   Úget_int_optr0   D   s¡   € Ø�[Š[˜ 'Ñ*Ô*€Fð	0Ý�6‰{Œ{ÐøÝð 0ð 0ð 0Ýˆkà$˜f˜f g g gð/ñ 0ô 0ð 	0õ ð 0ð 0ð 0Ýˆkà$˜f˜f g g gð/ñ 0ô 0ð 	0ð0øøøs
   ˜' §A A'c                 ó  — |                       ||¦  «        }t          |t          ¦  «        r|                     ¦   «         S t          |t          t
          f¦  «        rt	          |¦  «        S t          d|›d|›d�¦  «        ‚)Nr   r   z; you must give a list value)r   r(   r   ÚsplitÚlistÚtupler   )r   r   r   Úvals       r   Úget_list_optr6   R   s}   € Ø
�+Š+�g˜wÑ
'Ô
'€CÝ�#•sÑÔð -Ø�yŠy‰{Œ{ÐÝ	�C�$¥˜Ñ	'Ô	'ð -Ý�C‰yŒyÐåˆkà!˜c˜c 7 7 7ð,ñ -ô -ð 	-r   c                 ó@  — | j         sdS g }| j                              ¦   «                              ¦   «         D ]A}|                     ¦   «         r+|                     d|                     ¦   «         z   ¦  «         ŒA d                     |¦  «                             ¦   «         S )NÚ ú )r	   ÚstripÚ
splitlinesÚappendr   Úlstrip)ÚobjÚresÚlines      r   Údocstring_headlinerA   ^   s�   € ØŒ;ð ØˆrØ
€CØ”×!Ò!Ñ#Ô#×.Ò.Ñ0Ô0ð ð ˆØ�:Š:‰<Œ<ð 	Ø�JŠJ�s˜TŸZšZ™\œ\Ñ)Ñ*Ô*Ð*Ð*àØ�7Š7�3‰<Œ<×ÒÑ Ô Ð r   c                 óD   ‡ — ˆ fd„}‰ j         |_         t          |¦  «        S )zAReturn a static text analyser function that returns float values.c           	      óÐ   •— 	  ‰| ¦  «        }n# t           $ r Y dS w xY w|sdS 	 t          dt          dt          |¦  «        ¦  «        ¦  «        S # t          t
          f$ r Y dS w xY w)Ng        g      ð?)Ú	ExceptionÚminÚmaxÚfloatr/   r.   )ÚtextÚrvÚfs     €r   Útext_analysez%make_analysator.<locals>.text_analysel   s’   ø€ ð	Ø��4‘”ˆBˆBøÝð 	ð 	ð 	Ø�3�3ð	øøøàð 	Ø�3ð	Ý�s�C ¥U¨2¡Y¤YÑ/Ô/Ñ0Ô0Ð0øÝ�IÐ&ð 	ð 	ð 	Ø�3�3ð	øøøs   ƒ �
œ¥*A ÁA%Á$A%)r	   Ústaticmethod)rJ   rK   s   ` r   Úmake_analysatorrM   j   s6   ø€ ð
ð 
ð 
ð 
ð 
ð œ9€LÔÝ˜Ñ%Ô%Ð%r   c                 óè  — |                       d¦  «        }|dk    r| d|…                              ¦   «         }n|                      ¦   «         }|                     d¦  «        r�	 d„ t                               |dd…                              ¦   «         ¦  «        D ¦   «         d         }n# t          $ r Y dS w xY wt          j        d	|z  t          j	        ¦  «        }| 
                    |¦  «        �d
S dS )aò  Check if the given regular expression matches the last part of the
    shebang if one exists.

        >>> from pygments.util import shebang_matches
        >>> shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?')
        True
        >>> shebang_matches('#!/usr/bin/python2.4', r'python(2\.\d)?')
        True
        >>> shebang_matches('#!/usr/bin/python-ruby', r'python(2\.\d)?')
        False
        >>> shebang_matches('#!/usr/bin/python/ruby', r'python(2\.\d)?')
        False
        >>> shebang_matches('#!/usr/bin/startsomethingwith python',
        ...                 r'python(2\.\d)?')
        True

    It also checks for common windows executable file extensions::

        >>> shebang_matches('#!C:\\Python2.4\\Python.exe', r'python(2\.\d)?')
        True

    Parameters (``'-f'`` or ``'--foo'`` are ignored so ``'perl'`` does
    the same as ``'perl -e'``)

    Note that this method automatically searches the whole string (eg:
    the regular expression is wrapped in ``'^$'``)
    ú
r   Nz#!c                 ó@   — g | ]}|¯|                      d ¦  «        °|‘ŒS )ú-)Ú
startswith)Ú.0Úxs     r   ú
<listcomp>z#shebang_matches.<locals>.<listcomp>ž   s@   € ð 5ð 5ð 5˜1Øð5Ø"#§,¢,¨sÑ"3Ô"3ð5�Qð 5ð 5ð 5r   é   éÿÿÿÿFz^%s(\.(exe|cmd|bat|bin))?$T)Úfindr   rR   Úsplit_path_rer2   r:   Ú
IndexErrorÚreÚcompileÚ
IGNORECASEÚsearch)rH   ÚregexÚindexÚ
first_lineÚfounds        r   Úshebang_matchesrc   {   sÿ   € ð8 �IŠI�d‰OŒO€EØ�‚z€zØ˜&˜5˜&”\×'Ò'Ñ)Ô)ˆ
ˆ
à—Z’Z‘\”\ˆ
Ø×Ò˜TÑ"Ô"ð ð	ð5ð 5¥× 3Ò 3°J¸q¸r¸r´N×4HÒ4HÑ4JÔ4JÑ KÔ Kð 5ñ 5ô 5Ø57ô9ˆEˆEøåð 	ð 	ð 	Ø�5�5ð	øøøå”
Ð8¸5Ñ@Å"Ä-ÑPÔPˆØ�<Š<˜ÑÔÐ*Ø�4Øˆ5s   Á#AB( Â(
B6Â5B6c                 óô   — t                                | ¦  «        }|€dS |                     d¦  «        }t          j        |t          j        ¦  «                             |                     ¦   «         ¦  «        duS )zÁCheck if the doctype matches a regular expression (if present).

    Note that this method only checks the first part of a DOCTYPE.
    eg: 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
    NFé   )Údoctype_lookup_rer^   Úgroupr[   r\   ÚIÚmatchr:   )rH   r_   ÚmÚdoctypes       r   Údoctype_matchesrl   ¨   s_   € õ 	× Ò  Ñ&Ô&€AØ€yØˆuØ�gŠg�a‰jŒj€GÝŒ:�e�RœTÑ"Ô"×(Ò(¨¯ª©¬Ñ9Ô9ÀÐEÐEr   c                 ó"   — t          | d¦  «        S )z3Check if the file looks like it has a html doctype.Úhtml)rl   )rH   s    r   Úhtml_doctype_matchesro   µ   s   € å˜4 Ñ)Ô)Ð)r   c                 ó2  — t                                | ¦  «        rdS t          | ¦  «        }	 t          |         S # t          $ rR t
                               | ¦  «        }|�Y dS t                               | dd…         ¦  «        du}|t          |<   |cY S w xY w)z2Check if a doctype exists or if we have some tags.TNiè  )Úxml_decl_reri   ÚhashÚ_looks_like_xml_cacheÚKeyErrorrf   r^   Útag_re)rH   Úkeyrj   rI   s       r   Úlooks_like_xmlrw   ½   s¤   € å×Ò˜ÑÔð ØˆtÝ
ˆt‰*Œ*€CðÝ$ SÔ)Ð)øÝð ð ð Ý×$Ò$ TÑ*Ô*ˆØˆ=Ø�4�4Ý�]Š]˜4   œ;Ñ'Ô'¨tÐ3ˆØ%'Õ˜cÑ"Øˆ	ˆ	ˆ	ðøøøs   ­: º&BÁ#0BÂBc                 ó"   — d| dz	  z   d| dz  z   fS )zoGiven a unicode character code with length greater than 16 bits,
    return the two 16 bit surrogate pair.
    iÀ×  é
   i Ü  iÿ  r
   )Úcs    r   Úsurrogatepairr{   Í   s!   € ð �a˜2‘gÑ ¨1¨u©9Ñ!5Ð7Ð7r   c                 óˆ  — g }d|z  dz  }d|dz   z  dz  }|                      || z   dz   ¦  «         |r!|D ]}|                      ||z   dz   ¦  «         ŒnC|D ]@}t          |dz   ¦  «        }|                      ||dd…         z   |d	         z   dz   ¦  «         ŒA|                      |d
z   ¦  «         d                     |¦  «        S )z)Formats a sequence of strings for output.r9   é   re   z = (ú,ú"NéþÿÿÿrW   ú)rO   )r<   Úreprr   )	Úvar_nameÚseqÚrawÚindent_levelÚlinesÚbase_indentÚinner_indentÚiÚrs	            r   Úformat_linesrŒ   Ö   sú   € à€EØ˜Ñ$ qÑ(€KØ˜,¨Ñ*Ñ+¨aÑ/€LØ	‡L‚L�˜xÑ'¨&Ñ0Ñ1Ô1Ð1Ø
ð >àð 	1ð 	1ˆAØ�LŠL˜¨Ñ)¨CÑ/Ñ0Ô0Ð0Ð0ð	1ð ð 	>ð 	>ˆAå�Q˜‘W‘”ˆAØ�LŠL˜¨¨#¨2¨#¬Ñ.°°2´Ñ6¸Ñ<Ñ=Ô=Ð=Ð=Ø	‡L‚L�˜sÑ"Ñ#Ô#Ð#Ø�9Š9�UÑÔÐr   r
   c                 ó–   — g }t          ¦   «         }| D ]5}||v s||v rŒ|                     |¦  «         |                     |¦  «         Œ6|S )za
    Returns a list with duplicates removed from the iterable `it`.

    Order is preserved.
    )Úsetr<   Úadd)ÚitÚalready_seenÚlstÚseenrŠ   s        r   Úduplicates_removedr”   é   s\   € ð €CÝ‰5Œ5€DØð ð ˆØ�ˆ9ˆ9˜˜\Ð)Ð)ØØ�
Š
�1‰ŒˆØ�Š�‰ŒˆˆØ€Jr   c                   ó   — e Zd ZdZd„ ZdS )ÚFuturez‡Generic class to defer some work.

    Handled specially in RegexLexerMeta, to support regex string construction at
    first use.
    c                 ó   — t           ‚©N)ÚNotImplementedError©Úselfs    r   r   z
Future.getÿ   s   € Ý!Ð!r   N)r   r   r   r	   r   r
   r   r   r–   r–   ù   s-   € € € € € ðð ð
"ð "ð "ð "ð "r   r–   c                 ó  — 	 |                       d¦  «        } | dfS # t          $ rf 	 ddl}|                     ¦   «         }|                       ¦   «         } | |fcY S # t          t          f$ r |                       d¦  «        } | dfcY cY S w xY ww xY w)zÃDecode *text* with guessed encoding.

    First try UTF-8; this should fail for non-UTF-8 encodings.
    Then try the preferred locale encoding.
    Fall back to latin-1, which always works.
    zutf-8r   NÚlatin1)ÚdecodeÚUnicodeDecodeErrorÚlocaleÚgetpreferredencodingÚLookupError)rH   r    Úprefencodings      r   Úguess_decoder¤     sÁ   € ð"Ø�{Š{˜7Ñ#Ô#ˆØ�Wˆ}ÐøÝð "ð "ð "ð	"ØˆMˆMˆMØ!×6Ò6Ñ8Ô8ˆLØ—;’;‘=”=ˆDØ˜Ð%Ð%Ð%Ð%øÝ"¥KÐ0ð 	"ð 	"ð 	"Ø—;’;˜xÑ(Ô(ˆDØ˜�>Ð!Ð!Ð!Ð!Ð!ð	"øøøð"øøøs,   ‚ ›
B¦/AÁBÁ*BÂBÂBÂBc                 óª   — t          |dd¦  «        r4	 |                      |j        ¦  «        } | |j        fS # t          $ r Y nw xY wt	          | ¦  «        S )zÊDecode *text* coming from terminal *term*.

    First try the terminal encoding, if given.
    Then try UTF-8.  Then try the preferred locale encoding.
    Fall back to latin-1, which always works.
    ÚencodingN)Úgetattrrž   r¦   rŸ   r¤   )rH   Úterms     r   Úguess_decode_from_terminalr©     sq   € õ ˆt�Z Ñ&Ô&ð 'ð	'Ø—;’;˜tœ}Ñ-Ô-ˆDð ˜œÐ&Ð&øõ "ð 	ð 	ð 	ØˆDð	øøøõ ˜ÑÔÐs   “6 ¶
AÁAc                 ób   — t          | dd¦  «        r| j        S ddl}|                     ¦   «         S )z7Return our best guess of encoding for the given *term*.r¦   Nr   )r§   r¦   r    r¡   )r¨   r    s     r   Úterminal_encodingr«   )  s9   € åˆt�Z Ñ&Ô&ð ØŒ}ÐØ€M€M€MØ×&Ò&Ñ(Ô(Ð(r   c                   ó   — e Zd Zd„ ZdS )ÚUnclosingTextIOWrapperc                 ó.   — |                       ¦   «          d S r˜   )Úflushrš   s    r   ÚclosezUnclosingTextIOWrapper.close3  s   € Ø�
Š
‰Œˆˆˆr   N)r   r   r   r°   r
   r   r   r­   r­   1  s#   € € € € € ðð ð ð ð r   r­   )NFr˜   )Fr   )r
   )%r	   r[   Úior   r\   rY   ÚDOTALLÚ	MULTILINEÚVERBOSErf   r]   ru   rh   rq   r/   r   rD   r   r   r,   r0   r6   rA   rM   rc   rl   ro   rs   rw   r{   rŒ   r”   r–   r¤   r©   r«   r­   r
   r   r   ú<module>rµ      s€  ððð ð 
€	€	€	Ø Ð Ð Ð Ð Ð ð �”
˜9Ñ%Ô%€Ø�B”Jð  ð „Y�”Ñ ¤
Ñ*ñ,ô ,Ð ð 
ˆŒÐ/Ø”M B¤IÑ-°´Ñ<ñ
>ô 
>€àˆbŒjÐ-¨r¬tÑ4Ô4€ðNð Nð Nð Nð N�Jñ Nô Nð Nð	ð 	ð 	ð 	ð 	�)ñ 	ô 	ð 	ðð ð ð ð0ð 0ð 0ð 0ð(0ð 0ð 0ð 0ð	-ð 	-ð 	-ð 	-ð	!ð 	!ð 	!ð&ð &ð &ð"*ð *ð *ðZ
Fð 
Fð 
Fð*ð *ð *ð
 Ð ðð ð ð 8ð 8ð 8ðð ð ð ð&ð ð ð ð "ð "ð "ð "ð "ñ "ô "ð "ð"ð "ð "ð*ð ð ð")ð )ð )ðð ð ð ð ˜]ñ ô ð ð ð r   