+
     hD  c                   s   ^ RI Ht ^ RIHt ^ RIHtHtHt ^RIH	t	 ]'       d   ^ RI
Ht  ! R R4      t]R8X  dN   ^ R	It^ R
IHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt  ! R R4      t]! 4       t]P7                  ]! 4       4       R	# R	# )    )sqrt)	lru_cache)SequenceTupleTYPE_CHECKING)ColorTripletTablec                   s   a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR lt]! RR	7      V 3R
 lR l4       t	Rt
V tR# )PalettezA palette of available colors.c                sJ   < V ^8  d   QhRS[ S[S[S[S[3,          ,          /# )   colors)r   r   intformat__classdict__   "=/usr/lib/python3.14/site-packages/pip/_vendor/rich/palette.py__annotate__Palette.__annotate__   s$      xc3m(<=     c                s    Wn         R # N_colors)selfr      &&r   __init__ZPalette.__init__   s    r   c                s&   < V ^8  d   QhRS[ RS[/# )r
   numberreturn)r   r   r   r   r   r   r      s     3 3# 3, 3r   c                s6    \        V P                  V,          !  # r   )r   r   )r   r   r   r   __getitem__ZPalette.__getitem__   s    T\\&122r   c                s   < V ^8  d   QhRR/# )r
   r   r    r   r   r   r   r      s      ' r   c                s@   ^ RI Hp ^ RIHp ^ RIHp ^ RIHp V! RRRR\        V P                  4       R	2R
RR7      p\        V P                  4       FG  w  rgVP                  \        V4      \        V4      V! RV! VP                  ! V!  R7      R7      4       KI  	  V# )r    ColorStyle)Textr   indexZRGBr    r	   z colorsTZright)ZtitleZcaptionZ	highlightZcaption_justify)bgcolor)Zstylez                )pip._vendor.rich.colorr    pip._vendor.rich.styler"   Zpip._vendor.rich.textr#   pip._vendor.rich.tabler   lenr   Z	enumerateZadd_rowZstrZreprfrom_rgb)r   r    r"   r#   r   Ztabler$   colors   &       r   __rich__ZPalette.__rich__   s    00.04<<()1#
 &dll3LEMME
UXU5>>53I%JK 4 r   i   )Zmaxsizec                s@   < V ^8  d   QhRS[ S[S[S[3,          RS[/# )r
   r+   r   )r   r   r   r   r   r   r   -   s&      5c3/ C r   c                s   aaaaa Vw  ooo\         oV P                  P                  oR VVVVV3R llp\        \	        \        V P                  4      4      VR7      pV# )zFind a color from a palette that most closely matches a given color.

Args:
    color (Tuple[int, int, int]): RGB components in range 0 > 255.

Returns:
    int: Index of closes matching color.
c                s0    V ^8  d   QhR\         R\        /# )r
   r$   r   )r   Zfloat)r   s   "r   r   Z#Palette.match.<locals>.__annotate__:   s     	 	c 	e 	r   c                s(  < S
! V 4      w  rpSV,           ^,          pSV,
          pSV,
          pS	V,
          pS! RV,           V,          V,          ^,	          ^V,          V,          ,           RV,
          V,          V,          ^,	          ,           4      # )zGet the distance to a color.i   i  r   )r$   Zred2Zgreen2Zblue2Zred_meanZredZgreenZblue_sqrtblue1	get_colorgreen1red1s   &       r   get_color_distanceZ)Palette.match.<locals>.get_color_distance:   s    "+E"2D%t)H+CVOE5=D>S(3.14e)e#$8^t+d2q8: r   )Zkey)r   r   r   Zminranger)   )	r   r+   r2   Z	min_indexr-   r.   r/   r0   r1   s	   &&  @@@@@r   matchZPalette.match,   sR     $feLL,,		 	 c$,,/06HI	r   r   N)__name__
__module____qualname____firstlineno__Z__doc__r   r   r,   r   r4   __static_attributes____classdictcell__r      @r   r	   r	      s?     ( 3 3 0 t r   r	   Z__main__N)Iterabler   )ConsoleConsoleOptions)Segmentr!   c                   s2   a  ] tR t^St o V 3R lR ltRtV tR# )ColorBoxc                s<   < V ^8  d   QhRS[ RS[RS[S[,          /# )r
   consoleoptionsr   )r>   r?   r=   r@   r   r   r   r   ZColorBox.__annotate__T   s*     	% 	%"	%-;	%g	%r   c           
   #  s  "   VP                   P                  ^,
          p\        ^ V4       EF  p\        VP                  4       F  pWRP                  ,          pWC^,           ,          p\        P
                  ! WgR4      w  rp
\        P
                  ! Wg^V,          ^,          ,           R4      w  rp\        P                  ! V^,          V	^,          V
^,          4      p\        P                  ! V^,          V^,          V^,          4      p\        R\        WR7      4      x  K  	  \        P                  ! 4       x  EK  	  R# 5i)i   g      ?u   ▄)r+   r%   N)Zsizeheightr3   Z	max_widthcolorsysZ
hls_to_rgbr    r*   r@   r"   Zline)r   rB   rC   rD   ZyZxZhZlZr1Zg1Zb1Zr2Zg2Zb2r%   r+   s   &&&             r   __rich_console__ZColorBox.__rich_console__T   s      \\((1,F1f%w001A---AaZ(A!)!4!4Q3!?JBB!)!4!4QQZ!^8Lc!RJBB#nnR#XrCxcJG!NN28R#XrCxHE!%U)LMM 2 lln$ &s   EEr   N)r5   r6   r7   r8   rF   r9   r:   r;   r<   r   rA   rA   S   s     	% 	%r   rA   )Zmathr   Z	functoolsr   Ztypingr   r   r   Zcolor_tripletr   r(   r   r	   r5   rE   r=   r&   r    Zpip._vendor.rich.consoler>   r?   Zpip._vendor.rich.segmentr@   r'   r"   rA   rB   Zprintr   r   r   <module>rG      sg      1 1 ',= =@ z,@0,% %  iGMM(*3 r   