Ë
    Ã?Æ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
)av  CBU (Clave Bancaria Uniforme, Argentine bank account number).

CBU it s a code of the Banks of Argentina to identify customer accounts. The
number consists of 22 digits and consists of a 3 digit bank identifier,
followed by a 4 digit branch identifier, a check digit, a 13 digit account
identifier and another check digit.

More information:

* https://es.wikipedia.org/wiki/Clave_Bancaria_Uniforme

>>> validate('2850590940090418135201')
'2850590940090418135201'
>>> format('2850590940090418135201')
'28505909 40090418135201'
>>> validate('2810590940090418135201')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó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.z -)r   Ústrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ar/cbu.pyÚcompactr   0   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                óv   ‡— dŠt        ˆfd„t        t        | «      «      D «       «      }t        d|z
  dz  «      S )zCalculate the check digit.)é   é   é   é	   c              3  óL   •K  — | ]  \  }}t        |«      ‰|d z     z  –— Œ y­w)é   N)Úint)Ú.0ÚiÚnÚweightss      €r   ú	<genexpr>z#calc_check_digit.<locals>.<genexpr>9   s.   øè ø€ ò 9Ù�A�qô �A“˜  Q¡™Õ'ñ 9ùs   ƒ!$é
   )ÚsumÚ	enumerateÚreversedÚstr)r
   Úcheckr   s     @r   Úcalc_check_digitr!   6   s=   ø€ à€GÜó 9Ü%¤h¨vÓ&6Ó7ô9ó 9€Eä��U‘
˜bÑ Ó!Ð!r   c                óî   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚t        | dd «      | d   k7  r
t        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )ú#Check if the number is a valid CBU.é   Nr   é   éÿÿÿÿ)r   ÚlenÚInvalidLengthr   ÚInvalidFormatr!   ÚInvalidChecksumr	   s    r   Úvalidater+   >   st   € ä�V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐÜ˜˜r ˜
Ó# v¨a¡yÒ0ÜÓÐÜ˜˜q ˜Ó%¨°©Ò3ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r#   F)Úboolr+   ÚValidationErrorr	   s    r   Úis_validr/   L   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óJ   — t        | «      } dj                  | dd | dd f«      S )z8Reformat the number to the standard presentation format.ú Nr%   )r   Újoinr	   s    r   Úformatr3   T   s+   € ä�V‹_€FØ�8‰8�V˜B˜Q�Z ¨¨ Ð,Ó-Ð-r   N)r
   r   Úreturnr   )r
   r   r4   r-   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r!   r+   r/   r3   © r   r   ú<module>r:      s.   ðñ*õ* #ä ß 'ó'ó"óóô.r   