+
    jHàjð	  ã                   óR   € R t ^ RIt^ RIHtHt ^ RIHt ^ RIHt R R ltR R lt	R# )	zCPreserve WhatsApp authentication state before dashboard re-pairing.N)ÚUTCÚdatetime©ÚPath)ÚHTTPExceptionc                ó(   € V ^8„  d   QhR\         RR/# ©é   Úsession_pathÚreturnNr   )Úformats   "ÚD/home/ubuntu/.hermes/hermes-agent/hermes_cli/web_whatsapp_session.pyÚ__annotate__r   
   s   € ÷ xñ x´$ð x¸4ñ xó    c                 óR  € ^ RI HpHp V R,          pVP                  4       '       g   R# Rp VP	                  RR7      P                  4       p\        V^ ,          4      pV^ 8:  d   \        R4      h T! T4      '       g   R#  \        T^,          4      pT^ 8:  d   \        R
4      h T! T4      p	T	f   \        RTR	7      hY˜8X  d   \        RRR	7      hR#   \        \        \        3 d   p\        RTR	7      ThRp?ii ; i  \        \        3 d   p\        RTR	7      ThRp?ii ; i)é    )Ú_pid_existsÚget_process_start_timez
bridge.pidNzUCannot verify the WhatsApp bridge is stopped. Check its bridge.pid before re-pairing.z	utf-8-sig)Úencodingzinvalid bridge PIDé™  ©Ústatus_codeÚdetailzinvalid bridge start timez@The WhatsApp bridge is still running. Stop it before re-pairing.)Úgateway.statusr   r   ÚexistsÚ	read_textÚ
splitlinesÚintÚ
ValueErrorÚOSErrorÚ
IndexErrorr   )
r
   r   r   Úpid_fileÚunknownÚlinesÚpidÚexcÚrecorded_startÚcurrent_starts
   &         r   Ú_assert_whatsapp_bridge_stoppedr(   
   s0  € ßBà˜lÕ*€HØ�?‰?×ÒÙØe€GðFØ×"Ñ"¨KÐ"Ó8×CÑCÓEˆÜ�%˜•(‹mˆØ�!Œ8ÜÐ1Ó2Ð2ð ñ �s×ÒÙðFÜ˜U 1�X›ˆØ˜QÔÜÐ8Ó9Ð9ð ñ +¨3Ó/€MØÒÜ¨°GÔ<Ð<ØÔ&Ü¨Ð4vÔwÐwñ 'øô ”Z¤Ð,ô FÜ¨°GÔ<À#ÐEûðFûô œ
Ð#ô FÜ¨°GÔ<À#ÐEûðFús0   ­AC Â$D ÃC?Ã,C:Ã:C?ÄD&ÄD!Ä!D&c                ó(   € V ^8„  d   QhR\         RR/# r   r   )r   s   "r   r   r   )   s   € ÷ Eñ E¬4ð E°Dñ Er   c                ó8  € \        V 4       V P                  4       '       d   \        RRR7      hRp V P                  4       '       d…   \        P
                  ! \        4      P                  R4      p\        \        P                  ! RV R2V P                  R7      4      R	,          pV P                  V4       V P                  R
R7       R# R#   \         dA   pRT R2pTe$   TP                  4       '       d   TRT R2,          p\        RTR7      ThRp?ii ; i)zHCalled while onboarding owns the session reservation. Never delete keys.r   zOThe WhatsApp session is a symbolic link. Back it up manually before re-pairing.r   Nz%Y%m%dT%H%M%SZzsession-backup-Ú-)ÚprefixÚdirÚsessioniÀ  )Úmodez(Could not back up the WhatsApp session: z. Pairing was not started.z& The previous session is preserved at Ú.iô  )r(   Ú
is_symlinkr   r   r   Únowr   Ústrftimer   ÚtempfileÚmkdtempÚparentÚrenameÚmkdirr   )r
   ÚbackupÚstampr%   r   s   &    r   Ú_backup_whatsapp_sessionr;   )   s  € ä# LÔ1Ø×Ñ× Ò Ü¨ð  5Fô  Gð  	GØ€Fð
EØ×Ñ× Ò Ü—L’L¤Ó%×.Ñ.Ð/?Ó@ˆEÜœ(×*Ò*°OÀEÀ7È!Ð2LÐR^×ReÑReÔfÓgÐjsÕsˆFØ×Ñ Ô'Ø×Ñ EÐÖ*ñ	 !øô
 ô EØ;¸C¸5Ð@ZÐ[ˆØÒ &§-¡-§/¢/ØÐ>¸v¸hÀaÐHÕHˆFÜ¨°FÔ;ÀÐDûð	Eús$   ²C ÁBC ÃDÃDÃ9DÄD)
Ú__doc__r4   r   r   Úpathlibr   Úfastapir   r(   r;   © r   r   Ú<module>r@      s    ðÙ Iã ß "Ý å !õx÷>Er   