Ë
    Ã?Æiñ
  ã                  óJ   — d Z ddlmZ ddlZddl­ ddlmZ d	d„Zd	d„Zd
d„Z	y)a¹  Identiteitskaartnummer, Paspoortnummer (the Dutch passport number).

Each Dutch passport has an unique number of 9 alphanumerical characters.
The first 2 characters are always letters and the last character is a number.
The 6 characters in between can be either.

The letter "O" is never used to prevent it from being confused with the number "0".
Zeros are allowed, but are not used in numbers issued after December 2019.

More information:

* https://www.rvig.nl/node/356
* https://nl.wikipedia.org/wiki/Paspoort#Nederlands_paspoort

>>> compact('EM0000000')
'EM0000000'
>>> compact('XR 1001R5 8')
'XR1001R58'
>>> validate('EM0000000')
'EM0000000'
>>> validate('XR1001R58')
'XR1001R58'
>>> validate('XR1001R')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('581001RXR')
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> validate('XR1O01R58')
Traceback (most recent call last):
    ...
InvalidComponent: ...
é    )ÚannotationsN)Ú*)Úcleanc                óR   — t        | d«      j                  «       j                  «       S )z‰Convert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding white space.ú )r   ÚstripÚupper©Únumbers    úg/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/nl/identiteitskaartnummer.pyÚcompactr   A   s#   € ô �˜Ó×#Ñ#Ó%×+Ñ+Ó-Ð-ó    c                ó¼   — t        | «      } t        | «      dk7  r
t        «       ‚t        j                  d| «      s
t        «       ‚d| v rt        t        d«      «      ‚| S )zgCheck if the number is a valid passport number.
    This checks the length, formatting and check digit.é	   z^[A-Z]{2}[0-9A-Z]{6}[0-9]$ÚOzThe letter 'O' is not allowed)r   ÚlenÚInvalidLengthÚreÚmatchÚInvalidFormatÚInvalidComponentr
   s    r   Úvalidater   G   sV   € ô �V‹_€FÜ
ˆ6ƒ{�aÒÜ‹oÐÜ�8‰8Ð0°&Ô9Ü‹oÐØ
ˆf�}ÜÔ/Ð0OÓPÓQÐQØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z5Check if the number is a valid Dutch passport number.F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   T   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡")r   ÚstrÚreturnr   )r   r   r   r   )
Ú__doc__Ú
__future__r   r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   © r   r   ú<module>r$      s(   ðñ*"õH #ã 	ä Ý ó.ó
ôr   