
    Eqg3                         d Z ddlmZmZmZ ddlmZmZmZmZm	Z	  G d de
          Z G d de          Z G d d	ee          Zd
S )zPhoneNumber object definition   )UnicodeMixinImmutableMixinmutating_method)to_longunicodrprforce_unicodeuc                   <    e Zd ZdZdZdZdZdZdZe	d             Z
dS )	CountryCodeSourcez0The source from which a country code is derived.    r      
      c                 \   |t           j        k    rt          d          S |t           j        k    rt          d          S |t           j        k    rt          d          S |t           j        k    rt          d          S |t           j        k    rt          d          S t          d|z            S )z;Return a string representation of a CountryCodeSource valueUNSPECIFIEDFROM_NUMBER_WITH_PLUS_SIGNFROM_NUMBER_WITH_IDDFROM_NUMBER_WITHOUT_PLUS_SIGNFROM_DEFAULT_COUNTRYzINVALID (%d))r   r   r
   r   r   r   r   )clsvals     J/var/www/html/env/lib/python3.11/site-packages/phonenumbers/phonenumber.py	to_stringzCountryCodeSource.to_string3   s     #///]###%@@@1222%:::+,,,%CCC4555%:::+,,,^c)***    N)__name__
__module____qualname____doc__r   r   r   r   r   classmethodr    r   r   r   r      sZ        :: K "#
 
 %'! + + [+ + +r   r   c                   X    e Zd ZdZddddddej        dfdZd Zd Zd Z	d Z
d Zd	 ZdS )
PhoneNumberzClass representing international telephone numbers.

    This class is hand-created based on phonenumber.proto. Please refer
    to that file for detailed descriptions of the meaning of each field.
    Nc	                    |d | _         nt          |          | _         |d | _        nt          |          | _        t	          |          | _        |d | _        nt          |          | _        |d | _        nt          |          | _        t	          |          | _	        || _
        | j
        t          j        | _
        t	          |          | _        d S N)country_codeintnational_numberr   r	   	extensionitalian_leading_zeroboolnumber_of_leading_zeros	raw_inputcountry_code_sourcer   r   preferred_domestic_carrier_code)	selfr&   r(   r)   r*   r,   r-   r.   r/   s	            r   __init__zPhoneNumber.__init__K   s      $D #L 1 1D" "#'D  #*?#;#;D  'y11*  '(,D%%(,-A(B(BD% #*+/D((+./F+G+GD( 'y11
 $7 #+'8'DD$ 0==\/]/],,,r   c                     d| _         d| _        d| _        d| _        d| _        d| _        t          j        | _        d| _	        dS )z Erase the contents of the objectN)
r&   r(   r)   r*   r,   r-   r   r   r.   r/   r0   s    r   clearzPhoneNumber.clear   sI     #$(!'+$#4#@ /3,,,r   c                 R   |j         |j         | _         |j        |j        | _        |j        |j        | _        |j        |j        | _        |j        |j        | _        |j        |j        | _        |j        t          j        ur|j        | _        |j	        |j	        | _	        dS dS )z@Merge information from another PhoneNumber object into this one.N)
r&   r(   r)   r*   r,   r-   r.   r   r   r/   r0   others     r   
merge_fromzPhoneNumber.merge_from   s    ) % 2D ,#(#8D ?&"_DN%1(-(BD%(4+0+HD(?&"_DN$,=,III','@D$0<383XD000 =<r   c                 d   t          |t                    sdS | j        |j        k    o| j        |j        k    oy| j        |j        k    oit          | j                  t          |j                  k    o?| j        |j        k    o/| j        |j        k    o| j	        |j	        k    o| j
        |j
        k    S )NF)
isinstancer#   r&   r(   r)   r+   r*   r,   r-   r.   r/   r6   s     r   __eq__zPhoneNumber.__eq__   s    %-- 	5!U%77 ^$(==^%/1^ T.//48R3S3SS^ ,0MM	^
 %/1^ (E,EE^ 48]]	_r   c                 .    |                      |           S r%   )r;   r6   s     r   __ne__zPhoneNumber.__ne__   s    ;;u%%%%r   c                     t          d          t          |           j        | j        | j        t          | j                  | j        | j        | j	        t          | j
                  fz  S )Nz%s(country_code=%s, national_number=%s, extension=%s, italian_leading_zero=%s, number_of_leading_zeros=%s, country_code_source=%s, preferred_domestic_carrier_code=%s))r   typer   r&   r(   r   r)   r*   r,   r.   r/   r3   s    r   __repr__zPhoneNumber.__repr__   sm     U V V d$"%T^$$*-)T9::<
< 
	=r   c                    t          d          | j        | j        fz  }| j        |t          d          | j        z  z  }| j        |t          d          | j        z  z  }| j        |t          d          | j        z  z  }| j        t          j        ur|t          d          | j        z  z  }| j	        |t          d          | j	        z  z  }|S )Nz$Country Code: %s National Number: %sz Leading Zero(s): %sz Number of leading zeros: %dz Extension: %sz Country Code Source: %sz$ Preferred Domestic Carrier Code: %s)
r   r&   r(   r*   r,   r)   r.   r   r   r/   )r0   results     r   __unicode__zPhoneNumber.__unicode__   s    ?@@$d&:;<$0f344t7PPPF'3f;<<t?[[[F>%f-..??F#+<+HHHf7884;SSSF/;vDEE;< =Fr   )r   r   r   r   r   r   r1   r4   r8   r;   r=   r@   rC   r!   r   r   r#   r#   D   s          #!%&*)-%6%B15j^ j^ j^ j^Z	4 	4 	4Y Y Y&
_ 
_ 
_& & &= = =    r   r#   c                   8     e Zd ZdZd Ze fd            Z xZS )FrozenPhoneNumberz Immutable version of PhoneNumberc           
          t          | j        | j        | j        t	          | j                  | j        | j        | j        | j	        f          S r%   )
hashr&   r(   r)   r+   r*   r,   r-   r.   r/   r3   s    r   __hash__zFrozenPhoneNumber.__hash__  sN    T&)^$3441^-9; < < 	<r   c                 $   t          |          dk    r[t          |          dk    rHt          |d         t                    r- t          t          |           j        di |d         j         d S  t          t          |           j        |i | d S )Nr   r   r!   )lenr:   r#   superrE   r1   __dict__)r0   argskwargs	__class__s      r   r1   zFrozenPhoneNumber.__init__  s    v;;!D		Q:d1g{3S3S3E#T**3GGd1g6FGGGGG3E#T**3TDVDDDDDr   )r   r   r   r   rH   r   r1   __classcell__)rO   s   @r   rE   rE     sb        **< < < E E E E _E E E E Er   rE   N)r   utilr   r   r   r   r   r   r	   r
   objectr   r#   rE   r!   r   r   <module>rS      s    # #$ @ ? ? ? ? ? ? ? ? ? 8 8 8 8 8 8 8 8 8 8 8 8 8 8*+ *+ *+ *+ *+ *+ *+ *+Z| | | | |, | | |~E E E E E^ E E E E Er   