+
    i`                        ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
HtHtHtHtHtHtHtHtHtHt ^RIHtHtHtHtHt ^RIHtHt ^R	IHt ]'       d   ^R
I H!t!H"t"H#t# ]! R4      t$ ! R R]4      t%]]]%,          ]]%]]&]'3,          3,          ]]%]&]&3,          3,          t(]! 4        ! R R]4      4       t) ! R R4      t* ! R R4      t+],R8X  Ed	   ^ RI-H!t! ^ RI.H/t/ ^ RI0H1t1 Rt2]1Pf                  ! R4      t4]!! 4       t ] Pk                  R4       ] Pm                  R4       ] Pm                  R4       ] Pm                  ]/! ]2RRR7      4       ] Pm                  4        ] Pm                  R 4       ]7! ] Pq                  ]44      4      t9] Pm                  ]94       ] Pm                  4        ] Pm                  R!4       ] Pm                  ]44       ] Pm                  R"4       R## R## )$    )IntEnum)	lru_cache)filterfalse)	getLogger)
attrgetter)
TYPE_CHECKINGDictIterableList
NamedTupleOptionalSequenceTupleTypeUnion)_is_single_cell_widthscached_cell_lencell_lenget_character_cell_sizeset_cell_size)Result	rich_repr)Style)ConsoleConsoleOptionsRenderResultrichc                   Z    ] tR t^#tRt^t^t^t^t^t	^t
^t^t^	t^
t^t^t^t^t^t^tRtR# )ControlTypezDNon-printable control codes which typically translate to ANSI codes. N)__name__
__module____qualname____firstlineno____doc__BELLCARRIAGE_RETURNHOMECLEARSHOW_CURSORHIDE_CURSORENABLE_ALT_SCREENDISABLE_ALT_SCREEN	CURSOR_UPCURSOR_DOWNCURSOR_FORWARDCURSOR_BACKWARDCURSOR_MOVE_TO_COLUMNCURSOR_MOVE_TOERASE_IN_LINESET_WINDOW_TITLE__static_attributes__r        _/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_vendor/rich/segment.pyr   r   #   sY    NDODEKKIKNONMr7   r   c                     a  ] tR t^?t o RtRtRt]V 3R lR l4       tV 3R lR lt	V 3R lR lt
]V 3R	 lR
 l4       t]]! R34      V 3R lR l4       4       tV 3R lR lt]V 3R lR l4       t]R4V 3R lR ll4       t]R5V 3R lR ll4       t]V 3R lR l4       t]R6V 3R lR ll4       t]R7V 3R lR ll4       t]V 3R lR l4       t]V 3R lR l4       t]R8V 3R lR  ll4       t]R5V 3R! lR" ll4       t]R5V 3R# lR$ ll4       t]R5V 3R% lR& ll4       t]V 3R' lR( l4       t]V 3R) lR* l4       t]V 3R+ lR, l4       t]V 3R- lR. l4       t]V 3R/ lR0 l4       t V 3R1 lt!R2t"V t#R# )9Segmenta  A piece of text with associated style. Segments are produced by the Console render process and
are ultimately converted in to strings to be written to the terminal.

Args:
    text (str): A piece of text.
    style (:class:`~rich.style.Style`, optional): An optional style to apply to the text.
    control (Tuple[ControlCode], optional): Optional sequence of control codes.

Attributes:
    cell_length (int): The cell length of this Segment.
Nc                    < V ^8  d   QhRS[ /#    return)int)format__classdict__s   "r8   __annotate__Segment.__annotate__R   s     0 0S 0r7   c                6    V w  rpV'       d   ^ # \        V4      # )zbThe number of terminal cells required to display self.text.

Returns:
    int: A number of cells.
)r   )selftext_stylecontrols   &   r8   cell_lengthSegment.cell_lengthQ   s     !%gq/$/r7   c                    < V ^8  d   QhRS[ /# r<   )r   )r@   rA   s   "r8   rB   rC   [   s      v r7   c              #     "   V P                   x  V P                  f!   V P                  e   V P                  x  R # R # V P                  x  V P                  x  R # 5iN)rF   rH   stylerE   s   &r8   __rich_repr__Segment.__rich_repr__[   sG     ii<<zz%jj  & **,,s   AAc                    < V ^8  d   QhRS[ /# r<   bool)r@   rA   s   "r8   rB   rC   d   s      $ r7   c                ,    \        V P                  4      # )z#Check if the segment contains text.)rT   rF   rO   s   &r8   __bool__Segment.__bool__d   s    DIIr7   c                    < V ^8  d   QhRS[ /# r<   rS   )r@   rA   s   "r8   rB   rC   i   s     ( (D (r7   c                    V P                   RJ# )z,Check if the segment contains control codes.N)rH   rO   s   &r8   
is_controlSegment.is_controlh   s     ||4''r7   c                8   < V ^8  d   QhRRRS[ RS[R,          /# )r=   segmentr:   cutr>   r:   r:   r?   r   )r@   rA   s   "r8   rB   rC   o   s(     - -9 -3 -5AU;V -r7   c                f   Vw  r4p\         pVP                  pW'8  d   W! RWE4      3# \        p\        W',          \	        V4      ,          4      p	 VRV	 p
\        V
4      pW,
          pV'       g   V! WV4      V! W9R WE4      3# VR8X  d@   V! W9,          4      ^8X  d-   V! VRV	 R,           WE4      V! RW9^,           R ,           WE4      3# V^8X  dG   V! W9^,
          ,          4      ^8X  d-   V! VRV	^,
           R,           WE4      V! RW9R ,           WE4      3# W8  d   V	^,          p	K  V	^,          p	K  )a  Split a segment in to two at a given cell position.

Note that splitting a double-width character, may result in that character turning
into two spaces.

Args:
    segment (Segment): A segment to split.
    cut (int): A cell position to cut on.

Returns:
    A tuple of two segments.
 N )r:   rI   r   r?   lenr   )clsr]   r^   rF   rN   rH   _SegmentrI   	cell_sizeposbeforecell_posout_bys   &&&          r8   _split_cellsSegment._split_cellsm   sL     'W))HR888+	3$D	12$3ZF'H^FVG4T$Z8  |	$) 4 9T$3Z#-u>S4a	?2EC  |	$Qw- 8A =T)C!G_s2ECS4:-u>  ~qqr7   c                4   < V ^8  d   QhRS[ RS[R,          /# )r=   r^   r>   r_   r`   )r@   rA   s   "r8   rB   rC      s!     , ,s ,u-A'B ,r7   c                    V w  r#pV^ 8  g   Q h\        V4      '       d<   V\        V4      8  d   V \        RW44      3# \        VRV W44      \        W!R W44      3# V P                  W4      # )a@  Split segment in to two segments at the specified column.

If the cut point falls in the middle of a 2-cell wide character then it is replaced
by two spaces, to preserve the display width of the parent segment.

Args:
    cut (int): Offset within the segment to cut.

Returns:
    Tuple[Segment, Segment]: Two segments.
rb   N)r   re   r:   rm   )rE   r^   rF   rN   rH   s   &&   r8   split_cellsSegment.split_cells   s}      $Waxx!$''c$iWR888Tc
E3T
E3 
   ++r7   c                   < V ^8  d   QhRR/# )r=   r>   r:   r    )r@   rA   s   "r8   rB   rC      s      Y r7   c                    V ! R4      # )zMake a new line segment.
r    )rf   s   &r8   lineSegment.line   s     4yr7   c          	      n   < V ^8  d   QhRS[ R,          RS[S[,          RS[S[,          RS[ R,          /# )r=   segmentsr:   rN   
post_styler>   )r
   r   r   )r@   rA   s   "r8   rB   rC      sE     & &9%& & UO	&
 
)	&r7   c                |   a aa TpV'       d   VP                   oVV 3R lV 4       pS'       d   V V3R lV 4       pV# )a  Apply style(s) to an iterable of segments.

Returns an iterable of segments where the style is replaced by ``style + segment.style + post_style``.

Args:
    segments (Iterable[Segment]): Segments to process.
    style (Style, optional): Base style. Defaults to None.
    post_style (Style, optional): Style to apply on top of segment style. Defaults to None.

Returns:
    Iterable[Segments]: A new iterable of segments (possibly the same iterable).
c              3   \   <"   T F!  w  rpS! Y'       d   R MS! V4      V4      x  K#  	  R # 5irM   r    ).0rF   rG   rH   applyrf   s   &   r8   	<genexpr>&Segment.apply_style.<locals>.<genexpr>   s1      -<)D' D'$uV}gFF-<s   ),c              3   t   <"   T F-  w  rpS! TV'       d   R MV'       d
   VS,           MSV4      x  K/  	  R # 5irM   r    )r}   rF   rG   rH   rf   rz   s   &   r8   r   r      sG       .=)D'  # 5;fz1  .=s   88)__add__)rf   ry   rN   rz   result_segmentsr~   s   f&&f @r8   apply_styleSegment.apply_style   sC    & #MME-<O  .=O r7   c                H   < V ^8  d   QhRS[ R,          RS[RS[ R,          /# )r=   ry   r:   rZ   r>   )r
   rT   )r@   rA   s   "r8   rB   rC      s4     @ @	*@8<@	)	@r7   c                f    V'       d   \        \        R4      V4      # \        \        R4      V4      # )a  Filter segments by ``is_control`` attribute.

Args:
    segments (Iterable[Segment]): An iterable of Segment instances.
    is_control (bool, optional): is_control flag to match in search.

Returns:
    Iterable[Segment]: And iterable of Segment instances.

rH   )filterr   r   )rf   ry   rZ   s   &&&r8   filter_controlSegment.filter_control   s+     *Y/::z)4h??r7   c                R   < V ^8  d   QhRS[ R,          RS[ S[R,          ,          /# r=   ry   r:   r>   )r
   r   )r@   rA   s   "r8   rB   rC      s)      8I#6 8DO;T r7   c              #  \  "   . pVP                   pV F  pRVP                  9   dj   VP                  '       gX   Vw  rVpV'       dI   VP                  R4      w  rpV'       d   V! V ! W4      4       V	'       g   K<  Vx  . pVP                   pKP  K}  V! V4       K  	  V'       d   Vx  R# R# 5i)zSplit a sequence of segments in to a list of lines.

Args:
    segments (Iterable[Segment]): Segments potentially containing line feeds.

Yields:
    Iterable[List[Segment]]: Iterable of segment lists, one per line.
ru   N)appendrF   rH   	partition)
rf   ry   rv   r   r]   rF   rN   __textnew_lines
   &&        r8   split_linesSegment.split_lines   s      !Gw||#GOOO!(Q,0NN4,@)ETs501x"
!!%  w   J s   6B,B,/B,:)B,$B,c                z   < V ^8  d   QhRS[ R,          RS[RS[S[,          RS[RS[RS[ S[R,          ,          /# )r=   ry   r:   lengthrN   padinclude_new_linesr>   )r
   r?   r   r   rT   r   )r@   rA   s   "r8   rB   rC     sa     ,I ,I9%,I ,I 	,I
 ,I  ,I 
$y/	",Ir7   c              #    "   . pVP                   pV P                  pV ! R4      p	V F  p
RV
P                  9   d   V
P                  '       g}   V
w  rpV'       dn   VP	                  R4      w  rpV'       d   V! V ! W4      4       V'       g   K<  V! WbW4R7      pV'       d   VP                  V	4       Vx  VP                  4        Ku  K  V! V
4       K  	  V'       d   V! WbW4R7      x  R# R# 5i)a  Split segments in to lines, and crop lines greater than a given length.

Args:
    segments (Iterable[Segment]): An iterable of segments, probably
        generated from console.render.
    length (int): Desired line length.
    style (Style, optional): Style to use for any padding.
    pad (bool): Enable padding of lines that are less than `length`.

Returns:
    Iterable[List[Segment]]: An iterable of lines of segments.
ru   )rN   r   N)r   adjust_line_lengthrF   rH   r   clear)rf   ry   r   rN   r   r   rv   r   r   new_line_segmentr]   rF   segment_styler   r   r   cropped_lines   &&&&&&           r8   split_and_crop_linesSegment.split_and_crop_lines  s     * ! 33t9Gw||#GOOO)0&Q,0NN4,@)ETs589x'9 ( -(//0@A**

  w!  " $THH s   A
C-C-/C-AC-C-c                d   < V ^8  d   QhRS[ R,          RS[RS[S[,          RS[RS[ R,          /# )r=   rv   r:   r   rN   r   r>   r   r?   r   r   rT   )r@   rA   s   "r8   rB   rC   F  sI     * *9o* * 	*
 * 
i*r7   c                   \        R V 4       4      pWR8  d4   V'       d    W! RW%,
          ,          V4      .,           pV# VR,          p V# WR8  d   . pVP                  p^ pV Ff  pVP                  p	WY,           V8  g   VP                  '       d   V! V4       WY,          pK@  Vw  rp\	        WV,
          4      p
V! V ! W4      4        V# 	   V# VR,          pV# )a  Adjust a line to a given width (cropping or padding as required).

Args:
    segments (Iterable[Segment]): A list of segments in a single line.
    length (int): The desired width of the line.
    style (Style, optional): The style of padding if used (space on the end). Defaults to None.
    pad (bool, optional): Pad lines with spaces if they are shorter than `length`. Defaults to True.

Returns:
    List[Segment]: A line of segments with the desired length.
c              3   8   "   T F  qP                   x  K  	  R # 5irM   )rI   )r}   r]   s   & r8   r   -Segment.adjust_line_length.<locals>.<genexpr>X  s     BT'--Ts   rc   NNN)sumr   rI   rH   r   )rf   rv   r   rN   r   line_lengthr   r   r]   segment_lengthrF   r   r   s   &&&&&        r8   r   Segment.adjust_line_lengthE  s    & BTBB 3sf.B'CU#K"LL& #  7" ! !H__FK!(!4!4/&8GOOO7O1K-4*D(/CDD3t34     AwHr7   c                4   < V ^8  d   QhRS[ R,          RS[/# )r=   rv   r:   r>   )r   r?   )r@   rA   s   "r8   rB   rC   s  s#     
T 
T4	? 
Ts 
Tr7   c                :   a \         o\        V3R lV 4       4      # )zGet the length of list of segments.

Args:
    line (List[Segment]): A line encoded as a list of Segments (assumes no '\\n' characters),

Returns:
    int: The length of the line.
c              3   L   <"   T F  w  rq3'       d   K  S! V4      x  K  	  R # 5irM   r    )r}   rF   rN   rH   	_cell_lens   &   r8   r   *Segment.get_line_length.<locals>.<genexpr>}  s      St';tG7?9T??ts   $$)r   r   )rf   rv   r   s   &&@r8   get_line_lengthSegment.get_line_lengthr  s     	StSSSr7   c                Z   < V ^8  d   QhRS[ S[ R,          ,          RS[S[S[3,          /# )r=   linesr:   r>   )r   r   r?   )r@   rA   s   "r8   rB   rC     s,     ' 'd4	?3 'c3h 'r7   c                t   a V P                   oV'       d   \        V3R lV 4       4      M^ pV\        V4      3# )zGet the shape (enclosing rectangle) of a list of lines.

Args:
    lines (List[List[Segment]]): A list of lines (no '\\n' characters).

Returns:
    Tuple[int, int]: Width and height in characters.
c              3   4   <"   T F  pS! V4      x  K  	  R # 5irM   r    )r}   rv   r   s   & r8   r   $Segment.get_shape.<locals>.<genexpr>  s     @%$--%s   )r   maxre   )rf   r   	max_widthr   s   && @r8   	get_shapeSegment.get_shape  s3     --DIC@%@@q	3u:&&r7   c                   < V ^8  d   QhRS[ S[ R,          ,          RS[RS[S[,          RS[S[,          RS[RS[ S[ R,          ,          /# )r=   r   r:   widthheightrN   	new_linesr>   r   )r@   rA   s   "r8   rB   rC     sa     ! !DO$! ! 	!
 ! ! 
d9o	!r7   c           	     h   T;'       g    \        V4      pV'       d   V ! RV,          R,           V4      .MV ! RV,          V4      .pV P                  pVRV p	V U
u. uF  q! WVR7      NK  	  up
V	R&   \        V	4      V8  d*   V	P                  V.V\        V	4      ,
          ,          4       V	# u up
i )a  Set the shape of a list of lines (enclosing rectangle).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style, optional): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        rc   ru   N)rN   r   )re   r   extend)rf   r   r   r   rN   r   _heightblankr   shaped_linesrv   s   &&&&&&     r8   	set_shapeSegment.set_shape  s    * &&CJ 1:Sut#U+,C%KQV@W?X 	 !33XgEJ
EJTt%8U
Q |w&7S5F+F GH
s   B/c                   < V ^8  d   QhRS[ R,          RS[S[R,          ,          RS[RS[RS[RS[RS[S[R,          ,          /# 	r=   rf   r:   r   r   r   rN   r   r>   r   r   r?   r   rT   )r@   rA   s   "r8   rB   rC     e      )_DO$  	
   
d9o	r7   c                    V\        V4      ,
          pV'       g
   VR,          # VRV pV'       d   V ! RV,          R,           V4      MV ! RV,          V4      pW..V,          ,           pV# )a  Aligns lines to top (adds extra lines to bottom as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        r   Nrc   ru   re   rf   r   r   r   rN   r   extra_linesr   s   &&&&&&  r8   	align_topSegment.align_top  sd    * s5z)8Ogv2;C%K$&.S5[RWAX	K//r7   c                   < V ^8  d   QhRS[ R,          RS[S[R,          ,          RS[RS[RS[RS[RS[S[R,          ,          /# r   r   )r@   rA   s   "r8   rB   rC     r   r7   c                    V\        V4      ,
          pV'       g
   VR,          # VRV pV'       d   V ! RV,          R,           V4      MV ! RV,          V4      pV..V,          V,           pV# )a  Aligns render to bottom (adds extra lines above as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added. Defaults to None.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        r   Nrc   ru   r   r   s   &&&&&&  r8   align_bottomSegment.align_bottom  sf    * s5z)8Ogv2;C%K$&.S5[RWAX	K'%/r7   c                   < V ^8  d   QhRS[ R,          RS[S[R,          ,          RS[RS[RS[RS[RS[S[R,          ,          /# r   r   )r@   rA   s   "r8   rB   rC     se      )_DO$  	
   
d9o	r7   c                   V\        V4      ,
          pV'       g
   VR,          # VRV pV'       d   V ! RV,          R,           V4      MV ! RV,          V4      pV^,          pWh,
          p	V..V,          V,           V..V	,          ,           pV# )a  Aligns lines to middle (adds extra lines to above and below as required).

        Args:
            lines (List[List[Segment]]): A list of lines.
            width (int): Desired width.
            height (int, optional): Desired height or None for no change.
            style (Style): Style of any padding added.
            new_lines (bool, optional): Padded lines should include "
". Defaults to False.

        Returns:
            List[List[Segment]]: New list of lines.
        r   Nrc   ru   r   )
rf   r   r   r   rN   r   r   r   	top_linesbottom_liness
   &&&&&&    r8   align_middleSegment.align_middle  s    * s5z)8Ogv2;C%K$&.S5[RWAX1$	".	I%-%	L0HHr7   c                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r
   )r@   rA   s   "r8   rB   rC     s%       3 8K r7   c              #  L  "   \        V4      p \        V4      p\        pT Ff  pTP                  TP                  8X  dC   TP
                  '       g1   T! TP                  TP                  ,           TP                  4      pK`  Tx  TpKh  	  Tx  R#   \         d     R# i ; i5i)a  Simplify an iterable of segments by combining contiguous segments with the same style.

Args:
    segments (Iterable[Segment]): An iterable of segments.

Returns:
    Iterable[Segment]: A possibly smaller iterable of segments that will render the same way.
N)iternextStopIterationr:   rN   rH   rF   )rf   ry   iter_segmentslast_segmentrg   r]   s   &&    r8   simplifySegment.simplify
  s      X	.L $G!!W]]27???' %%4l6H6H  #"& %   		s.   B$B 7B$A B$B!B$ B!!B$c                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r   )r@   rA   s   "r8   rB   rC   &  s)     L L8I#6 L8I;N Lr7   c              #     "   V FQ  pVP                   '       g   VP                  f   Vx  K)  Vw  r4pT ! Y4'       d   VP                  R4      MR4      x  KS  	  R# 5i)zRemove all links from an iterable of styles.

Args:
    segments (Iterable[Segment]): An iterable segments.

Yields:
    Segment: Segments with link removed.
N)rH   rN   update_link)rf   ry   r]   rF   rN   _controls   &&    r8   strip_linksSegment.strip_links%  sN       G'--"7(/%X$5 1 1$ 7dKK  s   AAc                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r   )r@   rA   s   "r8   rB   rC   7  s%     
+ 
+HY$7 
+HY<O 
+r7   c              #  >   "   V F  w  r#pV ! VRV4      x  K  	  R# 5i)zRemove all styles from an iterable of segments.

Args:
    segments (Iterable[Segment]): An iterable segments.

Yields:
    Segment: Segments with styles replace with None
Nr    )rf   ry   rF   rG   rH   s   &&   r8   strip_stylesSegment.strip_styles6  s%      &.!D'dD'** &.s   c                B   < V ^8  d   QhRS[ R,          RS[ R,          /# r   r   )r@   rA   s   "r8   rB   rC   D  s%     / /HY$7 /HY<O /r7   c              #     "   / pV FL  w  r4pV'       d3   VP                  V4      pVf   VP                  pWbV&   V ! W6V4      x  K@  V ! VRV4      x  KN  	  R# 5i)zRemove all color from an iterable of segments.

Args:
    segments (Iterable[Segment]): An iterable segments.

Yields:
    Segment: Segments with colorless style.
N)getwithout_color)rf   ry   cacherF   rN   rH   colorless_styles   &&     r8   remove_colorSegment.remove_colorC  s`      %'$, D"'))E"2"*&+&9&9O#2%L$99$g.. %-s   AAc                h   < V ^8  d   QhRS[ R,          RS[ S[,          RS[ S[R,          ,          /# )r=   ry   r:   cutsr>   )r
   r?   r   )r@   rA   s   "r8   rB   rC   Z  s<     B B	*B2:3-B	$y/	"Br7   c              #    "   . pVP                   p\        V4      p \        VR4      pVR8X  d   R# V^ 8w  d   M. x  K$  ^ pVP                  pVP                  p	\
        p
V F  pVw  rpV'       g   K  V'       d   TMWz! V4      ,           pW8  d   V! V4       TpK<  W8X  dD   V! V4       V	! 4       x  V! 4        Tp\        VR4      pVR8X  d   V'       d
   V	! 4       x   R# K  VP                  Wg,
          4      w  ppVw  rpV! V4       V	! 4       x  V! 4        Tp\        VR4      pVR8X  g   K  V'       d
   V	! 4       x   R# 	  V	! 4       x  R# 5i)zDivides an iterable of segments in to portions.

Args:
    cuts (Iterable[int]): Cell positions where to divide.

Yields:
    [Iterable[List[Segment]]]: An iterable of Segments in List.
Nrd   )r   r   r   r   copyr   rq   )rf   ry   r   split_segmentsadd_segment	iter_cutsr^   ri   segments_clearsegments_copyr   r]   rF   rG   rH   end_posrj   s   &&&              r8   divideSegment.divideY  sV     +-$++J	y"%CbyaxH'--&++#	G$+!D'$!(#cIdO.C=(!C>('/)"$!Cy"-Cby)"//1 '.&9&9#)&DOFG,3)D'''/)"$C9b)"9%+o-G  J os&   A-E4E<AEAE5E=Ec                n   < V ^8  d   Qh/ S[ ;R&   S[S[,          ;R&   S[S[S[,          ,          ;R&   # )r=   rF   rN   rH   )strr   r   r   ControlCode)r@   rA   s   "r8   rB   rC   ?   s9      I  E?!   h{+,3! r7   r    i @  )NNF)NTT)NT)NNF)$r!   r"   r#   r$   r%   rN   rH   propertyrI   rP   rV   rZ   classmethodr   rm   rq   rv   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __annotate_func__r6   __classdictcell__rA   s   @r8   r:   r:   ?   s    
 "E/3G0 0   ( ( y-  -^, ,4   & & &P @ @ @$  8 ,I ,I ,I\ * * *X 
T 
T ' ' ! ! !F   8   8   <  4 L L  
+ 
+ / /* B Bw  r7   r:   c                   L   a  ] tR tRt o RtR	V 3R lR lltV 3R lR ltRtV tR# )
Segmentsi  a)  A simple renderable to render an iterable of segments. This class may be useful if
you want to print segments outside of a __rich_console__ method.

Args:
    segments (Iterable[Segment]): An iterable of segments.
    new_lines (bool, optional): Add new lines between segments. Defaults to False.
c                :   < V ^8  d   QhRS[ S[,          RS[RR/# )r=   ry   r   r>   N)r
   r:   rT   )r@   rA   s   "r8   rB   Segments.__annotate__  s(     # #'!2 #t #PT #r7   c                2    \        V4      V n        W n        R # rM   )listry   r   )rE   ry   r   s   &&&r8   __init__Segments.__init__  s    X"r7   c                &   < V ^8  d   QhRRRRRR/# r=   consoler   optionsr   r>   r   r    )r@   rA   s   "r8   rB   r    s%     	% 	% 	%+;	%		%r7   c              #     "   V P                   '       d2   \        P                  4       pV P                   F  pVx  Vx  K  	  R # V P                   R j  xL
  R #  L5irM   )r   r:   rv   ry   )rE   r  r  rv   r]   s   &&&  r8   __rich_console__Segments.__rich_console__  sB      >>><<>D==
 ) }}$$s   AAAA)r   ry   Nr  )	r!   r"   r#   r$   r%   r  r  r6   r	  r
  s   @r8   r  r    s     # #	% 	%r7   r  c                   H   a  ] tR tRt o RV 3R lR lltV 3R lR ltRtV tR# )	SegmentLinesi  c                J   < V ^8  d   QhRS[ S[S[,          ,          RS[RR/# )r=   r   r   r>   N)r
   r   r:   rT   )r@   rA   s   "r8   rB   SegmentLines.__annotate__  s,     	# 	#htG}5 	#$ 	#SW 	#r7   c                2    \        V4      V n        W n        R# )a  A simple renderable containing a number of lines of segments. May be used as an intermediate
in rendering process.

Args:
    lines (Iterable[List[Segment]]): Lists of segments forming lines.
    new_lines (bool, optional): Insert new lines after each line. Defaults to False.
N)r  r   r   )rE   r   r   s   &&&r8   r  SegmentLines.__init__  s     %[
"r7   c                &   < V ^8  d   QhRRRRRR/# r  r    )r@   rA   s   "r8   rB   r    s%     
  
  
 +;
 	
 r7   c              #     "   V P                   '       d8   \        P                  4       pV P                   F  pT R j  xL
  Vx  K  	  R # V P                   F  pT R j  xL
  K  	  R #  L- L5irM   )r   r:   rv   r   )rE   r  r  r   rv   s   &&&  r8   r  SegmentLines.__rich_console__  sV      >>>||~H

 # 

 #    s!   ;A/A+"A/ A-!A/-A/)r   r   Nr  )r!   r"   r#   r$   r  r  r6   r	  r
  s   @r8   r  r    s     	# 	#
  
 r7   r  __main__)r   )Syntax)Textzfrom rich.console import Console
console = Console()
text = Text.from_markup("Hello, [bold magenta]World[/]!")
console.print(text)zHello, [bold magenta]World[/]!zrich.Segmentz]A Segment is the last step in the Rich render process before generating text with ANSI codes.z
Consider the following code:
pythonT)line_numberszRWhen you call [b]print()[/b], Rich [i]renders[/i] the object in to the following:
zAThe Segments are then processed to produce the following output:
zS
You will only need to know this if you are implementing your own Rich renderables.N):enumr   	functoolsr   	itertoolsr   loggingr   operatorr   typingr   r	   r
   r   r   r   r   r   r   r   cellsr   r   r   r   r   reprr   r   rN   r   r  r   r   r   logr   r?   r  r  r:   r  r  r!   pip._vendor.rich.consolepip._vendor.rich.syntaxr$  pip._vendor.rich.textr%  codefrom_markuprF   ruleprintr  render	fragmentsr    r7   r8   <module>r:     s     !      $ >>' * 	+	+uS#X
&'	+sC
 " \	j \	 \	~% %2   2 z0.*D
 <=DiGLL MMg MM45MM&xd;<MMOMM] W^^D)*IMM)MMOMMVWMM$MM^; r7   