Ë
    Ã?ÆiL
  ã                  ón   — d Z ddlmZ ddlmZ ddl­ ddlmZ g d¢Zej                  Z	dd„Z
dd„Zdd	„Zy
)uB  NIE (NÃºmero de IdentificaciÃ³n de Extranjero, Spanish foreigner number).

The NIE is an identification number for foreigners. It is a 9 digit number
where the first digit is either X, Y or Z and last digit is a checksum
letter.

More information:

* https://es.wikipedia.org/wiki/N%C3%BAmero_de_identidad_de_extranjero

>>> validate('x-2482300w')
'X2482300W'
>>> validate('x-2482300a')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('X2482300')  # digit missing
Traceback (most recent call last):
    ...
InvalidLength: ...
é    )Úannotations)Údni)Ú*)Úisdigits)ÚcompactÚcalc_check_digitÚvalidateÚis_validc                ór   — t        dj                  | d   «      «      | dd z   } t        j                  | «      S )zZCalculate the check digit. The number passed should not have the
    check digit included.ÚXYZr   é   N)ÚstrÚindexr   r   ©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/es/nie.pyr   r   9   s7   € ô �—‘˜V A™YÓ'Ó(¨6°!°"¨:Ñ5€FÜ×Ñ Ó'Ð'ó    c                óÆ   — t        | «      } t        | dd «      r| dd dvr
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )údCheck if the number provided is a valid NIE. This checks the length,
    formatting and check digit.r   éÿÿÿÿNr   é	   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr   s    r   r	   r	   A   si   € ô �V‹_€FÜ�F˜1˜R�LÔ! V¨B¨Q Z°uÑ%<Ü‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐÜ˜˜s ˜Ó$¨¨r©
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr	   ÚValidationErrorr   s    r   r
   r
   N   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   r   Úreturnr   )r   r   r   r   )Ú__doc__Ú
__future__r   Ú	stdnum.esr   Ústdnum.exceptionsÚstdnum.utilr   Ú__all__r   r   r	   r
   © r   r   ú<module>r'      s:   ðñ*õ, #å Ü Ý  ò B€ð �+‰+€ó(ó
ôr   