
    q	h5
                        S SK Jr  S SKrS SKrS SKrS SKrS SKJr  S SKJ	r	  S SK
JrJr  \R                  " 5       r\R                  " \R                   5        SS jrSSS	.SS
 jjrg)    )annotationsN)HTML)display)as_filefilesc               X   SnSn[        S5      S-  S-  n[        R                  [        U5      5      nUR	                  5       nUR                  XA5      nUR                  XP5      nS[        R                  ;   nU(       d!  [        R                  " USS9n	S	U S
U SU	 S3n[        U5      $ )aC  
Generate the HTML needed to embed a LiveKit room.

Args:
    url (str): The LiveKit room URL.
    token (str): The LiveKit join token.

Important:
    The returned HTML contains the provided `url` and `token` values directly.
    Avoid using sensitive tokens in public notebooks (e.g., tokens with long expiration times).
z##livekit-token-placeholder##z##livekit-url-placeholder##zlivekit.rtc.resourceszjupyter-htmlz
index.htmlzgoogle.colabT)quotez <iframe width="z
" height="z" frameborder="0" srcdoc="z"></iframe>)r   _resource_stackenter_contextr   	read_textreplacesysmoduleshtmlescaper   )
urltokenwidthheighttoken_placeholderurl_placeholder
index_path	html_textIN_COLABescaped_contents
             E/var/www/html/env/lib/python3.13/site-packages/livekit/rtc/jupyter.py	room_htmlr      s     83O./.@<OJ ..wz/BCJ
 $$&I!!"3;I!!/7I,H ++it< ugZx 8&'{4 	
 	?    z100%110pxr   r   c          	     *    [        [        XX#S95        g)aQ  
Display a LiveKit room in a Jupyter notebook or Google Colab.

Args:
    url (str): The LiveKit room URL.
    token (str): The LiveKit join token.

Important:
    The rendered HTML will include the provided `url` and `token` in plain text.
    Avoid using sensitive tokens in public notebooks (e.g., tokens with long expiration times).
r    N)r   r   )r   r   r   r   s       r   display_roomr"   8   s     Ic=>r   )
r   strr   r#   r   r#   r   r#   returnr   )
r   r#   r   r#   r   r#   r   r#   r$   None)
__future__r   r   atexit
contextlibr   IPython.core.displayr   IPython.displayr   importlib.resourcesr   r   	ExitStackr
   registercloser   r"    r   r   <module>r0      sT    " 
    % # .&&( %% &&R 8>W ? ?r   