ó
    Ãu„jb  ã                  óª   • S SK Jr  S SKrS SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  \R                  " S5      rSS	 jr  S           SS
 jjrg)é    )ÚannotationsN)ÚIterable)Úget_character_cell_size)Úcell_len)Ú	loop_last)Úget_tab_widthsz
\S+\s*|\s+c              #  óÈ   #   • Sn[         R                  X5      =nbD  UR                  5       u  p1UR                  S5      nX1U4v •  [         R                  X5      =nb  MC  gg7f)a,  Yields each "chunk" from the text as a tuple containing (start_index, end_index, chunk_content).
A "chunk" in this context refers to a word and any whitespace around it.

Args:
    text: The text to split into chunks.

Returns:
    Yields tuples containing the start, end and content for each chunk.
r   N)Úre_chunkÚmatchÚspanÚgroup)ÚtextÚendÚchunk_matchÚstartÚchunks        Ú›C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\textual/_wrap.pyÚchunksr      sa   é € ð €CÜ"Ÿ.™.¨Ó3Ð3ˆ;Ñ
@Ø ×%Ñ%Ó'‰
ˆØ×!Ñ! !Ó$ˆØ˜%ÐÒô #Ÿ.™.¨Ó3Ð3ˆ;Õ
@ùs   ‚AA"Á A"c                óz  • [        X!5      nU(       a  UnO[        X5      n/ nUR                  nSn[        n	Sn
Sn/ nUR                  n[        U5       HV  u  nu  nn[        U5      [        [        U5      5      -   nU/U-  nU" U5        UU-  nU(       d  ME  UR                  U5        MX     [        U 5       GHx  u  nnnU	" U5      nUU   nUU   nUU-
  nUU-  nX-
  nUU:¬  nU(       a  UU-  nM;  UU:”  Ga  U(       aý  [        n/ /nUR                  nUS   R                  nSn U HP  n!U!S:X  a  XZ   S   n"U
S-  n
OU" U!5      n"U U"-   U:”  a  U" U!/5        US   R                  nU"n MC  U" U!5        U U"-  n MR     U V#s/ s H  n#SR                  U#5      PM     n$n#[        U$5       HN  u  nn#U(       a  U" U5        U(       a$  UU[        U#5      -      UU   -
  n%U	" U#5      U%-   nM@  U[        U#5      -  nMP     GMF  U(       a  U" U5        UnGMZ  U(       d  GMd  U(       d  GMn  U" U5        UnGM{     U$ s  sn#f )a3  Given a string of text, and a width (measured in cells), return a list
of codepoint indices which the string should be split at in order for it to fit
within the given width.

Args:
    text: The text to examine.
    width: The available cell width.
    tab_size: The tab stop width.
    fold: If True, words longer than `width` will be folded onto a new line.
    precomputed_tab_sections: The output of `get_tab_widths` can be passed here directly,
        to prevent us from having to recompute the value.

Returns:
    A list of indices to break the line at.
r   éÿÿÿÿÚ	é   Ú )Úminr   Úappendr   Úextendr   ÚlenÚintÚboolr   r   Újoin)&r   ÚwidthÚtab_sizeÚfoldÚprecomputed_tab_sectionsÚtab_sectionsÚbreak_positionsr   Úcell_offsetÚ	_cell_lenÚtab_section_indexÚcumulative_widthÚcumulative_widthsÚrecord_widthsÚlastÚtab_sectionÚ	tab_widthÚsection_codepoint_lengthÚwidthsr   r   r   Úchunk_widthÚtab_width_before_startÚtab_width_before_endÚchunk_tab_widthÚremaining_spaceÚ
chunk_fitsÚ_get_character_cell_sizeÚlinesÚappend_new_lineÚappend_to_last_lineÚtotal_widthÚ	characterÚ
cell_widthÚlineÚfolded_wordÚline_tab_widthss&                                         r   Úcompute_wrap_offsetsrB       sŽ  € ô, �8Ó#€HÞØ/‰ä% dÓ5ˆà!#€OØ×#Ñ#€FØ€KÜ€IàÐØÐØ#%ÐØ%×,Ñ,€Mä*3°LÖ*AÑ&ˆÑ&ˆ{˜Iä#& {Ó#3´c¼$¸y»/Ó6JÑ#JÐ Ø"Ð#Ð&>Ñ>ˆÙ�fÔØ˜IÑ%Ðßˆ4Ø×$Ñ$Ð%5Ö6ñ +Bô $ DŸ\Ñˆˆs�EÙ Ó&ˆØ!2°5Ñ!9ÐØ0°Ñ5ÐØ.Ð1GÑGˆØ�Ñ&ˆØÑ-ˆØ$¨Ñ3ˆ
æà˜;Ñ&ŠKð ˜UÔ"æÜ/FÐ,Ø.0¨T�Eà&+§l¡l�OØ*/°©)×*:Ñ*:Ð'à"#�KÛ%*˜	Ø$¨Ó,à)5Ñ)HÈÑ)K˜JØ-°Ñ2Ñ-á)AÀ)Ó)L˜Jà&¨Ñ3°eÓ;Ù+¨Y¨KÔ8Ø27¸±)×2BÑ2BÐ/Ø*4šKá/°	Ô:Ø'¨:Ñ5šKñ &+ñ  >CÓ"CºU°T 2§7¡7¨4¦=¹U�KÐ"CÜ&/°Ö&<™
˜˜dÞ Ù" 5œMÞð !2°%¼#¸d»)Ñ2CÑ DØ"3°EÑ":ñ!;ð ,ñ +4°D«/¸OÑ*KšKà!¤S¨£YÑ.šEô '=ö$ Ù˜uœØ"-“Kß‘§¡ñ �u”Ø)“ñE *ðH Ðùò9 #Ds   ÆH8)r   ÚstrÚreturnzIterable[tuple[int, int, str]])TN)r   rC   r!   r   r"   r   r#   r   r$   zlist[tuple[str, int]] | NonerD   z	list[int])Ú
__future__r   ÚreÚtypingr   Ú
rich.cellsr   Útextual._cellsr   Útextual._loopr   Útextual.expand_tabsr   Úcompiler
   r   rB   © ó    r   Ú<module>rO      sy   ðÝ "ã 	Ý å .å #Ý #Ý .à�:Š:�mÓ$€ô ð* Ø=AðsØ
ðsàðsð ðsð ð	sð
 ;ðsð ösrN   