Ë
    Ã?ÆiÞ  ã                  óN   — d Z ddlmZ ddl­ ddlmZmZ d
d„Zd
d„Zd
d„Z	dd„Z
y	)u°  VÃ–EN (Vergi Ã¶dÉ™yicisinin eynilÉ™ÅŸdirmÉ™ nÃ¶mrÉ™si, Azerbaijan tax number).

The Vergi Ã¶dÉ™yicisinin eynilÉ™ÅŸdirmÉ™ nÃ¶mrÉ™si is issued by the Azerbaijan state
tax authorities to individuals and legal entities.

This number consists of 10 digits. The first two digits are the code for the
territorial administrative unit. The following six digits are a serial
number. The ninth digit is a check digit. The tenth digit represents the
legal status of a taxpayer: 1 for legal persons and 2 for natural persons.

More information:

* https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Azerbaijan-TIN.pdf
* https://www.e-taxes.gov.az/ebyn/payerOrVoenChecker.jsp

>>> validate('140 155 5071')
'1401555071'
>>> validate('140 155 5081')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('1400057424')
Traceback (most recent call last):
    ...
InvalidComponent: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óD   — t        | d«      } t        | «      dk(  rd| z   } | S )z’Convert the number to the minimal representation.

    This strips the number of any valid separators and removes surrounding
    whitespace.
    ú é	   Ú0)r   Úlen©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/az/voen.pyÚcompactr   6   s*   € ô �6˜3Ó€FÜ
ˆ6ƒ{�aÒØ�v‘ˆØ€Mó    c           	     óZ   — g d¢}t        t        d„ t        || «      D «       «      dz  «      S )u(   Calculate the check digit for the VÃ–EN.)é   é   é   é   é   é   é   é   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z$_calc_check_digit.<locals>.<genexpr>E   s   è ø€ Ò?¡$ ! Q�1”s˜1“v•:Ñ?ùs   ‚é   )ÚstrÚsumÚzip)r   Úweightss     r   Ú_calc_check_digitr%   B   s)   € â&€GÜŒsÑ?¬#¨g°vÓ*>Ô?Ó?À"ÑDÓEÐEr   c                óÎ   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚| d   dvr
t        «       ‚| dd t        | «      k7  r
t        «       ‚| S )õ7   Check if the number is a valid Azerbaijan VÃ–EN number.é
   éÿÿÿÿ)Ú1Ú2éþÿÿÿ)r   r   ÚInvalidLengthr   ÚInvalidFormatÚInvalidComponentr%   ÚInvalidChecksumr   s    r   Úvalidater1   H   sf   € ä�V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐØˆb�z˜Ñ#ÜÓ Ð Øˆb�€}Ô)¨&Ó1Ò1ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r'   F)Úboolr1   ÚValidationErrorr   s    r   Úis_validr5   V   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   r!   Úreturnr!   )r   r!   r6   r3   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r%   r1   r5   © r   r   ú<module>r<      s*   ðñ*õ6 #ä ß 'ó	óFóôr   