Ë
    Ã?Æi–	  ã                  óV   — 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
dd	„Zy
)ai  PIB (Poreski Identifikacioni Broj, Montenegro tax number).

This number consists of 8 digits.

More information:

* http://www.pretraga.crps.me:8083/
* https://www.vatify.eu/montenegro-vat-number.html

>>> validate('02655284')
'02655284'
>>> validate('02655283')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('02655284')
'02655284'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó   — t        | d«      S )z’Convert the number to the minimal representation.

    This strips the number of any valid separators and removes surrounding
    whitespace.
    ú )r   ©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/me/pib.pyÚcompactr   /   s   € ô �˜ÓÐó    c           	     ó^   — d}t        t        d„ t        || «      D «       «       dz  dz  «      S )z)Calculate the check digit for the number.)é   é   é   é   é   é   é   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>;   s   è ø€ ÒA¡D A q�Qœ˜Q›•ZÑAùs   ‚é   é
   )ÚstrÚsumÚzip)r
   Úweightss     r   Úcalc_check_digitr"   8   s1   € à#€GÜ”ÑA¬C°¸Ó,@ÔAÓAÐAÀRÑGÈ"ÑLÓMÐMr   c                ó¬   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚| d   t        | «      k7  r
t        «       ‚| S )ú5Check if the number is a valid Montenegro PIB number.r   éÿÿÿÿ)r   ÚlenÚInvalidLengthr   ÚInvalidFormatr"   ÚInvalidChecksumr	   s    r   Úvalidater*   >   sO   € ä�V‹_€FÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�FÔÜ‹oÐØˆb�zÔ% fÓ-Ò-ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r$   F)Úboolr*   ÚValidationErrorr	   s    r   Úis_validr.   J   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó   — t        | «      S )z8Reformat the number to the standard presentation format.)r   r	   s    r   Úformatr0   R   s   € ä�6‹?Ðr   N)r
   r   Úreturnr   )r
   r   r1   r,   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r"   r*   r.   r0   © r   r   ú<module>r7      s/   ðñ,õ& #ä ß 'óóNó	óôr   