
    Be
                        d Z ddlmZ ddlmZmZmZ ddlZddlm	Z
 ddlmZ dd	lmZ dd
lmZ erddlmZ ddlmZ ddlmZ  G d de          Z	dS )zQ
Defines a BrowserInfo component exposing the browser window and
navigator APIs.
    )annotations)TYPE_CHECKINGClassVarMappingN   )BrowserInfo)Syncable   )create_doc_if_none_exists)state)Document)Model)Commc                  .    e Zd ZU dZ ej        dd          Z ej        dd          Z ej	        dd          Z
 ej	        dd          Z ej        dd          Z ej        dd	          Zd
diZded<   	 	 dd dZ	 	 d!d"dZd#d$ fdZ xZS )%r   z
    The Location component can be made available in a server context
    to provide read and write access to the URL components in the
    browser.
    Nz,
        Whether the user prefers dark mode.)defaultdocz
        Provides the ratio of the resolution in physical pixels to
        the resolution in CSS pixels for the current display device.z\
        The preferred language of the user, usually the language of the
        browser UI.zC
        The timezone configured as the local timezone of the user.z-
        The time offset from UTC in minutes.zF
        Indicates whether the user agent is controlled by automation.namez"ClassVar[Mapping[str, str | None]]_renamer   r   rootModel | NoneparentcommComm | Nonereturnr   c                    t                      }|p|}||f| j        |j        d         <   |                     || j        |||           |S Nid)_BkBrowserInfo_modelsref_link_props_linked_properties)selfr   r   r   r   models         0lib/python3.11/site-packages/panel/io/browser.py
_get_modelzBrowserInfo._get_model4   sR       }u(-vTXd^$ 7dDIII    TDocument | None
preprocessbool'Model'c                    t          |          }|                     ||          }|j        d         }| |||ft          j        |<   || j        |<   |S )N)r   r   )r   r&   r    r   _views
_documents)r#   r   r   r)   r   r    s         r%   get_rootzBrowserInfo.get_root>   sW     (,,s..htn!4d3S#r'   Nonec                    |r)|j         | j        v r| j        |j         = |j        d         }nd }t                                          |           |t
          j        v rt
          j        |= d S d S r   )documentr.   r    super_cleanupr   r-   )r#   r   r    	__class__s      r%   r4   zBrowserInfo._cleanupI   su     	}//ODM2(4.CCC%,S!!! r'   )NNN)
r   r   r   r   r   r   r   r   r   r   )NNT)r   r(   r   r   r)   r*   r   r+   )N)r   r   r   r0   )__name__
__module____qualname____doc__paramBoolean	dark_modeNumberdevice_pixel_ratioStringlanguagetimezonetimezone_offset	webdriverr   __annotations__r&   r/   r4   __classcell__)r5   s   @r%   r   r      s|          d 1/ 0 0 0I &d 9H I I I u|D /   H u|D /F G G GH #el4 60 1 1 1O d 1I J J JI 4:4.G@@@@ 379=     @D	 	 	 	 		" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"r'   r   )r9   
__future__r   typingr   r   r   r:   models.browserr   r   reactiver	   r2   r   r   bokeh.documentr   bokeh.modelr   pyviz_commsr    r'   r%   <module>rN      s    # " " " " " 3 3 3 3 3 3 3 3 3 3  : : : : : :       / / / / / /       !''''''!!!!!!      <" <" <" <" <"( <" <" <" <" <"r'   