Ë
    Ã?Æi#  ã                  óž   — d Z ddlmZ ddlZddl­ ddlmZ  ej                  d«      Zdd„Z	dd„Z
dd	„Zdd
„Zdd„Zdd„Zdd„Zdd„Zdd„Zy)a‚  Czech bank account number.

The Czech bank account numbers consist of up to 20 digits:
    UUUUUK-MMMMMMMMKM/XXXX

The first part is prefix that is up to 6 digits. The following part is from 2 to 10 digits.
Both parts could be filled with zeros from left if missing.
The final 4 digits represent the bank code.

More information:

* https://www.penize.cz/osobni-ucty/424173-tajemstvi-cisla-uctu-klicem-pro-banky-je-11
* https://www.zlatakoruna.info/zpravy/ucty/cislo-uctu-v-cr

>>> validate('34278-0727558021/0100')
'034278-0727558021/0100'
>>> validate('4278-727558021/0100')  # invalid check digits (prefix)
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('34278-727558021/0000')  # invalid bank
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> format('34278-727558021/0100')
'034278-0727558021/0100'
>>> to_bic('34278-727558021/0100')
'KOMBCZPP'
é    )ÚannotationsN)Ú*)ÚcleanzC((?P<prefix>[0-9]{0,6})-)?(?P<root>[0-9]{2,10})\/(?P<bank>[0-9]{4})c           	     ó8  — t        | «      j                  «       } t        j                  | «      }|ri|j	                  d«      xs dj                  d«      }|j	                  d«      j                  d«      }dj                  |d|d|j	                  d«      f«      } | S )	zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ÚprefixÚ é   Úrooté
   ú-ú/Úbank)r   ÚstripÚ_bankaccount_reÚmatchÚgroupÚzfillÚjoin)Únumberr   r   r
   s       ú\/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/cz/bankaccount.pyÚcompactr   ?   s‡   € ô �6‹]× Ñ Ó"€FÜ×!Ñ! &Ó)€EÙà—+‘+˜hÓ'Ò-¨2×4Ñ4°QÓ7ˆØ�{‰{˜6Ó"×(Ñ(¨Ó,ˆØ—‘˜& # t¨S°%·+±+¸fÓ2EÐFÓGˆØ€Mó    c                ó¨   — t         j                  | «      }|s
t        «       ‚|j                  d«      |j                  d«      |j                  d«      fS )zCSplit valid numbers into prefix, root and bank parts of the number.r   r
   r   )r   r   ÚInvalidFormatr   )r   r   s     r   Ú_splitr   L   sE   € ä×!Ñ! &Ó)€EÙÜ‹oÐØ�;‰;�xÓ  %§+¡+¨fÓ"5°u·{±{À6Ó7JÐJÐJr   c                óˆ   — ddl m} i }|j                  d«      j                  | «      D ]  \  }}|j	                  |«       Œ |S )z!Look up information for the bank.r   )Únumdbzcz/banks)Ústdnumr   ÚgetÚinfoÚupdate)r   r   r    Ú_nrÚfounds        r   Ú_infor$   T   sB   € åØ€DØ—i‘i 
Ó+×0Ñ0°Ó6ò ‰
ˆˆUØ�‰�EÕðà€Kr   c                óH   — t        t        | «      «      \  }}}t        |«      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   r   r$   ©r   r   r
   r   s       r   r    r    ]   s#   € ô  ¤¨£Ó0Ñ€FˆD�$Ü�‹;Ðr   c                ó6   — t        | «      j                  d«      S )z7Return the BIC for the bank that this number refers to.Úbic)r    r   ©r   s    r   Úto_bicr*   d   s   € ä�‹<×Ñ˜EÓ"Ð"r   c           	     ób   — d}t        d„ t        || j                  d«      «      D «       «      dz  S )N)
r	   é   é   é	   r   é   é   é   é   é   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z!_calc_checksum.<locals>.<genexpr>k   s   è ø€ ÒE™d˜a ˆq”3�q“6�zÑEùs   ‚r   é   )ÚsumÚzipr   )r   Úweightss     r   Ú_calc_checksumr>   i   s-   € Ø-€GÜÑE¤c¨'°6·<±<ÀÓ3CÓ&DÔEÓEÈÑJÐJr   c                óÐ   — t        | «      } t        | «      \  }}}|sJ ‚t        |«      dk7  r
t        «       ‚t        |«      dk7  r
t        «       ‚dt	        |«      vr
t        «       ‚| S )ú<Check if the number provided is a valid bank account number.r   r   )r   r   r>   ÚInvalidChecksumr$   ÚInvalidComponentr&   s       r   ÚvalidaterC   n   sh   € ä�V‹_€FÜ ›Ñ€FˆD�$á€Mˆ6Ü�fÓ Ò"ÜÓÐÜ�dÓ˜qÒ ÜÓÐØ”U˜4“[Ñ ÜÓ Ð Ø€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r@   F)ÚboolrC   ÚValidationErrorr)   s    r   Úis_validrG   }   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó   — t        | «      S )z8Reformat the number to the standard presentation format.)r   r)   s    r   ÚformatrI   …   s   € ä�6‹?Ðr   )r   ÚstrÚreturnrJ   )r   rJ   rK   ztuple[str | None, str, str])r   rJ   rK   údict[str, str])r   rJ   rK   rL   )r   rJ   rK   z
str | None)r   rJ   rK   r5   )r   rJ   rK   rE   )Ú__doc__Ú
__future__r   ÚreÚstdnum.exceptionsÚstdnum.utilr   Úcompiler   r   r   r$   r    r*   r>   rC   rG   rI   © r   r   ú<module>rT      s]   ðñ*õ< #ã 	ä Ý ð �"—*‘*ØJóL€ó
óKóóó#ó
Kó
óôr   