+
    üÐjè  ã                   ó’   a € R t0 t R t^ RIHtHtHt ^ RIHtHtH	t	  ! R R]
4      tR R ltR R lt/ t] ^ k R	 t ! R
 R4      tR# )a$  
Jabber Identifier support.

This module provides an object to represent Jabber Identifiers (JIDs) and
parse string representations into them with proper checking for illegal
characters, case folding and canonicalisation through
L{stringprep<twisted.words.protocols.jabber.xmpp_stringprep>}.
)ÚDictÚTupleÚUnion)ÚnameprepÚnodeprepÚresourceprepc                   ó   € ] tR t^tRtRtR# )ÚInvalidFormatzL
The given string could not be parsed into a valid Jabber Identifier (JID).
© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r
   ó    ÚD/usr/lib/python3/dist-packages/twisted/words/protocols/jabber/jid.pyr	   r	      s   † õr   r	   c          	      ó�   € V ^8„  d   QhR\         R\        \        \         R3,          \         \        \         R3,          3,          /# )é   Ú	jidstringÚreturnN)Ústrr   r   )Úformats   "r   Ú__annotate__r      s8   € ÷ ,&ñ ,&”Sð ,&œU¤5¬¨d¨Õ#3´S¼%ÄÀTÀ	Õ:JÐ#JÕKñ ,&r   c                óÀ  € RpRpRpV P                  R4      pV P                  R4      pVR8X  d&   VR8X  d   T pMšV ^ V pW^,           R ;'       g    RpMVR8X  d   V ^ V ;'       g    RpW^,           R pM]WE8  d>   V ^ V ;'       g    RpW^,           WEV,
          ,            pW^,           R ;'       g    RpMV ^ V pW^,           R ;'       g    Rp\        WV4      # )a£  
Parse given JID string into its respective parts and apply stringprep.

@param jidstring: string representation of a JID.
@type jidstring: L{str}
@return: tuple of (user, host, resource), each of type L{str} as
         the parsed and stringprep'd parts of the given JID. If the
         given string did not have a user or resource part, the respective
         field in the tuple will hold L{None}.
@rtype: L{tuple}
NÚ@Ú/éÿÿÿÿ)ÚfindÚprep)r   ÚuserÚhostÚresourceÚuser_sepÚres_seps   &     r   Úparser%      s  € ð €DØ€DØ€Hð �~‰~˜cÓ"€HØ�n‰n˜SÓ!€Gà�2„~Ø�bŒ=à‰Dð ˜Q˜wÐ'ˆDØ ¨1¥ Ð/×7Ð7°4‰Hà�bŒ=à˜Q˜xÐ(×0Ð0¨DˆDØ¨�\˜^Ð,‰DàÔ!à   8Ð,×4Ð4°�Ø ¨A¥°ÀhÕ<NÕ0OÐP�Ø$¨q¥[ ]Ð3×;Ð;°t‘ð !  7Ð+�Ø$¨q¥[ ]Ð3×;Ð;°t�ä�˜HÓ%Ð%r   c                óÜ   € V ^8„  d   QhR\         \        R3,          R\        R\         \        R3,          R\        \         \        R3,          \        \         \        R3,          3,          /# )r   r    Nr!   r"   r   ©r   r   r   )r   s   "r   r   r   M   s\   € ÷ ("ñ ("Ü
”�T�	Õ
ð("Ü"%ð("Ü16´s¸D°yÕ1Að("ä
Œ5”�d�ÕœS¤%¬¨T¨	Õ"2Ð2Õ3ñ("r   c                ó¸  € V '       d"    \         P                  ! \        V 4      4      p MRp V'       g   \	        R4      h \
        P                  ! \        V4      4      pT'       d"    \        P                  ! \        T4      4      pMRpYT3#   \         d    \	        R4      hi ; i  \         d    \	        R4      hi ; i  \         d    \	        R4      hi ; i)a(  
Perform stringprep on all JID fragments.

@param user: The user part of the JID.
@type user: L{str}
@param host: The host part of the JID.
@type host: L{str}
@param resource: The resource part of the JID.
@type resource: L{str}
@return: The given parts with stringprep applied.
@rtype: L{tuple}
zInvalid character in usernameNzServer address required.zInvalid character in hostnamezInvalid character in resource)r   Úpreparer   ÚUnicodeErrorr	   r   r   )r    r!   r"   s   &&&r   r   r   M   sÝ   € ÷  ð	AÜ×#Ò#¤C¨£IÓ.‰Dð ˆçÜÐ6Ó7Ð7ð	AÜ×#Ò#¤C¨£IÓ.ˆD÷ ð	AÜ#×+Ò+¬C°«MÓ:‰Hð ˆà˜Ð!Ð!øô+ ô 	AÜÐ ?Ó@Ð@ð	Aûô ô 	AÜÐ ?Ó@Ð@ð	Aûô ô 	AÜÐ ?Ó@Ð@ð	Aús#   ŠB Á B( Á(C ÂB%Â(B?ÃCc                ó^   € V \         9   d   \         V ,          # \        V 4      pV\         V &   V# )z&
Return interned JID.

@rtype: L{JID}
)Ú__internJIDsÚJID)r   Újs   & r   Ú	internJIDr/   {   s/   € ð ”LÔ Ü˜IÕ&Ð&ä�	‹NˆØ"#Œ�YÑØˆr   c                   ó€   a € ] tR t^Št o RtRV 3R lR lltR tR tR tV 3R lR	 lt	R
 t
R t]tV 3R lR ltRtV tR# )r-   zy
Represents a stringprep'd Jabber ID.

JID objects are hashable so they can be used in sets and as keys in
dictionaries.
Nc          
      ó�   <€ V ^8„  d   QhRS[ S[R3,          RS[ S[S[ S[R3,          S[S[ S[R3,          3,          R3,          /# )r   r   NÚtupler'   )r   Ú__classdict__s   "€r   r   ÚJID.__annotate__’   sP   ø€ ÷ ñ á‘3˜�9Õðñ ‘U™5¡ d Õ+©S±%¹¸T¸	Õ2BÐBÕCÀTÐIÕJñr   c                ó˜   € V'       d   \        V4      w  r4pM V'       d   \        V!  w  r4pM\        R 4      hW0n        W@n        WPn        R# )z?You must provide a value for either 'str' or 'tuple' arguments.N)r%   r   ÚRuntimeErrorr    r!   r"   )Úselfr   r2   r    r!   Úress   &&&   r   Ú__init__ÚJID.__init__’   sE   € ÷
 Ü# C›j‰OˆD™ßÜ" E™l‰OˆD™äØQóð ð Œ	ØŒ	ØŽr   c                ót   € V P                   '       d   V P                    RV P                   2# V P                  # )z›
Extract the bare JID as a unicode string.

A bare JID does not have a resource part, so this returns either
C{user@host} or just C{host}.

@rtype: L{str}
r   )r    r!   ©r7   s   &r   ÚuserhostÚJID.userhost¤   s0   € ð �9�9ˆ9Ø—i‘i�[  $§)¡) Ð-Ð-à—9‘9Ðr   c                ó\   € V P                   '       d   \        V P                  4       4      # V # )aO  
Extract the bare JID.

A bare JID does not have a resource part, so this returns a
L{JID} object representing either C{user@host} or just C{host}.

If the object this method is called upon doesn't have a resource
set, it will return itself. Otherwise, the bare JID object will
be created, interned using L{internJID}.

@rtype: L{JID}
)r"   r/   r=   r<   s   &r   ÚuserhostJIDÚJID.userhostJID²   s#   € ð �=�=ˆ=Ü˜TŸ]™]›_Ó-Ð-àˆKr   c                óB  € V P                   '       dV   V P                  '       d)   V P                    RV P                   RV P                   2# V P                    RV P                   2# V P                  '       d   V P                   RV P                   2# V P                  # )z?
Return the string representation of this JID.

@rtype: L{str}
r   r   )r    r"   r!   r<   s   &r   ÚfullÚJID.fullÄ   s~   € ð �9�9ˆ9Ø�}�}ˆ}ØŸ)™)˜ A d§i¡i [°°$·-±-°ÐAÐAàŸ)™)˜ A d§i¡i [Ð1Ð1à�}�}ˆ}ØŸ)™)˜ A d§m¡m _Ð5Ð5à—y‘yÐ r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   Úotherr   )ÚobjectÚbool)r   r3   s   "€r   r   r4   Õ   s   ø€ ÷ "ñ "™Fð "¡tñ "r   c                óð   € \        V\        4      '       d\   V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # \
        # )z¹
Equality comparison.

L{JID}s compare equal if their user, host and resource parts all
compare equal.  When comparing against instances of other types, it
uses the default comparison.
)Ú
isinstancer-   r    r!   r"   ÚNotImplemented)r7   rF   s   &&r   Ú__eq__Ú
JID.__eq__Õ   sb   € ô �eœS×!Ò!à—	‘	˜UŸZ™ZÑ'÷ 4ð 4Ø—I‘I §¡Ñ+÷4ð 4à—M‘M U§^¡^Ñ3ðô "Ð!r   c                óZ   € \        V P                  V P                  V P                  34      # )zÞ
Calculate hash.

L{JID}s with identical constituent user, host and resource parts have
equal hash values.  In combination with the comparison defined on JIDs,
this allows for using L{JID}s in sets and as dictionary keys.
)Úhashr    r!   r"   r<   s   &r   Ú__hash__ÚJID.__hash__æ   s"   € ô �T—Y‘Y §	¡	¨4¯=©=Ð9Ó:Ð:r   c                ó"   € V P                  4       # )zn
Get unicode representation.

Return the string representation of this JID as a unicode string.
@see: L{full}
©rC   r<   s   &r   Ú__unicode__ÚJID.__unicode__ð   s   € ð �y‰y‹{Ðr   c                ó    <€ V ^8„  d   QhRS[ /# )r   r   )r   )r   r3   s   "€r   r   r4   ü   s   ø€ ÷ 'ñ '™#ñ 'r   c                ó0   € RV P                  4       ,          # )zr
Get object representation.

Returns a string that would create a new JID object that compares equal
to this one.
zJID(%r)rS   r<   s   &r   Ú__repr__ÚJID.__repr__ü   s   € ð ˜4Ÿ9™9›;Õ&Ð&r   )r!   r"   r    )NN)r   r   r   r   r   r9   r=   r@   rC   rL   rP   rT   Ú__str__rX   r   Ú__classdictcell__)r3   s   @r   r-   r-   Š   sH   ø‡ € ñ÷ò ò$òò$!÷""ð "ò";òð €G÷'ö 'r   r-   c                óZ   € V ^8„  d   Qh/ ^ \         9   d   \        \        R3,          ;R&   # )r   r-   r,   )Ú__conditional_annotations__r   r   )r   s   "r   r   r      s)   € ÷ ñ ÷d $Ò #Œd”3˜�:ÕÑ #òer   N)r]   r   Útypingr   r   r   Ú.twisted.words.protocols.jabber.xmpp_stringprepr   r   r   Ú	Exceptionr	   r%   r   r,   r/   r-   r   )r]   s   @r   Ú<module>ra      sP   øðö÷ &Ñ %÷ñ ô�Iô õ,&õ^("ðV "$€Ó #ò÷y'ó y'r   