Ë
    Ã?Æi#  ã                  ó¢   — d Z ddlmZ ddlZddl­ ddlmZ  ej                  d«      Z e	d„  e
dd	«      D «       «      Zdd
„Zdd„Zdd„Zdd„Zy)a’  ITIN (U.S. Individual Taxpayer Identification Number).

The Individual Taxpayer Identification Number is issued by the United
States IRS to individuals who are required to have a taxpayer
identification number but who are not eligible to obtain a Social Security
Number.

It is a nine-digit number that begins with the number 9 and the
fourth and fifth digit are expected to be in a certain range.

>>> validate('912-90-3456')
'912903456'
>>> validate('9129-03456')  # dash in the wrong place
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> validate('123-45-6789')  # wrong start digit
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('912-93-4567')  # wrong group
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> compact('1234-56-789')
'123456789'
>>> format('111223333')
'111-22-3333'
>>> format('123')  # unknown formatting is left alone
'123'
é    )ÚannotationsN)Ú*)Úcleanz3^(?P<area>[0-9]{3})-?(?P<group>[0-9]{2})-?[0-9]{4}$c              #  ó<   K  — | ]  }|d vsŒt        |«      –— Œ y­w))éY   é]   N)Ústr)Ú.0Úxs     úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/us/itin.pyú	<genexpr>r   A   s   è ø€ ÒK !¸À(Ò9J”s˜1—vÑKùs   ‚	ŒéF   éd   c                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú-)r   Ústrip©Únumbers    r   Úcompactr   D   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c                ó  — t         j                  t        | d«      j                  «       «      }|s
t	        «       ‚|j                  d«      }|j                  d«      }|d   dk7  s|t        vr
t        «       ‚t        | «      S )zhCheck if the number is a valid ITIN. This checks the length, groups
    and formatting if it is present.Ú ÚareaÚgroupr   Ú9)	Ú_itin_reÚsearchr   r   ÚInvalidFormatr   Ú_allowed_groupsÚInvalidComponentr   )r   Úmatchr   r   s       r   Úvalidater"   J   sn   € ô �O‰OœE &¨"Ó-×3Ñ3Ó5Ó6€EÙÜ‹oÐØ�;‰;�vÓ€DØ�K‰K˜Ó €EØˆA�w�#‚~˜¤oÑ5ÜÓ Ð Ü�6‹?Ðr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z$Check if the number is a valid ITIN.F)Úboolr"   ÚValidationErrorr   s    r   Úis_validr&   W   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óP   — t        | «      dk(  r| dd dz   | dd z   dz   | dd z   } | S )z8Reformat the number to the standard presentation format.é	   Né   r   é   )Úlenr   s    r   Úformatr,   _   s>   € ä
ˆ6ƒ{�aÒØ˜˜�˜cÑ! F¨1¨Q KÑ/°#Ñ5¸¸q¸r¸
ÑBˆØ€Mr   )r   r	   Úreturnr	   )r   r	   r-   r$   )Ú__doc__Ú
__future__r   ÚreÚstdnum.exceptionsÚstdnum.utilr   Úcompiler   ÚsetÚranger   r   r"   r&   r,   © r   r   ú<module>r7      sX   ðñ(õ@ #ã 	ä Ý ð ˆ2�:‰:ÐLÓM€ñ ÑK¡u¨R°£~ÔKÓL€ó&ó
óôr   