Ë
    Ã?Æi»  ã                  ó  — d Z ddlmZ ddl­ ddlmZmZ i dd“dd“dd“d	d“d
d“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“ddddddddddddddddœ¥Zdddd d!d"d#d$œZd%d%d%d&d'd(d)d$œZ	d1d*„Z
d2d+„Zd3d,„Zd1d-„Zd4d.„Zd1d/„Zy0)5a™  New Zealand bank account number

The New Zealand bank account numbers consist of 16 digits. The first two
represent the bank, followed by four for the branch, seven digits for the
account base number and three for the account type.

More information:

* https://en.wikipedia.org/wiki/New_Zealand_bank_account_number

>>> validate('01-0242-0100194-00')
'0102420100194000'
>>> validate('01-0242-0100195-00')  # invalid check digits
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('01-9999-0100197-00')  # invalid branch
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> format('0102420100194000')
'01-0242-0100194-000'
é    )Úannotations)Ú*)ÚcleanÚisdigitsÚ01ÚAÚ02Ú03Ú04Ú06Ú08ÚDÚ09ÚEÚ10Ú11Ú12Ú13Ú14Ú15Ú16Ú17Ú18Ú19ÚFÚGÚX)Ú20Ú21Ú22Ú23Ú24Ú25Ú26Ú27Ú28Ú29Ú30Ú31Ú33Ú35Ú38)r   r   é   é   é   é	   r   é
   é   é   é   é   é   r   r   r   )r   r   r   r   r   r   r   r1   r2   r3   r4   r5   r6   r   r   r   )r   r   r   r   r   r   r/   r-   r2   r4   r.   r5   r6   r   r   r   )r   r   r   r   r   r   r   r   r   r2   r4   r.   r5   r   r   r6   )r   r   r   r   r   r   r6   r/   r.   r6   r/   r.   r6   r   r   r   )r   r   r   r   r   r   r6   r.   r/   r6   r.   r/   r6   r.   r/   r6   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   ÚBr   r   r   r   r   )é   r8   )r0   r8   )r1   r1   )r0   r1   )r6   r6   c                ó,  — t        | «      j                  «       j                  dd«      j                  d«      }t	        |«      dk(  r$d}dj                  d„ t        ||«      D «       «      S dj                  |«      } | dd | dd j                  d	«      z   S )
zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú ú-r4   )r5   r4   r/   r.   Ú c              3  óD   K  — | ]  \  }}|j                  |«      –— Œ y ­w©N)Úzfill)Ú.0ÚnÚls      ú\/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/nz/bankaccount.pyú	<genexpr>zcompact.<locals>.<genexpr>`   s   è ø€ ÒB¡d a¨�q—w‘w˜q—zÑBùs   ‚ Né   r.   )r   ÚstripÚreplaceÚsplitÚlenÚjoinÚzipr?   )ÚnumberÚpartsÚlengthss      rC   ÚcompactrO   Y   s‹   € ô �&‹M×ÑÓ!×)Ñ)¨#¨sÓ3×9Ñ9¸#Ó>€EÜ
ˆ5ƒz�Q‚àˆØ�w‰wÑB¬c°%¸Ó.AÔBÓBÐBð —‘˜“ˆØ�c�rˆ{˜V B C˜[×.Ñ.¨qÓ1Ñ1Ð1ó    c                óž   — t        | «      } ddlm} i }|j                  d«      j	                  | «      D ]  \  }}|j                  |«       Œ |S )z‹Return a dictionary of data about the supplied number. This typically
    returns the name of the bank and branch and a BIC if it is valid.r   )Únumdbznz/banks)rO   ÚstdnumrR   ÚgetÚinfoÚupdate)rL   rR   rU   Ú_nrÚfounds        rC   rU   rU   g   sM   € ô �V‹_€FÝØ€DØ—i‘i 
Ó+×0Ñ0°Ó8ò ‰
ˆˆUØ�‰�EÕðà€KrP   c                óÎ   ‡— t         j                  | d d d«      }|dk(  r
| dd dk\  rd}t        |   }t        |   \  Š}t	        ˆfd„d	„ t        || «      D «       D «       «      |z  S )
Nr5   r   r   r-   rE   Ú0990000r7   c              3  ó6   •K  — | ]  }|‰kD  r|‰z  n|–— Œ y ­wr>   © )r@   ÚcÚmod1s     €rC   rD   z!_calc_checksum.<locals>.<genexpr>z   s%   øè ø€ ò 7Ø()�A˜’HˆˆDŠ !Ó#ñ7ùs   ƒc              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­wr>   )Úint)r@   ÚwrA   s      rC   rD   z!_calc_checksum.<locals>.<genexpr>|   s   è ø€ Ò5™˜˜1ˆŒS�‹V�Ñ5ùs   ‚)Ú_algorithmsrT   Ú_weightsÚ_moduliÚsumrK   )rL   Ú	algorithmÚweightsÚmod2r^   s       @rC   Ú_calc_checksumri   r   sy   ø€ ä—‘  r¨ 
¨CÓ0€IØ�CÒ˜F 1 R˜L¨IÒ5Øˆ	Ü�yÑ!€GÜ˜Ñ#�J€Dˆ$äó 7á5¤ G¨VÓ 4Ô5ô7ó 7à9=ñ>ð >rP   c                óà   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | «      dk7  r
t        «       ‚t        | «      }d|vsd|vr
t        «       ‚| S )ú<Check if the number provided is a valid bank account number.é   r   ÚbankÚbranch)	rO   r   ÚInvalidFormatrI   ÚInvalidLengthri   ÚInvalidChecksumrU   ÚInvalidComponent)rL   Úis     rC   Úvalidatert      sj   € ä�V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�fÓ Ò"ÜÓÐÜˆV‹€AØ�Q�˜(¨!Ñ+ÜÓ Ð Ø€MrP   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)rk   F)Úboolrt   ÚValidationError©rL   s    rC   Úis_validry   Ž   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óZ   — t        | «      } dj                  | dd | dd | dd | dd g«      S )z8Reformat the number to the standard presentation format.r;   Nr5   r-   rE   )rO   rJ   rx   s    rC   Úformatr{   –   sE   € ä�V‹_€FØ�8‰8Øˆr�ˆ
Øˆq�ˆØˆq�ˆØˆrˆsˆð	ó ð rP   N)rL   ÚstrÚreturnr|   )rL   r|   r}   zdict[str, str])rL   r|   r}   r`   )rL   r|   r}   rv   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   rb   rc   rd   rO   rU   ri   rt   ry   r{   r\   rP   rC   ú<module>r‚      sU  ðñ*õ0 #ä ß 'ðØˆ#ðØ�SðØ ðØ%)¨3ðØ04°cðØ;?Àðàˆ#ðà�Sðà ðà%)¨3ðà04°cðà;?Àðð 	ˆ#ðð �Sðð  ðð &*¨3ðð 15°cðð BEØ
�S ¨3°cÀØ
�S ¨3°cÀØ
�Sò€ð 
;Ø	:Ø	9Ø	9Ø	9Ø	9Ø	9ñ€ð 
Ø	Ø	Ø	Ø	Ø	Ø	ñ€ó2óó
>óóôrP   