+
     h$  c                   sf    R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^RIHt R R lt	RR lt
RR ltR# )	z)Util functions that are needed but messy.N)PyPresenceExceptionc                s$    V ^8  d   QhR\         /# )i   d)dict)Zformats   "5/usr/lib/python3.14/site-packages/pypresence/utils.py__annotate__r      s     	 	4 	    c                 s   V P                  4        Ft  p\        W,          \        4      '       dH   \        W,          4      '       d   \	        W,          4      W&   \        W,          4      '       g   W Kd  Kf  W,          e   Kr  W Kv  	  V # N)ZcopyZ
isinstancer   Zlenremove_none)r   Zitem   & r   r   r      sb    agt$$17||%ag.qw<<G  W_  Hr   c                 s   R pV '       d   V V  2p\         P                  R9   dB   \        P                  P	                  R4      ;'       g    \
        P                  ! 4       p. ROpM\         P                  R8X  d   RpR.pMR# V F  p\        P                  P                  \        P                  P                  W$4      4      p\         P                  R8X  g(   \        P                  P                  V4      '       g   K{  \        P                  ! V4       F[  pVP                  P                  V4      '       g   K&  \        P                  P                  V4      '       g   KM  VP                  u u # 	  K  	  R# )zdiscord-ipc-ZXDG_RUNTIME_DIR.Zwin32z\\?\pipeN)ZlinuxZdarwin)r	   zsnap.discordzapp/com.discordapp.Discordz app/com.discordapp.DiscordCanary)sysZplatformosZenvironZgettempfileZ
gettempdirpathZabspathZjoinZisdirZscandirZnameZ
startswithZexists)ZpipeZipcZtempdirZpathsr   Z	full_pathZentrys   &      r   get_ipc_pathr      s    
CdVn
||**::>>"34MM8K8K8Mg		 GGOOBGGLL$?@	<<7"bggmmI&>&>I.::((--"''..2G2G ::% / r   c                 s   V '       d   \         P                  ! 4       #  \         P                  ! 4       pTP	                  4       '       d   \         P                  ! 4       # T#   \         d    \         P                  ! 4       u # i ; ir   )asyncioZnew_event_loopZget_running_loopZRuntimeErrorZ	is_closed)Zforce_freshZrunningr   r   get_event_loopr   /   sl    %%''(**, %%''N	  (%%''(s   A! ! BBr   )F)Z__doc__r   Zjsonr   r
   r   ZtimeZ
exceptionsr    r   r   r   ) r   r   <module>r      s,    /   	 
   +	&,	r   