8fddlmZddlZddlmZddlmZddlmZej dj Z edd#d Z e fd$dZ edd%dZedd&dZd'dZd(dZedkrdeededdD] Zeeeddd D]*Zeeded!zed"ez)dSdS))) annotationsN) lru_cache)Callable) CELL_WIDTHSu^[ -o ˿Ͱ-҂]*$itextstrreturnintcLttfd|D}|S)a/Get the number of cells required to display text. This method always caches, which may use up a lot of memory. It is recommended to use `cell_len` over this method. Args: text (str): Text to display. Returns: int: Get the number of cells required to display text. c3.K|]}|VdSN.0 character _get_sizes v/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/rich/cells.py z"cached_cell_len..-@@iYYy))@@@@@@)get_character_cell_sizesum)r total_sizers @rcached_cell_lenr s2(I@@@@4@@@@@J r _cell_lenCallable[[str], int]ct|dkr ||Sttfd|D}|S)zGet the number of cells required to display text. Args: text (str): Text to display. Returns: int: Get the number of cells required to display text. ic3.K|]}|VdSrrrs rrzcell_len..+rr)lenrr)rrrrs @rcell_lenr!sO 4yy3y'I@@@@4@@@@@J r)maxsizerc:tt|S)zGet the cell size of a character. Args: character (str): A single character. Returns: int: Number of cells (0, 1 or 2) occupied by that character. )_get_codepoint_cell_sizeord)rs rrr/s $C NN 3 33r codepointct}d}t|dz }||zdz} ||\}}}||kr|dz }n||kr|dz}n |dkrdn|S||krn ||zdz}>dS)zGet the cell size of a character. Args: codepoint (int): Codepoint of a character. Returns: int: Number of cells (0, 1 or 2) occupied by that character. rrT)rr )r&_table lower_bound upper_boundindexstartendwidths rr$r$<sFKf++/K ; &1 ,E 1"5MsE u  !)KK __!)KK 11 .  $ $ {*q0 1 1rtotalct|r*t|}||kr |d||z zzS|d|S|dkrdSt|}||kr|S||kr |d||z zzSd}t|} ||zdz}|d|dz}t|}||dzkr&t|ddkr |dddzS||kr|S||kr|}n|}g) z?Set the length of a string to fit within given number of cells. NrTr(rr))_is_single_cell_widthsr r!) rr1size cell_sizer.r/posbefore before_lens r set_cell_sizer;Ys8d##4yy %<<#.. .FUF| zzrIE 5cUY./// E d))C s{q iaif%%  " "xr ';';q'@'@#2#;$ $   M   CCE rr0 list[str]ct}gg}|j}|dj}d}|D]D}||}||z|k} | r||g|dj}|}4||||z }Ed|DS)ahSplit text into lines such that each line fits within the available (cell) width. Args: text: The text to fold such that it fits in the given width. width: The width available (number of cells). Returns: A list of strings such that each string in the list has cell width less than or equal to the available width. r)rc8g|]}d|S)r4)join)rlines r zchop_cells..s" , , ,dBGGDMM , , ,r)rappend) rr0_get_character_cell_sizelinesappend_new_lineappend_to_last_line total_widthr cell_widthchar_doesnt_fits r chop_cellsrJ|s 7 TElO)*K & & --i88 % 2U:  & OYK ( ( ("')"2 $KK   * * * : %KK , ,e , , ,,r__main__u😽u]这是对亚洲语言支持的测试。面对模棱两可的想法,拒绝猜测的诱惑。Pr)|x)rr r r )rr rrr r )rr r r )r&r r r )rr r1r r r )rr r0r r r<) __future__rre functoolsrtypingr _cell_widthsrcompilematchr5rr!rr$r;rJ__name__printr@rangenrrrr[s"""""" %%%%%%$$QRRX 4";J       4 4 4 4 4 4    8    F"-"-"-"-J z E ! !& ) )*** ~ABCC d U2q"   mmBCDDGJJ K K K cAg r