
    q"h+                     j   S SK JrJr  SSKJr  SSKJrJr  SSKJ	r	  SSK
Jr  SSKJrJr  SSKJrJr  SS	KJr  SS
KJrJr  SSKJrJr  \(       a  SSKJrJrJrJr   " S S\5      r\ S:X  aG  SSKJr  \" 5       r!SSKJ"r"Jr  SSKJr  \" SSS\"SS9r#\!RI                  5         \!RI                  \#5        gg)    )TYPE_CHECKINGOptional   )AlignMethod)ROUNDEDBox)cell_len)JupyterMixin)Measurementmeasure_renderables)PaddingPaddingDimensions)Segment)Style	StyleType)TextTextType)ConsoleConsoleOptionsRenderableTypeRenderResultc                       \ rS rSrSr\4SSSSSSSSSSSSS	.S
SS\S\\   S\	S\\   S\	S\\
   S\
S\S\S\\   S\\   S\S\
SS4S jjjr\\4SSSSSSSSSSSS.S
SS\S\\   S\	S\\   S\	S\\
   S\S\S\\   S\\   S\S\
SS 4S jjj5       r\S\\   4S j5       r\S\\   4S j5       r      S"S jr      S#S  jrS!rg)$Panel   a  A console renderable that draws a border around its contents.

Example:
    >>> console.print(Panel("Hello, World!"))

Args:
    renderable (RenderableType): A console renderable object.
    box (Box): A Box instance that defines the look of the border (see :ref:`appendix_box`. Defaults to box.ROUNDED.
    title (Optional[TextType], optional): Optional title displayed in panel header. Defaults to None.
    title_align (AlignMethod, optional): Alignment of title. Defaults to "center".
    subtitle (Optional[TextType], optional): Optional subtitle displayed in panel footer. Defaults to None.
    subtitle_align (AlignMethod, optional): Alignment of subtitle. Defaults to "center".
    safe_box (bool, optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.
    expand (bool, optional): If True the panel will stretch to fill the console width, otherwise it will be sized to fit the contents. Defaults to True.
    style (str, optional): The style of the panel (border and contents). Defaults to "none".
    border_style (str, optional): The style of the border. Defaults to "none".
    width (Optional[int], optional): Optional width of panel. Defaults to None to auto-detect.
    height (Optional[int], optional): Optional height of panel. Defaults to None to auto-detect.
    padding (Optional[PaddingDimensions]): Optional padding around renderable. Defaults to 0.
    highlight (bool, optional): Enable automatic highlighting of panel title (if str). Defaults to False.
NcenterTnone)r   r   F)titletitle_alignsubtitlesubtitle_alignsafe_boxexpandstyleborder_stylewidthheightpadding	highlight
renderabler   boxr   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   returnc                    Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        Xl	        Xl
        Xl        Xl        Xl        g )N)r)   r*   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   )selfr)   r*   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   s                  H/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/rich/panel.py__init__Panel.__init__(   sM    $ %
(3 , 
(
"    )r   r   r   r    r!   r#   r$   r%   r&   r'   r(   c                (    U " UUUUUUUUU	U
UUUSS9$ )z2An alternative constructor that sets expand=False.F)r   r   r   r    r!   r#   r$   r%   r&   r'   r(   r"    )clsr)   r*   r   r   r   r    r!   r#   r$   r%   r&   r'   r(   s                 r.   fit	Panel.fitI   s;    & #)%
 	
r1   c                 |   U R                   (       a  [        U R                   [        5      (       a   [        R                  " U R                   5      OU R                   R                  5       nSUl        UR                  R                  SS5      Ul        SUl	        UR                  5         UR                  S5        U$ g N 
 Tr   )r   
isinstancestrr   from_markupcopyendplainreplaceno_wrapexpand_tabspad)r-   
title_texts     r.   _titlePanel._titlem   s    :: djj#..   ,ZZ__& 
  JN)//77cBJ!%J""$NN1r1   c                 |   U R                   (       a  [        U R                   [        5      (       a   [        R                  " U R                   5      OU R                   R                  5       nSUl        UR                  R                  SS5      Ul        SUl	        UR                  5         UR                  S5        U$ g r8   )r   r<   r=   r   r>   r?   r@   rA   rB   rC   rD   rE   )r-   subtitle_texts     r.   	_subtitlePanel._subtitle}   s    == dmmS11   /]]'') 
 !#M"/"5"5"="=dC"HM$(M!%%'a   r1   c              #     ^#    [         R                  " U R                  5      n[        U5      (       a  [        U R                  U5      OU R                  nTR                  U R                  5      nTR                  U R                  5      nXV-   nU R                  c  UR                  O[        UR                  U R                  5      nU R                  c  TR                  OU R                  n	U R                  R                  X)S9n
S[        S[        S[         S[         S["        S[        4U4S jjnU R$                  nUb  UR'                  U5        U R(                  (       a  US	-
  O*TR+                  XBR-                  US	-
  5      S
9R.                  nU R0                  =(       d    UR0                  =(       d    S nU(       a  US	-  nUb/  [        UR                  S	-
  [3        XR4                  S	-   5      5      nUS	-   nUR7                  XU R8                  S9nTR;                  XOUS9n[=        U
R>                  U5      n[=        U
R@                   U5      n[<        RB                  " 5       nUb  US::  a"  [=        U
RE                  US	-
  /5      U5      v   OU" UUS-
  U RF                  U
RH                  U5      n[=        U
RJ                  U
RH                  -   U5      v   TRM                  XR-                  US-
  5      5       S h  vN   [=        U
RH                  U
RN                  -   U5      v   Uv   U H  nUv   U S h  vN   Uv   Uv   M     U RP                  nUb  UR'                  U5        Ub  US::  a"  [=        U
RS                  US	-
  /5      U5      v   OU" UUS-
  U RT                  U
RV                  U5      n[=        U
RX                  U
RV                  -   U5      v   TRM                  UUR-                  US-
  5      5       S h  vN   [=        U
RV                  U
RZ                  -   U5      v   Uv   g  GN6 N N37f)N)safetextr%   align	characterr#   r+   c                   > U R                  5       n U R                  U5        U[        U R                  5      -
  nU R                  (       a*  U R                  TR                  U R                  5      5        U(       aj  US:X  a  [        R                  " U X5-  U4SSS9$ US:X  a(  US-  n[        R                  " X6-  U4U X5U-
  -  U4SSS9$ [        R                  " X5-  U4U SSS9$ U $ )zGets new aligned text.

Args:
    text (Text): Title or subtitle text.
    width (int): Desired width.
    align (str): Alignment.
    character (str): Character for alignment.
    style (Style): Border style

Returns:
    Text: New text instance
leftTr9   )rC   r@   r      )	r?   truncater	   rA   r#   stylize	get_styler   assemble)rO   r%   rP   rQ   r#   excess_spacerS   consoles          r.   
align_text*Panel.__rich_console__.<locals>.align_text   s     99;DMM%  8DJJ#77LzzW..tzz:;F?=="159 $	  h&'1,D==")51"T&9:EB $   =="159 $	  Kr1   rT   )options)r%   r&   r(   )r#      ).r   unpackr'   anyr)   rW   r#   r$   r%   	max_widthminr!   r*   
substituter   intr=   r   rG   stylize_beforer"   measureupdate_widthmaximumr&   maxr	   updater(   render_linesr   mid_left	mid_rightlineget_topr   toptop_leftrender	top_rightrK   
get_bottomr    bottombottom_leftbottom_right)r-   rZ   r]   _paddingr)   r#   partial_border_styler$   r%   r!   r*   r[   rF   child_widthchild_heightchild_optionslines
line_startline_endnew_linern   rJ   s    `                    r.   __rich_console__Panel.__rich_console__   s     >>$,,/25h--GDOOX.T__ 	 !!$**-&001B1BC3 zz! W&&

3 	 .2]]-B))hh!!'!9-	-	"-	+.-	;>-	GL-	-	^ [[
!%%&:; {{ AI$8$8$C ! g 	 {{<gnn<AL!!!A%s;8K8Ka8O'PK adnn ' 
 $$Ze$LS\\<8
cmm_|<<<>!#++uqyk2LAA#	  J #,,0,??~~j2L2LUUVY2WXXX#''CMM1<@@DOONN	  $(()=> EQJ#..%!)5|DD&	##

M #//CJJ6EE~~}99%!)D   #**s'7'77FF= Y &s7   LQP:;Q P=C
QP?/Q=Q?Qc                 n   U R                   n[        R                  " U R                  5      u  pEpFXe-   nU(       a  U R                  U/OU R                  /nU R
                  c=  [        UUR                  UR                  U-
  S-
  5      U5      R                  U-   S-   n	OU R
                  n	[        X5      $ )NrT   )rG   r   r_   r'   r)   r%   r   rg   ra   rh   r   )
r-   rZ   r]   rG   _rightrS   r'   renderablesr%   s
             r.   __rich_measure__Panel.__rich_measure__  s     #NN4<<8!,39t/?P::#(():):W)Dq)HI '   JJE5((r1   )r$   r*   r"   r&   r(   r'   r)   r!   r#   r   r    r   r   r%   )rZ   r   r]   r   r+   r   )rZ   r   r]   r   r+   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   boolr   rd   r   r/   classmethodr5   propertyr   rG   rK   r   r   __static_attributes__r3   r1   r.   r   r      sF   2 #
 %)#+'+&.#'!"(# $%+!#$# #
 !# !# 8$# $# 4.# # #  # }# # ##  !#" 
##B  !

 %)#+'+&.#'!"(# $%+!
$!
 !

 !!
 !!
 8$!
 $!
 4.!
 !
  !
 }!
 !
 #!
 !
  
!!
 !
F    8D>  G G+;G	GR) )+;)	)r1   r   __main__)r   )DOUBLEr   )r   zHello, World!z
rich.Panelzwhite on blue)r   r#   r*   r'   N)%typingr   r   rP   r   r*   r   r   cellsr	   jupyterr
   rf   r   r   r'   r   r   segmentr   r#   r   r   rO   r   r   rZ   r   r   r   r   r   r   cr   pprintr3   r1   r.   <module>r      s    *    ! 5 /  #  NNY)L Y)x z 	A$ 	A GGIGGAJ# r1   