§
    hiF  ã                  óv   — d Z ddlmZ ddlZddlmZmZ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d„Zd„ ZdS )zŸDirectly exposed API functions and classes, :func:`Document` for now.

Provides a syntactically more convenient API for interacting with the OpcPackage graph.
é    )ÚannotationsN)ÚIOÚTYPE_CHECKINGÚcast)ÚCONTENT_TYPE)ÚPackage)ÚDocument)ÚDocumentPartÚdocxústr | IO[bytes] | NoneÚreturnÚDocumentObjectc                óâ   — | €t          ¦   «         n| } t          dt          j        | ¦  «        j        ¦  «        }|j        t          j        k    rd}t          || |j        fz  ¦  «        ‚|j	        S )zîReturn a |Document| object loaded from `docx`, where `docx` can be either a path
    to a ``.docx`` file (a string) or a file-like object.

    If `docx` is missing or ``None``, the built-in default document "template" is
    loaded.
    Nr
   z2file '%s' is not a Word file, content type is '%s')
Ú_default_docx_pathr   r   ÚopenÚmain_document_partÚcontent_typeÚCTÚWML_DOCUMENT_MAINÚ
ValueErrorÚdocument)r   Údocument_partÚtmpls      ú`/var/www/development/aibuddy-work/election-extract/venv/lib/python3.11/site-packages/docx/api.pyr	   r	      so   € ð $( <ÕÑÔÐ°T€DÝ˜­¬°dÑ);Ô);Ô)NÑOÔO€MØÔ!¥RÔ%9Ò9Ð9ØCˆÝ˜  }Ô'AÐ BÑBÑCÔCÐCØÔ!Ð!ó    c                 ó˜   — t           j                             t          ¦  «        d         } t           j                             | dd¦  «        S )z6Return the path to the built-in default .docx package.r   Ú	templateszdefault.docx)ÚosÚpathÚsplitÚ__file__Újoin)Ú_thisdirs    r   r   r   "   s2   € åŒw}Š}XÑ&Ô& qÔ)€HÝŒ7<Š<˜ +¨~Ñ>Ô>Ð>r   )N)r   r   r   r   )Ú__doc__Ú
__future__r   r   Útypingr   r   r   Údocx.opc.constantsr   r   Údocx.packager   Údocx.documentr	   r   Údocx.parts.documentr
   r   © r   r   ú<module>r,      sÌ   ððð ð
 #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø *Ð *Ð *Ð *Ð *Ð *Ð *Ð *Ð *Ð *à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø  Ð  Ð  Ð  Ð  Ð  àð 1Ø8Ð8Ð8Ð8Ð8Ð8Ø0Ð0Ð0Ð0Ð0Ð0ð"ð "ð "ð "ð "ð?ð ?ð ?ð ?ð ?r   