+
    ÁFñj]Y  ã                   óp  € R t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
HtHt ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHtHt ^ R
IHt ^ RIHtHtHtHtHtHt Rt Rt!]
! R]R7      t"R R lt#R R lt$R R lt% ! R R]PL                  4      t' ! R R]PP                  4      t) ! R R]]]]3,          4      t*R# )z1This module contains the PicklePersistence class.N)ÚCallable)Údeepcopy)ÚPath)ÚAnyÚTypeVarÚcastÚoverload)ÚBotÚTelegramObject)ÚFilePathInput)Úwarn)ÚBasePersistenceÚPersistenceInput)ÚContextTypes)ÚBDÚCDÚUDÚCDCDataÚConversationDictÚConversationKeyz/a known bot replaced by PTB's PicklePersistencez2an unknown bot replaced by PTB's PicklePersistenceÚTelegramObj)Úboundc                ór   € V ^8„  d   QhR\         \        ,          R\        \         \        ,          ,          /# ©é   ÚclsÚreturn)Útyper   Úset)Úformats   "ÚU/opt/hermes-site/venv/lib/python3.14/site-packages/telegram/ext/_picklepersistence.pyÚ__annotate__r!   (   s-   € ÷ Vñ VœœkÕ*ð V¬s´4¼Õ3DÕ/Eñ Vó    c           	     ó¨   € V P                  4       p\        V4      P                  V UUu. uF  p\        V4       F  q3NK  	  K  	  upp4      # u uppi )zkGets all subclasses of the specified object, recursively. from
https://stackoverflow.com/a/3862957/9706202
)Ú__subclasses__r   ÚunionÚ_all_subclasses)r   Ú
subclassesÚcÚss   &   r    r&   r&   (   sH   € ð ×#Ñ#Ó%€JÜˆz‹?× Ñ ©ZÔ!T©Z¨ÄÐQRÖAS¸A¢!ÑAS¡!©ZÒ!TÓUÐUùÓ!Ts   ªA
c                óR   € V ^8„  d   QhR\         \        ,          R\        R\        /# )r   r   Úkwargsr   )r   r   Údict)r   s   "r    r!   r!   0   s&   € ÷ 	ñ 	œœkÕ*ð 	´Dð 	¼[ñ 	r"   c                óJ   € V P                  V 4      pVP                  V4       V# )am  
This method is used for unpickling. The data, which is in the form a dictionary, is
converted back into a class. Works mostly the same as :meth:`TelegramObject.__setstate__`.
This function should be kept in place for backwards compatibility even if the pickling logic
is changed, since `_custom_reduction` places references to this function into the pickled data.
)Ú__new__Ú__setstate__)r   r+   Úobjs   && r    Ú_reconstruct_tor1   0   s%   € ð �+‰+�cÓ
€CØ×Ñ�VÔØ€Jr"   c                óŠ   € V ^8„  d   QhR\         R\        \        \        \        \         ,          \        3,          3,          /# r   ©r   Útupler   r   r,   )r   s   "r    r!   r!   <   s4   € ÷ 	2ñ 	2œ;ð 	2¬5´¼5ÄÄkÕARÔTXÐAXÕ;YÐ1YÕ+Zñ 	2r"   c                óx   € V P                  RR7      p\        VR,          4      VR&   \        V P                  V33# )zt
This method is used for pickling. The bot attribute is preserved so _BotPickler().persistent_id
works as intended.
T)Úinclude_privateÚ
api_kwargs)Ú
_get_attrsr,   r1   Ú	__class__)r   Údatas   & r    Ú_custom_reductionr;   <   s>   € ð
 �>‰>¨$ˆ>Ó/€Dô ˜d <Õ0Ó1€DˆÑÜ˜SŸ]™]¨DÐ1Ð1Ð1r"   c                   óf   a a€ ] tR t^Ht oRtV3R lV 3R lltV3R lR ltV3R lR ltRtVt	V ;t
# )Ú_BotPicklerc                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# ©r   ÚbotÚargsr+   ©r	   r   )r   Ú__classdict__s   "€r    r!   Ú_BotPickler.__annotate__K   ó"   ø€ ÷ *ñ *™Cð *©ð *±sñ *r"   c                ó4   <€ Wn         \        SV `  ! V/ VB  R # ©N©Ú_botÚsuperÚ__init__©Úselfr@   rA   r+   r9   s   &&*,€r    rK   Ú_BotPickler.__init__K   ó   ø€ ØŒ	Ü‰Ò˜$Ð) &Ô)r"   c                ób   <€ V ^8„  d   QhRS[ RS[S[S[S[S[ ,          S[3,          3,          /# )r   r0   r   r3   )r   rC   s   "€r    r!   rD   O   s6   ø€ ÷ 
&ñ 
&Ùð
&á	‰x™™t¡KÕ0±$Ð6Õ7Ð7Õ	8ñ
&r"   c                óP   € \        V\        4      '       g   \        # \        V4      # )zt
This method is used for pickling. The bot attribute is preserved so
_BotPickler().persistent_id works as intended.
)Ú
isinstancer
   ÚNotImplementedr;   ©rM   r0   s   &&r    Úreducer_overrideÚ_BotPickler.reducer_overrideO   s"   € ô ˜#œ~×.Ò.Ü!Ð!ä  Ó%Ð%r"   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# )r   r0   r   N)ÚobjectÚstr)r   rC   s   "€r    r!   rD   [   s   ø€ ÷ ñ ¡ð ©C°$­Jñ r"   c                ó‚   € WP                   J d   \        # \        V\        4      '       d   \	        R^R7       \
        # R# )z’Used to 'mark' the Bot, so it can be replaced later. See
https://docs.python.org/3/library/pickle.html#pickle.Pickler.persistent_id for more info
zHUnknown bot instance found. Will be replaced by `None` during unpickling)Ú
stacklevelN)rI   Ú_REPLACED_KNOWN_BOTrR   r	   r   Ú_REPLACED_UNKNOWN_BOTrT   s   &&r    Úpersistent_idÚ_BotPickler.persistent_id[   s:   € ð —)‘)ÓÜ&Ð&Ü�cœ3×ÒÜØZØõô )Ð(Ùr"   ©rI   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú	__slots__rK   rU   r^   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r9   rC   s   @@r    r=   r=   H   s-   ù‡ € Ø€I÷*ó *÷
&ð 
&÷÷ ð r"   r=   c                   óT   a a€ ] tR t^jt oRtV3R lV 3R lltV3R lR ltRtVtV ;t	# )Ú_BotUnpicklerc                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# r?   rB   )r   rC   s   "€r    r!   Ú_BotUnpickler.__annotate__m   rE   r"   c                ó4   <€ Wn         \        SV `  ! V/ VB  R # rG   rH   rL   s   &&*,€r    rK   Ú_BotUnpickler.__init__m   rO   r"   c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# )r   Úpidr   N)rY   r	   )r   rC   s   "€r    r!   rm   q   s#   ø€ ÷ Uñ U¡3ð U©3°­:ñ Ur"   c                óv   € V\         8X  d   V P                  # V\        8X  d   R# \        P                  ! R4      h)zSReplaces the bot with the current bot if known, else it is replaced by :obj:`None`.Nz,Found unknown persistent id when unpickling!)r\   rI   r]   ÚpickleÚUnpicklingError)rM   rq   s   &&r    Úpersistent_loadÚ_BotUnpickler.persistent_loadq   s3   € àÔ%Ô%Ø—9‘9ÐØÔ'Ô'ÙÜ×$Ò$Ð%SÓTÐTr"   r`   )
ra   rb   rc   rd   re   rK   ru   rf   rg   rh   ri   s   @@r    rk   rk   j   s&   ù‡ € Ø€I÷*ó *÷U÷ Uð Ur"   rk   c                   óò  a a€ ] tR t^zt oRtR0t]R1V3R lR ll4       t]R2V3R lR ll4       tR2V3R lV 3R llltV3R lR	 ltV3R
 lR lt	V3R lR lt
V3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R  lR! ltV3R" lR# ltV3R$ lR% ltV3R& lR' ltV3R( lR) ltV3R* lR+ ltV3R, lR- ltV3R. lR/ ltR0tVtV ;t# )3ÚPicklePersistencea•  Using python's builtin :mod:`pickle` for making your bot persistent.

Attention:
    The interface provided by this class is intended to be accessed exclusively by
    :class:`~telegram.ext.Application`. Calling any of the methods below manually might
    interfere with the integration of persistence into :class:`~telegram.ext.Application`.

Note:
    This implementation of :class:`BasePersistence` uses the functionality of the pickle module
    to support serialization of bot instances. Specifically any reference to
    :attr:`~BasePersistence.bot` will be replaced by a placeholder before pickling and
    :attr:`~BasePersistence.bot` will be inserted back when loading the data.

Examples:
    :any:`Persistent Conversation Bot <examples.persistentconversationbot>`

.. seealso:: :wiki:`Making Your Bot Persistent <Making-your-bot-persistent>`

.. versionchanged:: 20.0

    * The parameters and attributes ``store_*_data`` were replaced by :attr:`store_data`.
    * The parameter and attribute ``filename`` were replaced by :attr:`filepath`.
    * :attr:`filepath` now also accepts :obj:`pathlib.Path` as argument.

Args:
    filepath (:obj:`str` | :obj:`pathlib.Path`): The filepath for storing the pickle files.
        When :attr:`single_file` is :obj:`False` this will be used as a prefix.
    store_data (:class:`~telegram.ext.PersistenceInput`, optional): Specifies which kinds of
        data will be saved by this persistence instance. By default, all available kinds of
        data will be saved.
    single_file (:obj:`bool`, optional): When :obj:`False` will store 5 separate files of
        `filename_user_data`, `filename_bot_data`, `filename_chat_data`,
        `filename_callback_data` and `filename_conversations`. Default is :obj:`True`.
    on_flush (:obj:`bool`, optional): When :obj:`True` will only save to file when
        :meth:`flush` is called and keep data in memory until that happens. When
        :obj:`False` will store data on any transaction *and* on call to :meth:`flush`.
        Default is :obj:`False`.
    context_types (:class:`telegram.ext.ContextTypes`, optional): Pass an instance
        of :class:`telegram.ext.ContextTypes` to customize the types used in the
        ``context`` interface. If not passed, the defaults documented in
        :class:`telegram.ext.ContextTypes` will be used.

        .. versionadded:: 13.6
    update_interval (:obj:`int` | :obj:`float`, optional): The
        :class:`~telegram.ext.Application` will update
        the persistence in regular intervals. This parameter specifies the time (in seconds) to
        wait between two consecutive runs of updating the persistence. Defaults to 60 seconds.

        .. versionadded:: 20.0
Attributes:
    filepath (:obj:`str` | :obj:`pathlib.Path`): The filepath for storing the pickle files.
        When :attr:`single_file` is :obj:`False` this will be used as a prefix.
    store_data (:class:`~telegram.ext.PersistenceInput`): Specifies which kinds of data will
        be saved by this persistence instance.
    single_file (:obj:`bool`): Optional. When :obj:`False` will store 5 separate files of
        `filename_user_data`, `filename_bot_data`, `filename_chat_data`,
        `filename_callback_data` and `filename_conversations`. Default is :obj:`True`.
    on_flush (:obj:`bool`): Optional. When :obj:`True` will only save to file when
        :meth:`flush` is called and keep data in memory until that happens. When
        :obj:`False` will store data on any transaction *and* on call to :meth:`flush`.
        Default is :obj:`False`.
    context_types (:class:`telegram.ext.ContextTypes`): Container for the types used
        in the ``context`` interface.

        .. versionadded:: 13.6
c                óJ   <€ V ^8„  d   QhRRRS[ RS[R,          RS[RS[RS[/# )	r   rM   zAPicklePersistence[dict[Any, Any], dict[Any, Any], dict[Any, Any]]ÚfilepathÚ
store_dataNÚsingle_fileÚon_flushÚupdate_interval)r   r   ÚboolÚfloat)r   rC   s   "€r    r!   ÚPicklePersistence.__annotate__Ë   sJ   ø€ ÷ ñ ØQðáðñ % tÕ+ðñ ð	ñ
 ðñ ñr"   c                ó   € R # rG   © )rM   rz   r{   r|   r}   r~   s   &&&&&&r    rK   ÚPicklePersistence.__init__Ê   s   € ñ r"   c                ó|   <€ V ^8„  d   QhRRRS[ RS[R,          RS[RS[RS[R	S[S[S[S[S[3,          R,          /# )
r   rM   zPicklePersistence[UD, CD, BD]rz   r{   Nr|   r}   r~   Úcontext_types©	r   r   r   r€   r   r   r   r   r   )r   rC   s   "€r    r!   r�   Õ   sf   ø€ ÷ ñ Ø-ðáðñ % tÕ+ðñ ð	ñ
 ðñ ðñ $¡C©©R± OÕ4°tÕ;ñr"   c                ó   € R # rG   rƒ   )rM   rz   r{   r|   r}   r~   r†   s   &&&&&&&r    rK   r„   Ô   s   € ñ r"   c                óx   <€ V ^8„  d   QhRS[ RS[R,          RS[RS[RS[RS[S[S[S[S[3,          R,          /# )r   rz   r{   Nr|   r}   r~   r†   r‡   )r   rC   s   "€r    r!   r�   ß   s^   ø€ ÷ 
ñ 
áð
ñ % tÕ+ð
ñ ð	
ñ
 ð
ñ ð
ñ $¡C©©R± OÕ4°tÕ;ñ
r"   c                óì   <€ \         SV `  W%R 7       \        V4      V n        W0n        W@n        RV n        RV n        RV n        RV n	        RV n
        \        RT;'       g    \        4       4      V n        R# ))r{   r~   NzContextTypes[Any, UD, CD, BD])rJ   rK   r   rz   r|   r}   Ú	user_dataÚ	chat_dataÚbot_dataÚcallback_dataÚconversationsr   r   r†   )rM   rz   r{   r|   r}   r~   r†   r9   s   &&&&&&&€r    rK   r„   ß   sl   ø€ ô 	‰Ñ JÐÔPÜ" 8›nˆŒØ(3ÔØ%-ŒØ/3ˆŒØ/3ˆŒØ#'ˆŒØ-1ˆÔØTXˆÔÜ<@Ø+¨]×-LÐ-L¼l»nó=
ˆÖr"   c                ó   <€ V ^8„  d   QhRR/# ©r   r   Nrƒ   )r   rC   s   "€r    r!   r�   õ   s   ø€ ÷ ^ñ ^ $ñ ^r"   c                ó&  €  V P                   P                  R 4      ;_uu_ 4       p\        V P                  V4      P	                  4       pRRR4       XR,          V n        VR,          V n        VP                  RV P                  P                  4       4      V n	        VP                  R/ 4      V n
        VR,          V n        R#   + '       g   i     L‚; i  \         d@    / T n        / T n        / T n        T P                  P                  4       T n	        RT n
         R# \        P                   d,   pT P                   P                  p\!        RT R24      ThRp?i\"         d)   p\!        R	T P                   P                   24      ThRp?ii ; i)
ÚrbNr‹   rŒ   r�   rŽ   r�   úFile ú# does not contain valid pickle dataú Something went wrong unpickling )rz   Úopenrk   r@   Úloadr‹   rŒ   Úgetr†   r�   rŽ   r�   ÚOSErrorrs   rt   ÚnameÚ	TypeErrorÚ	Exception)rM   Úfiler:   ÚexcÚfilenames   &    r    Ú_load_singlefileÚ"PicklePersistence._load_singlefileõ   sH  € ð	^Ø—‘×#Ñ# D×)Ô)¨TÜ$ T§X¡X¨tÓ4×9Ñ9Ó;�÷ *ð " +Õ.ˆDŒNØ! +Õ.ˆDŒNà ŸH™H Z°×1CÑ1C×1LÑ1LÓ1NÓOˆDŒMØ!%§¡¨/¸2Ó!>ˆDÔØ!% oÕ!6ˆDÖ÷ *×)ûô ô 	&Ø!#ˆDÔØˆDŒNØˆDŒNØ ×.Ñ.×7Ñ7Ó9ˆDŒMØ!%ˆD×Ü×%Ñ%ô 	\Ø—}‘}×)Ñ)ˆHÜ˜e H :Ð-PÐQÓRÐX[Ð[ûÜô 	^ÜÐ>¸t¿}¹}×?QÑ?QÐ>RÐSÓTÐZ]Ð]ûð	^úsN   ‚#C ¥%CÁ
A8C ÃC	ÃC ÃAFÄ FÄ3FÄ4&EÅFÅ'FÅ(#FÆFc                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   rz   r   )r   r   )r   rC   s   "€r    r!   r�     s   ø€ ÷ 
Yñ 
Y¡4ð 
Y©Cñ 
Yr"   c                ó’  €  VP                  R 4      ;_uu_ 4       p\        V P                  V4      P                  4       uuRRR4       #   + '       g   i     R# ; i  \         d     R# \
        P                   d    p\        RTP                   R24      ThRp?i\         d   p\        RTP                   24      ThRp?ii ; i)r“   Nr”   r•   r–   )
r—   rk   r@   r˜   rš   rs   rt   rœ   r›   r�   )rM   rz   rž   rŸ   s   &&  r    Ú
_load_fileÚPicklePersistence._load_file  s£   € ð		YØ—‘˜t×$Ô$¨Ü$ T§X¡X¨tÓ4×9Ñ9Ó;÷ %×$×$Ó$ûô ô 	ÚÜ×%Ñ%ô 	aÜ˜e H§M¡M ?Ð2UÐVÓWÐ]`Ð`ûÜô 	YÜÐ>¸x¿}¹}¸oÐNÓOÐUXÐXûð	YúsQ   ‚A ›$A
¿
A Á
A	ÁA ÁA ÁCÁ,CÁ?CÂ BÂCÂ'CÂ(CÃCc                ó   <€ V ^8„  d   QhRR/# r‘   rƒ   )r   rC   s   "€r    r!   r�     s   ø€ ÷ 	Uñ 	U $ñ 	Ur"   c           
     ól  € R V P                   RV P                  RV P                  RV P                  RV P                  /pV P
                  P                  R4      ;_uu_ 4       p\        V P                  V\        P                  R7      P                  V4       RRR4       R#   + '       g   i     R# ; i)r�   r‹   rŒ   r�   rŽ   Úwb©ÚprotocolN)r�   r‹   rŒ   r�   rŽ   rz   r—   r=   r@   rs   ÚHIGHEST_PROTOCOLÚdump)rM   r:   rž   s   &  r    Ú_dump_singlefileÚ"PicklePersistence._dump_singlefile  sƒ   € à˜T×/Ñ/Ø˜Ÿ™Ø˜Ÿ™Ø˜Ÿ™Ø˜T×/Ñ/ð
ˆð �]‰]×Ñ ×%Ô%¨Ü˜Ÿ™ $´×1HÑ1HÔI×NÑNÈtÔT÷ &×%×%Ò%ús   Á"6B"Â"B3	c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   rz   r:   r   N)r   rX   )r   rC   s   "€r    r!   r�   #  s'   ø€ ÷ Uñ U¡4ð U©vð U¸$ñ Ur"   c                óÜ   € VP                  R 4      ;_uu_ 4       p\        V P                  V\        P                  R7      P                  V4       RRR4       R#   + '       g   i     R# ; i)r©   rª   N)r—   r=   r@   rs   r¬   r­   )rM   rz   r:   rž   s   &&& r    Ú
_dump_fileÚPicklePersistence._dump_file#  sC   € Ø�]‰]˜4× Ô  DÜ˜Ÿ™ $´×1HÑ1HÔI×NÑNÈtÔT÷ !× × Ò ús   š6AÁA+	c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# ©r   r   )r,   Úintr   )r   rC   s   "€r    r!   r�   '  ó   ø€ ÷ (ñ (¡T©#©r¨'¥]ñ (r"   c              ƒ  ó  "  € V P                   '       d   MZV P                  '       g9   V P                  \        V P                   R24      4      pV'       g   / pWn         MV P                  4        \        V P                   4      # 5i)z–Returns the user_data from the pickle file if it exists or an empty :obj:`dict`.

Returns:
    dict[:obj:`int`, :obj:`dict`]: The restored user data.
Ú
_user_data)r‹   r|   r¥   r   rz   r¡   r   ©rM   r:   s   & r    Úget_user_dataÚPicklePersistence.get_user_data'  óe   é € ð �>�>ˆ>ØØ×!×!Ð!Ø—?‘?¤4¨4¯=©=¨/¸Ð(DÓ#EÓFˆDßØ�Ø!�Nà×!Ñ!Ô#Ü˜Ÿ™Ó'Ð'ùó   ‚%B¨ABc                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# rµ   )r,   r¶   r   )r   rC   s   "€r    r!   r�   8  r·   r"   c              ƒ  ó  "  € V P                   '       d   MZV P                  '       g9   V P                  \        V P                   R24      4      pV'       g   / pWn         MV P                  4        \        V P                   4      # 5i)z–Returns the chat_data from the pickle file if it exists or an empty :obj:`dict`.

Returns:
    dict[:obj:`int`, :obj:`dict`]: The restored chat data.
Ú
_chat_data)rŒ   r|   r¥   r   rz   r¡   r   rº   s   & r    Úget_chat_dataÚPicklePersistence.get_chat_data8  r½   r¾   c                ó    <€ V ^8„  d   QhRS[ /# rµ   ©r   )r   rC   s   "€r    r!   r�   I  s   ø€ ÷ 'ñ '¡Bñ 'r"   c              ƒ  ó>  "  € V P                   '       d   MrV P                  '       gQ   V P                  \        V P                   R24      4      pV'       g   V P
                  P                  4       pWn         MV P                  4        \        V P                   4      # 5i)zëReturns the bot_data from the pickle file if it exists or an empty object of type
:obj:`dict` | :attr:`telegram.ext.ContextTypes.bot_data`.

Returns:
    :obj:`dict` | :attr:`telegram.ext.ContextTypes.bot_data`: The restored bot data.
Ú	_bot_data)r�   r|   r¥   r   rz   r†   r¡   r   rº   s   & r    Úget_bot_dataÚPicklePersistence.get_bot_dataI  st   é € ð �=�=ˆ=ØØ×!×!Ð!Ø—?‘?¤4¨4¯=©=¨/¸Ð(CÓ#DÓEˆDßØ×)Ñ)×2Ñ2Ó4�Ø �Mà×!Ñ!Ô#Ü˜Ÿ™Ó&Ð&ùs   ‚%B¨A5Bc                ó.   <€ V ^8„  d   QhRS[ R,          /# r‘   ©r   )r   rC   s   "€r    r!   r�   [  s   ø€ ÷ ,ñ ,©°4­ñ ,r"   c              ƒ  ó.  "  € V P                   '       d   MZV P                  '       g9   V P                  \        V P                   R24      4      pV'       g   RpWn         MV P                  4        V P                   f   R# \        V P                   4      # 5i)a4  Returns the callback data from the pickle file if it exists or :obj:`None`.

.. versionadded:: 13.6

Returns:
    tuple[list[tuple[:obj:`str`, :obj:`float`, dict[:obj:`str`, :class:`object`]]],
    dict[:obj:`str`, :obj:`str`]] | :obj:`None`: The restored metadata or :obj:`None`,
    if no data was stored.
Ú_callback_dataN)rŽ   r|   r¥   r   rz   r¡   r   rº   s   & r    Úget_callback_dataÚ#PicklePersistence.get_callback_data[  sz   é € ð ××ÐØØ×!×!Ð!Ø—?‘?¤4¨4¯=©=¨/¸Ð(HÓ#IÓJˆDßØ�Ø!%Õà×!Ñ!Ô#Ø×ÑÒ%ÙÜ˜×*Ñ*Ó+Ð+ùs   ‚%B¨A-Bc                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   r›   r   )rY   r   )r   rC   s   "€r    r!   r�   r  s   ø€ ÷ 7ñ 7©Cð 7Ñ4Dñ 7r"   c              ƒ  ó<  "  € V P                   '       d   M\V P                  '       g;   V P                  \        V P                   R24      4      pV'       g   V/ /pW n         MV P                  4        V P                   P                  V/ 4      P                  4       # 5i)zÆReturns the conversations from the pickle file if it exists or an empty dict.

Args:
    name (:obj:`str`): The handlers name.

Returns:
    :obj:`dict`: The restored conversations for the handler.
Ú_conversations)r�   r|   r¥   r   rz   r¡   r™   Úcopy)rM   r›   r:   s   && r    Úget_conversationsÚ#PicklePersistence.get_conversationsr  s€   é € ð ××ÐØØ×!×!Ð!Ø—?‘?¤4¨4¯=©=¨/¸Ð(HÓ#IÓJˆDßØ˜b�z�Ø!%Õà×!Ñ!Ô#Ø×!Ñ!×%Ñ% d¨BÓ/×4Ñ4Ó6Ð6ùs   ‚%B¨A4Bc                ó>   <€ V ^8„  d   QhRS[ RS[RS[R,          RR/# )r   r›   ÚkeyÚ	new_stateNr   )rY   r   rX   )r   rC   s   "€r    r!   r�   †  s1   ø€ ÷ (ñ (Ùð(Ù-ð(Ù:@À4½-ð(à	ñ(r"   c              ƒ  ó¢  "  € V P                   '       g   / V n         V P                   P                  V/ 4      P                  V4      V8X  d   R# W0P                   V,          V&   V P                  '       gY   V P                  '       g5   V P                  \        V P                   R24      V P                   4       R# V P                  4        R# R# 5i)a  Will update the conversations for the given handler and depending on :attr:`on_flush`
save the pickle file.

Args:
    name (:obj:`str`): The handler's name.
    key (:obj:`tuple`): The key the state is changed for.
    new_state (:class:`object`): The new state for the given key.
NrÒ   )	r�   Ú
setdefaultr™   r}   r|   r²   r   rz   r®   )rM   r›   r×   rØ   s   &&&&r    Úupdate_conversationÚ%PicklePersistence.update_conversation†  s¡   é € ð ×!×!Ð!Ø!#ˆDÔØ×Ñ×(Ñ(¨¨rÓ2×6Ñ6°sÓ;¸yÔHÙØ(1×Ñ˜4Õ  Ñ%Ø�}�}ˆ}Ø×#×#Ð#Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÖ[à×%Ñ%Ö'ñ	 ùs   ‚BCÂACc                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   Úuser_idr:   r   N©r¶   r   )r   rC   s   "€r    r!   r�   œ  ó"   ø€ ÷ (ñ (©cð (¹ð (Àñ (r"   c              ƒ  ól  "  € V P                   f   / V n         V P                   P                  V4      V8X  d   R# W P                   V&   V P                  '       gY   V P                  '       g5   V P	                  \        V P                   R24      V P                   4       R# V P                  4        R# R# 5i)zøWill update the user_data and depending on :attr:`on_flush` save the pickle file.

Args:
    user_id (:obj:`int`): The user the data might have been changed for.
    data (:obj:`dict`): The :attr:`telegram.ext.Application.user_data` ``[user_id]``.
Nr¹   )r‹   r™   r}   r|   r²   r   rz   r®   )rM   rÞ   r:   s   &&&r    Úupdate_user_dataÚ"PicklePersistence.update_user_dataœ  ó†   é € ð �>‰>Ò!ØˆDŒNØ�>‰>×Ñ˜gÓ&¨$Ô.ÙØ"&�‰�wÑØ�}�}ˆ}Ø×#×#Ð#Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÖSà×%Ñ%Ö'ñ	 ùó   ‚A)B4Á,AB4c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   Úchat_idr:   r   N©r¶   r   )r   rC   s   "€r    r!   r�   ®  rà   r"   c              ƒ  ól  "  € V P                   f   / V n         V P                   P                  V4      V8X  d   R# W P                   V&   V P                  '       gY   V P                  '       g5   V P	                  \        V P                   R24      V P                   4       R# V P                  4        R# R# 5i)zøWill update the chat_data and depending on :attr:`on_flush` save the pickle file.

Args:
    chat_id (:obj:`int`): The chat the data might have been changed for.
    data (:obj:`dict`): The :attr:`telegram.ext.Application.chat_data` ``[chat_id]``.
NrÁ   )rŒ   r™   r}   r|   r²   r   rz   r®   )rM   rç   r:   s   &&&r    Úupdate_chat_dataÚ"PicklePersistence.update_chat_data®  rä   rå   c                ó$   <€ V ^8„  d   QhRS[ RR/# ©r   r:   r   NrÅ   )r   rC   s   "€r    r!   r�   À  s   ø€ ÷ (ñ (©"ð (°ñ (r"   c              ƒ  ó  "  € V P                   V8X  d   R# Wn         V P                  '       gY   V P                  '       g5   V P                  \	        V P
                   R24      V P                   4       R# V P                  4        R# R# 5i)zÔWill update the bot_data and depending on :attr:`on_flush` save the pickle file.

Args:
    data (:obj:`dict` | :attr:`telegram.ext.ContextTypes.bot_data`): The
        :attr:`telegram.ext.Application.bot_data`.
NrÇ   )r�   r}   r|   r²   r   rz   r®   rº   s   &&r    Úupdate_bot_dataÚ!PicklePersistence.update_bot_dataÀ  sc   é € ð �=‰=˜DÔ ÙØŒØ�}�}ˆ}Ø×#×#Ð#Ø—‘¤¨¯© °iÐ%@Ó AÀ4Ç=Á=ÖQà×%Ñ%Ö'ñ	 ùó   ‚=BÁ ABc                ó$   <€ V ^8„  d   QhRS[ RR/# rí   rË   )r   rC   s   "€r    r!   r�   Ð  s   ø€ ÷ (ñ (©wð (¸4ñ (r"   c              ƒ  ó  "  € V P                   V8X  d   R# Wn         V P                  '       gY   V P                  '       g5   V P                  \	        V P
                   R24      V P                   4       R# V P                  4        R# R# 5i)aZ  Will update the callback_data (if changed) and depending on :attr:`on_flush` save the
pickle file.

.. versionadded:: 13.6

Args:
    data (tuple[list[tuple[:obj:`str`, :obj:`float`,                 dict[:obj:`str`, :class:`object`]]], dict[:obj:`str`, :obj:`str`]]):
        The relevant data to restore :class:`telegram.ext.CallbackDataCache`.
NrÍ   )rŽ   r}   r|   r²   r   rz   r®   rº   s   &&r    Úupdate_callback_dataÚ&PicklePersistence.update_callback_dataÐ  sh   é € ð ×Ñ Ô%ÙØ!ÔØ�}�}ˆ}Ø×#×#Ð#Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÖ[à×%Ñ%Ö'ñ	 ùrñ   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   rç   r   N©r¶   )r   rC   s   "€r    r!   r�   ä  ó   ø€ ÷ (ñ (©Cð (°Dñ (r"   c              ƒ  ó:  "  € V P                   f   R# V P                   P                  VR4       V P                  '       gY   V P                  '       g5   V P	                  \        V P                   R24      V P                   4       R# V P                  4        R# R# 5i)zÒWill delete the specified key from the ``chat_data`` and depending on
:attr:`on_flush` save the pickle file.

.. versionadded:: 20.0

Args:
    chat_id (:obj:`int`): The chat id to delete from the persistence.
NrÁ   )rŒ   Úpopr}   r|   r²   r   rz   r®   )rM   rç   s   &&r    Údrop_chat_dataÚ PicklePersistence.drop_chat_dataä  óp   é € ð �>‰>Ò!ÙØ�‰×Ñ˜7 DÔ)à�}�}ˆ}Ø×#×#Ð#Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÖSà×%Ñ%Ö'ñ	 ùó   ‚>BÁBÁABc                ó$   <€ V ^8„  d   QhRS[ RR/# )r   rÞ   r   Nr÷   )r   rC   s   "€r    r!   r�   ÷  rø   r"   c              ƒ  ó:  "  € V P                   f   R# V P                   P                  VR4       V P                  '       gY   V P                  '       g5   V P	                  \        V P                   R24      V P                   4       R# V P                  4        R# R# 5i)zÒWill delete the specified key from the ``user_data`` and depending on
:attr:`on_flush` save the pickle file.

.. versionadded:: 20.0

Args:
    user_id (:obj:`int`): The user id to delete from the persistence.
Nr¹   )r‹   rú   r}   r|   r²   r   rz   r®   )rM   rÞ   s   &&r    Údrop_user_dataÚ PicklePersistence.drop_user_data÷  rý   rþ   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   rÞ   r‹   r   Nrß   )r   rC   s   "€r    r!   r�   
  ó"   ø€ ÷ ñ ©sð ¹rð Àdñ r"   c              ƒ  ó   "  € R# 5i)zjDoes nothing.

.. versionadded:: 13.6
.. seealso:: :meth:`telegram.ext.BasePersistence.refresh_user_data`
Nrƒ   )rM   rÞ   r‹   s   &&&r    Úrefresh_user_dataÚ#PicklePersistence.refresh_user_data
  ó   é ‚ ùó   ‚c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   rç   rŒ   r   Nrè   )r   rC   s   "€r    r!   r�     r  r"   c              ƒ  ó   "  € R# 5i)zjDoes nothing.

.. versionadded:: 13.6
.. seealso:: :meth:`telegram.ext.BasePersistence.refresh_chat_data`
Nrƒ   )rM   rç   rŒ   s   &&&r    Úrefresh_chat_dataÚ#PicklePersistence.refresh_chat_data  r  r	  c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r�   r   NrÅ   )r   rC   s   "€r    r!   r�     s   ø€ ÷ ñ ©rð °dñ r"   c              ƒ  ó   "  € R# 5i)ziDoes nothing.

.. versionadded:: 13.6
.. seealso:: :meth:`telegram.ext.BasePersistence.refresh_bot_data`
Nrƒ   )rM   r�   s   &&r    Úrefresh_bot_dataÚ"PicklePersistence.refresh_bot_data  r  r	  c                ó   <€ V ^8„  d   QhRR/# r‘   rƒ   )r   rC   s   "€r    r!   r�     s   ø€ ÷ \ñ \˜Tñ \r"   c              ƒ  óº  "  € V P                   '       do   V P                  '       gI   V P                  '       g7   V P                  '       g%   V P                  '       g   V P
                  '       d   V P                  4        R# R# V P                  '       d3   V P                  \        V P                   R24      V P                  4       V P                  '       d3   V P                  \        V P                   R24      V P                  4       V P                  '       d3   V P                  \        V P                   R24      V P                  4       V P                  '       d3   V P                  \        V P                   R24      V P                  4       V P
                  '       d5   V P                  \        V P                   R24      V P
                  4       R# R# 5i)z/Will save all data in memory to pickle file(s).r¹   rÁ   rÇ   rÍ   rÒ   N)
r|   r‹   rŒ   r�   rŽ   r�   r®   r²   r   rz   )rM   s   &r    ÚflushÚPicklePersistence.flush  s=  é € à××Ðà——�Ø—>—>�>Ø—=—=�=Ø×%×%Ð%Ø×%×%Ð%à×%Ñ%Ö'ñ &ð �~�~ˆ~Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÔSØ�~�~ˆ~Ø—‘¤¨¯© °jÐ%AÓ BÀDÇNÁNÔSØ�}�}ˆ}Ø—‘¤¨¯© °iÐ%@Ó AÀ4Ç=Á=ÔQØ×!×!Ð!Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÔ[Ø×!×!Ð!Ø—‘¤¨¯© °nÐ%EÓ FÈ×HZÑHZÖ[ñ "ùsC   ‚$G§G¹GÁGÁGÁ/%GÂAGÃAGÄAGÅ!AGÆ%6G)	r�   rŽ   rŒ   r†   r�   rz   r}   r|   r‹   )NTFé<   )NTFr  N)ra   rb   rc   rd   Ú__doc__re   r   rK   r¡   r¥   r®   r²   r»   rÂ   rÈ   rÎ   rÔ   rÛ   râ   rê   rï   rô   rû   r  r  r  r  r  rf   rg   rh   ri   s   @@r    rx   rx   z   s'  ù‡ € ñAðF
€Ið ÷ñ ó ðð ÷ñ ó ð÷
õ 
÷,^ð ^÷.
Yð 
Y÷	Uð 	U÷Uð U÷(ð (÷"(ð (÷"'ð '÷$,ð ,÷.7ð 7÷((ð (÷,(ð (÷$(ð (÷$(ð (÷ (ð (÷((ð (÷&(ð (÷&ð ÷ð ÷ð ÷\÷ \ð \r"   rx   )+r  rs   Úcollections.abcr   rÓ   r   Úpathlibr   Útypingr   r   r   r   Útelegramr	   r
   Útelegram._utils.typesr   Útelegram._utils.warningsr   Útelegram.extr   r   Útelegram.ext._contexttypesr   Útelegram.ext._utils.typesr   r   r   r   r   r   r\   r]   r   r&   r1   r;   ÚPicklerr=   Ú	Unpicklerrk   rx   rƒ   r"   r    Ú<module>r#     s™   ðñ& 8ã Ý $Ý Ý ß /Ó /ç (Ý /Ý )ß :Ý 3ß \× \àGÐ ØLÐ á�m¨>Ô:€õVõ	õ	2ô�&—.‘.ô ôDU�F×$Ñ$ô Uô z\˜¨¨B°¨
Õ3ö z\r"   