ó
    ýÞ j�  ã                  ó˜   • S SK Jr  S SKJrJrJr   " S S\5      r\ " S S\5      5       r " S S\5      r    SS	 jr	 " S
 S\5      r
g)é    )Úannotations)ÚAnyÚProtocolÚruntime_checkablec                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚUntypedSerializerProtocolé   z:Protocol for serialization and deserialization of objects.c                ó   • g ©N© ©ÚselfÚobjs     ÚY/var/www/html/gaurav/venv/lib/python3.13/site-packages/langgraph/checkpoint/serde/base.pyÚdumpsÚUntypedSerializerProtocol.dumps	   s   € ¨ó    c                ó   • g r   r   ©r   Údatas     r   ÚloadsÚUntypedSerializerProtocol.loads   s   € ¨r   r   N)r   r   ÚreturnÚbytes)r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__r   r   r   r   r      s   † ÙDä+ç,r   r   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚSerializerProtocolé   a  Protocol for serialization and deserialization of objects.

- `dumps_typed`: Serialize an object to a tuple `(type, bytes)`.
- `loads_typed`: Deserialize an object from a tuple `(type, bytes)`.

Valid implementations include the `pickle`, `json` and `orjson` modules.
c                ó   • g r   r   r   s     r   Údumps_typedÚSerializerProtocol.dumps_typed   s   € ¸#r   c                ó   • g r   r   r   s     r   Úloads_typedÚSerializerProtocol.loads_typed   s   € ¸3r   r   N©r   r   r   útuple[str, bytes]©r   r+   r   r   )r   r   r   r   r   r%   r(   r    r   r   r   r"   r"      s   † ñô >ç>r   r"   c                  ó2   • \ rS rSrSS jrSS jrS	S jrSrg)
ÚSerializerCompaté   c                ó   • Xl         g r   ©Úserde)r   r2   s     r   Ú__init__ÚSerializerCompat.__init__   s   € Ø�
r   c                ób   • [        U5      R                  U R                  R                  U5      4$ r   )Útyper   r2   r   r   s     r   r%   ÚSerializerCompat.dumps_typed!   s&   € Ü�C‹y×!Ñ! 4§:¡:×#3Ñ#3°CÓ#8Ð8Ð8r   c                ó>   • U R                   R                  US   5      $ )Né   )r2   r   r   s     r   r(   ÚSerializerCompat.loads_typed$   s   € Ø�z‰z×Ñ  Q¡Ó(Ð(r   r1   N)r2   r   r   ÚNoner*   r,   )r   r   r   r   r3   r%   r(   r    r   r   r   r.   r.      s   † ôô9÷)r   r.   c                óF   • [        U [        5      (       d  [        U 5      $ U $ )zmWrap serde old serde implementations in a class with loads_typed and dumps_typed for backwards compatibility.)Ú
isinstancer"   r.   r1   s    r   Úmaybe_add_typed_methodsr>   (   s"   € ô
 �eÔ/×0Ñ0Ü Ó&Ð&à€Lr   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚCipherProtocolé3   zrProtocol for encryption and decryption of data.

- `encrypt`: Encrypt plaintext.
- `decrypt`: Decrypt ciphertext.
c                ó   • g)z?Encrypt plaintext. Returns a tuple `(cipher name, ciphertext)`.Nr   )r   Ú	plaintexts     r   ÚencryptÚCipherProtocol.encrypt:   ó   € àr   c                ó   • g)z*Decrypt ciphertext. Returns the plaintext.Nr   )r   Ú
ciphernameÚ
ciphertexts      r   ÚdecryptÚCipherProtocol.decrypt>   rF   r   r   N)rC   r   r   r+   )rH   ÚstrrI   r   r   r   )r   r   r   r   r   rD   rJ   r    r   r   r   r@   r@   3   s   † ñô÷r   r@   N)r2   z.SerializerProtocol | UntypedSerializerProtocolr   r"   )Ú
__future__r   Útypingr   r   r   r   r"   r.   r>   r@   r   r   r   Ú<module>rO      sc   ðÝ "ç 3Ñ 3ô- ô -ð ô?˜ó ?ó ð?ô)Ð)ô )ðØ9ðàôô�Xõ r   