Ë
    Ã?Æid
  ã                  óR   — d Z ddlm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y	)aá  BN (Canadian Business Number).

A Business Number (BN) is a 9-digit identification number for businesses
issued by the Canada Revenue Agency for tax purposes. The 9-digit number can
be followed by two letters (program identifier) and 4 digits (reference
number) to form a program account (or BN15).

More information:

* https://www.canada.ca/en/services/taxes/business-number.html
* https://www.ic.gc.ca/app/scr/cc/CorporationsCanada/fdrlCrpSrch.html?locale=en_CA/

>>> validate('12302 6635')
'123026635'
>>> validate('12302 6635 RC 0001')
'123026635RC0001'
>>> validate('123456783')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('12345678Z')
Traceback (most recent call last):
    ...
InvalidFormat: ...
é    )Úannotations)Úluhn)Ú*)Ú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    úS/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ca/bn.pyÚcompactr   5   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                ó  — t        | «      } t        | «      dvr
t        «       ‚t        | dd «      s
t	        «       ‚t        j                  | dd «       t        | «      dk(  r)| dd dvr
t        «       ‚t        | dd «      s
t	        «       ‚| S )zbCheck if the number is a valid BN or BN15. This checks the length,
    formatting and check digit.)é	   é   Nr   r   é   )ÚRCÚRMÚRPÚRT)r   ÚlenÚInvalidLengthr   ÚInvalidFormatr   ÚvalidateÚInvalidComponentr
   s    r   r   r   ;   sˆ   € ô �V‹_€FÜ
ˆ6ƒ{˜'Ñ!Ü‹oÐÜ�F˜2˜A�JÔÜ‹oÐÜ‡M�M�&˜˜!�*ÔÜ
ˆ6ƒ{�bÒØ�!�Bˆ<Ð7Ñ7Ü"Ó$Ð$Ü˜˜r˜s˜Ô$Ü“/Ð!Ø€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z*Check if the number is a valid BN or BN15.F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   L   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr    )r   r    r!   r   )Ú__doc__Ú
__future__r   Ústdnumr   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   © r   r   ú<module>r(      s'   ðñ(õ4 #å Ü ß 'ó'óô"r   