§
    £”jñ  ã                  ó¨   — d Z ddlmZ ddlZddlmZmZ ddlm	Z	 erddl
mZmZ ddlmZ ddlmZ dd	lmZ  G d
„ d¦  «        Z G d„ de	¦  «        ZdS )z?Collection providing access to comments added to this document.é    )ÚannotationsN)ÚTYPE_CHECKINGÚIterator)ÚBlockItemContainer)Ú
CT_CommentÚCT_Comments)ÚCommentsPart)ÚParagraphStyle)Ú	Paragraphc                  ó<   — e Zd ZdZdd„Zdd	„Zdd„Zddd„Zdd„ZdS )ÚCommentsz:Collection containing the comments added to this document.Úcomments_elmr   Úcomments_partr	   c                ó"   — || _         || _        d S ©N)Ú_comments_elmÚ_comments_part)Úselfr   r   s      ú\/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/docx/comments.pyÚ__init__zComments.__init__   s   € Ø)ˆÔØ+ˆÔÐÐó    ÚreturnúIterator[Comment]c                ó4   ‡ — ˆ fd„‰ j         j        D ¦   «         S )z.Iterator over the comments in this collection.c              3  óB   •K  — | ]}t          |‰j        ¦  «        V — Œd S r   )ÚCommentr   )Ú.0Úcomment_elmr   s     €r   ú	<genexpr>z$Comments.__iter__.<locals>.<genexpr>   sD   øè è € ð 
ð 
àõ �K Ô!4Ñ5Ô5ð
ð 
ð 
ð 
ð 
ð 
r   )r   Úcomment_lst©r   s   `r   Ú__iter__zComments.__iter__   s4   ø€ ð
ð 
ð 
ð 
à#Ô1Ô=ð
ñ 
ô 
ð 	
r   Úintc                ó4   — t          | j        j        ¦  «        S )z*The number of comments in this collection.)Úlenr   r    r!   s    r   Ú__len__zComments.__len__   s   € å�4Ô%Ô1Ñ2Ô2Ð2r   Ú ÚtextÚstrÚauthorÚinitialsú
str | Noner   c                óÐ  — | j                              ¦   «         }||_        ||_        t          j                             t          j        j        ¦  «        |_	        t          || j        ¦  «        }|dk    r|S t          |                     d¦  «        ¦  «        }t          |¦  «        }|j        d         }|                     |¦  «         |D ]}	|                     |	¬¦  «         Œ|S )a²  Add a new comment to the document and return it.

        The comment is added to the end of the comments collection and is assigned a unique
        comment-id.

        If `text` is provided, it is added to the comment. This option provides for the common
        case where a comment contains a modest passage of plain text. Multiple paragraphs can be
        added using the `text` argument by separating their text with newlines (`"\\n"`).
        Between newlines, text is interpreted as it is in `Document.add_paragraph(text=...)`.

        The default is to place a single empty paragraph in the comment, which is the same
        behavior as the Word UI when you add a comment. New runs can be added to the first
        paragraph in the empty comment with `comments.paragraphs[0].add_run()` to adding more
        complex text with emphasis or images. Additional paragraphs can be added using
        `.add_paragraph()`.

        `author` is a required attribute, set to the empty string by default.

        `initials` is an optional attribute, set to the empty string by default. Passing |None|
        for the `initials` parameter causes that attribute to be omitted from the XML.
        r'   ú
r   ©r(   )r   Úadd_commentr*   r+   ÚdtÚdatetimeÚnowÚtimezoneÚutcÚdater   r   ÚiterÚsplitÚnextÚ
paragraphsÚadd_runÚadd_paragraph)
r   r(   r*   r+   r   ÚcommentÚpara_text_iterÚfirst_para_textÚ
first_paraÚss
             r   r0   zComments.add_comment#   s×   € ð, Ô(×4Ò4Ñ6Ô6ˆØ#ˆÔØ'ˆÔÝœ;Ÿ?š?­2¬;¬?Ñ;Ô;ˆÔÝ˜+ tÔ':Ñ;Ô;ˆà�2Š:ˆ:ØˆNå˜dŸjšj¨Ñ.Ô.Ñ/Ô/ˆå˜~Ñ.Ô.ˆØÔ'¨Ô*ˆ
Ø×Ò˜?Ñ+Ô+Ð+àð 	*ð 	*ˆAØ×!Ò! qÐ!Ñ)Ô)Ð)Ð)àˆr   Ú
comment_idúComment | Nonec                óh   — | j                              |¦  «        }|�t          || j        ¦  «        ndS )zFReturn the comment identified by `comment_id`, or |None| if not found.N)r   Úget_comment_by_idr   r   )r   rB   r   s      r   ÚgetzComments.getM   s6   € àÔ(×:Ò:¸:ÑFÔFˆØ<GÐ<S�w�{ DÔ$7Ñ8Ô8Ð8ÐY]Ð]r   N)r   r   r   r	   )r   r   ©r   r#   )r'   r'   r'   )r(   r)   r*   r)   r+   r,   r   r   )rB   r#   r   rC   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r"   r&   r0   rF   © r   r   r   r      sŠ   € € € € € ØDÐDð,ð ,ð ,ð ,ð
ð 
ð 
ð 
ð3ð 3ð 3ð 3ð(ð (ð (ð (ð (ðT^ð ^ð ^ð ^ð ^ð ^r   r   c                  óî   ‡ — e Zd ZdZdˆ fd„Zddˆ fd„Zedd„¦   «         Zej        dd„¦   «         Zed d„¦   «         Z	ed!d„¦   «         Z
e
j        d"d„¦   «         Z
edd„¦   «         Zed#d„¦   «         Zˆ xZS )$r   as  Proxy for a single comment in the document.

    Provides methods to access comment metadata such as author, initials, and date.

    A comment is also a block-item container, similar to a table cell, so it can contain both
    paragraphs and tables and its paragraphs can contain rich text, hyperlinks and images,
    although the common case is that a comment contains a single paragraph of plain text like a
    sentence or phrase.

    Note that certain content like tables may not be displayed in the Word comment sidebar due to
    space limitations. Such "over-sized" content can still be viewed in the review pane.
    r   r   r   r	   c                óZ   •— t          ¦   «                              ||¦  «         || _        d S r   )Úsuperr   Ú_comment_elm)r   r   r   Ú	__class__s      €r   r   zComment.__init__a   s+   ø€ Ý‰Œ×Ò˜ mÑ4Ô4Ð4Ø'ˆÔÐÐr   r'   Nr(   r)   Ústyleústr | ParagraphStyle | Noner   r   c                óh   •— t          ¦   «                              ||¦  «        }|€d|j        _        |S )aA  Return paragraph newly added to the end of the content in this container.

        The paragraph has `text` in a single run if present, and is given paragraph style `style`.
        When `style` is |None| or ommitted, the "CommentText" paragraph style is applied, which is
        the default style for comments.
        NÚCommentText)rO   r<   Ú_prR   )r   r(   rR   Ú	paragraphrQ   s       €r   r<   zComment.add_paragraphe   s5   ø€ õ ‘G”G×)Ò)¨$°Ñ6Ô6ˆ	ð ˆ=Ø!.ˆIŒLÔàÐr   c                ó   — | j         j        S )z}Read/write. The recorded author of this comment.

        This field is required but can be set to the empty string.
        ©rP   r*   r!   s    r   r*   zComment.authoru   s   € ð Ô Ô'Ð'r   Úvaluec                ó   — || j         _        d S r   rY   ©r   rZ   s     r   r*   zComment.author}   s   € à#(ˆÔÔ Ð Ð r   r#   c                ó   — | j         j        S )z&The unique identifier of this comment.)rP   Úidr!   s    r   rB   zComment.comment_id�   s   € ð Ô Ô#Ð#r   r,   c                ó   — | j         j        S )zÑRead/write. The recorded initials of the comment author.

        This attribute is optional in the XML, returns |None| if not set. Assigning |None| removes
        any existing initials from the XML.
        ©rP   r+   r!   s    r   r+   zComment.initials†   s   € ð Ô Ô)Ð)r   c                ó   — || j         _        d S r   r`   r\   s     r   r+   zComment.initials�   s   € à%*ˆÔÔ"Ð"Ð"r   c                óJ   — d                      d„ | j        D ¦   «         ¦  «        S )zßThe text content of this comment as a string.

        Only content in paragraphs is included and of course all emphasis and styling is stripped.

        Paragraph boundaries are indicated with a newline (`"\\n"`)
        r.   c              3  ó$   K  — | ]}|j         V — Œd S r   r/   )r   Úps     r   r   zComment.text.<locals>.<genexpr>›   s$   è è € Ð9Ð9 A˜œÐ9Ð9Ð9Ð9Ð9Ð9r   )Újoinr:   r!   s    r   r(   zComment.text“   s'   € ð �yŠyÐ9Ð9¨¬Ð9Ñ9Ô9Ñ9Ô9Ð9r   údt.datetime | Nonec                ó   — | j         j        S )z€The date and time this comment was authored.

        This attribute is optional in the XML, returns |None| if not set.
        )rP   r6   r!   s    r   Ú	timestampzComment.timestamp�   s   € ð Ô Ô%Ð%r   )r   r   r   r	   )r'   N)r(   r)   rR   rS   r   r   )r   r)   )rZ   r)   rG   )r   r,   )rZ   r,   )r   rf   )rH   rI   rJ   rK   r   r<   Úpropertyr*   ÚsetterrB   r+   r(   rh   Ú__classcell__)rQ   s   @r   r   r   S   sN  ø€ € € € € ðð ð(ð (ð (ð (ð (ð (ðð ð ð ð ð ð ð  ð(ð (ð (ñ „Xð(ð „]ð)ð )ð )ñ „]ð)ð ð$ð $ð $ñ „Xð$ð ð*ð *ð *ñ „Xð*ð „_ð+ð +ð +ñ „_ð+ð ð:ð :ð :ñ „Xð:ð ð&ð &ð &ñ „Xð&ð &ð &ð &ð &r   r   )rK   Ú
__future__r   r2   r1   Útypingr   r   Údocx.blkcntnrr   Údocx.oxml.commentsr   r   Údocx.parts.commentsr	   Údocx.styles.styler
   Údocx.text.paragraphr   r   r   rL   r   r   ú<module>rs      s  ðØ EÐ Eà "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *Ð *Ð *à ,Ð ,Ð ,Ð ,Ð ,Ð ,àð .Ø:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ø0Ð0Ð0Ð0Ð0Ð0Ø0Ð0Ð0Ð0Ð0Ð0Ø-Ð-Ð-Ð-Ð-Ð-ð?^ð ?^ð ?^ð ?^ð ?^ñ ?^ô ?^ð ?^ðDP&ð P&ð P&ð P&ð P&Ð ñ P&ô P&ð P&ð P&ð P&r   