)L icUdZddlmZddlZddlZddlZddlZddlmZm Z m Z m Z m Z m Z mZddlmZddlmZddlmZmZmZd gZej0d Zej0d Zej0d Zej0d Zej0dZej0dZee edfej@Z!de"d<Gdde eZ#GddZ$Gdd Z%y)zB The `Document` that implements all the text operations/querying. ) annotationsN)CallableDictIterableListNoReturnPatterncast) ClipboardData)vi_mode) PasteModeSelectionState SelectionTypeDocumentz ([a-zA-Z0-9_]+|[^a-zA-Z0-9_\s]+)z!^([a-zA-Z0-9_]+|[^a-zA-Z0-9_\s]+)z&^(([a-zA-Z0-9_]+|[^a-zA-Z0-9_\s]+)\s*)z([^\s]+)z ^([^\s]+)z ^([^\s]+\s*)_DocumentCachezdict[str, _DocumentCache]_text_to_document_cachec<eZdZdZddZeZeZeZeZeZ eZ eZ eZ eZ y)_ImmutableLineListz Some protection for our 'lines' list, which is assumed to be immutable in the cache. (Useful for detecting obvious bugs.) ctd)Nz$Attempt to modify an immutable list.)NotImplementedError)selfakws ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/prompt_toolkit/document.py_errorz_ImmutableLineList._error6s!"HIIN)robjectrrreturnr)__name__ __module__ __qualname____doc__r __setitem__appendclearextendinsertpopremovereversesortrrrr0s< JK F E F F C FG DrrceZdZddZy)rc d|_d|_yN)lines line_indexesrs r__init__z_DocumentCache.__init__Es04 /3rN)rNone)r r!r"r4r-rrrrDs3rcleZdZdZdZ dG dHdZdIdZdJdZedIdZ edKdZ edLd Z edId Z edId Z edId ZedId ZedIdZedIdZedMdZedNdZedMdZedKdZedIdZedIdZdOdPdZedQdZedQdZedKdZedKdZdRdZdRdZdSdZedQdZ edQdZ!dTd Z" dU dVd"Z#dWdXd#Z$ dY dZd$Z% d[ d\d%Z& d[ d]d&Z' d^ d_d'Z( d` dad(Z)dWdbd)Z* dc ddd*Z+ de dfd+Z, dc ddd,Z- dc ddd-Z. dg dhd.Z/ dg dhd/Z0dgdid0Z1dgdid1Z2 dj dkd2Z3 dj dkd3Z4 dl dmd4Z5 dl dnd5Z6 do dpd6Z7dKd7Z8dKd8Z9dWdqd9Z:dKd:Z;dKd;Zdtd>Z?dud?Z@dvd@ZAeBjd!f dwdAZDdKdBZEdcdxdCZFdcdydDZGdzdEZHdzdFZIy){ra This is a immutable class around the text and cursor position, and contains methods for querying this data, e.g. to give the text before the cursor. This class is usually instantiated by a :class:`~prompt_toolkit.buffer.Buffer` object, and accessed as the `document` property of that class. :param text: string :param cursor_position: int :param selection: :class:`.SelectionState` )_text_cursor_position _selection_cacheNc N|-|t|ksJtd|dt|| t|}||_||_||_ t |j |_y#t$r/t|_|jt |j <YywxYw)Nzcursor_position=z , len_text=) lenAssertionErrorr7r8r9rtextr:KeyErrorr)rr>cursor_position selections rr4zDocument.__init__\s&/SY*F 1SYM JI  F  "!$iO  /# =1$))r@r3s r__repr__zDocument.__repr__s2..))*!DII=4;O;O:RRSTTrct|tsy|j|jk(xr4|j|jk(xr|j|jk(S)NF) isinstancerr>r@rA)rothers r__eq__zDocument.__eq__sT%* II # 2$$(=(== 2%//1 rc|jS)zThe document text.)r7r3s rr>z Document.textszzrc|jS)zThe document cursor position.)r8r3s rr@zDocument.cursor_positions$$$rc|jS)z :class:`.SelectionState` object.)r9r3s rrAzDocument.selectionsrc,|jdxsdS)z1Return character under cursor or an empty string.r_get_char_relative_to_cursorr3s r current_charzDocument.current_chars0039r9rc,|jdxsdS)z6Return character before the cursor or an empty string.rOrPr3s rchar_before_cursorzDocument.char_before_cursors004::rc4|jd|jSr0r>r@r3s rtext_before_cursorzDocument.text_before_cursorsyy14//22rc4|j|jdSr0rWr3s rtext_after_cursorzDocument.text_after_cursorsyy--/00rcD|jjd\}}}|S)z1Text from the start of the line until the cursor. )rX rpartition)r_r>s rcurrent_line_before_cursorz#Document.current_line_before_cursors%,,77= 1d rcD|jjd\}}}|S)z/Text from the cursor until the end of the line.r\)rZ partition)rr>r^s rcurrent_line_after_cursorz"Document.current_line_after_cursors%++55d; a rc|jj3t|jj d|j_|jjS)z) Array of all the lines. r\)r:r1rr>splitr3s rr1zDocument.linessB ;;   $ 2499??43H IDKK {{   rc<|jjqtt|j}dg}|j }d}|D]}||dzz }||t|dkDr|j ||j_|jjS)zG Array pointing to the start indexes of all the lines. rr )r:r2mapr<r1r%r))r line_lengthsindexesr%pos line_lengths r_line_start_indexeszDocument._line_start_indexess ;; # # +sDJJ/LcG^^FC+  {Q&s   7|a '.DKK ${{'''rc4|j|jdS)zY Array of the lines starting from the current line, until the last line. N)r1cursor_position_rowr3s rlines_from_currentzDocument.lines_from_currents zz$22455rc,t|jS)zReturn the number of lines in this document. If the document ends with a trailing \n, that counts as the beginning of a new line.)r<r1r3s r line_countzDocument.line_counts4::rc4|j|jzS)zuReturn the text on the line where the cursor is. (when the input consists of just one line, it equals `text`.)r_rbr3s r current_linezDocument.current_lines..1O1OOOrcn|j}t|t|jz }|d|S)z>The leading whitespace in the left margin of the current line.N)rrr<lstrip)rrrlengths r"leading_whitespace_in_current_linez+Document.leading_whitespace_in_current_lines9(( \"S)<)<)>%??GV$$rcZ |j|j|zS#t$rYywxYw)zO Return character relative to cursor position, or empty string rO)r>r@ IndexError)roffsets rrQz%Document._get_char_relative_to_cursors3 99T11F:; ;  s  **c |jdk(S)z5 True when we are at the first line. r)rmr3s r on_first_linezDocument.on_first_lines ''1,,rc:|j|jdz k(S)z4 True when we are at the last line. r )rmrpr3s r on_last_linezDocument.on_last_lines ''4??Q+>>>rcB|j|j\}}|S)z) Current row. (0-based.) _find_line_start_indexr@)rrowr^s rrmzDocument.cursor_position_rows# ,,T-A-ABQ rc\|j|j\}}|j|z S)z, Current column. (0-based.) r)rr^line_start_indexs rcursor_position_colzDocument.cursor_position_cols2#99$:N:NO ##&666rcZ|j}tj||dz }|||fS)z For the index of a character at a certain line, calculate the index of the first character on that line. Return (row, index) tuple. r )rkbisect bisect_right)rindexrhris rrzDocument._find_line_start_index(s5**!!'51A5GCL  rc<|j|\}}||z }||fS)z Given an index for the text, return the corresponding (row, col) tuple. (0-based. Returns (0, 0) for index=0.) )r)rrr row_indexcols rtranslate_index_to_positionz$Document.translate_index_to_position4s+ 44U;YiCxrc | |j|}|j|}|tdt |t |z }tdt |t |j }|S#t$rE|dkr|jd}|jd}n|jd}|jd}YwxYw)z Given a (row, col) tuple, return the corresponding index. (Row and col params are 0-based.) Negative row/col values are turned into zero. rrT)rkr1rxmaxminr<r>)rrrresultlines rtranslate_row_col_to_indexz#Document.translate_row_col_to_index?s &--c2F::c?D #aS#d),--QFC N34  &Qw11!4zz!}11"5zz"~  &sA--A B;:B;cF|jt|jk(S)z/True when the cursor is at the end of the text.)r@r<r>r3s ris_cursor_at_the_endzDocument.is_cursor_at_the_endXs##s499~55rc|jdvS)z0True when the cursor is at the end of this line.)r\rO)rRr3s ris_cursor_at_the_end_of_linez%Document.is_cursor_at_the_end_of_line]s  J..rch|jj||j|jk(S)zM `True` when this substring is found at the cursor position. )r>findr@)rsubs rhas_match_at_current_positionz&Document.has_match_at_current_positionbs*yy~~c4#7#78Dflagsiteratorimatchs rrz Document.findhs+t,,, 11D))D'4yA~ABx!, !;;ryy~tU; %h/ 25q5E>/${{1~-${{1~11  2   s$C C 2C C CCc|rtjnd}tjtj||j|Dcgc]}|j c}Scc}w)zu Find all occurrences of the substring. Return a list of absolute positions in the document. r)rrrrr>r)rrrrrs rfind_allzDocument.find_allsD "- !#%;;ryy~tyy%#PQa QQQs A%cr|r|jddd}n|jddd}|rtjnd}tjtj |ddd||} t |D]-\}} |dz|k(s| jd t|z cS y#t$rYywxYw)z Find `text` before the cursor, return position relative to the cursor position. Return `None` if nothing was found. :param count: Find the n-th occurrence. NrTrr ) r_rXrrrrrrr<r) rrrrr before_cursorrrrrs rfind_backwardszDocument.find_backwardss  ;;DbDAM 33DbD9M!, !;;ryyTrT3]EJ %h/ 65q5E>!KKN?SX55 6    s-B*B*'B** B65B6c|j||ry|j}|j||xsd}|t||zdS)z Give the word before the cursor. If we have whitespace before the cursor this returns an empty string. :param pattern: (None or compiled regex). When given, use this regex pattern. WORDpatternrOrN)_is_word_before_cursor_completerXfind_start_of_previous_wordr<)rrrrXrs rget_word_before_cursorzDocument.get_word_before_cursorsZ  / /T7 / K!4400dG0LQPQ!#&8"9E"A"CDDrc|r|j||duS|jdk(xs|jddjS)NrrOrT)rrXisspace)rrrs rrz(Document._is_word_before_cursor_completesS 33w3OSWW W''2-W1H1H1M1U1U1W rc|r|rJ|jddd}|r|}n|rt}nt}|j|} t |D]!\}}|dz|k(s|j d cS y#t $rYywxYw)z Return an index relative to the cursor position pointing to the start of the previous word. Return `None` if nothing was found. :param pattern: (None or compiled regex). When given, use this regex pattern. NrTr r)rX_FIND_BIG_WORD_RE _FIND_WORD_RErrendr) rrrrrXregexrrrs rrz$Document.find_start_of_previous_wordsW%%"44TrT: E %E!E>>"45 %h/ )5q5E>!IIaL=( )    sA0A0-A00 A<;A<c|jddd}|j}dfd }||j|}||j|}sW|rU|rS|j|jdz } |j|j} t j dz} | | v| | vk7rd}|r|jd nd|r|jdfSdfS)a Return the relative boundaries (startpos, endpos) of the current word under the cursor. (This is at the current line, because line boundaries obviously don't belong to any word.) If not on a word, this returns (0,0) NrTc<ttttd|fS)N))FF)FT)TF)TT)_FIND_CURRENT_WORD_RE1_FIND_CURRENT_WORD_INCLUDE_TRAILING_WHITESPACE_RE_FIND_CURRENT_BIG_WORD_RE5_FIND_CURRENT_BIG_WORD_INCLUDE_TRAILING_WHITESPACE_RE)include_whitespacers r get_regexz;Document.find_boundaries_of_current_word..get_regexs) 5P8S  '( * *rr 0123456789_r)rrrz Pattern[str])r_rbsearchr>r@string ascii_lettersr) rrinclude_leading_whitespaceinclude_trailing_whitespacerXrZr match_before match_afterc1c2alphabets ` rfind_boundaries_of_current_wordz(Document.find_boundaries_of_current_words"<r@)rrrrs rget_word_under_cursorzDocument.get_word_under_cursorsB 99t9D syy--58L8Ls8RSSrcB|dkr|j| |S|rtnt}|j|j} t |D]>\}}|dk(r|j ddk(r|dz }|dz|k(s-|j dcS y#t$rYywxYw)z Return an index relative to the cursor position pointing to the start of the next word. Return `None` if nothing was found. rrrr N)find_previous_word_beginningrrrrZrrrrrrrrrrs rfind_next_word_beginningz!Document.find_next_word_beginning's 1944E64M M%)!}>>$"8"89 %h/ *56ekk!n1QJEq5E> ;;q>)  *   s7B<BB BBcD|dkr|j| |S|r |j}n|jdd}|rtnt}|j |} t |D]+\}}|dz|k(s|j d} |r| cS| dzcS y#t$rYywxYw)z Return an index relative to the cursor position pointing to the end of the next word. Return `None` if nothing was found. rrr N)find_previous_word_endingrZrrrrrr) rrrrr>riterablerrvalues rfind_next_word_endingzDocument.find_next_word_ending@s 1911T1J J #))D))!"-D%)!}>>$' %h/ )5q5E>!IIaLE/$ $qy( )   s$B2B BB BBc|dkr|j| |S|rtnt}|j|jddd} t |D]!\}}|dz|k(s|j d cS y#t$rYywxYw)z Return an index relative to the cursor position pointing to the start of the previous word. Return `None` if nothing was found. rrNrTr )rrrrrXrrrrs rrz%Document.find_previous_word_beginning`s 1900vD0I I%)!}>>$"9"9$B$"?@ %h/ )5q5E>!IIaL=( )    s A;$A;8A;; BBcz|dkr|j| |S|jdd|jdddz}|rtnt}|j |} t |D]B\}}|dk(r|jddk(r|dz }|dz|k(s-|jd dzcS y#t$rYywxYw)z Return an index relative to the cursor position pointing to the end of the previous word. Return `None` if nothing was found. rrNr rT) rrZrXrrrrrr)rrrrXrrrrs rrz"Document.find_previous_word_endingus 19--UF-F F!33BQ7$:Q:QRVTVRV:WW%)!}>>"45 %h/ /56ekk!n1QJEq5E>!KKN?Q..  /   s7B.B.+B.. B:9B:cd}t|j|jdzdD]\}}||r d|z}|dz}|dk(s|S|S)zn Look downwards for empty lines. Return the line index, relative to the current line. Nr rrr1rmr match_funcrrrrs rfind_next_matching_linez Document.find_next_matching_linesh$TZZ0H0H10L0N%OP KE4$U z   rcd}t|jd|jdddD]\}}||r d|z }|dz}|dk(s|S|S)zl Look upwards for empty lines. Return the line index, relative to the current line. NrTr rrrs rfind_previous_matching_linez$Document.find_previous_matching_linesl$TZZ0J$2J2J%KDbD%QR KE4$e z   rc^|dkr|j| St|j| S)z4 Relative position for cursor left. r)get_cursor_right_positionrrrrs rget_cursor_left_positionz!Document.get_cursor_left_positions4 19115&9 9D,,e444rcn|dkr|j| St|t|jS)z5 Relative position for cursor_right. r)rrr<rbrs rrz"Document.get_cursor_right_positions6 1900%8 85#d<<=>>rc|dk\sJ| |jn|}|jtd|j|z ||jz S)a Return the relative cursor position (character index) where we would be if the user pressed the arrow-up button. :param preferred_column: When given, go to this column instead of staying at the current column. r r)rrrrmr@rrpreferred_columncolumns rget_cursor_up_positionzDocument.get_cursor_up_positionsbzz(8(@D $ $FV   + +At//%78& "" # rc|dk\sJ| |jn|}|j|j|z||jz S)a Return the relative cursor position (character index) where we would be if the user pressed the arrow-down button. :param preferred_column: When given, go to this column instead of staying at the current column. r )rrrmr@rs rget_cursor_down_positionz!Document.get_cursor_down_positionsVzz(8(@D $ $FV   + +D,D,Du,Lf U"" # rcF|j|k(ry|t|j}ntt|j|}d}t |j dz|D]<}|j|}||k(r|dz }n ||k(r|dz}|dk(s-||j z cSy)z Find the right bracket enclosing current position. Return the relative position to the cursor position. When `end_pos` is given, don't look past the position. rNr )rRr<r>rranger@)rleft_chright_chend_posstackrcs rfind_enclosing_bracket_rightz%Document.find_enclosing_bracket_rights    ( ?$))nG#dii.'2Gt++a/9 0A ! AG| h z4//// 0rc|j|k(ry|d}n td|}d}t|jdz |dz dD]<}|j|}||k(r|dz }n ||k(r|dz}|dk(s-||jz cSy)z Find the left bracket enclosing current position. Return the relative position to the cursor position. When `start_pos` is given, don't look past the position. rNr rT)rRrrr@r>)rrr start_posrrrs rfind_enclosing_bracket_leftz$Document.find_enclosing_bracket_lefts    '  IAy)It++a/QC 0A ! AH} g z4//// 0rcdD]^}|d}|d}|j|k(r|j|||xsdcS|j|k(sF|j|||xsdcSy)z Return relative cursor position of matching [, (, { or < bracket. When `start_pos` or `end_pos` are given. Don't look past the positions. )z()z[]z{}z<>rr )r)r)rRrr)rrrpairABs rfind_matching_bracket_positionz'Document.find_matching_bracket_position4s+ XDQAQA  A%88Aw8OTSTT""a'771 7RWVWW  Xrc|j S)z0Relative position for the start of the document.)r@r3s rget_start_of_document_positionz'Document.get_start_of_document_positionHs$$$$rcFt|j|jz S)z.Relative position for the end of the document.)r<r>r@r3s rget_end_of_document_positionz%Document.get_end_of_document_positionLs499~ 4 444rc|r>|j}t|t|jz |jz St|j S)z-Relative position for the start of this line.)rrr<rtrr_)rafter_whitespacerrs rget_start_of_line_positionz#Document.get_start_of_line_positionPsW ,,LL!l))+,-**+  7788 8rc,t|jS)z+Relative position for the end of this line.)r<rbr3s rget_end_of_line_positionz!Document.get_end_of_line_position\s41122rcht|jj|jz dz S)zR Relative position for the last non blank character of this line. r )r<rrrstriprr3s r'last_non_blank_of_current_line_positionz0Document.last_non_blank_of_current_line_position`s.4$$++-.1I1IIAMMrczt|j}|j}tdt ||}||z S)z Return the relative cursor position for this column at the current line. (It will stay between the boundaries of the line in case of a larger number.) r)r<rrrrr)rrrjcurrent_columns rget_column_cursor_positionz#Document.get_column_cursor_positionfs= $++, 11QK01&&rc|jr2t|j|jjg\}}||fS|j|j}}||fS)z Return (from, to) tuple of the selection. start and end position are included. This doesn't take the selection type into account. Use `selection_ranges` instead. )rAsortedr@original_cursor_position)rfrom_tos rselection_rangezDocument.selection_rangers^ >>%%t~~'N'NOIE2 by,,d.B.B2Ebyrc #K|jrt|j|jjg\}}|jjt j k(r|j|\}}|j|\}}t||g\}}|j}tr|dz }t||dzD]F}t||} || ks|j|||j|t| |fHy|jjt jk(r~td|j j#dd|dz}|j j%d|dk\r|j j%d|}nt|j dz }tr|dz }||fyyw)aE Return a list of `(from, to)` tuples for the selection or none if nothing was selected. The upper boundary is not included. This will yield several (from, to) tuples in case of a BLOCK selection. This will return zero ranges, like (8,8) for empty lines in a block selection. r rr\N)rArr@rtyperBLOCKrr1r rr<rrLINESrr>rfindr) rrr from_line from_columnto_line to_columnr1lrjs rselection_rangeszDocument.selection_rangess >>%%t~~'N'NOIE2~~""m&9&99)-)I)I%)P& ;%)%E%Eb%I")/i0H)I& Y 9NIy'A+6 A"%eAh-K"k1 ;;A{K ;; !3{I#> >>&&-*=*==499??4E#BQ#FGEyy~~dB/14!YY^^D"5 ^a/9!GBRiO s CG C/G c|jr|j|}|j|d}|j|t|}t |j |jj g\}}t||}t||}||kr|jjtjk(r|}|}n|jjtjk(rk|j|\} } |j|\} } t | | g\} } | t|kDry|j|| }|j|| }|j|\} } |j|\} } tr| dz } | | fSy)aB If the selection spans a portion of the given line, return a (from, to) tuple. The returned upper boundary is not included in the selection, so `(0, 0)` is an empty selection. `(0, 1)`, is a one character selection. Returns None if the selection doesn't cover this line at all. rNr )rAr1rr<rr@rrrrrrrrr )rrr row_startrow_endrrintersection_startintersection_endr^col1col2rr!s rselection_range_at_linez Document.selection_range_at_lines~ >>::c?D77Q?I55c3t9EG%%t~~'N'NOIE2 "%Y!6 "7B/ !%55>>&&-*=*==)2&'.$^^((M,?,??">>uEGAt">>rBGAt!'t !5JD$c$i'#)-)H)Hd)S&'+'F'FsD'Q$!%!A!ABT!U;#??@PQ 99NI"I--rch|jrg}g}|j}d}|jD]J\}}|dk(r|}|j|j|||j|j|||}L|j|j|ddj |}dj |}|jj tjk(r|jdr|dd}t||t||jj fS|tdfS)z Return a (:class:`.Document`, :class:`.ClipboardData`) tuple, where the document represents the new document when the selection is cut, and the clipboard data, represents whatever has to be put on the clipboard. rNr\rOrTrW) rAr@r#r%r>joinrrrendswithrr ) r cut_partsremaining_partsnew_cursor_positionlast_torrcut_textremaining_texts r cut_selectionzDocument.cut_selections- >>I O"&"6"6 G!224  ra<*/'&&tyy'?@  5!45    " "499WX#6 7yy+HWW_5N~~""m&9&99h>O>OPT>U#CR=n>QRh(;(;<  r** *rc|tjk(}|tjk(}|jtj k(r|rJ|j d|jdz|j |zz|j |jdzdz}n)|j|j |zz|jz}|jt|j |zz}|r|dz}n|jtjk(r|j}|rm|jd||j g|zz|j|dz} dj| }tdj|jd||z}nh|jd|dz|j g|zz|j|dzdz} tdj|jd|dz|zdz}dj| }n|jtjk(r|jdd} |j} |j |rdndz} t#|j j%dD]Z\} } | | z}|t| k\r| j'd| |j)| | |<| |d| | |zz| || dz| |<\dj| }|j|rdndz}t+S)a Return a new :class:`.Document` instance which contains the result if we would paste this data at the current cursor position. :param paste_mode: Where to paste. (Before/after/emacs.) :param count: When >1, Paste multiple times. Nr r\rOrrW)r VI_BEFOREVI_AFTERrr CHARACTERSr>r@rXrZr<rrmr1r-rrrrdr%ljustr)rdata paste_moderbeforeafternew_textr1r"r1 start_line start_columnrrrs rpaste_clipboard_datazDocument.paste_clipboard_datasy222i000 99 00 0II8 4 4q 89ii%'(ii 4 4q 8 :;<++dii%.??$BXBXX#'"6"6TYY%9O"O #q(# YY--- -((A 2A$))u)<     rcdd}|j||}|r&|rdnd}td|j| |zS|j S)zX Return the start of the current paragraph. (Relative cursor position.) c,| xs|jSr0rr>s rrz/Document.start_of_paragraph..match_funcb8-t||~ -rrrrr rr>strrr)rrrr@)rrr=r line_indexadds rstart_of_paragraphzDocument.start_of_paragraph]sb  .55!6  !1Cq$55ZK5H3NO O((( (rcdd}|j||}|r%|rdnd}td|j||z St|jS)zV Return the end of the current paragraph. (Relative cursor position.) c,| xs|jSr0rGrHs rrz-Document.end_of_paragraph..match_functrIrrJrr rKrL)rrrr<rZ)rrr>rrNrOs rend_of_paragraphzDocument.end_of_paragraphos[  .11Zu1U !!Cq$77j7ICOP Pt--. .rc`t|j|z|j|jS)z Create a new document, with this text inserted after the buffer. It keeps selection ranges and cursor position in sync. r>r@rA)rr>r@rA)rr>s r insert_afterzDocument.insert_afters- T! 00nn  rc|j}|r-t|jt|z|j}t ||j z|jt|z|S)z Create a new document, with this text inserted before the buffer. It keeps selection ranges and cursor position in sync. )rrrU)rArrr<rrr>r@)rr>selection_states r insert_beforezDocument.insert_beforesh .. ,)8)Q)Qd)*$))O  ! 003t9<%  r)rONN)r>rMr@ int | NonerASelectionState | Nonerr5)rrM)rIrrr)rint)rr[)rz list[str])r list[int])r)ryr\rrM)rr)rr\rtuple[int, int])rr\rr\rr\)rrMrr)FFFr ) rrMrrrrrrrr\rrZ)F)rrMrrrr])FFr ) rrMrrrrrr\rrZ)FN)rrrPattern[str] | NonerrM)rrrr_rr)r FN)rr\rrrr_rrZ)FFF)rrrrrrrr^)rrrrM)r F)rr\rrrrZ)Fr F)rrrr\rrrrZ)r )rzCallable[[str], bool]rr\rrZ)rr\rr\)r N)rr\rrZrr\r0)rrMrrMrrZrrZ)rrMrrMrrZrrZ)NN)rrZrrZrr\)r rrr\)rr\rr\)rr^)rzIterable[tuple[int, int]])rr\rztuple[int, int] | None)rztuple[Document, ClipboardData])r;r r<rrr\rr)rr\r=rrr\)rr\r>rrr\)r>rMrr)Jr r!r"r# __slots__r4rFrJpropertyr>r@rArRrUrXrZr_rbr1rkrnrprrrvrQr{r}rmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r rrrr#r+r5rEMACSrBrDrPrSrVrYr-rrrrMs FI&*+/ ==$=) =  =NU %%::;;3311  !!((666  PP %% -- ?? 77 ! 266//Q!&).! ' ''#' '  '  ' 'RR!&!       <BFEE+>E E(BF+> RV$(;N F+0,1 ) ) %)) &* )  ) VT,1$( 4TY(,=@LP B,1$( ,,1$( 8?@/8; (?@/8; &5?>B  0:  .>B  0:  *BF&)4> DDH&)6@ DCG#5? (%5 93N ' *0 d0d"+N!* ?L?L?L ?L  ?LB )$/$   r)&r# __future__rrrrweakreftypingrrrrrr r clipboardr filtersr rArrr__all__compilerrrrrrrMWeakValueDictionaryr__annotations__rrrr-rrrls# JJJ$??  >? " #GH4>BJJ-51 BJJ{+&BJJ|48B ?8S5 6: G!62 c(33Q Q r