<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    ʗRe("                     @   s  d dl mZm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 ddlmZmZ ddlmZ dd	lmZ dd
lmZmZ erddlmZmZmZmZ G dd de	ZedkrddlmZ e ZddlmZmZ ddlmZ edddeddZ e!  e!e  dS )    )TYPE_CHECKINGOptional   )AlignMethod)ROUNDEDBox)JupyterMixin)Measurementmeasure_renderables)PaddingPaddingDimensions)Segment)	StyleType)TextTextType)ConsoleConsoleOptionsRenderableTypeRenderResultc                   @   s  e Zd ZdZefdddddddddddddd	eee eee eee	 e	e
e
ee ee ee	dd
ddZeefdddddddddd	d	eee eee eee	 e
e
ee ed dddZeee dddZeee dddZddddddZddddddZdS )Panela  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, optional): A Box instance that defines the look of the border (see :ref:`appendix_box`.
            Defaults to box.ROUNDED.
        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	highlightr   )
renderableboxr   r   r   r   r   r   r   r   r    r!   r"   r#   returnc                C   sX   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	|| _
|| _|| _|| _d S )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#    r(   /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/rich/panel.py__init__%   s    zPanel.__init__)	r   r   r   r   r   r   r   r    r"   )r$   r%   r   r   r   r   r   r   r   r    r"   r&   c       	         C   s    | |||||||||	|
|ddS )z2An alternative constructor that sets expand=False.F)
r   r   r   r   r   r   r   r    r"   r   r(   )clsr$   r%   r   r   r   r   r   r   r   r    r"   r(   r(   r)   fitF   s    z	Panel.fit)r&   c                 C   s^   | j rZt| j trt| j n| j  }d|_|jdd|_d|_	|
  |d |S d S N 
 Tr   )r   
isinstancestrr   from_markupcopyendplainreplaceno_wrapexpand_tabspad)r'   
title_textr(   r(   r)   _titlef   s    

zPanel._titlec                 C   s^   | j rZt| j trt| j n| j  }d|_|jdd|_d|_	|
  |d |S d S r-   )r   r1   r2   r   r3   r4   r5   r6   r7   r8   r9   r:   )r'   subtitle_textr(   r(   r)   	_subtitlev   s    

zPanel._subtitler   r   r   )consoleoptionsr&   c                 c   s  t | j}t|r t | j|n| j}|| j}||| j }| jd krR|j	nt
|j	| j}| jd krp|jn| j}| jj||d}	| j}
|
d k	r||
_| jr|d n|j|||d dj}| jp|jpd }|r|d8 }|
d k	rt
|j	d t||
jd }|d }|j||| jd}|j|||d}t|	j|}t|	j |}t }|
d ksd|dkr~t|	|d g|V  n\|
j| j|d |	j d t|	j!|	j  |V  |"|
||d E d H  t|	j |	j# |V  |V  |D ]"}|V  |E d H  |V  |V  q| j$}|d k	r||_|d ks2|dkrLt|	%|d g|V  n\|j| j&|d |	j'd t|	j(|	j' |V  |"|||d E d H  t|	j'|	j) |V  |V  d S )N)safe   )r@   )r    r!   r#   )r      )	character)*r   unpackr"   anyr$   	get_styler   r   r    	max_widthminr   r%   
substituter<   r   measureupdate_widthmaximumr!   maxcell_lenupdater#   render_linesr   mid_left	mid_rightlineget_topalignr   toptop_leftrender	top_rightr>   
get_bottomr   bottombottom_leftbottom_right)r'   r?   r@   _paddingr$   r   r   r    r   r%   r;   child_widthchild_heightchild_optionslines
line_startline_endnew_linerT   r=   r(   r(   r)   __rich_console__   s    
 
   


 
zPanel.__rich_console__r	   c           
      C   sz   | j }t| j\}}}}|| }|r0| j|gn| jg}| jd krjt|||j| d |j	| d }	n| j}	t
|	|	S )NrB   )r<   r   rE   r"   r$   r    r
   rL   rH   rM   r	   )
r'   r?   r@   r<   _rightleftr"   renderablesr    r(   r(   r)   __rich_measure__   s"    

zPanel.__rich_measure__)__name__
__module____qualname____doc__r   r   r   r   r   boolr   intr   r*   classmethodr,   propertyr   r<   r>   rg   rl   r(   r(   r(   r)   r      s   ! N r   __main__)r   )DOUBLEr   )r   zHello, World!z
rich.Panelzwhite on blue)r   r   r%   r"   N)"typingr   r   rV   r   r%   r   r   jupyterr   rK   r	   r
   r"   r   r   segmentr   r   r   textr   r   r?   r   r   r   r   r   rm   crv   pprintr(   r(   r(   r)   <module>   s4    [
