Ë
    Ã?ÆiW  ã                  ó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	)aX  REGON (Rejestr Gospodarki Narodowej, Polish register of economic units).

The REGON (Rejestr Gospodarki Narodowej) is a statistical identification
number for businesses. National entities are assigned a 9-digit number, while
local units append 5 digits to form a 14-digit number.

More information:

* https://bip.stat.gov.pl/en/regon/
* https://wyszukiwarkaregon.stat.gov.pl/appBIR/index.aspx

>>> validate('192598184')
'192598184'
>>> validate('123456785')
'123456785'
>>> validate('192598183')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('12345678512347')
'12345678512347'
>>> validate('12345678612342')  # first check digit invalid
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('12345678512348')  # last check digit invalid
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óR   — t        | d«      j                  «       j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -)r   ÚupperÚstrip©Únumbers    úV/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/pl/regon.pyÚcompactr   ;   s#   € ô �˜Ó×$Ñ$Ó&×,Ñ,Ó.Ð.ó    c                óŠ   — t        | «      dk(  rg d¢}ng d¢}t        d„ t        || «      D «       «      }t        |dz  dz  «      S )zlCalculate the check digit for organisations. The number passed
    should not have the check digit included.é   )r   é	   é   é   é   é   é   é   )r   r   r   r   r   r   r   r   r   é   r   r   r   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>H   s   è ø€ Ò<™t˜q !�”C˜“F•
Ñ<ùs   ‚é   é
   )ÚlenÚsumÚzipÚstr)r   ÚweightsÚchecks      r   Úcalc_check_digitr'   A   sD   € ô ˆ6ƒ{�aÒÚ*‰â9ˆÜÑ<¤s¨7°FÓ';Ô<Ó<€EÜˆu�r‰z˜B‰ÓÐr   c                ó  — t        | «      } t        | «      s
t        «       ‚t        | «      dvr
t	        «       ‚| d   t        | dd «      k7  r
t        «       ‚t        | «      dk(  r| d   t        | dd «      k7  r
t        «       ‚| S )zdCheck if the number is a valid REGON number. This checks the length,
    formatting and check digit.)r   é   éÿÿÿÿNr)   r   )r   r   ÚInvalidFormatr!   ÚInvalidLengthr'   ÚInvalidChecksumr
   s    r   Úvalidater.   L   sƒ   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{˜'Ñ!Ü‹oÐØˆb�zÔ% f¨S¨b kÓ2Ò2ÜÓÐÜ
ˆ6ƒ{�bÒ˜V A™YÔ*:¸6À"À1¸:Ó*FÒFÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z,Check if the number is a valid REGON number.F)Úboolr.   ÚValidationErrorr
   s    r   Úis_validr2   [   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   r$   Úreturnr$   )r   r$   r3   r0   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r'   r.   r2   © r   r   ú<module>r9      s)   ðñ,õ> #ä ß 'ó/ó óôr   