Ë
    Ã?Æ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
)aw  NIP (Numer Identyfikacji Podatkowej, Polish VAT number).

The NIP (Numer Identyfikacji Podatkowej) number consists of 10 digit with
a straightforward weighted checksum.

>>> validate('PL 8567346215')
'8567346215'
>>> validate('PL 8567346216')  # invalid check digits
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('PL 8567346215')
'856-734-62-15'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó‚   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } | S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -ÚPLé   N)r   ÚupperÚstripÚ
startswith©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/pl/nip.pyÚcompactr   )   s@   € ô �6˜4Ó ×&Ñ&Ó(×.Ñ.Ó0€FØ×Ñ˜ÔØ˜˜�ˆØ€Mó    c                óD   — d}t        d„ t        || «      D «       «      dz  S )zCalculate the checksum.)
é   é   é   r	   é   é   r   r   r   éÿÿÿÿc              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>zchecksum.<locals>.<genexpr>5   s   è ø€ Ò;™d˜a ˆq”3�q“6�zÑ;ùs   ‚é   )ÚsumÚzip)r   Úweightss     r   Úchecksumr#   2   s$   € à-€GÜÑ;¤c¨'°6Ó&:Ô;Ó;¸bÑ@Ð@r   c                ó¦   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | «      dk7  r
t        «       ‚| S )zbCheck if the number is a valid VAT number. This checks the length,
    formatting and check digit.é
   r   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr#   ÚInvalidChecksumr   s    r   Úvalidater*   8   sL   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�Ó˜1ÒÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z*Check if the number is a valid VAT number.F)Úboolr*   ÚValidationErrorr   s    r   Úis_validr.   E   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óZ   — t        | «      } dj                  | dd | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.ú-r   r   r   é   N)r   Újoinr   s    r   Úformatr3   M   s;   € ä�V‹_€FØ�8‰8�V˜A˜a�[ &¨¨1 +¨v°a¸¨{¸FÀ1À2¸JÐGÓHÐHr   N)r   ÚstrÚreturnr4   )r   r4   r5   r   )r   r4   r5   r,   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r#   r*   r.   r3   © r   r   ú<module>r;      s0   ðñ(õ #ä ß 'óóAó
óôIr   