Ë
    Ã?Æi‰	  ã                  óF   — 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	y)a*  Postcode (the Spanish postal code).

The Spanish postal code consists of five digits where the first two digits,
ranging 01 to 52, correspond either to one of the 50 provinces of Spain or to
one of the two autonomous cities on the African coast.

More information:

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

>>> validate('01000')
'01000'
>>> validate('52000')
'52000'
>>> validate('00000')
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('53000')
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('99999')
Traceback (most recent call last):
    ...
InvalidComponent: ...
>>> validate('5200')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('520000')
Traceback (most recent call last):
    ...
InvalidLength: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )z1Convert the number to the minimal representation.ú )r   Ústrip©Únumbers    ú\/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/es/postal_code.pyÚcompactr   ?   s   € ä�˜Ó×#Ñ#Ó%Ð%ó    c                ó¼   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚d| dd cxk  rdk  st        «       ‚ t        «       ‚| S )ú4Check if the number provided is a valid postal code.é   Ú01Né   Ú52)r   ÚlenÚInvalidLengthr   ÚInvalidFormatÚInvalidComponentr
   s    r   Úvalidater   D   s^   € ä�V‹_€FÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�FÔÜ‹oÐØ�6˜"˜1�:Ô% Ò%ÜÓ Ð ð &ÜÓ Ð Ø€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   P   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr   )r   r   r   r   )
Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   © r   r   ú<module>r%      s%   ðñ*"õH #ä ß 'ó&ó
	ôr   