)L iSdZddlmZddlmZmZddlmZddlm Z ddl m Z m Z m Z mZmZddlmZddlmZdd lmZdd lmZmZmZmZdd lmZmZmZdd lm Z m!Z!dd l"m#Z#ddl$m%Z%m&Z&ddl'm(Z(m)Z)m*Z*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1ddl2m3Z3m4Z4m5Z5m6Z6m7Z7ddl8m9Z9ddl:m;Z;ddlZ>m?Z?ddl@mAZAe rddlBmCZCmDZDddlEmFZFgdZGGddeZHe r GddeCZIeeHdfZJd@d ZKGd!d"eZLGd#d$eZMGd%d&eHZNGd'd(eNZOGd)d*eNZPGd+d,eHZQGd-d.ZRGd/d0ZSGd1d2ZTGd3d4ZUeezZVGd5d6eZWGd7deHZXGd8d9eHZYGd:d;eHZZdAd<Z[dBd=Z\dCd>Z]y?)Dza Container for the layout. (Containers can contain other containers or user interface controls.) ) annotations)ABCMetaabstractmethod)Enum)partial) TYPE_CHECKINGCallableSequenceUnioncast)get_app) SimpleCache)Point) FilterOrBoolemacs_insert_mode to_filtervi_insert_mode)AnyFormattedTextStyleAndTextTuplesto_formatted_text)fragment_list_to_textfragment_list_width)KeyBindingsBase) MouseEventMouseEventType) get_cwidthtake_using_weightsto_intto_str) DummyControlFormattedTextControlGetLinePrefixCallable UIContent UIControl) AnyDimension Dimensionmax_layout_dimensionssum_layout_dimensions to_dimension)Margin) MouseHandlers) _CHAR_CACHEScreen WritePosition)explode_text_fragments)Protocol TypeGuard)NotImplementedOrNone) AnyContainer ContainerHorizontalAlign VerticalAlignHSplitVSplitFloatContainerFloat WindowAlignWindowWindowRenderInfoConditionalContainer ScrollOffsets ColorColumn to_container to_window is_containerDynamicContainerceZdZdZed dZed dZed dZe d dZddZ ddZ eddZ y )r5z/ Base class for user interface layout. cy)zu Reset the state of this container and all the children. (E.g. reset scroll offsets, etc...) Nselfs f/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/prompt_toolkit/layout/containers.pyresetzContainer.resetWcy)z Return a :class:`~prompt_toolkit.layout.Dimension` that represents the desired width for this container. NrHrJmax_available_widths rKpreferred_widthzContainer.preferred_width^rMrNcy)z Return a :class:`~prompt_toolkit.layout.Dimension` that represents the desired height for this container. NrHrJwidthmax_available_heights rKpreferred_heightzContainer.preferred_heighterMrNcy)a= Write the actual content to the screen. :param screen: :class:`~prompt_toolkit.layout.screen.Screen` :param mouse_handlers: :class:`~prompt_toolkit.layout.mouse_handlers.MouseHandlers`. :param parent_style: Style string to pass to the :class:`.Window` object. This will be applied to all content of the windows. :class:`.VSplit` and :class:`.HSplit` can use it to pass their style down to the windows that they contain. :param z_index: Used for propagating z_index from parent to child. NrHrJscreenmouse_handlerswrite_position parent_styleerase_bgz_indexs rKwrite_to_screenzContainer.write_to_screenlrMrNcy)z When this container is modal, key bindings from parent containers are not taken into account if a user control in this container is focused. FrHrIs rKis_modalzContainer.is_modals rNcy)z Returns a :class:`.KeyBindings` object. These bindings become active when any user control in this container has the focus, except if any containers between this container and the focused user control is modal. NrHrIs rKget_key_bindingszContainer.get_key_bindingss rNcgS)zG Return the list of child :class:`.Container` objects. rHrIs rK get_childrenzContainer.get_childrens  rNNreturnNonerQintrhr'rUrkrVrkrhr'rZr.r[r,r\r/r]strr^boolr_ int | NonerhrirhrorhKeyBindingsBase | Nonerhzlist[Container]) __name__ __module__ __qualname____doc__rrLrRrWr`rbrdrfrHrNrKr5r5Rs        & &          *rNr5) metaclassceZdZdZddZy)MagicContainerzY Any object that implements ``__pt_container__`` represents a container. cyNrHrIs rK__pt_container__zMagicContainer.__pt_container__rMrNN)rhr4)rurvrwrxr~rHrNrKr{r{s   8rNr{r=c.ttdgS)z.getMs&(Fzzm22M4H4HII f9q+ABC  e$ #||!.."00  zzm22M4E4EFF f9q+ABCMrNrtrrtuplerrJrs` rKrzHSplit._all_childrenG,  4##''dmm($$^4s"VDJJ%77!\\1't|| =  ! ! 1 1x  "&&D!&&D"((EE4#5#56 1!!"!$eQ7    .22^5J5JJTQ !#,,<<"!$e5EF $rNc |jsgS|j}|j}|jDcgc]}|j ||}}t |}|j |kDry|Dcgc]}|j }}tttt||Dcgc]}|jc}} t| } t ||j} |Dcgc]}|j} }t|| kr2|| | | kr || xxdz cc<t| } t|| kr2tj sot ||j"} |Dcgc]}|j"}}t|| kr2|| || kr || xxdz cc<t| } t|| kr2|Scc}wcc}wcc}wcc}wcc}w)zb Return the heights for all rows. Or None when there is not enough space. Nitemsweightsr )rrUrrrWr)minrlistrangelenweightnextrsumr is_donemax)rJr\rUrrrsum_dimensionsdrchild_generatoripreferred_stoppreferred_dimensionsmax_stopmax_dimensionss rKrzHSplit._divide_heightss }}I$$&&BFASASTAa((7T T/z:    &!++1++,uS_-.:8Va8V   !V^%=%=>5?@ @@%j>)Qx.q11aA _%A%j>) y  6>#5#56H-78aee8N8e*x'8nQ//!HMH)e*x'  OU,9W A9sG/G)G )G,G)rrrrrr7rr&rrrrnrUr&rr&r_rprrorrsrrrhrirjrlrgrtrm)r\r/rhlist[int] | None)rurvrwrxr7rrrRrWrLpropertyrr`r __classcell__rs@rKr8r8s-H.2,44 !#'"#"/3)+"0("0+"0 "0  "0 ! "0"0"0"0"0"0-"0'"0 "0H1CCB77&7& 7  7  77 7r3rNr8c eZdZdZdej dddddddddf d fd ZddZddZdd Z e dd Z dd Z dd Z xZS)r9a Several layouts, one stacked left/right of the other. :: +---------+----------+ | | | | | | +---------+----------+ By default, this doesn't display a vertical line between the children, but if this is something you need, then create a HSplit as follows:: VSplit(children=[ ... ], padding_char='|', padding=1, padding_style='#ffff00') :param children: List of child :class:`.Container` objects. :param window_too_small: A :class:`.Container` object that is displayed if there is not enough space for all the children. By default, this is a "Window too small" message. :param align: `HorizontalAlign` value. :param width: When given, use this width instead of looking at the children. :param height: When given, use this height instead of looking at the children. :param z_index: (int or None) When specified, this can be used to bring element in front of floating elements. `None` means: inherit from parent. :param style: A style string. :param modal: ``True`` or ``False``. :param key_bindings: ``None`` or a :class:`.KeyBindings` object. :param padding: (`Dimension` or int), size to be used for the padding. :param padding_char: Character to be used for filling in the padding. :param padding_style: Style to applied to the padding. NrrFc t ||||||||| | | |  ||_td|_t |_yrrrs rKrzVSplit.__init__rrNc|jt|jS|jDcgc]}|j|}}t |Scc}wr})rUr*rrRr)rs rKrRzVSplit.preferred_widths\ :: ! + +=A.getIs&(Fzzo44o6K6KLL f9q+ABC  e$ "ll!.."00  zzo44o6J6JKK f9q+ABCMrNrtrrs` rKrzVSplit._all_childrenCrrNc N|j}|sgS|Dcgc]}|j|}}|Dcgc]}|j}}t|}|j|kDry|Dcgc]}|j}}t t tt||Dcgc]}|jc}} t| } t ||j} t|| kr2|| || kr || xxdz cc<t| } t|| kr2|Dcgc]}|j} }t ||j} t|| kr2|| | | kr || xxdz cc<t| } t|| kr2|Scc}wcc}wcc}wcc}wcc}w)zd Return the widths for all columns. Or None when there is not enough space. Nrr ) rrRrr)rrrrrrrrr)rJrUrrrrrrrrrrrrs rKrzVSplit._divide_widthses %%I9AA1a''.A A5?@ @@/z:    %!++1++,uS_-.:8Va8V   !UN$<$<=%j>)Qx.q11aA _%A%j>) *44A!%%44un001%j8#Qx.++aA _%A%j8#  MB@,9W5sFF'F!F !F"c T|jsy|j}|j|j}|dzt |j z} |j |n |j }|!|jj|||| ||yt||D cgc]+\} } | j| |jj-} } } t|jt|jt| } |j}|j }t||D],\}}|j||t#|||| | ||||z }.|j |jz|z }|dkDr-|j$j||t#|||| | ||yycc} } w)rNrr)rrrrUrrr_rr`rrWrrrrrrr/r)rJrZr[r\r]r^r_rrrrUrheightsrrrrrremaining_widths rKr`zVSplit.write_to_screens}} %%##N$8$89s"VDJJ%77!\\1't|| =  ! ! 1 1x   !$E8 4 u  " "5.*?*? @ J J  ^**C0E0Es7|,TU""""x( DAq  dD!V4   AID  )--0D0DDtK Q   ( ( 8 8dD/6B   9 s0F$)rrrrrr6rr&rrrrnrUr&rr&r_rprrorrsrrrhrirjrlrgrt)rUrkrhrrm)rurvrwrxr6rrrRrWrLrrrr`rrs@rKr9r9s5F.2!0!8!8 !#'"#"/3)+"0("0+"0 "0  "0 ! "0"0"0"0"0"0-"0'"0 "0H150CCB1fDD&D& D  D  DD DrNr9ceZdZdZ d ddZddZddZddZ ddZ ddZ dd Z dd Z dd Z dd Z y)r:a Container which can contain another container for the background, as well as a list of floating containers on top of it. Example Usage:: FloatContainer(content=Window(...), floats=[ Float(xcursor=True, ycursor=True, content=CompletionsMenu(...)) ]) :param z_index: (int or None) When specified, this can be used to bring element in front of floating elements. `None` means: inherit from parent. This is the z_index for the whole `Float` container as a whole. Ncjt||_||_||_||_||_||_yr})rBcontentfloatsrrrr_)rJrrrrrr_s rKrzFloatContainer.__init__s4$G,   (  rNc|jj|jD]}|jjyr})rrLr)rJfs rKrLzFloatContainer.resets3  A IIOO  rNc8|jj|Sr})rrRrPs rKrRzFloatContainer.preferred_width s||++,?@@rNc:|jj||S)z Return the preferred height of the float container. (We don't care about the height of the floats, they should always fit into the dimensions provided by the container.) )rrWrTs rKrWzFloatContainer.preferred_height s ||,,U4HIIrNc|dzt|jz}|j|n |j}|jj ||||||t |j D]\}} |xsd| jz} |dzt|jz}| jduxs| jdu} | r3|dz} |j| t|j| |||||| |j| |||||| y)Nrrir_ draw_func) rrr_rr` enumeraterxcursorycursordraw_with_z_indexr _draw_float) rJrZr[r\r]r^r_rnumberfl new_z_indexpostpones rKr`zFloatContainer.write_to_screens)s"VDJJ%77!\\1't|| $$ NNE8W $DKK0' JFB#MMO  77 8#777DE WW RXX%977D"((2772RXX=E  !bhh&:!''"((2X=DE ZZ 22>3G3GHRRN00%8 "$$De|n2221n22U:; ,,x71<=DEJJ..~/C/CDNNEww"ww%1n22U:RXXEF1c>#7#7%#?1"DEF~33d:;E 66 )"766DF VV BII$966D#**RVV3bii?F  "ryy'<!((94ryy@DF ZZ"$$R-B-BJD 44>00)#--44!((4/!3t;,22T9F!):):;F*,,v5D-- 9Q>?DFZZ008M8MNXXFvv!vv&1n33f#8#86#AQ"FGH!6!6!=>F A:%!)N///N/// B00D4G4GPR4S **"!#!11# +5T$:rNc:|}t|j|j|jzD]i}||jvs|j|}t|j|j|j zD]}||}|j dk7syky)z Return True when the area below the write position is still empty. (For floats that should not hide content underneath.) rFT)rrr data_bufferrrUr)rJrZr\r'rrowrrs rKr!zFloatContainer._area_is_emptys rww")) 34 %AF&&&((+rww"(((:;%AAAvv}$%  %rNc|jSr}rrIs rKrbzFloatContainer.is_modalrrNc|jSr}rrIs rKrdzFloatContainer.get_key_bindingsrrNcd|jg}|jd|jD|S)Nc34K|]}|jywr}r).0rs rK z.FloatContainer.get_children..s7a 7s)rextendr)rJrs rKrfzFloatContainer.get_childrens(LL>74;;77rN)FNrN)rr4rz list[Float]rrorrsrrr_rprhrirgrjrlrm)r r;rZr.r[r,r\r/rrnr^ror_rprhri)rZr.r\r/rhrorqrrrt)rurvrwrxrrLrRrWr`r r!rbrdrfrHrNrKr:r:s*,/3)+"  -  '  " AJ77&7& 7  7  77 7rN NN& N & N  NNN N`$!rNr:ceZdZdZ d ddZd dZd dZd dZy) r;a Float for use in a :class:`.FloatContainer`. Except for the `content` parameter, all other options are optional. :param content: :class:`.Container` instance. :param width: :class:`.Dimension` or callable which returns a :class:`.Dimension`. :param height: :class:`.Dimension` or callable which returns a :class:`.Dimension`. :param left: Distance to the left edge of the :class:`.FloatContainer`. :param right: Distance to the right edge of the :class:`.FloatContainer`. :param top: Distance to the top of the :class:`.FloatContainer`. :param bottom: Distance to the bottom of the :class:`.FloatContainer`. :param attach_to_window: Attach to the cursor from this window, instead of the current window. :param hide_when_covering_content: Hide the float when it covers content underneath. :param allow_cover_cursor: When `False`, make sure to display the float below the cursor. Not on top of the indicated position. :param z_index: Z-index position. For a Float, this needs to be at least one. It is relative to the z_index of the parent container. :param transparent: :class:`.Filter` indicating whether this float needs to be drawn transparently. Nc| dk\sJ||_||_||_||_||_||_||_| |_| r t| nd|_ t||_ | |_ | |_ | |_t||_y)Nr )rrrrrUrrrrCrrBrr rr_rr")rJrrrrrrUrrrrr rr_r"s rKrzFloat.__init__s"!||       ,a{ Render information for the last render time of this control. It stores mapping information between the input buffers (in case of a :class:`~prompt_toolkit.layout.controls.BufferControl`) and the actual render position on the output screen. (Could be used for implementation of the Vi 'H' and 'L' key bindings as well as implementing mouse support.) :param ui_content: The original :class:`.UIContent` instance that contains the whole input, without clipping. (ui_content) :param horizontal_scroll: The horizontal scroll of the :class:`.Window` instance. :param vertical_scroll: The vertical scroll of the :class:`.Window` instance. :param window_width: The width of the window that displays the content, without the margins. :param window_height: The height of the window that displays the content. :param configured_scroll_offsets: The scroll offsets as configured for the :class:`Window` instance. :param visible_line_to_row_col: Mapping that maps the row numbers on the displayed screen (starting from zero for the first visible line) to (row, col) tuples pointing to the row and column of the :class:`.UIContent`. :param rowcol_to_yx: Mapping that maps (row, column) tuples representing coordinates of the :class:`UIContent` to (y, x) absolute coordinates at the rendered screen. c ||_||_||_||_||_||_||_| |_| |_| |_ | |_ yr}) window ui_contentvertical_scroll window_width window_heightconfigured_scroll_offsetsvisible_line_to_row_col wrap_lines _rowcol_to_yx _x_offset _y_offset) rJrArBhorizontal_scrollrCrDrErFrG rowcol_to_yxx_offsety_offsetrHs rKrzWindowRenderInfo.__init__fsW $.(*)B&'>$$)!!rNcp|jjDcic] \}}||d c}}Scc}}wNr)rGr)rJ visible_linerowcols rKvisible_line_to_input_linez+WindowRenderInfo.visible_line_to_input_lines@)-(D(D(J(J(L $ f &) #   s2c|jj} |j|j|jf\}}t ||j z ||jz S#t$rt ddcYSwxYw)zy Return the cursor position coordinates, relative to the left/top corner of the rendered screen. rr) rBr$rIrrrrJrKKeyError)rJr#rrs rKr$z WindowRenderInfo.cursor_positionsy .. E%%dffdffn5DAq 1t~~-T^^1CD D  #1? " #s(A''B?Bcn|jddk(rd}nM|j|jjj}t ||j j}t|t |jj|jdz dz |j jddS)a Return a :class:`.ScrollOffsets` instance that indicates the actual offset. This can be less than or equal to what's configured. E.g, when the cursor is completely at the top, the top offset will be zero rather than what's configured. rr )rrrr) displayed_linesinput_line_to_visible_linerBr$rrrFrr@ line_countr)rJrrs rKapplied_scroll_offsetsz'WindowRenderInfo.applied_scroll_offsetss    "a 'C//0O0O0Q0QRAa77;;.sPhc3cPs)sortedrGvaluesrIs rKrYz WindowRenderInfo.displayed_liness$ P$*F*F*M*M*OPPPrNci}|jjD]!\}}||vrt|||||<|||<#|S)z Return the dictionary mapping the line numbers of the input buffer to the lines of the screen. When a line spans several rows at the screen, the first row appears in the dictionary. )rTrr)rJrkvs rKrZz+WindowRenderInfo.input_line_to_visible_linesV"$3399; DAqF{q 1-q q    rNcj|r#|j|jjS|jdS)z~ Return the line number (0 based) of the input document that corresponds with the first visible line. r)rYr\r)rJafter_scroll_offsets rKfirst_visible_linez#WindowRenderInfo.first_visible_lines5 ''(C(C(G(GH H''* *rNcp|r&|jd|jjz S|jdS)zK Like `first_visible_line`, but for the last visible line. rX)rYr\r)rJbefore_scroll_offsets rKlast_visible_linez"WindowRenderInfo.last_visible_lines: ''T-H-H-O-O(OP P''+ +rNcr|j||j||j|z dzzS)zM Like `first_visible_line`, but for the center visible line. r)rgrj)rJrirfs rKcenter_visible_linez$WindowRenderInfo.center_visible_linesJ  # #$7 8&&';<))*=>?   rNc.|jjS)z6 The full height of the user control. )rBr[rIs rKcontent_heightzWindowRenderInfo.content_heights )))rNc^|jdk(xr|j|jk(S)zU True when the full height is visible (There is no vertical scroll.) r)rCrjrnrIs rKfull_height_visiblez$WindowRenderInfo.full_height_visibles4  A % @&&(D,?,?? rNc |jdk(S)z= True when the top of the buffer is visible. r)rCrIs rK top_visiblezWindowRenderInfo.top_visibles ##q((rNcB|j|jdz k(S)z@ True when the bottom of the buffer is visible. r )rjrnrIs rKbottom_visiblezWindowRenderInfo.bottom_visibles# %%'4+>+>+BBBrNcT|jryd|jz|jzS)z{ Vertical scroll as a percentage. (0 means: the top is visible, 100 means: the bottom is visible.) d)rtrCrnrIs rKvertical_scroll_percentagez+WindowRenderInfo.vertical_scroll_percentages,   ---1D1DD DrNc|jr;|jj||j|jj Sy)z| Return the height of the given line. (The height that it would take, if this line became visible.) r )rHrBget_height_for_linerDrAget_line_prefix)rJlinenos rKryz$WindowRenderInfo.get_height_for_lines> ????66))4;;+F+F rNN)rAr=rBr$rLrkrCrkrDrkrErkrFr@rGzdict[int, tuple[int, int]]rMz&dict[tuple[int, int], tuple[int, int]]rNrkrOrkrHrorhri)rhzdict[int, int])rhr)rhr@)rhz list[int]F)rfrorhrk)rirorhrk)FF)rirorfrorhrkrhrkrqr{rkrhrk)rurvrwrxrrrTr$r\rYrZrgrjrlrnrprrrtrwryrHrNrKr>r>Ks4""" "  "  ""$1""<"="""" "<   E E  6QQ  +,OT  $(  GK    **   )) CC EE rNr>ceZdZdZ d d dZed dZed dZed dZed dZ d dZ y) r@z Scroll offsets for the :class:`.Window` class. Note that left/right offsets only make sense if line wrapping is disabled. c<||_||_||_||_yr}_top_bottom_left_right)rJrrrrs rKrzScrollOffsets.__init__.s     rNc,t|jSr})rrrIs rKrzScrollOffsets.top:sdii  rNc,t|jSr})rrrIs rKrzScrollOffsets.bottom>sdll##rNc,t|jSr})rrrIs rKrzScrollOffsets.leftBsdjj!!rNc,t|jSr})rrrIs rKrzScrollOffsets.rightFsdkk""rNc pd|jd|jd|jd|jd S)NzScrollOffsets(top=z , bottom=z, left=z, right=r9rrIs rKr:zScrollOffsets.__repr__Js>#DII= $,,9IQUQ[Q[P^^fgkgrgrfuuvwwrNN)rrrr) rint | Callable[[], int]rrrrrrrhrir}r>) rurvrwrxrrrrrrr:rHrNrKr@r@'s()*+())*  $ ( &  '   !!$$""##xrNr@ceZdZdZdddZy)rAz6 Column for a :class:`.Window` to be colored. c ||_||_yr})positionr)rJrrs rKrzColorColumn.__init__Ss   rNN)zclass:color-column)rrkrrnrhri)rurvrwrxrrHrNrKrArANs rNrAceZdZdZdZdZdZy)r<z Alignment of the Window content. Note that this is different from `HorizontalAlign` and `VerticalAlign`, which are used for the alignment of the child containers in respectively `VSplit` and `HSplit`. rrrN)rurvrwrxrrrrHrNrKr<r<[s D E FrNr<ceZdZdZdddddddddddddddddddej dddf d!dZd"dZd#dZd$dZ d%d Z d&d Z d'd Z e d( d)d Zd*d Zd+dZ d,dZ d-dZdddddddej df d.dZ d/dZ d0dZd1dZd1dZ d2dZ d3dZd4dZ d4dZ d4dZd5dZd#dZd#dZd6dZ d7d Z!y)8r=a^ Container that holds a control. :param content: :class:`.UIControl` instance. :param width: :class:`.Dimension` instance or callable. :param height: :class:`.Dimension` instance or callable. :param z_index: When specified, this can be used to bring element in front of floating elements. :param dont_extend_width: When `True`, don't take up more width then the preferred width reported by the control. :param dont_extend_height: When `True`, don't take up more width then the preferred height reported by the control. :param ignore_content_width: A `bool` or :class:`.Filter` instance. Ignore the :class:`.UIContent` width when calculating the dimensions. :param ignore_content_height: A `bool` or :class:`.Filter` instance. Ignore the :class:`.UIContent` height when calculating the dimensions. :param left_margins: A list of :class:`.Margin` instance to be displayed on the left. For instance: :class:`~prompt_toolkit.layout.NumberedMargin` can be one of them in order to show line numbers. :param right_margins: Like `left_margins`, but on the other side. :param scroll_offsets: :class:`.ScrollOffsets` instance, representing the preferred amount of lines/columns to be always visible before/after the cursor. When both top and bottom are a very high number, the cursor will be centered vertically most of the time. :param allow_scroll_beyond_bottom: A `bool` or :class:`.Filter` instance. When True, allow scrolling so far, that the top part of the content is not visible anymore, while there is still empty space available at the bottom of the window. In the Vi editor for instance, this is possible. You will see tildes while the top part of the body is hidden. :param wrap_lines: A `bool` or :class:`.Filter` instance. When True, don't scroll horizontally, but wrap lines instead. :param get_vertical_scroll: Callable that takes this window instance as input and returns a preferred vertical scroll. (When this is `None`, the scroll is only determined by the last and current cursor position.) :param get_horizontal_scroll: Callable that takes this window instance as input and returns a preferred vertical scroll. :param always_hide_cursor: A `bool` or :class:`.Filter` instance. When True, never display the cursor, even when the user control specifies a cursor position. :param cursorline: A `bool` or :class:`.Filter` instance. When True, display a cursorline. :param cursorcolumn: A `bool` or :class:`.Filter` instance. When True, display a cursorcolumn. :param colorcolumns: A list of :class:`.ColorColumn` instances that describe the columns to be highlighted, or a callable that returns such a list. :param align: :class:`.WindowAlign` value or callable that returns an :class:`.WindowAlign` value. alignment of content. :param style: A style string. Style to be applied to all the cells in this window. (This can be a callable that returns a string.) :param char: (string) Character to be used for filling the background. This can also be a callable that returns a character. :param get_line_prefix: None or a callable that returns formatted text to be inserted before a line. It takes a line number (int) and a wrap_count and returns formatted text. This can be used for implementation of line continuations, things like Vim "breakindent" and so on. NFrct| |_t||_t| |_t||_t||_|xs t |_t||_t||_ t||_ t||_ | xsg|_ | xsg|_ | xs t|_||_||_|xsg|_||_||_||_||_||_||_||_t5d|_t5d|_|j;y)Nrr )rallow_scroll_beyond_bottomalways_hide_cursorrH cursorline cursorcolumnr!rdont_extend_widthdont_extend_heightignore_content_widthignore_content_height left_margins right_marginsr@scroll_offsetsget_vertical_scrollget_horizontal_scroll colorcolumnsrrrrzrUrr_r_ui_content_cache_margin_width_cacherL)rJrrUrr_rrrrrrrrrHrrrrrrrrrrzs rKrzWindow.__init__s58+44N*O'"+,>"?#J/#J/%l30,. !*+"?$-.B$C!%./D%E"(.B*0b,? #6 %:"(.B   .     " JUJ   rNc"d|jdS)NzWindow(content=r9r/rIs rKr:zWindow.__repr__s  022rNcp|jjd|_d|_d|_d|_yrQ)rrLrCrLvertical_scroll_2 render_inforIs rKrLz Window.resets8  !!" "#59rNcdfd dfd }tjf}jj||S)zb Return the width for this margin. (Calculate only once per render time.) c*jddS)NrrUr)_get_ui_contentrIsrKget_ui_contentz0Window._get_margin_width..get_ui_contents''a': :rNc&jSr})r)rmarginsrKrz+Window._get_margin_width..get_widths##N3 3rNrhr$r})r render_counterrr)rJrrkeyrs`` @rK_get_margin_widthzWindow._get_margin_widths: ; 4wy//0''++C;;rNc~tfdjDtfdjDzS)zN Calculate and return the width of the margin (left + right). c3@K|]}j|ywr}rr0mrJs rKr1z1Window._get_total_margin_width..sH4))!,Hc3@K|]}j|ywr}rrs rKr1z1Window._get_total_margin_width..s#O *+D " "1 %O r)rrrrIs`rK_get_total_margin_widthzWindow._get_total_margin_width s@Hd6G6GHH3O /3/A/AO L   rNc~dfd }jtj|jS)z@ Calculate the preferred width for this window. cjryj}jj|z }|||z }|S)zYContent width: is only calculated if no exact width for the window was given.N)rrrrR)total_margin_widthrRrQrJs rKpreferred_content_widthz7Window.preferred_width..preferred_content_widths]((*"&!=!=!? #ll::#&88O*#55" "rN dimension get_preferred dont_extendr=)_merge_dimensionsr*rUr)rJrQrs`` rKrRzWindow.preferred_widths=  #(%%"4::.1..0&  rNcdfd }jtj|jS)zA Calculate the preferred height for this window. cjryj}j}jj |z |j S)z[Content height: is only calculated if no exact height for the window was given.N)rrrHrrWrz)rrHrVrJrUs rKpreferred_content_heightz9Window.preferred_height..preferred_content_height6s^))+!%!=!=!? *J<<00**$$$  rNrr=)rr*rr)rJrUrVrs``` rKrWzWindow.preferred_height1s=   %%"4;;/2//1&  rNc|xs t}|jr |j}n|}|D|jrt ||j }|j rt ||j}|r|t |j |}n|jr |j nd}|j r |jnd}t||||jS)z Take the Dimension from this `Window` class and the received preferred size from the `UIControl` and return a `Dimension` to report to the parent container. N)rrrr)r'preferred_specifiedr max_specifiedrr min_specifiedr)rrrrmax_min_s rKrzWindow._merge_dimensionsLs,  ( (!++I&I  && 9==9 && 9==9  90y}}i0D$-$;$;9==D ) 7 7y}}T$)IjjS)Nr)rcreate_content)rrJrUsrK get_contentz+Window._get_ui_content..get_contents<<..U6.J JrNr)r rrr)rJrUrrrs``` rKrzWindow._get_ui_content}s8  Ky''7%%))#{;;rNct}|jry|jjr-|jjr|jjSyy)z1Return `False`, or the Digraph symbol to be used.^?N)r quoted_insertvi_statewaiting_for_digraphdigraph_symbol1)rJapps rK_get_digraph_charzWindow._get_digraph_charsEi    << + +||++||333rNclt|j|j|j|j}|j r>t |j|j|jj|_|jrIt |j|j|j|jj|_|j|n |j}t|j|||||}||dkr|y|j||y)z Write window to screen. This renders the user control, the margins and copies everything over to the absolute position at the given screen. rNrr)r/rrrUrrrrRrrrWr_r_write_to_screen_at_indexr )rJrZr[r\r]r^r_rs rKr`zWindow.write_to_screens"'$$$$ &&!((    ! ! ##&$$$$^%9%9:DD$N  " " $$'%%%%"((.*?*?) %N !"\\1't||  * *        ?gl K  $ $W $ JrNc4jdksjdkryjDcgc]}j|}}jDcgc]}j|}}t ||z} j jj| z j} t| tsJj} j| j| z jj||tjrjn j} j| |t |j| z j j"| dj$j't)j*j,j k(| j.\j0t |z} j2}t5| j"j j| z jj6| ||  _dfd }|j;j0t |zj0jz| z j2j2jz|d}d fd }t=j|D].\}}|dkDs |||}j?||||||z }0jt |z }t=j|D](\}}|||}j?||||||z }*jA|||jB<ycc}wcc}w) NrT)rHhighlight_linesrr has_focusrrz) rArBrLrCrDrErFrGrMrNrOrHc$ tjjvrtS j Dcic]\}}|| }}}|j j }|j j} jt zdz }t||}|dk\r] |||f\}} jjtt|||j|j |j"} nQ jjttdd|j|j |j"} | tk(r j'|} | Scc}}w#t$$r|dz}YnwxYw|dk\rꌎ)z Wrapper around the mouse_handler of the `UIControl` that turns screen coordinates into line coordinates. Returns `NotImplemented` if no UI invalidation should be done. r rr)r event_typebutton modifiers)r rwalk_through_modal_areaNotImplementedrrrrrrrr mouse_handlerrrrrrrV_mouse_handler) mouse_eventrcrd yx_to_rowcolrrmax_yr*r_rrMrJrGr\s rKrz7Window._write_to_screen_at_index..mouse_handlers79++CCEE%%.:-?-?-ABTQAqDBLB$$&&A$$&&A#''#.E*FFJEE1 Aq&+AqD1HC"\\77"%*SC%8'2'='=#.#5#5&1&;&; F 33!&a#.#9#9*11"-"7"7 ',,[9M]C FAq&s E1( E77FF)x_minx_maxy_miny_maxhandlerc|j|j}t|j|dzjS)zRender margin. Return `Screen`.r ) create_marginrr"r)rrU fragmentsrr\s rK render_marginz7Window._write_to_screen_at_index..render_margin^sF UN00 rNrrrhr3)rr+rUrkrhr$)"rrUrrrrrr isinstancer$rH_scroll_fill_bgr6r _copy_bodyrCrLrrr rcurrent_controlrzrrr>rrset_mouse_handler_for_ranger _copy_margin _apply_style"visible_windows_to_write_positions)rJrZr[r\r]r^rleft_margin_widthsright_margin_widthsrrBrHrrNrOrmove_xrrUmargin_contentrrMrGs` ` @@@rKrz Window._write_to_screen_at_indexs  A %)=)=)B BFARARSAd44Q7SSBFBTBTUQt55a8UU !36I!IJ\\00  #5 5~7L7L *i000__&  ,,/AA>CXCX fnh7!) 4 $**15    " #  #5 5   " "! "44#668i&&66$,,F 001@1 -$"&&-?)@@!&&&!"44 00'--0BB(//&*&9&9$;%!  ': : x 22 %%,>(?? %%(<(<j||| rd_ nj_ |j| r |j|j| rj r|jjrAj||jj jjt!jjz_ fS) a  Copy the UIContent into the output screen. Return (visible_line_to_row_col, rowcol_to_yx) tuple. :param get_line_prefix: None or a callable that takes a line number (int) and a wrap_count (int) and returns formatted text. )rrFc |r}ni}|r$r"t|d}||||d\}}d}rA|r?}t|}|dkDr(|r&|t|ddz}|dz }|dd=|dkDr|r&||z}tjk(rt |} | kr7| | z dzz }n+tj k(rt |} | kr| | z z }d} d} |D]|^} } }|$z}d| vr!j|$z|#zxx| z cc<4| D]C}t|| f}|j}!rl||z kDrd||d|zf|dz<|dz }| dz } d}|r$r"t|| }||||d\}}|$z}|"jk\r||fccS|dk\r|dk\r| kr|||#z<|dkDrtd|D] }||#z|z<nf|dk(radD]\}||z dk\s ||#z|z j|k(s%||#z|z }t|j|z|jf}|||#z|z <^|$z|#zf||| |zf<| dz } ||z }F||fS) z Copy over a single line to the output screen. This can wrap over multiple lines in the output. It will call the prefix (prompt) function before every line. rFis_inputr Nrz[ZeroWidthEscape])rr )rr0rr<rrrzero_width_escapesr-rUrrrr)%liner{rrrcurrent_rowcol_to_yxpromptskippedh_scroll line_widthr_ wrap_countrr_new_buffer_rowrr char_widthrpw prev_charchar2r copy_line empty_charrzrL new_buffer new_screenrMrGrUrHr\rrs% rKrz$Window._copy_body..copy_linesa'3$')$O*?61+EF AF1G X,-d3lt 471: 66HqLGRaRlt X   ***06 %%*,22A++++06 %++ACJ#'I $ta!+AH!5'%/11!d(;AHEME@$A&q%x0D!%J"a*nu&<"3A6q9A=:/A6Q"a $%6 / C&F$-VVQE#RDAq)3AH)= 5 55#$a4KAv!q&QY37q4x0 &>%*1j%9J?Iq4x!| <J(1_'- J$%FaK(6q4x"}(E(K(Kr(Q0>q4x"}0MI,7(1(:IOO(K-&EEJN1t8b=$A JHHG,VS7]-BC 1HCOAA@$I $Ta4KrNc }}| jkrN|krIj|}|f |<d}||||d\}}|dz }|dz }| jkr|krI|S)NrTrr )rget_line) rr{rrrrLr[rBrCrrGr\s rKcopyzWindow._copy_body..copy%s""A$Fn+++0C!**62.46G-H'* vq!dC1! Qn+++0CHrNcl ||f\}}t||S#t$rtddcYSwxYw)z.cursor_pos_to_screen_pos9sG '#CH-1qA& 'qA& 's 33r|) rrr{rkrrkrrkrrorhztuple[int, int]r})r*rkr_rkrhr)rrr[r)r-r$rrset_cursor_position show_cursor_highlight_digraph_highlight_cursorlinesr_show_key_processor_key_buffer menu_positionset_menu_positionr)rJrBrr\rrUrCrLrHrrrrrrzrrscreen_cursor_positionrrr[rrMrGrrs ``` ```` ` `` @@@@@@@@rKrzWindow._copy_bodys0""V+""** ++  ( ?A@B # z $z z z  z   z   z z z z  $  '"  % %%=**,,j.H.H.J.J& "..t5KL%-2J*-7-C-CJ*'' 3++*"))  33  / / ;  # #  ( ((,,.. 0H0H0J0J  1 14.:O:O3OP & 44rNct|jr|j}n |j}|s|r|}t|xsddf}t|j|j|j zD]H}|j |}t|j|j|jzD]} ||| < Jyy)zj Erase/fill the background. (Useful for floats and when a `char` has been given.) rrN) r6rr-rrrr)rrU) rJrZr\r^rr'char_objrr*rs rKrzWindow._fill_bgus DII 99;D99D tB"4;3?3H277BGGbii$78 &((+rww"(((:;&A%CF& & rNc|dzt|jz}|j||dt|j|j |j zdz |jd}|j|ddy)NrF)rafterr zclass:last-lineT)r&)rr fill_arear/rrrrU)rJrr\r]rr's rKrzWindow._apply_styless"VDJJ%77^5F      ."7"7 7! ;    R!2$?rNc|j}|rA|j|}t|df|j|j|j <yy)zd When we are in Vi digraph mode, put a question mark underneath the cursor. z class:digraphN)rget_cursor_positionr-r)rr)rJr digraph_charr#s rKrzWindow._highlight_digraphsT --/ 11$7D5@o-6J " "466 *466 2 rNc6t}|jj}|rwtrl|js_|dj }t |dk(rA|j|}t|df|j|j|j<yyyyy)ah When the user is typing a key binding that consists of several keys, display the last pressed key if the user is in insert mode and the key is meaningful to be displayed. E.g. Some people want to bind 'jj' to escape in Vi insert mode. But the first 'j' needs to be displayed in order to get some feedback. rXr zclass:partial-key-bindingN) r key_processor key_buffer_in_insert_moderdatarr)r-r)rr)rJrrr-r/r#s rKrz%Window._show_key_processor_key_buffersi&&11 /+CKKb>&&D$1$!55d;9D55: &&tvv.tvv6% 5@+:rNcd}d}|j} |jrM| |j} t|||zD],}| |} t| j | j |zf| |<.|jrWt|||zD]E} | | } | |j} t| j | j |zf| |j<G|j} t| r| } | D]}t|tsJ|j}|||zks*d|j z}t|||zD]7} | | } | ||z} t| j | j |zf| ||z<9y)z. Highlight cursor row/column. z class:cursor-line z class:cursor-column rN)r)rrrr-rrrrrr6rrAr)rJrr#rrrUrcursor_line_stylecursor_column_styler)r* original_chary2rcccolumncolor_column_styles rKrzWindow._highlight_cursorliness 25 ,,  ?? dff%C1a%i(  #A $!&& (;(;>O(OOA     Aq6z* !"o #DFF )!&& (;(;>Q(QQDFF  (( L !'>L Bb+. ..[[FE !%(288^"1v:.B%b/C$' OM&1%**M,?,?BT,TT'C O rNc|j|z}|j}t||||j}|j |||d|y)zL Copy characters from the margin screen to the real screen. rN)rrr/rr) rJrrr\rrUrrmargin_write_positions rKrzWindow._copy_marginsK""V+"" -dD%AVAV W  4I1eTrNcj|jr |j}n |j}||||y)zA Scroll body. Ensure that the cursor is visible. N)rH_scroll_when_linewrapping_scroll_without_linewrapping)rJrBrUrfuncs rKrzWindow._scroll s0 ?? 11D44D Z'rNc jj jj d_d fd dkr#jj _d_y jj }| z kDrjjj jjj}jj _t|dz |z j_td|z j_yd_d  fd }d fd }d fd }|} tj t| |_tj |_jstj | _yy) Scroll to make sure the cursor position is visible and that we maintain the requested scroll offset. Set `self.horizontal_scroll/vertical_scroll`. rc>j|jSr})ryrz)r{rJrBrUs rKget_line_heightz9Window._scroll_when_linewrapping..get_line_height s11&%AUAUV VrNN) slice_stopr cd}jj}tjjddD]}||z }|z kDr|cS|}y)NrrXr$rr) used_height prev_linenor{rArscroll_offsets_bottomrBs rKget_min_vertical_scrollzAWindow._scroll_when_linewrapping..get_min_vertical_scrollH slK$4466K : : < .get_max_vertical_scrollW sm$4466KK : : < .get_topmost_visiblee sg %//!3KK 5 5 92rB )v66 '&&"(K  )  rNr~r})rrrrLr$rrCrryrzrrrr) rJrBrUr line_heighttext_before_heightrHrKrMtopmost_visiblerArGrJs ```` @@@rKr;z Window._scroll_when_linewrapping s!% 3 3 : :!0044"# W A:#-#=#=#?#?D %&D " &j&@&@&B&BC "44 4",!?!?**,,$$%5577 "@" $.#=#=#?#?D %("Q&&& &D " &)%.0F0F&D " %&D "    $./ #  #o7N7P"Q  #4#7#79P9RS..0#&t';';_#MD 1rNc |jxs tdd}d_|jdk(rd_d_yt |j|j} dfd }jr2j_tjtsJjr2j_tj tsJj}|j|j|j|jj||j_j r9t#t%j!|jjd}nd}|j |j&|j(t+|d|jj,||z t/t+|j |z_y)r?rrNc4tt||dz |}tt||dz |dz |z }|dkrd}js|||z kDrtd||z }|||z kDrtd||z }||dz|z |zkr |dz|z |z}|S)zEScrolling algorithm. Used for both horizontal and vertical scrolling.rr r)rkrrr)current_scrollscroll_offset_startscroll_offset_end cursor_pos window_size content_sizerJs rK do_scrollz6Window._scroll_without_linewrapping..do_scroll s#&'q*E# !$%{Q q8H:8UV!  !!"335"\K%??!$Q {(B!C -@ @@!$Q 5H(H!Ia; >AR RR",q.K!?BS!S! !rN)rSrTrUrVrWrX)rSrkrTrkrUrkrVrkrWrkrXrkrhrk)r$rrr[rCrLrrrrrrkrrrrrzrrrrrrr) rJrBrUrr$current_line_textrYoffsetscurrent_line_prefix_widths ` rKr<z#Window._scroll_without_linewrapping s %44GQ"#  A %#$D %&D "  5##O$5$56! & "& "!$& " #& " & "  & "  & "& "R  # ##'#;#;D#AD d22C8 88  % %%)%?%?%ED "d44c: ::%%(// ' %nn!1133#..     (;!$"6"6z7Q7Q7S7SUV"WX) %)* %!*11 ' %mm!"34Rj6P6P6R6R"ST 99,-t/E/E/M " rNc|jtjk(r|jy|jtjk(r|j yt S)z Mouse handler. Called when the UI control doesn't handle this particular event. Return `NotImplemented` if nothing was done as a consequence of this key binding (no UI invalidate required in that case). N)rr SCROLL_DOWN _scroll_down SCROLL_UP _scroll_upr)rJrs rKrzWindow._mouse_handler sN  ! !^%?%? ?      # #~'?'? ? OO rNc(|j}|y|j|j|jz kr]|jj |j jkr|jj|xjdz c_yy)zScroll window down.Nr ) rrCrnrEr$rrFrrmove_cursor_downrJinfos rKr_zWindow._scroll_down s{ <    $"5"58J8J"J J##%%)G)G)K)KK --/  A % KrNc|j}|y|jdkDrm|jj|jdz |j j z k\r|jj|xjdzc_yy)zScroll window up.Nrr ) rrCr$rrErFrrmove_cursor_uprds rKrazWindow._scroll_up s <    ! #$$&&%%)D,J,J,Q,QQR ++-  A %  $rNc6|jjSr})rrdrIs rKrdzWindow.get_key_bindings s||,,..rNcgSr}rHrIs rKrfzWindow.get_children s rN)0rzUIControl | NonerUr&rr&r_rprrrrrrrrrSequence[Margin] | NonerrjrzScrollOffsets | NonerrrHrrCallable[[Window], int] | Nonerrkrrrrrrrz:None | list[ColorColumn] | Callable[[], list[ColorColumn]]rz'WindowAlign | Callable[[], WindowAlign]rrrzNone | str | Callable[[], str]rzzGetLinePrefixCallable | Nonerhrir>rg)rr+rhrkr}rjrlr|)rzDimension | NonerzCallable[[], int | None]rrorhr')rUrkrrkrhr$)rhrrm) rZr.r[r,r\r/r]rnr^rorhri)rBr$rr.r\r/rrkrUrkrCrkrLrkrHrorrorrkrrorrorr<rzz-Callable[[int, int], AnyFormattedText] | NonerhzItuple[dict[int, tuple[int, int]], dict[tuple[int, int], tuple[int, int]]])rZr.r\r/r^rorhri)rr.r\r/r]rnrhri)rr.rhri)rr.r#rrrkrrkrUrkrrkrhri) rr$rr.r\r/rrkrUrkrhri)rBr$rUrkrrkrhrirrrrt)"rurvrwrxr<rrr:rLrrrRrW staticmethodrrrr`rrrrrrrrrr;r<rr_rardrfrHrNrKr=r=isw;~%)"#"*/+0-2.30415/338#(>B@D+0#(%* 9D9I9I)+/38<5>!>> >  > ( >)>+> ,>.>/>->%1>!><> >!>")#>$!%>&#'>* G+>.7/>0'1>2-3>465>6 7>@39 <   > 6". #. /. .   . . ` < 7K7K&7K& 7K  7K  7K7K 7KruIuI&uI& uI  uI  uI uI| !!" %!"#((--IMp5p5p5& p5  p5  p5p5p5p5p5p5!p5p5p5Gp5 S!p5d&&.;&GK& &,@ @2?@OR@ @$ .. .(-.25.:=.FI.SV. .`U!UU& U  U  U U" (wN#wN,/wN9<wN wNrg #g ,/g 9<g g R" &&"/rNcveZdZdZ d d dZd dZd dZddZddZ ddZ dd Z y)r?a Wrapper around any other container that can change the visibility. The received `filter` determines whether the given container should be displayed or not. :param content: :class:`.Container` instance. :param filter: :class:`.Filter` instance. Nclt||_| t|nd|_t||_yr})rBralternative_contentrfilter)rJrrpros rKrzConditionalContainer.__init__. s< $G, #. , -   ' rNc<d|jd|jdS)NzConditionalContainer(z , filter=r9)rrprIs rKr:zConditionalContainer.__repr__< s &t||&6i aPPrNc8|jjyr})rrLrIs rKrLzConditionalContainer.reset? s rNc|jr|jj|S|j|jj|St j Sr})rprrRror'zerorPs rKrRz$ConditionalContainer.preferred_widthB sR ;;=<<//0CD D  % % 1++;;># #rNc|jr|jj||S|j|jj||St j Sr})rprrWror'rtrTs rKrWz%ConditionalContainer.preferred_heightJ s] ;;=<<008LM M  % % 1++<<+ >># #rNc|jr |jj||||||S|j |jj||||||Syr})rprr`rorYs rKr`z$ConditionalContainer.write_to_screenT sp ;;=<<// hPW  % % 1++;;  2rNcn|jg}|j|j|j|Sr})rror)rJrs rKrfz!ConditionalContainer.get_childrenk s0,,  # # / MM$22 3 rNr})rr4rprror<rhrir>rgrjrlrmrt) rurvrwrxrr:rLrRrWr`rfrHrNrKr?r?$ s48 ( ( (1 (  (Q$$&&      .rNr?cteZdZdZd dZd dZddZddZddZ ddZ ddZ dd Z dd Z y )rEz Container class that dynamically returns any Container. :param get_container: Callable that returns a :class:`.Container` instance or any widget with a ``__pt_container__`` method. c||_yr}) get_container)rJrzs rKrzDynamicContainer.__init__z s *rNc8|j}t|S)z Return the current container object. We call `to_container`, because `get_container` can also return a widget with a ``__pt_container__`` method. )rzrB)rJobjs rK_get_containerzDynamicContainer._get_container} s  "C  rNc@|jjyr})r}rLrIs rKrLzDynamicContainer.reset s ##%rNc@|jj|Sr})r}rRrPs rKrRz DynamicContainer.preferred_width s""$445HIIrNcB|jj||Sr})r}rWrTs rKrWz!DynamicContainer.preferred_height s""$55e=QRRrNcL|jj||||||yr})r}r`rYs rKr`z DynamicContainer.write_to_screen s( -- NNL(G rNcy)NFrHrIs rKrbzDynamicContainer.is_modal srNcyr}rHrIs rKrdz!DynamicContainer.get_key_bindings srNc$|jgSr})r}rIs rKrfzDynamicContainer.get_children s ##%&&rNN)rzzCallable[[], AnyContainer]rhri)rhr5rgrjrlrmrqrrrt) rurvrwrxrr}rLrRrWr`rbrdrfrHrNrKrErEr sz+!&JS    &  &            'rNrEct|tr|St|drt|j St d|)zC Make sure that the given object is a :class:`.Container`. r~zNot a container object: )rr5hasattrrBr~ ValueError containers rKrBrB sF)Y' . /I668993I=ABBrNct|tr|St|dr#tt d|j St d|d)zB Make sure that the given argument is a :class:`.Window`. r~r{zNot a Window object: .)rr=rrCr r~rrs rKrCrC sP)V$ . /. :KKMNN0 Q?@@rNct|tryt|dr#tt d|j Sy)zb Checks whether the given value is a container object (for use in assert statements). Tr~r{F)rr5rrDr r~)values rKrDrD s; %#u()D!159JJLMM rNN)rhr=)rr4rhr5)rr4rhr=)robjectrhzTypeGuard[AnyContainer])^rx __future__rabcrrenumr functoolsrtypingrr r r r "prompt_toolkit.application.currentr prompt_toolkit.cacherprompt_toolkit.data_structuresrprompt_toolkit.filtersrrrrprompt_toolkit.formatted_textrrr#prompt_toolkit.formatted_text.utilsrrprompt_toolkit.key_bindingrprompt_toolkit.mouse_eventsrrprompt_toolkit.utilsrrrrcontrolsr!r"r#r$r%rr&r'r(r)r*marginsr+r[r,rZr-r.r/utilsr0typing_extensionsr1r2'prompt_toolkit.key_binding.key_bindingsr3__all__r5r{r4rr7r6rr8r9r:r;r>r@rAr.r<r=r?rErBrCrDrHrNrKrs #'AA6,0  7BOO)66)5L ,D'DN88Y 001 Dd(Y(VkVk\DVDNYYYxM2M2`YYx$x$xN!#44 $ xYxv%K9K\8'y8'v C A rN