
    i                     p    S SK r S SKJr  S SKrS SKJr  S SKJr  \ R                  " \5      r " S S5      r	g)    N)Union)raw)typesc                   >    \ rS rSrSSS\S\S\S\SS	\4   4
S
 jrSrg)SignIn   selfzpyrogram.Clientphone_numberphone_code_hash
phone_codereturnz
types.Userztypes.TermsOfServicec                   #    UR                  S5      nU R                  [        R                  R                  R                  UUUS95      I Sh  vN n[        U[        R                  R                  R                  5      (       a9  UR                  (       a'  [        R                  R                  UR                  S9$ gU R                  R                  UR                  R                  5      I Sh  vN   U R                  R!                  S5      I Sh  vN   [        R"                  R                  XR                  5      $  N NR N17f)aH  Authorize a user in Telegram with a valid confirmation code.

.. include:: /_includes/usable-by/users.rst

Parameters:
    phone_number (``str``):
        Phone number in international format (includes the country prefix).

    phone_code_hash (``str``):
        Code identifier taken from the result of :meth:`~pyrogram.Client.send_code`.

    phone_code (``str``):
        The valid confirmation code you received (either as Telegram message or as SMS in your phone number).

Returns:
    :obj:`~pyrogram.types.User` | :obj:`~pyrogram.types.TermsOfService` | bool: On success, in case the
    authorization completed, the user is returned. In case the phone number needs to be registered first AND the
    terms of services accepted (with :meth:`~pyrogram.Client.accept_terms_of_service`), an object containing
    them is returned. In case the phone number needs to be registered, but the terms of services don't need to
    be accepted, False is returned instead.

Raises:
    BadRequest: In case the arguments are invalid.
    SessionPasswordNeeded: In case a password is needed to sign in.
z +)r
   r   r   N)terms_of_serviceF)stripinvoker   	functionsauthr   
isinstancer   AuthorizationSignUpRequiredr   TermsOfService_parsestorageuser_iduseridis_botUser)r	   r
   r   r   rs        J/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/auth/sign_in.pysign_inSignIn.sign_in   s     > $))$/++MM%%) /% & 
 
 aCCDD!!++22ADVDV2WW,,&&qvvyy111,,%%e,,,::$$T6622#
 2,s7   AE	EB"E	2E3"E	E.E	E	E	 N)	__name__
__module____qualname____firstlineno__strr   boolr    __static_attributes__r"       r   r   r      sB    232323 23 	23
 
|3T9	:23r*   r   )
loggingtypingr   pyrogramr   r   	getLoggerr#   logr   r"   r*   r   <module>r0      s0   &     !33 33r*   