
    ,h	                        S SK Jr  S SKrS SKrSSKJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  SS	KJr  SS
KJr   " S S\\   5      r " S S\\\   5      r " S S\\\   5      rg)    )annotationsN   )_CompactJSON)base64_decode)base64_encode)
BadPayload)_PDataSerializer)
Serializer)TimedSerializerc                  j   ^  \ rS rSr% Sr\rS\S'   SS.         S
U 4S jjjrSU 4S jjr	S	r
U =r$ )URLSafeSerializerMixin   zMixed in with a regular serializer it will attempt to zlib
compress the string to make it shorter if necessary. It will also
base64 encode the string so that it can safely be placed in a URL.
z_PDataSerializer[str]default_serializerN)
serializerc               2  > SnUR                  S5      (       a  USS  nSn [        U5      nU(       a   [        R
                  " U5      n[        TU ]  " U/UQ70 UD6$ ! [         a  n[        SUS9UeS nAff = f! [         a  n[        SUS9UeS nAff = f)NF   .r   Tz;Could not base64 decode the payload because of an exception)original_errorzACould not zlib decompress the payload before decoding the payload)
startswithr   	Exceptionr   zlib
decompresssuperload_payload)	selfpayloadr   argskwargsr   jsone	__class__s	           M/var/www/auris/envauris/lib/python3.13/site-packages/itsdangerous/url_safe.pyr   #URLSafeSerializerMixin.load_payload   s     
d##abkGJ	 )D t, w#D:4:6::  	M  	   W#$ s.   A A< 
A9)A44A9<
BBBc                   > [         TU ]  U5      nSn[        R                  " U5      n[	        U5      [	        U5      S-
  :  a  UnSn[        U5      nU(       a  SU-   nU$ )NFr   Tr   )r   dump_payloadr   compresslenr   )r   objr   is_compressed
compressedbase64dr    s         r!   r$   #URLSafeSerializerMixin.dump_payload7   s^    w#C(]]4(
z?c$i!m,D M%WnG     )
r   bytesr   t.Anyr   zt.Any | Noner   r/   returnr/   )r'   r/   r0   r.   )__name__
__module____qualname____firstlineno____doc__r   r   __annotations__r   r$   __static_attributes____classcell__)r    s   @r!   r   r      s`    
 1=-< $(	;; ; !	;
 ; 
; ;@ r,   r   c                      \ rS rSrSrSrg)URLSafeSerializerH   zWorks like :class:`.Serializer` but dumps and loads into a URL
safe string consisting of the upper and lowercase character of the
alphabet as well as ``'_'``, ``'-'`` and ``'.'``.
r-   Nr1   r2   r3   r4   r5   r7   r-   r,   r!   r:   r:   H       r,   r:   c                      \ rS rSrSrSrg)URLSafeTimedSerializerO   zWorks like :class:`.TimedSerializer` but dumps and loads into a
URL safe string consisting of the upper and lowercase character of
the alphabet as well as ``'_'``, ``'-'`` and ``'.'``.
r-   Nr<   r-   r,   r!   r?   r?   O   r=   r,   r?   )
__future__r   typingtr   _jsonr   encodingr   r   excr   r   r	   r
   timedr   strr   r:   r?   r-   r,   r!   <module>rI      s[    "    # #  ( " "6Z_ 6r.
3 3_S5I r,   