Ë
    vl�jò  ã                   óÜ   — d dl Z d dlZd dlmZ d dlmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ  ej                  d«      Z e j"                  e«      Zd	ed
efd„Zded
dfd„Z G d„ d«      Zy)é    N)ÚIterable)ÚClassVarÚcast)Úglyphname2unicode)ÚENCODING©ÚPDFKeyError)Ú	PSLiteralz[0-9a-fA-F]+ÚnameÚreturnc           	      ó„  — t        | t        «      st        d| › dt        | «      › �«      ‚| j	                  d«      d   } | j	                  d«      }t        |«      dkD  rdj                  t        t        |«      «      S | t        v r	t        |    S | j                  d«      rž| j                  d«      }t        j                  |«      rét        |«      d	z  dk(  rØt        dt        |«      d	«      D �cg c]  }t        |||d	z    d
¬«      ‘Œ }}|D ]  }t!        |«       Œ t        t"        |«      }dj                  |«      S | j                  d«      r`| j                  d«      }t        j                  |«      r:d	t        |«      cxk  rdk  r&n n#t        |d
¬«      }t!        |«       t#        |«      S t        d| › d�«      ‚c c}w )a·  Converts Adobe glyph names to Unicode numbers.

    In contrast to the specification, this raises a KeyError instead of return
    an empty string when the key is unknown.
    This way the caller must explicitly define what to do
    when there is not a match.

    Reference:
    https://github.com/adobe-type-tools/agl-specification#2-the-mapping

    :returns unicode character if name resembles something,
    otherwise a KeyError
    z Could not convert unicode name "z?" to character because it should be of type str but is of type ú.r   Ú_é   Ú Úunié   é   )ÚbaseÚué   z6" to character because it does not match specification)Ú
isinstanceÚstrr	   ÚtypeÚsplitÚlenÚjoinÚmapÚname2unicoder   Ú
startswithÚstripÚHEXADECIMALÚmatchÚrangeÚintÚ#raise_key_error_for_invalid_unicodeÚchr)	r   Ú
componentsÚname_without_uniÚiÚunicode_digitsÚdigitÚ
charactersÚname_without_uÚunicode_digits	            úI/var/www/html/pp/venv/lib/python3.12/site-packages/pdfminer/encodingdb.pyr   r      s¹  € ô �dœCÔ ÜØ.¨t¨fð 57Ü7;¸D³z°lðDó
ð 	
ð
 �:‰:�c‹?˜1Ñ€DØ—‘˜C“€Jä
ˆ:ƒ˜ÒØ�w‰w”sœ<¨Ó4Ó5Ð5à	Ô"Ñ	"Ü  Ñ&Ð&à	�‰˜Ô	ØŸ:™: eÓ,Ðä×ÑÐ-Ô.´3Ð7GÓ3HÈ1Ñ3LÐPQÒ3Qô ˜q¤#Ð&6Ó"7¸Ó;öàô Ð$ Q¨¨Q©Ð/°bÖ9ðˆNð ð (ò ;�Ü3°EÕ:ð;äœS .Ó1ˆJØ—7‘7˜:Ó&Ð&à	�‰˜Ô	ØŸ™ C›ˆä×Ñ˜^Ô,°´c¸.Ó6IÔ1NÈQÕ1NÜ °RÔ8ˆMÜ/°Ô>Ü�}Ó%Ð%ä
Ø
*¨4¨&ð 1*ð 	*óð ùò#s   Ã.F=r/   c                 ó>   — d| cxk  rdk  rn yt        d| › d�«      ‚y)z©Unicode values should not be in the range D800 through DFFF because
    that is used for surrogate pairs in UTF-16

    :raises KeyError if unicode digit is invalid
    iÿ×  i à  zUnicode digit z8 is invalid because it is in the range D800 through DFFFNr   )r/   s    r0   r&   r&   H   s4   € ð ˆ}Ô$˜uÕ$ÜØ˜]˜Oð ,3ð 3ó
ð 	
ð %ó    c            
       óT  — e Zd ZU i Zeeeef      ed<   i Z	eeeef      ed<   i Z
eeeef      ed<   i Zeeeef      ed<   eD ]-  \  ZZZZZ ee«      Zereee<   eree	e<   eree
e<   esŒ)eee<   Œ/ ee	e
edœZeeeeeef   f      ed<   e	 dded	ee   dz  d
eeef   fd„«       Zy)Ú
EncodingDBÚstd2unicodeÚmac2unicodeÚwin2unicodeÚpdf2unicode)ÚStandardEncodingÚMacRomanEncodingÚWinAnsiEncodingÚPDFDocEncodingÚ	encodingsNr   Údiffr   c                 óœ  — | j                   j                  || j                  «      }|ri|j                  «       }d}|D ]R  }t	        |t
        «      r|}Œt	        |t        «      sŒ'	 t        t        t        |j                  «      «      ||<   |dz  }ŒT |S # t        t        f$ r(}t        j                  t        |«      «       Y d }~Œ;d }~ww xY w)Nr   r   )r=   Úgetr5   Úcopyr   r%   r
   r   r   r   r   ÚKeyErrorÚ
ValueErrorÚlogÚdebug)Úclsr   r>   Úcid2unicodeÚcidÚxÚes          r0   Úget_encodingzEncodingDB.get_encodingl   s¸   € ð —m‘m×'Ñ'¨¨c¯o©oÓ>ˆÙØ%×*Ñ*Ó,ˆKØˆCØò �Ü˜a¤Ô%Ø‘CÜ ¤9Õ-ð*Ü+7¼¼SÀ!Ç&Á&Ó8IÓ+J˜ CÑ(ð ˜1‘H‘Cðð Ðøô %¤jÐ1ò *ÜŸ	™	¤# a£&×)Ñ)ûð*ús   Á%&BÂCÂ#CÃC)N)Ú__name__Ú
__module__Ú__qualname__r5   r   Údictr%   r   Ú__annotations__r6   r7   r8   r   r   ÚstdÚmacÚwinÚpdfr   Úcr=   Úclassmethodr   ÚobjectrK   © r2   r0   r4   r4   U   s0  … Ø,.€K�˜$˜s C˜x™.Ñ)Ó.Ø,.€K�˜$˜s C˜x™.Ñ)Ó.Ø,.€K�˜$˜s C˜x™.Ñ)Ó.Ø,.€K�˜$˜s C˜x™.Ñ)Ó.Ø$,ò 	!Ñ ˆˆc�3˜˜SÙ˜ÓˆÙØ ˆK˜ÑÙØ ˆK˜ÑÙØ ˆK˜ÑÚØ ˆK˜Òð	!ð (Ø'Ø&Ø%ñ	6€Iˆx˜˜S $ s¨C x¡.Ð0Ñ1Ñ2ó ð ð )-ñàðð �vÑ Ñ%ðð 
ˆc�3ˆh‰ò	ó ñr2   r4   )ÚloggingÚreÚcollections.abcr   Útypingr   r   Úpdfminer.glyphlistr   Úpdfminer.latin_encr   Úpdfminer.pdfexceptionsr	   Úpdfminer.psparserr
   Úcompiler"   Ú	getLoggerrL   rD   r   r   r%   r&   r4   rX   r2   r0   ú<module>rc      sp   ðÛ Û 	Ý $ß !å 0Ý 'Ý .Ý 'àˆb�j‰j˜Ó)€à€g×Ñ˜Ó!€ð5�sð 5˜só 5ðp

°sð 

¸tó 

÷*ò *r2   