
    wdf                     J    d Z ddlZ G d de          Z G d de          ZdS )a  
    werkzeug.useragents
    ~~~~~~~~~~~~~~~~~~~

    This module provides a helper to inspect user agent strings.  This module
    is far from complete but should work for most of the currently available
    browsers.


    :copyright: 2007 Pallets
    :license: BSD-3-Clause
    Nc                   J    e Zd ZdZdZdZdZ ej        d          Z	d Z
d ZdS )	UserAgentParserz5A simple user agent parser.  Used by the `UserAgent`.))z cros chromeos)z
iphone|iosiphone)ipadr   )zdarwin|mac|os\s*xmacos)winwindows)androidr   )netbsdr   )openbsdr   )freebsdr   )	dragonflydragonflybsd)z(sun|i86)ossolaris)zx11|lin(\b|ux)?linux)znintendo\s+wiiwii)irixr   )zhp-?uxhpux)aixr   )zsco|unix_svsco)bsdr   )amigar   )zblackberry|playbook
blackberry)symbianr   ))	googlebotgoogle)msnbotmsn)yahoor    )z
ask jeevesask)zaol|america\s+online\s+browseraol)z	opera|opropera)edger$   )zchrome|crioschrome)	seamonkeyr&   )z"firefox|firebird|phoenix|iceweaselfirefox)galeonr(   )zsafari|versionsafari)webkitr*   )caminor+   )	konquerorr,   )zk-meleonkmeleon)netscaper.   )z4msie|microsoft\s+internet\s+explorer|trident/.+? rv:msie)lynxr0   )linksr1   )Baiduspiderbaidu)bingbotbing)mozillar6   z(?:%s)[/\sa-z(]*(\d+[.\da-z]+)?za(?:;\s*|\s+)(\b\w{2}\b(?:-\b\w{2}\b)?)\s*;|(?:\(|\[|;)\s*(\b\w{2}\b(?:-\b\w{2}\b)?)\s*(?:\]|\)|;)c                 d     d  j         D              _          fd j        D              _        d S )Nc                 V    g | ]&\  }}|t          j        |t           j                  f'S  )recompileI).0abs      X/var/www/book.euthymeo.com/html/venv/lib/python3.11/site-packages/werkzeug/useragents.py
<listcomp>z,UserAgentParser.__init__.<locals>.<listcomp>L   s/    NNNtq!1bjBD112NNN    c                 h    g | ].\  }}|t          j        j        |z  t           j                  f/S r9   )r:   r;   _browser_version_rer<   )r=   r>   r?   selfs      r@   rA   z,UserAgentParser.__init__.<locals>.<listcomp>M   sH     
 
 
1 
43a7>>?
 
 
rB   )	platformsbrowsersrE   s   `r@   __init__zUserAgentParser.__init__K   sJ    NNt~NNN
 
 
 

 
 
rB   c                 n   | j         D ]\  }}|                    |          }| nd }| j        D ]3\  }}|                    |          }||                    d          } n4d x}}| j                            |          }|+|                    d          p|                    d          }nd }||||fS )N      )rF   searchrG   group_language_re)rE   
user_agentplatformregexmatchbrowserversionlanguages           r@   __call__zUserAgentParser.__call__R   s    #~ 	 	OHeLL,,E  ! H"m 	% 	%NGULL,,E ++a.. ! !%$Gg!((44{{1~~7QHHH'833rB   N)__name__
__module____qualname____doc__rF   rG   rD   r:   r;   rO   rI   rW   r9   rB   r@   r   r      sg        ??I.H4 =2:	B L

 
 
4 4 4 4 4rB   r   c                   H    e Zd ZdZ e            Zd Zd Zd Zd Z	e	Z
d ZdS )	UserAgenta  Represents a user agent.  Pass it a WSGI environment or a user agent
    string and you can inspect some of the details from the user agent
    string via the attributes.  The following attributes exist:

    .. attribute:: string

       the raw user agent string

    .. attribute:: platform

       the browser platform. ``None`` if not recognized.
       The following platforms are currently recognized:

       -   `aix`
       -   `amiga`
       -   `android`
       -   `blackberry`
       -   `bsd`
       -   `chromeos`
       -   `dragonflybsd`
       -   `freebsd`
       -   `hpux`
       -   `ipad`
       -   `iphone`
       -   `irix`
       -   `linux`
       -   `macos`
       -   `netbsd`
       -   `openbsd`
       -   `sco`
       -   `solaris`
       -   `symbian`
       -   `wii`
       -   `windows`

    .. attribute:: browser

        the name of the browser. ``None`` if not recognized.
        The following browsers are currently recognized:

        -   `aol` *
        -   `ask` *
        -   `baidu` *
        -   `bing` *
        -   `camino`
        -   `chrome`
        -   `edge`
        -   `firefox`
        -   `galeon`
        -   `google` *
        -   `kmeleon`
        -   `konqueror`
        -   `links`
        -   `lynx`
        -   `mozilla`
        -   `msie`
        -   `msn`
        -   `netscape`
        -   `opera`
        -   `safari`
        -   `seamonkey`
        -   `webkit`
        -   `yahoo` *

        (Browsers marked with a star (``*``) are crawlers.)

    .. attribute:: version

        the version of the browser. ``None`` if not recognized.

    .. attribute:: language

        the language of the browser. ``None`` if not recognized.
    c                     t          |t                    r|                    dd          }|| _        |                     |          \  | _        | _        | _        | _        d S )NHTTP_USER_AGENT )	
isinstancedictgetstring_parserrQ   rT   rU   rV   )rE   environ_or_strings     r@   rI   zUserAgent.__init__   sa    '.. 	M 1 5 56G L L'CG<<D
 D
@t|T\4===rB   c                     | j         S Nrd   rH   s    r@   	to_headerzUserAgent.to_header   
    {rB   c                     | j         S rh   ri   rH   s    r@   __str__zUserAgent.__str__   rk   rB   c                 *    t          | j                  S rh   )boolrT   rH   s    r@   __nonzero__zUserAgent.__nonzero__   s    DL!!!rB   c                 B    d| j         j        d| j        d| j        dS )N< />)	__class__rX   rT   rU   rH   s    r@   __repr__zUserAgent.__repr__   s(     #~666dlllSSrB   N)rX   rY   rZ   r[   r   re   rI   rj   rm   rp   __bool__rw   r9   rB   r@   r]   r]   h   s        I IV oG
 
 
    " " " HT T T T TrB   r]   )r[   r:   objectr   r]   r9   rB   r@   <module>rz      s     
			T4 T4 T4 T4 T4f T4 T4 T4nbT bT bT bT bT bT bT bT bT bTrB   