a
    $ñ»jJŒ  ã                   @  s¼  d dl mZ d dlZd dlZd dlmZ ddlmZmZ ddl	m
Z
 ddl	mZ ddl	mZ eG d	d
„ d
ƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZG dd„ dejƒZeG dd„ dƒƒZeG dd„ dƒƒZG dd„ dejƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd„ dƒƒZeG dd „ d ƒƒZeG d!d"„ d"ƒƒZG d#d$„ d$ejƒZd%d&œd'd(„Zd%d&œd)d*„Zd%d&œd+d,„Zd-d%d.œd/d0„Zd•d1d%d.œd2d3„Z d4d%d5œd6d7„Z!d–d8d%d9œd:d;„Z"d—d<d<d4d-d=d>d>d>d>d1d?d@dAdBd%dCœdDdE„Z#dd%dFœdGdH„Z$d%d&œdIdJ„Z%d-d%dKœdLdM„Z&d-d%dNœdOdP„Z'd˜d-dQd%dRœdSdT„Z(d™dQdUd%dVœdWdX„Z)dYd%dZœd[d\„Z*dšd=d=d=d%d]œd^d_„Z+dd`dZœdadb„Z,d›d-ddcd%ddœdedf„Z-dd"d%dgœdhdi„Z.d-d-d%djœdkdl„Z/d%d&œdmdn„Z0d4d%doœdpdq„Z1d-d%drœdsdt„Z2dœd-d>d%duœdvdw„Z3d�dd=d>dxd`dyœdzd{„Z4dždQd%d|œd}d~„Z5dYd%dœd€d�„Z6d<d<d%d‚œdƒd„„Z7d…d%d†œd‡dˆ„Z8d<d%d‰œdŠd‹„Z9dŸdYdQdQdŒd%d�œdŽd�„Z:d-d%d.œd�d‘„Z;ed’ƒeG d“d”„ d”ƒƒƒZ<dS ) é    )ÚannotationsN)Ú	dataclassé   )Úevent_classÚT_JSON_DICT)Údom)Únetwork)Úpagec                   @  sD   e Zd ZU dZded< ded< ddœdd	„Zedd d
œdd„ƒZdS )ÚScreenOrientationzScreen orientation.ÚstrÚtype_ÚintÚangler   ©Úreturnc                 C  s   t ƒ }| j|d< | j|d< |S )NÚtyper   )Údictr   r   ©ÚselfÚjson© r   ú5E:\soccer\ml_env\Lib\site-packages\mycdp/emulation.pyÚto_json   s    

zScreenOrientation.to_json©r   r   c                 C  s    | t | d¡ƒt| d¡ƒd�S )Nr   r   )r   r   ©r   Úgetr   ©Úclsr   r   r   r   Ú	from_json    s    þzScreenOrientation.from_jsonN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   Úclassmethodr   r   r   r   r   r
      s   
r
   c                   @  sH   e Zd ZU ded< ded< ded< ddœdd	„Zedd d
œdd„ƒZdS )ÚDisplayFeaturer   Úorientationr   ÚoffsetÚmask_lengthr   r   c                 C  s(   t ƒ }| j|d< | j|d< | j|d< |S )Nr'   r(   Ú
maskLength)r   r'   r(   r)   r   r   r   r   r   4   s
    


zDisplayFeature.to_jsonr   c                 C  s,   | t | d¡ƒt| d¡ƒt| d¡ƒd�S )Nr'   r(   r*   )r'   r(   r)   r   r   r   r   r   r   ;   s
    ýzDisplayFeature.from_jsonN©r    r!   r"   r$   r   r%   r   r   r   r   r   r&   (   s   
r&   c                   @  s8   e Zd ZU ded< ddœdd„Zedd dœdd	„ƒZd
S )ÚDevicePosturer   r   r   r   c                 C  s   t ƒ }| j|d< |S )Nr   )r   r   r   r   r   r   r   I   s    
zDevicePosture.to_jsonr   c                 C  s   | t | d¡ƒd�S )Nr   )r   ©r   r   r   r   r   r   r   N   s    ÿzDevicePosture.from_jsonNr+   r   r   r   r   r,   D   s   
r,   c                   @  s@   e Zd ZU ded< ded< ddœdd„Zedd dœd	d
„ƒZdS )ÚMediaFeaturer   ÚnameÚvaluer   r   c                 C  s   t ƒ }| j|d< | j|d< |S )Nr/   r0   )r   r/   r0   r   r   r   r   r   Z   s    

zMediaFeature.to_jsonr   c                 C  s    | t | d¡ƒt | d¡ƒd�S )Nr/   r0   )r/   r0   r-   r   r   r   r   r   `   s    þzMediaFeature.from_jsonNr+   r   r   r   r   r.   U   s
   
r.   c                   @  s>   e Zd ZdZdZdZdZddœdd„Zedd d	œd
d„ƒZ	dS )ÚVirtualTimePolicyaG  
    advance: If the scheduler runs out of immediate work,
    the virtual time base may fast forward to
    allow the next delayed task (if any) to run;
    pause: The virtual time base may not advance;
    pauseIfNetworkFetchesPending: The virtual time base may not advance
    if there are any pending resource fetches.
    ÚadvanceZpauseZpauseIfNetworkFetchesPendingr   r   c                 C  s   | j S ©N©r0   ©r   r   r   r   r   u   s    zVirtualTimePolicy.to_jsonr   c                 C  s   | |ƒS r3   r   r   r   r   r   r   x   s    zVirtualTimePolicy.from_jsonN)
r    r!   r"   r#   ZADVANCEZPAUSEZ PAUSE_IF_NETWORK_FETCHES_PENDINGr   r%   r   r   r   r   r   r1   h   s   r1   c                   @  sD   e Zd ZU dZded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚUserAgentBrandVersionzl
    Used to specify User Agent Client Hints to emulate.
    See https://wicg.github.io/ua-client-hints
    r   ÚbrandÚversionr   r   c                 C  s   t ƒ }| j|d< | j|d< |S )Nr7   r8   )r   r7   r8   r   r   r   r   r   †   s    

zUserAgentBrandVersion.to_jsonr   c                 C  s    | t | d¡ƒt | d¡ƒd�S )Nr7   r8   )r7   r8   r-   r   r   r   r   r   Œ   s    þzUserAgentBrandVersion.from_jsonNr   r   r   r   r   r6   }   s   
r6   c                   @  s˜   e Zd ZU dZded< ded< ded< ded< ded< d	Zd
ed< d	Zd
ed< d	Zded< d	Zded< d	Z	ded< ddœdd„Z
edd dœdd„ƒZd	S )ÚUserAgentMetadatazÍ
    Used to specify User Agent Client Hints to emulate.
    See https://wicg.github.io/ua-client-hints
    Missing optional values will be filled in by the target
    with what it would normally use.
    r   ÚplatformÚplatform_versionÚarchitectureÚmodelÚboolÚmobileNz3typing.Optional[typing.List[UserAgentBrandVersion]]ÚbrandsÚfull_version_listútyping.Optional[str]Úfull_versionÚbitnessútyping.Optional[bool]Úwow64r   r   c                 C  s´   t ƒ }| j|d< | j|d< | j|d< | j|d< | j|d< | jd urVdd„ | jD ƒ|d< | jd urtd	d„ | jD ƒ|d
< | jd urˆ| j|d< | j	d urœ| j	|d< | j
d ur°| j
|d< |S )Nr:   ÚplatformVersionr<   r=   r?   c                 S  s   g | ]}|  ¡ ‘qS r   ©r   ©Ú.0Úir   r   r   Ú
<listcomp>³   ó    z-UserAgentMetadata.to_json.<locals>.<listcomp>r@   c                 S  s   g | ]}|  ¡ ‘qS r   rH   rI   r   r   r   rL   µ   s   ÚfullVersionListÚfullVersionrD   rF   )r   r:   r;   r<   r=   r?   r@   rA   rC   rD   rF   r   r   r   r   r   «   s&    






ÿ






zUserAgentMetadata.to_jsonr   c                 C  sì   | t | d¡ƒt | d¡ƒt | d¡ƒt | d¡ƒt| d¡ƒ| dd ¡d ur`dd„ |d D ƒnd | d	d ¡d ur„d
d„ |d	 D ƒnd | dd ¡d ur¤t | d¡ƒnd | dd ¡d urÄt | d¡ƒnd | dd ¡d urät| d¡ƒnd d�
S )Nr:   rG   r<   r=   r?   r@   c                 S  s   g | ]}t  |¡‘qS r   ©r6   r   rI   r   r   r   rL   É   rM   z/UserAgentMetadata.from_json.<locals>.<listcomp>rN   c                 S  s   g | ]}t  |¡‘qS r   rP   rI   r   r   r   rL   Î   s   ÿrO   rD   rF   )
r:   r;   r<   r=   r?   r@   rA   rC   rD   rF   )r   r   r>   r   r   r   r   r   À   s0    ÿüþÿÿÿàzUserAgentMetadata.from_json)r    r!   r"   r#   r$   r@   rA   rC   rD   rF   r   r%   r   r   r   r   r   r9   ”   s   
ÿ
r9   c                   @  sV   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
Zddœdd„Zedd dœdd„ƒZdS )Ú
SensorTypezz
    Used to specify sensor types to emulate.
    See https://w3c.github.io/sensors/#automation for more information.
    zabsolute-orientationZaccelerometerzambient-lightZgravityZ	gyroscopezlinear-accelerationZmagnetometerZ	proximityzrelative-orientationr   r   c                 C  s   | j S r3   r4   r5   r   r   r   r   ö   s    zSensorType.to_jsonr   c                 C  s   | |ƒS r3   r   r   r   r   r   r   ù   s    zSensorType.from_jsonN)r    r!   r"   r#   ZABSOLUTE_ORIENTATIONZACCELEROMETERZAMBIENT_LIGHTZGRAVITYZ	GYROSCOPEZLINEAR_ACCELERATIONZMAGNETOMETERZ	PROXIMITYZRELATIVE_ORIENTATIONr   r%   r   r   r   r   r   rQ   ç   s   rQ   c                   @  sT   e Zd ZU dZded< dZded< dZded< ddœd	d
„Zedd dœdd„ƒZ	dS )ÚSensorMetadataNrE   Ú	availableútyping.Optional[float]Úminimum_frequencyÚmaximum_frequencyr   r   c                 C  sF   t ƒ }| jd ur| j|d< | jd ur.| j|d< | jd urB| j|d< |S )NrS   ÚminimumFrequencyÚmaximumFrequency)r   rS   rU   rV   r   r   r   r   r     s    





zSensorMetadata.to_jsonr   c                 C  sh   | |  dd ¡d ur t|  d¡ƒnd |  dd ¡d ur@t|  d¡ƒnd |  dd ¡d ur`t|  d¡ƒnd d�S )NrS   rW   rX   )rS   rU   rV   )r   r>   Úfloatr   r   r   r   r     s    ÿÿÿòzSensorMetadata.from_json)
r    r!   r"   rS   r$   rU   rV   r   r%   r   r   r   r   r   rR   þ   s   

rR   c                   @  s8   e Zd ZU ded< ddœdd„Zedd dœdd	„ƒZd
S )ÚSensorReadingSinglerY   r0   r   r   c                 C  s   t ƒ }| j|d< |S )Nr0   )r   r0   r   r   r   r   r   '  s    
zSensorReadingSingle.to_jsonr   c                 C  s   | t | d¡ƒd�S )Nr0   r4   ©rY   r   r   r   r   r   r   ,  s    ÿzSensorReadingSingle.from_jsonNr+   r   r   r   r   rZ   #  s   
rZ   c                   @  sH   e Zd ZU ded< ded< ded< ddœdd„Zedd d	œd
d„ƒZdS )ÚSensorReadingXYZrY   ÚxÚyÚzr   r   c                 C  s(   t ƒ }| j|d< | j|d< | j|d< |S )Nr]   r^   r_   )r   r]   r^   r_   r   r   r   r   r   9  s
    


zSensorReadingXYZ.to_jsonr   c                 C  s,   | t | d¡ƒt | d¡ƒt | d¡ƒd�S )Nr]   r^   r_   )r]   r^   r_   r[   r   r   r   r   r   @  s
    ýzSensorReadingXYZ.from_jsonNr+   r   r   r   r   r\   3  s   
r\   c                   @  sP   e Zd ZU ded< ded< ded< ded< ddœdd	„Zedd d
œdd„ƒZdS )ÚSensorReadingQuaternionrY   r]   r^   r_   Úwr   r   c                 C  s2   t ƒ }| j|d< | j|d< | j|d< | j|d< |S )Nr]   r^   r_   ra   )r   r]   r^   r_   ra   r   r   r   r   r   P  s    



zSensorReadingQuaternion.to_jsonr   c                 C  s8   | t | d¡ƒt | d¡ƒt | d¡ƒt | d¡ƒd�S )Nr]   r^   r_   ra   )r]   r^   r_   ra   r[   r   r   r   r   r   X  s    üz!SensorReadingQuaternion.from_jsonNr+   r   r   r   r   r`   I  s   
r`   c                   @  sT   e Zd ZU dZded< dZded< dZded< dd	œd
d„Zedd dœdd„ƒZ	dS )ÚSensorReadingNz$typing.Optional[SensorReadingSingle]Úsinglez!typing.Optional[SensorReadingXYZ]Úxyzz(typing.Optional[SensorReadingQuaternion]Ú
quaternionr   r   c                 C  sR   t ƒ }| jd ur| j ¡ |d< | jd ur6| j ¡ |d< | jd urN| j ¡ |d< |S )Nrc   rd   re   )r   rc   r   rd   re   r   r   r   r   r   h  s    


zSensorReading.to_jsonr   c                 C  sn   | |  dd ¡d ur"t |  d¡¡nd |  dd ¡d urDt |  d¡¡nd |  dd ¡d urft |  d¡¡nd d�S )Nrc   rd   re   )rc   rd   re   )r   rZ   r   r\   r`   r   r   r   r   r   r  s    ÿÿÿòzSensorReading.from_json)
r    r!   r"   rc   r$   rd   re   r   r%   r   r   r   r   r   rb   b  s   

rb   c                   @  s:   e Zd ZdZdZdZddœdd„Zedd dœd	d
„ƒZdS )ÚDisabledImageTypez)Enum of image types that can be disabled.ZavifZwebpr   r   c                 C  s   | j S r3   r4   r5   r   r   r   r   Œ  s    zDisabledImageType.to_jsonr   c                 C  s   | |ƒS r3   r   r   r   r   r   r   �  s    zDisabledImageType.from_jsonN)	r    r!   r"   r#   ZAVIFZWEBPr   r%   r   r   r   r   r   rf   ‡  s   rf   z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None]r   c                  c  s   ddi} | V }dS )z%Clears the overridden device metrics.Úmethodz$Emulation.clearDeviceMetricsOverrideNr   ©Úcmd_dictr   r   r   r   Úclear_device_metrics_override”  s    ÿrj   c                  c  s   ddi} | V }dS )z5Clears the overridden Geolocation Position and Error.rg   z"Emulation.clearGeolocationOverrideNr   rh   r   r   r   Úclear_geolocation_overridež  s    ÿrk   c                  c  s   ddi} | V }dS )zZ
    Requests that page scale factor is reset to initial values.
    **EXPERIMENTAL**
    rg   zEmulation.resetPageScaleFactorNr   rh   r   r   r   Úreset_page_scale_factor¨  s    ÿrl   r>   )Úenabledr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zš
    Enables or disables simulating a focused and active page.
    **EXPERIMENTAL**
    :param enabled: Whether to enable to disable focus emulation.
    rm   z"Emulation.setFocusEmulationEnabled©rg   ÚparamsN©r   ©rm   ro   ri   r   r   r   r   Úset_focus_emulation_enabledµ  s    þrr   rE   c                 c  s*   t ƒ }| dur| |d< d|dœ}|V }dS )zì
    Automatically render all web contents using a dark theme.
    **EXPERIMENTAL**
    :param enabled: *(Optional)*
    Whether to enable or disable automatic dark mode.
    If not specified, any existing override will be cleared.
    Nrm   z!Emulation.setAutoDarkModeOverridern   rp   rq   r   r   r   Úset_auto_dark_mode_overrideÆ  s    
þrs   rY   )Úrater   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )z›
    Enables CPU throttling to emulate slow CPUs.
    :param rate: Throttling rate as a slowdown factor
    (1 is no throttle, 2 is 2x slowdown, etc).
    rt   zEmulation.setCPUThrottlingRatern   Nrp   )rt   ro   ri   r   r   r   r   Úset_cpu_throttling_rateÚ  s    þru   ztyping.Optional[dom.RGBA])Úcolorr   c                 c  s.   t ƒ }| dur|  ¡ |d< d|dœ}|V }dS )a  
    Sets or clears an override of the default background color of the frame.
    This override is used if the content does not specify one.
    :param color: *(Optional)*
    RGBA of the default background color.
    If not specified, any existing override will be cleared.
    Nrv   z+Emulation.setDefaultBackgroundColorOverridern   ©r   r   )rv   ro   ri   r   r   r   r   Ú%set_default_background_color_overrideë  s    
þrx   r   rT   ztyping.Optional[int]z"typing.Optional[ScreenOrientation]ztyping.Optional[page.Viewport]ztyping.Optional[DisplayFeature]ztyping.Optional[DevicePosture])ÚwidthÚheightÚdevice_scale_factorr?   ÚscaleÚscreen_widthÚscreen_heightÚ
position_xÚ
position_yÚdont_set_visible_sizeÚscreen_orientationÚviewportÚdisplay_featureÚdevice_posturer   c                 c  sê   t ƒ }| |d< ||d< ||d< ||d< |dur6||d< |durF||d< |durV||d< |durf||d	< |durv||d
< |	dur†|	|d< |
durš|
 ¡ |d< |dur®| ¡ |d< |durÂ| ¡ |d< |durÖ| ¡ |d< d|dœ}|V }dS )a�  
    Overrides the values of device screen dimensions
    (window.screen.width, window.screen.height,
    window.innerWidth, window.innerHeight,
    and "device-width"/"device-height"-related CSS media query results).
    :param width: Overriding width value in pixels
     (minimum 0, maximum 10000000). 0 disables the override.
    :param height: Overriding height value in pixels
     (minimum 0, maximum 10000000). 0 disables the override.
    :param device_scale_factor: Overriding device scale factor value.
     0 disables the override.
    :param mobile: Whether to emulate mobile device.
     This includes viewport meta tag, overlay scrollbars,
     text autosizing and more.
    :param scale: **(EXPERIMENTAL)** *(Optional)*
     Scale to apply to resulting view image.
    :param screen_width: **(EXPERIMENTAL)** *(Optional)*
     Overriding screen width value in pixels (minimum 0, maximum 10000000).
    :param screen_height: **(EXPERIMENTAL)** *(Optional)*
    Overriding screen height value in pixels (minimum 0, maximum 10000000).
    :param position_x: **(EXPERIMENTAL)** *(Optional)*
     Overriding view X position on screen in pixels
     (minimum 0, maximum 10000000).
    :param position_y: **(EXPERIMENTAL)** *(Optional)*
     Overriding view Y position on screen in pixels
     (minimum 0, maximum 10000000).
    :param dont_set_visible_size: **(EXPERIMENTAL)** *(Optional)*
     Do not set visible view size, rely upon explicit setVisibleSize call.
    :param screen_orientation: *(Optional)* Screen orientation override.
    :param viewport: **(EXPERIMENTAL)** *(Optional)*
     If set, the visible area of the page will be overridden to this viewport.
     This viewport change is not observed by the page,
     e.g. viewport-relative elements do not change positions.
    :param display_feature: **(EXPERIMENTAL)** *(Optional)*
     If set, the display feature of a multi-segment screen.
     If not set, multi-segment support is turned-off.
    :param device_posture: **(DEPRECATED)** **(EXPERIMENTAL)** *(Optional)*
     If set, the posture of a foldable device.
     If not set the posture is set to continuous.
     Deprecated, use Emulation.setDevicePostureOverride.
    ry   rz   ZdeviceScaleFactorr?   Nr|   ZscreenWidthZscreenHeightZ	positionXZ	positionYZdontSetVisibleSizeZscreenOrientationrƒ   ZdisplayFeatureZdevicePosturez"Emulation.setDeviceMetricsOverridern   rw   )ry   rz   r{   r?   r|   r}   r~   r   r€   r�   r‚   rƒ   r„   r…   ro   ri   r   r   r   r   Úset_device_metrics_overrideÿ  s:    9þr†   )Úposturer   c                 c  s&   t ƒ }|  ¡ |d< d|dœ}|V }dS )z¶
    Start reporting the given posture value to the Device Posture API.
    This override can also be set in setDeviceMetricsOverride().
    **EXPERIMENTAL**
    :param posture:
    r‡   z"Emulation.setDevicePostureOverridern   Nrw   )r‡   ro   ri   r   r   r   r   Úset_device_posture_overrideX  s    	þrˆ   c                  c  s   ddi} | V }dS )zö
    Clears a device posture override set with either setDeviceMetricsOverride()
    or setDevicePostureOverride() and starts using posture information from the
    platform again.
    Does nothing if no override is set.
    **EXPERIMENTAL**
    rg   z$Emulation.clearDevicePostureOverrideNr   rh   r   r   r   Úclear_device_posture_overridej  s    ÿr‰   )Úhiddenr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zY
    **EXPERIMENTAL**
    :param hidden: Whether scrollbars should be always hidden.
    rŠ   zEmulation.setScrollbarsHiddenrn   Nrp   )rŠ   ro   ri   r   r   r   r   Úset_scrollbars_hiddenz  s    þr‹   )Údisabledr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )z`
    **EXPERIMENTAL**
    :param disabled: Whether document.coookie API should be disabled.
    rŒ   z#Emulation.setDocumentCookieDisabledrn   Nrp   )rŒ   ro   ri   r   r   r   r   Úset_document_cookie_disabledŠ  s    þr�   rB   )rm   Úconfigurationr   c                 c  s2   t ƒ }| |d< |dur||d< d|dœ}|V }dS )zÜ
    **EXPERIMENTAL**
    :param enabled:
    Whether touch emulation based on mouse input should be enabled.
    :param configuration: *(Optional)*
    Touch/gesture events configuration. Default: current platform.
    rm   NrŽ   z$Emulation.setEmitTouchEventsForMousern   rp   )rm   rŽ   ro   ri   r   r   r   r   Úset_emit_touch_events_for_mouseš  s    
þr�   z*typing.Optional[typing.List[MediaFeature]])ÚmediaÚfeaturesr   c                 c  sD   t ƒ }| dur| |d< |dur0dd„ |D ƒ|d< d|dœ}|V }dS )zë
    Emulates the given media type or media feature for CSS media queries.
    :param media: *(Optional)* Media type to emulate.
     Empty string disables the override.
    :param features: *(Optional)* Media features to emulate.
    Nr�   c                 S  s   g | ]}|  ¡ ‘qS r   rH   rI   r   r   r   rL   ½  rM   z&set_emulated_media.<locals>.<listcomp>r‘   zEmulation.setEmulatedMediarn   rp   )r�   r‘   ro   ri   r   r   r   r   Úset_emulated_media¯  s    
þr’   r   )r   r   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )a   
    Emulates the given vision deficiency.
    :param type_: Vision deficiency to emulate.
     Order: best-effort emulations come first,
     followed by any physiologically accurate emulations
     for medically recognized color vision deficiencies.
    r   z%Emulation.setEmulatedVisionDeficiencyrn   Nrp   ©r   ro   ri   r   r   r   r   Úset_emulated_vision_deficiencyÅ  s    
þr”   )ÚlatitudeÚ	longitudeÚaccuracyr   c                 c  sJ   t ƒ }| dur| |d< |dur&||d< |dur6||d< d|dœ}|V }dS )a
  
    Overrides the Geolocation Position or Error.
    Omitting any of the parameters emulates position unavailable.
    :param latitude: *(Optional)* Mock latitude
    :param longitude: *(Optional)* Mock longitude
    :param accuracy: *(Optional)* Mock accuracy
    Nr•   r–   r—   z Emulation.setGeolocationOverridern   rp   )r•   r–   r—   ro   ri   r   r   r   r   Úset_geolocation_overrideØ  s    þr˜   z1typing.Generator[T_JSON_DICT, T_JSON_DICT, float]c                 c  s0   t ƒ }|  ¡ |d< d|dœ}|V }t| d¡ƒS )z,
    **EXPERIMENTAL**
    :param type_:
    r   z(Emulation.getOverriddenSensorInformationrn   ZrequestedSamplingFrequency©r   r   rY   r   r“   r   r   r   Ú!get_overridden_sensor_informationò  s    þrš   ztyping.Optional[SensorMetadata])rm   r   Úmetadatar   c                 c  sB   t ƒ }| |d< | ¡ |d< |dur.| ¡ |d< d|dœ}|V }dS )aÑ  
    Overrides a platform sensor of a given type.
    If ``enabled`` is true, calls to Sensor.start() will use a virtual sensor
    as backend rather than fetching data from a real hardware sensor.
    Otherwise, existing virtual sensor-backend Sensor objects will fire
    an error event and new calls to Sensor.start() will attempt to use
    a real sensor instead.
    **EXPERIMENTAL**
    :param enabled:
    :param type_:
    :param metadata: *(Optional)*
    rm   r   Nr›   z"Emulation.setSensorOverrideEnabledrn   rw   )rm   r   r›   ro   ri   r   r   r   r   Úset_sensor_override_enabled  s    þrœ   )r   Úreadingr   c                 c  s2   t ƒ }|  ¡ |d< | ¡ |d< d|dœ}|V }dS )z±
    Updates the sensor readings reported by a sensor type
    previously overridden by setSensorOverrideEnabled.
    **EXPERIMENTAL**
    :param type_:
    :param reading:
    r   r�   z#Emulation.setSensorOverrideReadingsrn   Nrw   )r   r�   ro   ri   r   r   r   r   Úset_sensor_override_readings   s    
þrž   )Úis_user_activeÚis_screen_unlockedr   c                 c  s*   t ƒ }| |d< ||d< d|dœ}|V }dS )z…
    Overrides the Idle state.
    :param is_user_active: Mock isUserActive
    :param is_screen_unlocked: Mock isScreenUnlocked
    ZisUserActiveZisScreenUnlockedzEmulation.setIdleOverridern   Nrp   )rŸ   r    ro   ri   r   r   r   r   Úset_idle_override4  s    þr¡   c                  c  s   ddi} | V }dS )zClears Idle state overrides.rg   zEmulation.clearIdleOverrideNr   rh   r   r   r   Úclear_idle_overrideF  s    ÿr¢   )Úpage_scale_factorr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zs
    Sets a specified page scale factor.
    **EXPERIMENTAL**
    :param page_scale_factor: Page scale factor.
    ZpageScaleFactorzEmulation.setPageScaleFactorrn   Nrp   )r£   ro   ri   r   r   r   r   Úset_page_scale_factorN  s    þr¤   )r0   r   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )z{
    Switches script execution in the page.
    :param value: Whether script execution should be disabled in the page.
    r0   z$Emulation.setScriptExecutionDisabledrn   Nrp   )r0   ro   ri   r   r   r   r   Úset_script_execution_disabled_  s    þr¥   )rm   Úmax_touch_pointsr   c                 c  s2   t ƒ }| |d< |dur||d< d|dœ}|V }dS )zè
    Enables touch on platforms which do not support them.
    :param enabled: Whether the touch event emulation should be enabled.
    :param max_touch_points: *(Optional)* Maximum touch points supported.
     Defaults to one.
    rm   NZmaxTouchPointsz"Emulation.setTouchEmulationEnabledrn   rp   )rm   r¦   ro   ri   r   r   r   r   Úset_touch_emulation_enabledo  s    	þr§   z'typing.Optional[network.TimeSinceEpoch])ÚpolicyÚbudgetÚ&max_virtual_time_task_starvation_countÚinitial_virtual_timer   c                 c  sd   t ƒ }|  ¡ |d< |dur"||d< |dur2||d< |durF| ¡ |d< d|dœ}|V }t| d¡ƒS )	aE  
    Turns on virtual time for all frames
    (replacing real-time with a synthetic time source) and sets
    the current virtual time policy.
    Note this supersedes any previous time budget.
    **EXPERIMENTAL**
    :param policy:
    :param budget: *(Optional)*
     If set, after this many virtual milliseconds have elapsed
     virtual time will be paused and a virtualTimeBudgetExpired event is sent.
    :param max_virtual_time_task_starvation_count: *(Optional)*
    If set this specifies the maximum number of tasks that can be run
     before virtual is forced forwards to prevent deadlock.
    :param initial_virtual_time: *(Optional)*
     If set, base::Time::Now will be overridden to initially return this value.
    :returns: Absolute timestamp at which virtual time was first enabled
     (up time in milliseconds).
    r¨   Nr©   Z!maxVirtualTimeTaskStarvationCountZinitialVirtualTimezEmulation.setVirtualTimePolicyrn   ZvirtualTimeTicksBaser™   )r¨   r©   rª   r«   ro   ri   r   r   r   r   Úset_virtual_time_policyƒ  s    ÿþr¬   )Úlocaler   c                 c  s*   t ƒ }| dur| |d< d|dœ}|V }dS )a   
    Overrides default host system locale with the specified one.
    **EXPERIMENTAL**
    :param locale: *(Optional)* ICU style C locale (e.g. "en_US").
    If not specified or empty,
    disables the override and restores default host system locale.
    Nr­   zEmulation.setLocaleOverridern   rp   )r­   ro   ri   r   r   r   r   Úset_locale_override­  s    
þr®   )Útimezone_idr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )as  
    Overrides default host system timezone with the specified one.
    :param timezone_id: The timezone identifier. List of supported timezones:
    https://source.chromium.org/chromium/chromium/deps/icu.git/+/
    faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt
    If empty, disables the override and restores default host system timezone.
    Z
timezoneIdzEmulation.setTimezoneOverridern   Nrp   )r¯   ro   ri   r   r   r   r   Úset_timezone_overrideÁ  s    
þr°   )ry   rz   r   c                 c  s*   t ƒ }| |d< ||d< d|dœ}|V }dS )aV  
    Resizes the frame/viewport of the page.
    Note that this does not affect the frame's container (e.g. browser window).
    Can be used to produce screenshots of the specified size.
    Not supported on Android.
    .. deprecated:: 1.3
    **EXPERIMENTAL**
    :param width: Frame width (DIP).
    :param height: Frame height (DIP).
    ry   rz   zEmulation.setVisibleSizern   Nrp   )ry   rz   ro   ri   r   r   r   r   Úset_visible_sizeÔ  s    þr±   ztyping.List[DisabledImageType])Úimage_typesr   c                 c  s,   t ƒ }dd„ | D ƒ|d< d|dœ}|V }dS )zJ
    **EXPERIMENTAL**
    :param image_types: Image types to disable.
    c                 S  s   g | ]}|  ¡ ‘qS r   rH   rI   r   r   r   rL   ó  rM   z,set_disabled_image_types.<locals>.<listcomp>Z
imageTypeszEmulation.setDisabledImageTypesrn   Nrp   )r²   ro   ri   r   r   r   r   Úset_disabled_image_typesë  s    þr³   )Úhardware_concurrencyr   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )zZ
    **EXPERIMENTAL**
    :param hardware_concurrency: Hardware concurrency to report
    ZhardwareConcurrencyz(Emulation.setHardwareConcurrencyOverridern   Nrp   )r´   ro   ri   r   r   r   r   Ú!set_hardware_concurrency_overrideû  s    þrµ   z"typing.Optional[UserAgentMetadata])Ú
user_agentÚaccept_languager:   Úuser_agent_metadatar   c                 c  sV   t ƒ }| |d< |dur||d< |dur.||d< |durB| ¡ |d< d|dœ}|V }dS )aÚ  
    Allows overriding user agent with the given string.
    ``userAgentMetadata`` must be set for Client Hint headers to be sent.
    :param user_agent: User agent to use.
    :param accept_language: *(Optional)* Browser language to emulate.
    :param platform: *(Optional)*
    The platform navigator.platform should return.
    :param user_agent_metadata: **(EXPERIMENTAL)** *(Optional)*
    To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
    Z	userAgentNZacceptLanguager:   ZuserAgentMetadatazEmulation.setUserAgentOverridern   rw   )r¶   r·   r:   r¸   ro   ri   r   r   r   r   Úset_user_agent_override  s    þr¹   c                 c  s"   t ƒ }| |d< d|dœ}|V }dS )z�
    Allows overriding the automation flag.
    **EXPERIMENTAL**
    :param enabled: Whether the override should be enabled.
    rm   zEmulation.setAutomationOverridern   Nrp   rq   r   r   r   Úset_automation_override*  s    þrº   z"Emulation.virtualTimeBudgetExpiredc                   @  s$   e Zd ZdZedd dœdd„ƒZdS )ÚVirtualTimeBudgetExpiredz�
    **EXPERIMENTAL**
    Notification sent after the virtual time budget
    for the current VirtualTimePolicy has run out.
    r   r   c                 C  s   | ƒ S r3   r   r   r   r   r   r   D  s    z"VirtualTimeBudgetExpired.from_jsonN)r    r!   r"   r#   r%   r   r   r   r   r   r»   ;  s   r»   )N)N)
NNNNNNNNNN)N)NN)NNN)N)N)NNN)N)NNN)=Ú
__future__r   ÚenumÚtypingÚdataclassesr   Úutilr   r   Ú r   r   r	   r
   r&   r,   r.   ÚEnumr1   r6   r9   rQ   rR   rZ   r\   r`   rb   rf   rj   rk   rl   rr   rs   ru   rx   r†   rˆ   r‰   r‹   r�   r�   r’   r”   r˜   rš   rœ   rž   r¡   r¢   r¤   r¥   r§   r¬   r®   r°   r±   r³   rµ   r¹   rº   r»   r   r   r   r   Ú<module>   s¼   R$$

 ÿ ÿ          ò,Y ÿ  þ   ý ý ÿ   ü+ ÿ   ü