+
     h  c                   s    ^ RI Ht ^ RIHtHtHtHtHt ^RIH	t	 ^RI
HtHt ]'       d   ^RIHtHtHt  ! R R]4      tR R	 ltR
# )i    )
itemgetter)TYPE_CHECKINGCallable
NamedTupleOptionalSequence)errors)is_renderable	rich_cast)ConsoleConsoleOptionsRenderableTypec                   s   a  ] tR t^t o 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t	RV 3R lR llt
]V 3R lR l4       tV 3R ltRtV tR
# )MeasurementzSStores the minimum and maximum widths (in characters) required to render an object.c                s    < V ^8  d   QhRS[ /# )   returnintformat__classdict__   "=/usr/lib/python3.14/site-packages/pip/_vendor/rich/measure.py__annotate__Measurement.__annotate__   s     + +c +    c                s<    V P                   V P                  ,
          # )z+Get difference between maximum and minimum.)maximumminimum)selfs   &r   spanZMeasurement.span   s     ||dll**r   c                s   < V ^8  d   QhRR/# )r   r   r    r   r   r   r   r      s     K K= Kr   c           
     s    V w  r\        \        ^ V4      V4      p\        \        ^ V4      \        ^ \        W4      4      4      # )z{Get measurement that ensures that minimum <= maximum and minimum >= 0

Returns:
    Measurement: A normalized measurement.
)minmaxr   )r   r   r   s   &  r   	normalizeZMeasurement.normalize   s=      c!Wow/3q'?C3w3H,IJJr   c                $   < V ^8  d   QhRS[ RR/# r   widthr   r   r   r   r   r   r   r   "   s     
E 
E# 
E- 
Er   c                sF    V w  r#\        \        W!4      \        W14      4      # )zGet a RenderableWith where the widths are <= width.

Args:
    width (int): Maximum desired width.

Returns:
    Measurement: New Measurement object.
)r   r   r   r#   r   r      &&  r   with_maximumZMeasurement.with_maximum"   s#      3w.G0CDDr   c                r!   r"   r   r   r   r   r   r   .   s     E E# E- Er   c                s^    V w  r#\        ^ V4      p\        \        W!4      \        W14      4      # )zGet a RenderableWith where the widths are >= width.

Args:
    width (int): Minimum desired width.

Returns:
    Measurement: New Measurement object.
)r   r   r$   r%   r   with_minimumZMeasurement.with_minimum.   s.      Au3w.G0CDDr   Nc                sJ   < V ^8  d   QhRS[ S[,          RS[ S[,          RR/# )r   	min_width	max_widthr   r   )r   r   r   r   r   r   r   ;   s-      !#:B3-	r   c                s^    T pVe   VP                  V4      pVe   VP                  V4      pV# )a  Clamp a measurement within the specified range.

Args:
    min_width (int): Minimum desired width, or ``None`` for no minimum. Defaults to None.
    max_width (int): Maximum desired width, or ``None`` for no maximum. Defaults to None.

Returns:
    Measurement: New Measurement object.
)r'   r&   )r   r(   r)   Zmeasurements   &&& r   clampZMeasurement.clamp;   s;      %229=K %229=Kr   c                s*   < V ^8  d   QhRRRRRRRR/# )	r   consoler	   optionsr
   
renderabler   r   r   r   r   r   r   r   r   O   s-     + ++*:+HX+	+r   c                s   VP                   pV^8  d   \        ^ ^ 4      # \        V\        4      '       d   VP	                  W2P
                  RR7      p\        V4      p\        V4      '       dp   \        VRR4      pVeS   V! W4      P                  4       P                  V4      pVP                  ^8  d   \        ^ ^ 4      # VP                  4       # \        ^ V4      # \        P                  ! RV: R24      h)a  Get a measurement for a renderable.

Args:
    console (~rich.console.Console): Console instance.
    options (~rich.console.ConsoleOptions): Console options.
    renderable (RenderableType): An object that may be rendered with Rich.

Raises:
    errors.NotRenderableError: If the object is not renderable.

Returns:
    Measurement: Measurement object containing range of character widths required to render the object.
F)markupZ	highlightZ__rich_measure__NzUnable to get render width for zD; a str, Segment, or object with __rich_console__ method is required)r)   r   Z
isinstanceZstrZ
render_strr.   r   r   Zgetattrr    r&   r   r   ZNotRenderableError)Zclsr+   r,   r-   Z
_max_widthZget_console_widthZrender_widths   &&&&   r   getZMeasurement.getN   s    " &&
>q!$$j#&& ++>>U , J z*
$$ 
$6=  !,%g7Y[!\*- 
  ''!+&q!,,#--//"1j11++1* @U U r   c                s2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   r   r   r   r   r   r   r   r      s      L 
 L r   r   )NN)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Zpropertyr   r    r&   r'   r*   Zclassmethodr/   Z__annotate_func__Z__static_attributes__Z__classdictcell__)r   s   @r   r   r      sl     ] 65+ +K K
E 
EE E & + +I  r   r   c                s>    V ^8  d   QhRRRRR\         R,          RR/# )	r   r+   r	   r,   r
   renderablesr   r   r   )r   )r   s   "r   r   r   }   s6       *+ 	r   c           	     s   V'       g   \        ^ ^ 4      # \         P                  pV Uu. uF  qC! WV4      NK  	  pp\        \        V\        ^ 4      R7      P                  \        V\        ^4      R7      P
                  4      pV# u upi )a  Get a measurement that would fit a number of renderables.

Args:
    console (~rich.console.Console): Console instance.
    options (~rich.console.ConsoleOptions): Console options.
    renderables (Iterable[RenderableType]): One or more renderable objects.

Returns:
    Measurement: Measurement object containing range of character widths required to
        contain all given renderables.
)Zkey)r   r/   r   r    r   r   )r+   r,   r0   Zget_measurementr-   ZmeasurementsZmeasured_widths   &&&    r   measure_renderablesr1   }   s      1a  !ooOHSHS**5   !Ljm,44Ljm,44N s   BN)Zoperatorr    Ztypingr   r   r   r   r   Z r   Zprotocolr   r   r+   r	   r
   r   r   r1   r   r   r   <module>r2      s1     J J  .@@o* odr   