§
    ZŠtjÂ  ã                   ój   — d Z ddlmZmZ ddlmZmZ ddlmZ ej	        dd„¦   «         Z
d„ Zd	„ Zd
„ ZdS )z½
oauthlib.parameters
~~~~~~~~~~~~~~~~~~~

This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec.

.. _`section 3.5`: https://tools.ietf.org/html/rfc5849#section-3.5
é    )ÚurlparseÚ
urlunparse)Úextract_paramsÚ	urlencodeé   )ÚutilsNc                 óH  — |pi }g }| D ]X\  }}t          j        |¦  «        }t          j        |¦  «        }d                     ||¦  «        }|                     |¦  «         ŒYd                     |¦  «        }	|rd|z  |	z   }	d|	z  }
i }|                     |¦  «         |
|d<   |S )a  **Prepare the Authorization header.**
    Per `section 3.5.1`_ of the spec.

    Protocol parameters can be transmitted using the HTTP "Authorization"
    header field as defined by `RFC2617`_ with the auth-scheme name set to
    "OAuth" (case insensitive).

    For example::

        Authorization: OAuth realm="Example",
            oauth_consumer_key="0685bd9184jfhq22",
            oauth_token="ad180jjd733klru7",
            oauth_signature_method="HMAC-SHA1",
            oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D",
            oauth_timestamp="137131200",
            oauth_nonce="4572616e48616d6d65724c61686176",
            oauth_version="1.0"


    .. _`section 3.5.1`: https://tools.ietf.org/html/rfc5849#section-3.5.1
    .. _`RFC2617`: https://tools.ietf.org/html/rfc2617
    z{}="{}"z, zrealm="%s", zOAuth %sÚAuthorization)r   ÚescapeÚformatÚappendÚjoinÚupdate)Úoauth_paramsÚheadersÚrealmÚ%authorization_header_parameters_partsÚoauth_parameter_nameÚvalueÚescaped_nameÚescaped_valueÚpartÚauthorization_header_parametersÚauthorization_headerÚfull_headerss               ú`/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/oauthlib/oauth1/rfc5849/parameters.pyÚprepare_headersr      sê   € ð0 ˆm˜€Gð -/Ð)Ø'3ð ;ð ;Ñ#Ð˜eõ
 ”|Ð$8Ñ9Ô9ˆÝœ UÑ+Ô+ˆð
 ×Ò ¨mÑ<Ô<ˆà-×4Ò4°TÑ:Ô:Ð:Ð:ð '+§i¢iØ-ñ'/ô '/Ð#ð ð Là+9¸EÑ+AØ+Jñ,KÐ'ð &Ð(GÑGÐð €LØ×Ò˜Ñ Ô Ð Ø$8€L�Ñ!ØÐó    c                 ó|   — t          |¦  «        }|                     | ¦  «         |                     d„ ¬¦  «         |S )a>  Append OAuth params to an existing set of parameters.

    Both params and oauth_params is must be lists of 2-tuples.

    Per `section 3.5.2`_ and `3.5.3`_ of the spec.

    .. _`section 3.5.2`: https://tools.ietf.org/html/rfc5849#section-3.5.2
    .. _`3.5.3`: https://tools.ietf.org/html/rfc5849#section-3.5.3

    c                 ó8   — | d                               d¦  «        S )Nr   Úoauth_)Ú
startswith)Úis    r   ú<lambda>z _append_params.<locals>.<lambda>i   s   € ˜a œdŸošo¨hÑ7Ô7€ r   )Úkey)ÚlistÚextendÚsort)r   ÚparamsÚmergeds      r   Ú_append_paramsr+   X   s@   € õ �&‰\Œ\€FØ
‡M‚M�,ÑÔÐð
 ‡K‚KÐ7Ð7€KÑ8Ô8Ð8Ø€Mr   c                 ó"   — t          | |¦  «        S )z—Prepare the Form-Encoded Body.

    Per `section 3.5.2`_ of the spec.

    .. _`section 3.5.2`: https://tools.ietf.org/html/rfc5849#section-3.5.2

    )r+   )r   Úbodys     r   Úprepare_form_encoded_bodyr.   m   s   € õ ˜,¨Ñ-Ô-Ð-r   c                 ó°   — t          |¦  «        \  }}}}}}t          t          | t          |¦  «        pg ¦  «        ¦  «        }t	          ||||||f¦  «        S )z—Prepare the Request URI Query.

    Per `section 3.5.3`_ of the spec.

    .. _`section 3.5.3`: https://tools.ietf.org/html/rfc5849#section-3.5.3

    )r   r   r+   r   r   )r   ÚuriÚschÚnetÚpathÚparÚqueryÚfras           r   Úprepare_request_uri_queryr7   y   sb   € õ '/¨s¡m¤mÑ#€Cˆˆd�C˜ ÝÝ�|¥^°EÑ%:Ô%:Ð%@¸bÑAÔAñCô C€Eå�s˜C  s¨E°3Ð7Ñ8Ô8Ð8r   )NN)Ú__doc__Úurllib.parser   r   Úoauthlib.commonr   r   Ú r   Úfilter_paramsr   r+   r.   r7   © r   r   ú<module>r>      s³   ððð ð .Ð -Ð -Ð -Ð -Ð -Ð -Ð -à 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5à Ð Ð Ð Ð Ð ð
 ÔðBð Bð Bñ ÔðBðJð ð ð*	.ð 	.ð 	.ð9ð 9ð 9ð 9ð 9r   