+
    P(i                         R t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t
 ^RIHt ^RIHt Rt]! ]4      ]! R4      ,          t]P"                  ! R	4      tR
 tR tR tRR ltRR ltR tR tR tRR R lltR# )zWauthlib.util.urls.
~~~~~~~~~~~~~~~~~

Wrapper functions for URL encoding and decoding.
Nquote)unquote)	urlencode)to_bytes)
to_unicodezAABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-z=&;:%+~,*@!()/?z&%[^0-9A-Fa-f]|%[0-9A-Fa-f][^0-9A-Fa-f]c                     . pV  F*  w  r#VP                  \        V4      \        V4      34       K,  	  \        \        V4      4      # N)appendr   r   
_urlencode)paramsencodedkvs   &   Y/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/authlib/common/urls.py
url_encoder      s<    GXa[12 j)**    c                r   V '       d?   \        V 4      \        8:  g+   Rp\        V\        V 4      \        ,
          V 3,          4      h\        P	                  V 4      '       d   \        R4      h\
        P                  ! V RR7      p. pV F*  w  rEVP                  \        V4      \        V4      34       K,  	  V# )aj  Decode a query string in x-www-form-urlencoded format into a sequence
of two-element tuples.

Unlike urlparse.parse_qsl(..., strict_parsing=True) urldecode will enforce
correct formatting of the query string by validation. If validation fails
a ValueError will be raised. urllib.parse_qsl will only raise errors if
any of name-value pairs omits the equals sign.
zError trying to decode a non urlencoded string. Found invalid characters: %s in the string: '%s'. Please ensure the request/response body is x-www-form-urlencoded.z%Invalid hex encoding in query string.Tkeep_blank_values)	set
urlencoded
ValueErrorINVALID_HEX_PATTERNsearchurlparse	parse_qslr
   r   )queryerrorr   decodedr   r   s   &     r   
url_decoder       s     SZ:-% 	 #e*z"95!AABB !!%((@AA& >F G
1z!}56 Nr   c                    \        V\        4      '       d   VP                  4       p\        P                  ! V RR7      pVP                  V4       \        V4      # )z)Extend a query with a list of two-tuples.Tr   )
isinstancedictitemsr   r   extendr   )r   r   qss   && r   add_params_to_qsr'   Q   sB    &$			ET	:BIIfb>r   c                    \         P                   ! V 4      w  r4rVrxV'       d   \        W4      pM\        Wq4      p\         P                  ! W4WVWx34      # )z5Add a list of two-tuples to the uri query components.)r   r'   
urlunparse)	urir   fragmentschnetpathparr   fras	   &&&      r   add_params_to_urir1   [   sH    &.&7&7&<#Cds+ /$U@AAr   c                 >    \        \        \        V 4      V4      4      # r	   )r   _quoter   )ssafes   &&r   r   r   e   s    fXa[$/00r   c                 *    \        \        V 4      4      # r	   )r   _unquoter4   s   &r   r   r   i   s    hqk""r   c                     \        V R 4      # )s   ~@#$&()*!+=:;,.?/'r   r8   s   &r   	quote_urlr:   m   s    )**r   c                   \        V \        \        34      '       d    \        V 4      p \        V \        4      '       dC   . pV P                  4        F*  w  r#VP                  \        V4      \        V4      34       K,  	  V# V '       g   R#  \        V 4      #   \        \
        3 d     R# i ; i  \
         d     R# i ; i)a  Extract parameters and return them as a list of 2-tuples.

Will successfully extract parameters from urlencoded query strings,
dicts, or lists of 2-tuples. Empty strings/dicts/lists will return an
empty list of parameters. Any other input will result in a return
value of None.
N)
r"   listtupler#   	TypeErrorr   r$   r
   r   r    )rawr   r   r   s   &   r   extract_paramsr@   q   s     #e}%%	s)C #tIIKDAMM:a=*Q-89  # :& 		  s#   B 
B/ B,+B,/B>=B>c                $    V ^8  d   QhR\         /# )   url)str)formats   "r   __annotate__rF      s      c r   c                     \         P                   ! V 4      pVP                  ;'       d0    VP                  ;'       d    T;'       g    VP                  '       * # r	   )r   schemehostnamer+   )rC   fragments_allowedparseds   && r   is_valid_urlrL      sB    s#FXX&//XX/@/W/WDWr   )F)   /)T)__doc__reurllib.parseparser   r   r3   r   r7   r   r   encodingr   r   always_safer   r   compiler   r   r    r'   r1   r:   r@   rL    r   r   <module>rV      s    
  ( , 0   Q$5 66
jj!JK +2jB1#+: r   