
    <6hi                        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	m
Z
mZmZmZmZmZmZ ddlmZ ddlmZmZmZmZ dd	lmZmZ dd
lmZmZ eedf   Z G d d      Z e G d d             Z! e!       Z" G d d      Z#y)    N)	lru_cache)dumpsloads)randint)AnyDictIterableListOptionalTypeUnioncast   )errors)ColorColorParseErrorColorSystem	blend_rgb)Result	rich_repr)DEFAULT_TERMINAL_THEMETerminalThemeStylec                   F    e Zd ZdZdgZdeddfdZddd	ed   dee	   fd
Z
y)_Bitz.A descriptor to get/set a style attribute bit.bitbit_noreturnNc                     d|z  | _         y )Nr   )r   )selfr   s     [/var/www/panel.atabookie.online/venv/lib/python3.12/site-packages/pip/_vendor/rich/style.py__init__z_Bit.__init__   s    ;    objr   objtypec                 n    |j                   | j                  z  r|j                  | j                  z  dk7  S y )Nr   )_set_attributesr   _attributes)r    r$   r%   s      r!   __get__z_Bit.__get__   s/    )??TXX-22r#   )__name__
__module____qualname____doc__	__slots__intr"   r   r   boolr)    r#   r!   r   r      sA    8Is t 7 T'] x~ r#   r   c            &       V   e Zd ZU dZee   ed<   ee   ed<   eed<   eed<   ee   ed<   eed<   ee	   ed<   g d	Z
d
dddddddddddddZi ddddddddddddddddd d d!d!d"d"d#d"d$d$d%d$d&d&d'd&d(d(d(d)d*d+d+d,Zd-d-d-d-d-d-d-d-d-d-d-d-d-d-d-d-d-d.d/eeeef      d0eeeef      dee   dee   dee   dee   d ee   d!ee   d"ee   d$ee   d&ee   d(ee   d)ee   d*ee   d+ee   d1ee   d2eeeef      f"d3Zedrd5       Ze	 dsd/ee   d0ee   d4d fd6       Zed2eeeef      d4d fd7       Zedtd2eeeef      d8ed4d fd9       Z ed:      Z ed;      Z ed<      Z ed=      Z ed>      Z ed?      Z ed@      Z edA      Z edB      Z  edC      Z! edD      Z" edE      Z# edF      Z$e%d4efdG       Z&d4efdHZ'd4efdIZ(dJe)d4efdKZ*e e+dLM      dNed4efdO              Z,edPee-   d4e-fdQ       Z.d4e/fdRZ0dSed4efdTZ1dSed4efdUZ2d4efdVZ3e%d4ee   fdW       Z4e%d4ee   fdX       Z5e%d4ee   fdY       Z6e%d4efdZ       Z7e%drd[       Z8e%d4eeef   fd\       Z9e%drd]       Z:e e+d^M      d_ed4d fd`              Z; e+dLM      dtdaee<   d4efdb       Z=edce>d    d4d fdd       Z?edude       Z@drdfZA e+dgM      drdh       ZBdtd1ee   d4d fdiZC	 dve)j                  djdkdledJee)   dmed4efdnZEdtdlee   d4d-fdoZF e+dLM      dNed    d4d fdp       ZGdNed    d4d fdqZHy-)wr   a  A terminal style.

    A terminal style consists of a color (`color`), a background color (`bgcolor`), and a number of attributes, such
    as bold, italic etc. The attributes have 3 states: they can either be on
    (``True``), off (``False``), or not set (``None``).

    Args:
        color (Union[Color, str], optional): Color of terminal text. Defaults to None.
        bgcolor (Union[Color, str], optional): Color of terminal background. Defaults to None.
        bold (bool, optional): Enable bold text. Defaults to None.
        dim (bool, optional): Enable dim text. Defaults to None.
        italic (bool, optional): Enable italic text. Defaults to None.
        underline (bool, optional): Enable underlined text. Defaults to None.
        blink (bool, optional): Enabled blinking text. Defaults to None.
        blink2 (bool, optional): Enable fast blinking text. Defaults to None.
        reverse (bool, optional): Enabled reverse text. Defaults to None.
        conceal (bool, optional): Enable concealed text. Defaults to None.
        strike (bool, optional): Enable strikethrough text. Defaults to None.
        underline2 (bool, optional): Enable doubly underlined text. Defaults to None.
        frame (bool, optional): Enable framed text. Defaults to None.
        encircle (bool, optional): Enable encircled text. Defaults to None.
        overline (bool, optional): Enable overlined text. Defaults to None.
        link (str, link): Link URL. Defaults to None.

    _color_bgcolorr(   r'   _hash_null_meta)r3   r4   r(   r'   _link_link_id_ansi_style_definitionr5   r6   r7   12345678921515253)r   r                        	   
         dimdboldbitalici	underlineublinkblink2reverserconcealcstrikes
underline2frameencircleoverline)uure   rf   rg   oN)colorbgcolorrV   rT   rX   rZ   r\   r]   r^   r`   rb   rd   re   rf   rg   linkmetarj   rk   rl   rm   c                v   d | _         d | _        dt        t        t        f   dt        fd}|d n ||      | _        |d n ||      | _        t        |d u|d uxr d|d uxr d|d uxr d|d uxr d|d uxr d|	d uxr d	|
d uxr d
|d uxr d|d uxr d|d uxr d|d uxr d|d uxr df      | _        | j                  rt        |xr dxs d|xr dxs d|xr dxs d|xr dxs d|xr dxs d|xr dxs d|	xr d	xs d|
xr d
xs d|xr dxs d|xr dxs d|xr dxs d|xr dxs d|xr dxs df      nd| _	        || _
        |d n
t        |      | _        |s|r#t        dd       t        | j                         nd| _        d | _        | j                  xs |xs
 |xs |xs | | _        y )Nrj   r   c                 P    t        | t              r| S t        j                  |       S N)
isinstancer   parse)rj   s    r!   _make_colorz#Style.__init__.<locals>._make_color   s    &ue45L%++e:LLr#   rI   rK   rO          @                     r   r   ?B  )r:   r;   r   r   strr3   r4   sumr'   r(   r8   r   r7   r   hashr9   r5   r6   )r    rj   rk   rV   rT   rX   rZ   r\   r]   r^   r`   rb   rd   re   rf   rg   rl   rm   rs   s                      r!   r"   zStyle.__init__z   sD   * %)
04	MuUCZ0 	MU 	M $mdU1C '[5I"D 4%Ad"(q%+!T!(bd")rt#*t#+d"*s$&.3T!*d$-$- 
F ### JQO!IANLq%AO!(qLb%AMr&QN'aO(qNs'a&3+!Nd'a%*%*$ ' 	, 
!\TuT{
:>$wq&!"4

#3"45R 	 %)
..R%R7RdRdS
r#   r   c                     t         S )zCCreate an 'null' style, equivalent to Style(), but more performant.)
NULL_STYLE)clss    r!   nullz
Style.null   s
     r#   c                     | j                  t              }d|_        d|_        ||_        ||_        d|_        d|_        d|_        d|_	        d|_
        |xs | |_        d|_        |S )a  Create a new style with colors and no attributes.

        Returns:
            color (Optional[Color]): A (foreground) color, or None for no color. Defaults to None.
            bgcolor (Optional[Color]): A (background) color, or None for no color. Defaults to None.
        Nr   r~   )__new__r   r:   r;   r3   r4   r'   r(   r8   r9   r7   r6   r5   )r   rj   rk   styles       r!   
from_colorzStyle.from_color   so     {{5)"&  ! +G,r#   c                     | j                  t              }d|_        d|_        d|_        d|_        d|_        d|_        d|_        t        |      |_
        t        dd       t        |j                         |_        d|_        | |_        |S )zCreate a new style with meta data.

        Returns:
            meta (Optional[Dict[str, Any]]): A dictionary of meta data. Defaults to None.
        Nr   r}   )r   r   r:   r;   r3   r4   r'   r(   r8   r   r7   r   r   r9   r5   r6   )r   rm   r   s      r!   	from_metazStyle.from_meta   s     {{5)"& !Dk#Av./U[[0A/BCjr#   handlersc                     |i n|}|j                  |j                         D ci c]  \  }}d| | c}}       | j                  |      S c c}}w )a  Create a blank style with meta information.

        Example:
            style = Style.on(click=self.on_click)

        Args:
            meta (Optional[Dict[str, Any]], optional): An optional dict of meta information.
            **handlers (Any): Keyword arguments are translated in to handlers.

        Returns:
            Style: A Style with meta information attached.
        @)updateitemsr   )r   rm   r   keyvalues        r!   onzStyle.on   sQ     \rt8HI*#uqY%IJ}}T"" Js   A
r   r   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   c                     | j                   S )z+Get a link id, used in ansi code for links.)r9   r    s    r!   link_idzStyle.link_id       }}r#   c                 t   | j                    g }|j                  }| j                  }|dz  rl|dz  r || j                  rdnd       |dz  r || j                  rdnd       |dz  r || j
                  rd	nd
       |dz  r || j                  rdnd       |dz  r|dz  r || j                  rdnd       |dz  r || j                  rdnd       |dz  r || j                  rdnd       |dz  r || j                  rdnd       |dz  r || j                  rdnd       |dz  rl|dz  r || j                  rd nd!       |d"z  r || j                  rd#nd$       |d%z  r || j                  rd&nd'       |d(z  r || j                  rd)nd*       | j                    || j                   j"                         | j$                  $ |d+        || j$                  j"                         | j&                  r |d,        || j&                         d-j)                  |      xs d.| _         | j                   S )/z-Re-generate style definition from attributes.   r   rV   znot boldrI   rT   znot dimrK   rX   z
not italicrO   rZ   znot underline  rt   r\   z	not blinkru   r]   z
not blink2rv   r^   znot reverserw   r`   znot concealrx   rb   z
not strike   ry   rd   znot underline2rz   re   z	not framer{   rf   znot encircler|   rg   znot overliner   rl    none)r;   appendr'   rV   rT   rX   rZ   r\   r]   r^   r`   rb   rd   re   rf   rg   r3   namer4   r8   join)r    
attributesr   bitss       r!   __str__zStyle.__str__  s   !!)$&J&&F''Do%!8TYY6J?6?DHH5)<6?t{{8E6?$..;oNo%6?djj7kB6?t{{8E6?9-H6?9-H6?t{{8Eo%6?4??<@PQ7#djj7kB7#:NK7#:NK{{&t{{''(}}(tt}}))*zzvtzz"%(XXj%9%CVD"%%%r#   c                     | j                    S )z;A Style is false if it has no attributes, colors, or links.)r6   r   s    r!   __bool__zStyle.__bool__K  s    ::~r#   color_systemc                    | j                   ig }|j                  }| j                  }| j                  | j                  z  }|r|dz  r ||d          |dz  r ||d          |dz  r ||d          |dz  r ||d          |dz  r%t        dd      D ]  }|d|z  z  s |||           |d	z  r%t        dd
      D ]  }|d|z  z  s |||           | j                  8|j                  | j                  j                  |      j                                | j                  :|j                  | j                  j                  |      j                  d             dj                  |      | _         | j                   S )zGenerate ANSI codes for this style.

        Args:
            color_system (ColorSystem): Color system.

        Returns:
            str: String containing codes.
        r   r   rI   rK   rO   rJ   r   rP   r      F
foreground;)r:   r   
_style_mapr(   r'   ranger3   extend	downgradeget_ansi_codesr4   r   )r    r   sgrr   r   r   r   s          r!   _make_ansi_codeszStyle._make_ansi_codesO  s}    ::CZZFJ))D,@,@@J>:a=)>:a=)>:a=)>:a=)/$Q{ 4%c2":c?34 /$Q| 4%c2":c?34 {{&

4;;00>MMOP}}(

MM++L9HH#( I 
 #DJzzr#   rz   )maxsizer   c                     	 t        | j                  |            S # t        j                  $ r! |j	                         j                         cY S w xY w)zNormalize a style definition so that styles with the same effect have the same string
        representation.

        Args:
            style (str): A style definition.

        Returns:
            str: Normal form of style definition.
        )r   rr   r   StyleSyntaxErrorstriplower)r   r   s     r!   	normalizezStyle.normalizez  sE    	)syy'((&& 	);;=&&((	)s    1AAvaluesc                 2    |D ]  }||c S  t        d      )zPick first non-None style.z$expected at least one non-None style)
ValueError)r   r   r   s      r!   
pick_firstzStyle.pick_first  s,      	E 	 ?@@r#   c              #   D  K   d| j                   d f d| j                  d f d| j                  d f d| j                  d f d| j                  d f d| j
                  d f d| j                  d f d| j                  d f d	| j                  d f d
| j                  d f d| j                  d f d| j                  d f d| j                  d f d| j                  d f d| j                  d f | j                  rd| j                   f y y w)Nrj   rk   rV   rT   rX   rZ   r\   r]   r^   r`   rb   rd   re   rf   rl   rm   )rj   rk   rV   rT   rX   rZ   r\   r]   r^   r`   rb   rd   re   rf   rl   r7   rm   r   s    r!   __rich_repr__zStyle.__rich_repr__  s     tzz4''t++dii&&TXXt$$T))4>>400tzz4''T))t++t++T))DOOT11tzz4''$----dii%%::$))## s   DD otherc                 p    t        |t              st        S | j                         |j                         k(  S rp   rq   r   NotImplemented__hash__r    r   s     r!   __eq__zStyle.__eq__  *    %'!!}}%.."222r#   c                 p    t        |t              st        S | j                         |j                         k7  S rp   r   r   s     r!   __ne__zStyle.__ne__  r   r#   c                     | j                   | j                   S t        | j                  | j                  | j                  | j
                  | j                  | j                  f      | _         | j                   S rp   )r5   r   r3   r4   r(   r'   r8   r7   r   s    r!   r   zStyle.__hash__  sa    ::!::  $$



	

 zzr#   c                     | j                   S )z.The foreground color or None if it is not set.)r3   r   s    r!   rj   zStyle.color  s     {{r#   c                     | j                   S )z.The background color or None if it is not set.)r4   r   s    r!   rk   zStyle.bgcolor  r   r#   c                     | j                   S )zLink text, if set.)r8   r   s    r!   rl   z
Style.link  s     zzr#   c                 N    | j                   du xs | j                   j                  S )z6Check if the style specified a transparent background.N)rk   
is_defaultr   s    r!   transparent_backgroundzStyle.transparent_background  s"     ||t#>t||'>'>>r#   c                 .    t        | j                        S )zA Style with background only.)rk   )r   rk   r   s    r!   background_stylezStyle.background_style  s     T\\**r#   c                 ~    | j                   i S t        t        t        t        f   t        | j                               S )z=Get meta information (can not be changed after construction).)r7   r   r   r   r   r   r   s    r!   rm   z
Style.meta  s0     ZZ'rTT$sCx.%

BS-TTr#   c                 \   | j                   rt        S | j                  t              }d|_        d|_        d|_        d|_        | j                  |_        | j                  |_	        | j                  |_
        | j                  rt        dd       nd|_        d|_         d|_        d|_        |S )z+Get a copy of the style with color removed.Nr   r}   r~   F)r6   r   r   r   r:   r;   r3   r4   r(   r'   r8   r   r9   r7   r5   r    r   s     r!   without_colorzStyle.without_color  s     ::||E*"& ,, $ 4 4jj48JJGAv./Br#   r|   style_definitionc                 T   |j                         dk(  s|s| j                         S | j                  }d}d}i }d}t        |j	                               }|D ]  }|j                         }	|	dk(  r>t        |d      }	|	st        j                  d      	 t        j                  |	      du  |	}V|	dk(  r=t        |d      }	|j                  |	      }|t        j                  d	|	      d
||<   |	dk(  r&t        |d      }	|	st        j                  d      |	}|	|v r	d|||	   <   	 t        j                  |	       |	} t        d|||d|}|S # t        $ r!}
t        j                  d|	d|
       dd}
~
ww xY w# t        $ r!}
t        j                  d|	d|
       dd}
~
ww xY w)a  Parse a style definition.

        Args:
            style_definition (str): A string containing a style.

        Raises:
            errors.StyleSyntaxError: If the style definition syntax is invalid.

        Returns:
            `Style`: A Style instance.
        r   Nr   r~   zcolor expected after 'on'zunable to parse z as background color; notz,expected style attribute after 'not', found Frl   zURL expected after 'link'Tz as color; )rj   rk   rl   r1   )r   r   STYLE_ATTRIBUTESitersplitr   nextr   r   r   rr   r   getr   )r   r   r   rj   rk   r   rl   wordsoriginal_wordworderror	attributer   s                r!   rr   zStyle.parse  s    !!#v-5E88://#!%/1
"%++-." '	M &&(Dt|E2 112MNN KK%-
 E2,006	$ 11FthO  ).
9%E2 112MNN))59
+D12 KK%
 O'	P LE7LLC '   11*4(2HP  6 '   11*4(+eWE  s0   E&E=	E:E55E:=	F'F""F'themec                    |xs t         }g }|j                  }| j                  }| j                  }| j                  r||}}| j
                  rI||j                  n|j                  |      }t        j                  t        ||j                  d            }|;|j                  |      } |d|j                           |d|j                          |(|j                  |d      } |d|j                          | j                  r |d       | j                  r |d       | j                  r |d	       | j                   r |d
       | j"                  r |d       dj%                  |      S )zGet a CSS style rule.g      ?zcolor: ztext-decoration-color: Fr   zbackground-color: zfont-weight: boldzfont-style: italicztext-decoration: underlineztext-decoration: line-throughztext-decoration: overlinez; )r   r   rj   rk   r^   rT   foreground_colorget_truecolorr   from_tripletr   background_colorhexrV   rX   rZ   rb   rg   r   )r    r   cssr   rj   rk   r   theme_colors           r!   get_html_stylezStyle.get_html_style3  sZ    //

,,<<$e7E88*/-&&U=P=PQV=W  &&*E,B,BCHE --e4KW[__-./,[__,=>?!//%/HK''89:99&';;'(>>/0;;23==./yy~r#   stylesc                 B    t        |      }t        |t        |            S )zCombine styles and get result.

        Args:
            styles (Iterable[Style]): Styles to combine.

        Returns:
            Style: A new style instance.
        r   r   r   r   r   iter_styless      r!   combinezStyle.combineX       6l;[ 122r#   c                 B    t        |      }t        |t        |            S )zCombine styles from positional argument in to a single style.

        Args:
            *styles (Iterable[Style]): Styles to combine.

        Returns:
            Style: A new style instance.
        r   r   s      r!   chainzStyle.chaine  r   r#   c                    | j                   rt        S | j                  t              }| j                  |_        | j
                  |_        | j                  |_        | j                  |_        | j                  |_        | j                  |_	        | j                  |_
        | j                  rt        dd       nd|_        | j                  |_        d|_         | j                  |_        |S )zwGet a copy of this style.

        Returns:
            Style: A new Style instance with identical attributes.
        r   r}   r~   F)r6   r   r   r   r:   r;   r3   r4   r(   r'   r8   r   r9   r5   r7   r   s     r!   copyz
Style.copyr  s     ::||E*jj"&"8"8{{ ,, $ 4 4jj48JJGAv./Bjjjjr#   rw   c                 z   | j                   rt        S | j                  t              }| j                  |_        | j
                  |_        | j                  |_        | j                  |_        | j                  |_        | j                  |_	        d|_
        d|_        | j                  |_        d|_         d|_        |S )zGet a copy of this style with link and meta information removed.

        Returns:
            Style: New style object.
        Nr~   F)r6   r   r   r   r:   r;   r3   r4   r(   r'   r8   r9   r5   r7   r   s     r!   clear_meta_and_linkszStyle.clear_meta_and_links  s     ::||E*jj"&"8"8{{ ,, $ 4 4jjr#   c                 t   | j                  t              }| j                  |_        | j                  |_        | j                  |_        | j
                  |_        | j                  |_        | j                  |_        ||_        |rt        dd       nd|_
        d|_        d|_        | j                  |_        |S )zGet a copy with a different value for link.

        Args:
            link (str, optional): New value for link. Defaults to None.

        Returns:
            Style: A new Style instance.
        r   r}   r~   NF)r   r   r:   r;   r3   r4   r(   r'   r8   r   r9   r5   r6   r7   )r    rl   r   s      r!   update_linkzStyle.update_link  s     ||E*jj"&"8"8{{ ,, $ 4 448GAv./bjjr#   F)r   legacy_windowstextr   c                    |r||S | j                   xs | j                  |      }|r	d| d| dn|}| j                  r"|s d| j                   d| j                   d| d}|S )aD  Render the ANSI codes for the style.

        Args:
            text (str, optional): A string to style. Defaults to "".
            color_system (Optional[ColorSystem], optional): Color system to render to. Defaults to ColorSystem.TRUECOLOR.

        Returns:
            str: A string containing ANSI style codes.
        z[mz[0mz]8;id=r   z\z]8;;\)r:   r   r8   r9   )r    r   r   r   attrsrendereds         r!   renderzStyle.render  sw      |+K

Ad33LA49U5'4&0t::nT]]O1TZZLxjW  r#   c                     |xs t        |       }t        j                  j                  | j	                  |       d       y)zWrite text with style directly to terminal.

        This method is for testing purposes only.

        Args:
            text (Optional[str], optional): Text to style or None for style name.

        
N)r   sysstdoutwriter  )r    r   s     r!   testz
Style.test  s5      s4y

DKK-.b12r#   c                    ||j                   r| S | j                   r|S | j                  t              }d |_        d |_        |j
                  xs | j
                  |_        |j                  xs | j                  |_        | j                  |j                   z  |j                  |j                  z  z  |_        | j                  |j                  z  |_        |j                  xs | j                  |_	        |j                  xs | j                  |_
        |j                   |_         | j                  r5|j                  r)t        i | j                  |j                        |_        n| j                  xs |j                  |_        d |_        |S rp   )r6   r   r   r:   r;   r3   r4   r(   r'   r8   r9   r7   r   rm   r5   )r    r   	new_styles      r!   _addz
Style._add  s6   =EKKK::L<<.		&*	# <<64;;	"^^<t}}	!%!1!1U5J5J4J!J 5 55!
	 %)$8$85;P;P$P	!++3	"^^<t}}	++	::%++#$?tyy$?EJJ$?@IO"jj7EKKIO	r#   c                 `    | j                  |      }|j                  r|j                         S |S rp   )r  rl   r   )r    r   combined_styles      r!   __add__zStyle.__add__  s,    5)(6(;(;~""$OOr#   )r   r   )NNrp   )r   r   r   r   )r~   )Ir*   r+   r,   r-   r   r   __annotations__r/   r0   bytesr.   r   r   r   r   r   r   r"   classmethodr   r   r   r   r   rV   rT   rX   rZ   r\   r]   r^   r`   rb   rd   re   rf   rg   propertyr   r   r   r   r   r   r   	StyleTyper   r   r   r   r   r   rj   rk   rl   r   r   rm   r   rr   r   r   r	   r   r   r   r   r   	TRUECOLORr  r  r  r  r1   r#   r!   r   r      s   4 UOuoC=KE?I  J uU 	 	V	
 	( 	X 	[ 	[ 	 	( 	9 	Y 	9 	Y 	(  	X!" 	l#$ -8 .2/3#"!%$( $!%"&"&!%%) $#'#'")-'JT eSj)*JT %s
+,	JT
 tnJT d^JT JT D>JT ~JT JT $JT $JT JT TNJT ~JT  4.!JT" 4.#JT$ sm%JT& tCH~&'JTX   GKUO5=e_	 . Xd38n5 '  ( #htCH~. #3 #7 # #" 7D
q'C!WFQIGE!WF1gG1gG!WFaJHEBxHBxH  ,& ,&\$ )[ )S )V t)c )c )  ) A)!4 A A A$v $&3C 3D 3
3C 3D 3
#  x   %   hsm   ? ? ? + + Ud38n U U  $ t?S ?W ?  ?B t"H]$; "s " "H 
3Xg. 
37 
3 
3 
3 
3, s ,  2  /:.C.C$ {+	
  
4
3# 
3$ 
3 t(7+   0PXg. P7 Pr#   c                   \    e Zd ZdZdgZddZdefdZede	fd       Z
de	ddfd	Zde	fd
Zy)
StyleStackzA stack of styles._stackr   Nc                     |g| _         y rp   r  )r    default_styles     r!   r"   zStyleStack.__init__  s    $1?r#   c                 "    d| j                   dS )Nz<stylestack >r  r   s    r!   __repr__zStyleStack.__repr__  s    dkk_A..r#   c                      | j                   d   S )z&Get the Style at the top of the stack.r  r   s    r!   currentzStyleStack.current  s     {{2r#   r   c                 Z    | j                   j                  | j                   d   |z          y)z}Push a new style on to the stack.

        Args:
            style (Style): New style to combine with current style.
        r  N)r  r   r   s     r!   pushzStyleStack.push  s#     	4;;r?U23r#   c                 T    | j                   j                          | j                   d   S )z}Pop last style and discard.

        Returns:
            Style: New current style (also available as stack.current)
        r  )r  popr   s    r!   r$  zStyleStack.pop  s      	{{2r#   )r  r   r   N)r*   r+   r,   r-   r.   r"   r   r  r  r   r   r"  r$  r1   r#   r!   r  r    sW    
I3/# /   4% 4D 4U r#   r  )$r  	functoolsr   marshalr   r   randomr   typingr   r   r	   r
   r   r   r   r   r~   r   rj   r   r   r   r   reprr   r   terminal_themer   r   r   r  r   r   r   r  r1   r#   r!   <module>r+     sv    
     I I I  A A # A #w,	  XP XP XPv W
 r#   