
    Cj9                    f    S SK Jr  S SKJr  \(       a  S SKJrJr  S SKJr  S/r	 S     S	S jjr
g)
    )annotations)TYPE_CHECKING)AppComposeResult)WidgetcomposeNc                v   SnSSK JnJn  U R                  n/ n/ n/ nUR                  R                  U5        UR                  R                  U5        [        Ub  UOU R                  5       5      n	[        U	S5      n
   [        U	5      n[        X5      (       d1  U" S[        U5       S35      nU
(       a  U	R                  U5        OUSe UR                    U(       a!  UR#                  U5        UR%                  5         U(       a   US	   R'                  U5        OUR                  U5        M  ! [         a     Ogf = f! [          a&    U" S5      nU
(       a  U	R                  U5         NUSef = f! [(         a#  nU
(       a  U	R                  U5         SnANle SnAff = fU(       a!  UR#                  U5        UR%                  5         UR                  R+                  5         UR                  R+                  5         U$ ! UR                  R+                  5         UR                  R+                  5         f = f)
a_  Compose child widgets from a generator in the same way as [compose][textual.widget.Widget.compose].

Example:
    ```python
        def on_key(self, event:events.Key) -> None:

            def add_key(key:str) -> ComposeResult:
                with containers.HorizontalGroup():
                    yield Label("You pressed:")
                    yield Label(key)

            self.mount_all(
                compose(self, add_key(event.key)),
            )
    ```

Args:
    node: The parent node.
    compose_result: A compose result, or `None` to call `node.compose()`.

Returns:
    A list of widgets.
Tr   )
MountErrorr   NthrowzCan't mount z; expected a Widget instance.zOWidget is missing an 'id' attribute; did you forget to call super().__init__()?)textual.widgetr
   r   app_compose_stacksappend	_composediterr   hasattrnextStopIteration
isinstancetyper   idAttributeErrorextendclearcompose_add_child	Exceptionpop)nodecompose_result_rich_traceback_omitr
   r   r   nodescompose_stackcomposediter_composeis_generatorchildmount_errorerrors                 a/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/textual/compose.pyr   r      s   4  1
((CE"$MH}-MM"(4$,,.L <1L/\* e,,("4;-/LM   &&{3%4/	0 X& !"%77> U#Q  !  " 0(e   &&{3%4/0 ! # %**511 LL"NN!L 	!s   >H  D1 AH E /H 	E4 H 1
D>;H =D>>H *E1+H -E11H 4
F!>FH FF!!+H 6H8)N)r   zApp | Widgetr    zComposeResult | Nonereturnzlist[Widget])
__future__r   typingr   textual.appr   r   r   r   __all__r        r*   <module>r2      sC    "  .%+ @DW
W(<WWr1   