Ë
    \Rði  ã                  óú   — d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z ddlmZ ddlmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ erddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z&  G d„ de«      Z'y)z+|DocumentPart| and closely related objects.é    )Úannotations)ÚIOÚTYPE_CHECKINGÚcast)ÚDocument)ÚRELATIONSHIP_TYPE)ÚCommentsPart)Ú
FooterPartÚ
HeaderPart)ÚNumberingPart)ÚSettingsPart)Ú	StoryPart)Ú
StylesPart)ÚInlineShapes)Úlazyproperty)ÚComments)ÚWD_STYLE_TYPE)ÚCoreProperties)ÚSettings)Ú	BaseStylec                  óø   — e Zd ZdZd„ Zd„ Zedd„«       Zedd„«       Zed„ «       Z	dd„Z
dd„Zdd	„Zd
„ Zdd„Zed„ «       Zedd„«       Zdd„Zedd„«       Zed„ «       Zedd„«       Zedd„«       Zedd„«       Zy) ÚDocumentParta‘  Main document part of a WordprocessingML (WML) package, aka a .docx file.

    Acts as broker to other parts such as image, core properties, and style parts. It
    also acts as a convenient delegate when a mid-document object needs a service
    involving a remote ancestor. The `Parented.part` property inherited by many content
    objects provides access to this part object for that purpose.
    c                óˆ   — t        j                  | j                  «      }| j                  |t        j
                  «      }||fS )z=Return (footer_part, rId) pair for newly-created footer part.)r
   ÚnewÚpackageÚ	relate_toÚRTÚFOOTER)ÚselfÚfooter_partÚrIds      úN/var/www/html/Extract/venv/lib/python3.12/site-packages/docx/parts/document.pyÚadd_footer_partzDocumentPart.add_footer_part#   ó3   € ä —n‘n T§\¡\Ó2ˆØ�n‰n˜[¬"¯)©)Ó4ˆØ˜CÐÐó    c                óˆ   — t        j                  | j                  «      }| j                  |t        j
                  «      }||fS )z=Return (header_part, rId) pair for newly-created header part.)r   r   r   r   r   ÚHEADER)r   Úheader_partr!   s      r"   Úadd_header_partzDocumentPart.add_header_part)   r$   r%   c                ó.   — | j                   j                  S )zJ|Comments| object providing access to the comments added to this document.)Ú_comments_partÚcomments©r   s    r"   r,   zDocumentPart.comments/   s   € ð ×"Ñ"×+Ñ+Ð+r%   c                ó.   — | j                   j                  S )zfA |CoreProperties| object providing read/write access to the core properties
        of this document.)r   Úcore_propertiesr-   s    r"   r/   zDocumentPart.core_properties4   s   € ð �|‰|×+Ñ+Ð+r%   c                ó.   — t        | j                  | «      S )zEA |Document| object providing access to the content of this document.)r   Ú_elementr-   s    r"   ÚdocumentzDocumentPart.document:   s   € ô ˜Ÿ™ tÓ,Ð,r%   c                ó&   — | j                  |«       y)z/Remove related header part identified by `rId`.N)Údrop_rel©r   r!   s     r"   Údrop_header_partzDocumentPart.drop_header_part?   s   € à�‰�cÕr%   c                ó    — | j                   |   S )z%Return |FooterPart| related by `rId`.©Úrelated_partsr5   s     r"   r    zDocumentPart.footer_partC   ó   € à×!Ñ! #Ñ&Ð&r%   c                ó:   — | j                   j                  ||«      S )zÆReturn the style in this document matching `style_id`.

        Returns the default style for `style_type` if `style_id` is |None| or does not
        match a defined style of `style_type`.
        )ÚstylesÚ	get_by_id)r   Ústyle_idÚ
style_types      r"   Ú	get_stylezDocumentPart.get_styleG   s   € ð �{‰{×$Ñ$ X¨zÓ:Ð:r%   c                ó:   — | j                   j                  ||«      S )aT  Return the style_id (|str|) of the style of `style_type` matching
        `style_or_name`.

        Returns |None| if the style resolves to the default style for `style_type` or if
        `style_or_name` is itself |None|. Raises if `style_or_name` is a style of the
        wrong type or names a style not present in the document.
        )r<   Úget_style_id)r   Ústyle_or_namer?   s      r"   rB   zDocumentPart.get_style_idO   s   € ð �{‰{×'Ñ'¨°zÓBÐBr%   c                ó    — | j                   |   S )z%Return |HeaderPart| related by `rId`.r8   r5   s     r"   r(   zDocumentPart.header_partY   r:   r%   c                óB   — t        | j                  j                  | «      S )zIThe |InlineShapes| instance containing the inline shapes in the document.)r   r1   Úbodyr-   s    r"   Úinline_shapeszDocumentPart.inline_shapes]   s   € ô ˜DŸM™M×.Ñ.°Ó5Ð5r%   c                óè   — 	 t        t        | j                  t        j                  «      «      S # t
        $ r9 t        j                  «       }| j                  |t        j                  «       |cY S w xY w)z¢A |NumberingPart| object providing access to the numbering definitions for this document.

        Creates an empty numbering part if one is not present.
        )r   r   Úpart_related_byr   Ú	NUMBERINGÚKeyErrorr   r   )r   Únumbering_parts     r"   rL   zDocumentPart.numbering_partb   sX   € ð	"Üœ t×';Ñ';¼B¿L¹LÓ'IÓJÐJøÜò 	"Ü*×.Ñ.Ó0ˆNØ�N‰N˜>¬2¯<©<Ô8Ø!Ò!ð	"ús   ‚,/ ¯?A1Á0A1c                ó:   — | j                   j                  |«       y)z…Save this document to `path_or_stream`, which can be either a path to a
        filesystem location (a string) or a file-like object.N)r   Úsave)r   Úpath_or_streams     r"   rN   zDocumentPart.saveo   s   € ð 	�‰×Ñ˜.Õ)r%   c                ó.   — | j                   j                  S )zcA |Settings| object providing access to the settings in the settings part of
        this document.)Ú_settings_partÚsettingsr-   s    r"   rR   zDocumentPart.settingst   s   € ð ×"Ñ"×+Ñ+Ð+r%   c                ó.   — | j                   j                  S )z]A |Styles| object providing access to the styles in the styles part of this
        document.)Ú_styles_partr<   r-   s    r"   r<   zDocumentPart.stylesz   s   € ð × Ñ ×'Ñ'Ð'r%   c                ó  — 	 t        t        | j                  t        j                  «      «      S # t
        $ rR | j                  €J ‚t        j                  | j                  «      }| j                  |t        j                  «       |cY S w xY w)z™A |CommentsPart| object providing access to the comments added to this document.

        Creates a default comments part if one is not present.
        )	r   r	   rI   r   ÚCOMMENTSrK   r   Údefaultr   )r   Úcomments_parts     r"   r+   zDocumentPart._comments_part€   sn   € ð	!Üœ d×&:Ñ&:¼2¿;¹;Ó&GÓHÐHøÜò 	!Ø—<‘<Ð+Ð+Ð+Ü(×0Ñ0°·±Ó>ˆMØ�N‰N˜=¬"¯+©+Ô6Ø Ò ð		!ús   ‚,/ ¯AB
Â	B
c                óþ   — 	 t        t        | j                  t        j                  «      «      S # t
        $ rD t        j                  | j                  «      }| j                  |t        j                  «       |cY S w xY w)z«A |SettingsPart| object providing access to the document-level settings for
        this document.

        Creates a default settings part if one is not present.
        )	r   r   rI   r   ÚSETTINGSrK   rW   r   r   )r   Úsettings_parts     r"   rQ   zDocumentPart._settings_partŽ   s^   € ð	!Üœ d×&:Ñ&:¼2¿;¹;Ó&GÓHÐHøÜò 	!Ü(×0Ñ0°·±Ó>ˆMØ�N‰N˜=¬"¯+©+Ô6Ø Ò ð	!ús   ‚,/ ¯A
A<Á;A<c                ó
  — 	 t        t        | j                  t        j                  «      «      S # t
        $ rJ | j                  }|€J ‚t        j                  |«      }| j                  |t        j                  «       |cY S w xY w)zqInstance of |StylesPart| for this document.

        Creates an empty styles part if one is not present.
        )	r   r   rI   r   ÚSTYLESrK   r   rW   r   )r   r   Ústyles_parts      r"   rT   zDocumentPart._styles_partœ   so   € ð	Üœ
 D×$8Ñ$8¼¿¹Ó$CÓDÐDøÜò 	Ø—l‘lˆGØÐ&Ð&Ð&Ü$×,Ñ,¨WÓ5ˆKØ�N‰N˜;¬¯	©	Ô2ØÒð	ús   ‚,/ ¯ABÂBN)Úreturnr   )r_   r   )r!   Ústrr_   ÚNone)r!   r`   )r>   z
str | Noner?   r   r_   r   )r_   r   )rO   zstr | IO[bytes])r_   r   )r_   r	   )r_   r   )r_   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#   r)   Úpropertyr,   r/   r2   r6   r    r@   rB   r(   r   rG   rL   rN   rR   r<   r+   rQ   rT   © r%   r"   r   r      sø   „ ñò ò ð ò,ó ð,ð ò,ó ð,ð
 ñ-ó ð-óó'ó;òCó'ð ñ6ó ð6ð ò
"ó ð
"ó*ð
 ò,ó ð,ð
 ñ(ó ð(ð
 ò!ó ð!ð ò!ó ð!ð òó ñr%   r   N)(re   Ú
__future__r   Útypingr   r   r   Údocx.documentr   Údocx.opc.constantsr   r   Údocx.parts.commentsr	   Údocx.parts.hdrftrr
   r   Údocx.parts.numberingr   Údocx.parts.settingsr   Údocx.parts.storyr   Údocx.parts.stylesr   Ú
docx.shaper   Údocx.sharedr   Údocx.commentsr   Údocx.enum.styler   Údocx.opc.corepropsr   Údocx.settingsr   Údocx.styles.styler   r   rg   r%   r"   ú<module>ry      sO   ðÙ 1å "ç *Ñ *å "Ý 6Ý ,ß 4Ý .Ý ,Ý &Ý (Ý #Ý $áÝ&Ý-Ý1Ý&Ý+ôO�9õ Or%   