
    >hF                    t    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y)zDirectly 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)DocumentPartc                    | 
t               n| } t        dt        j                  |       j                        }|j
                  t        j                  k7  rd}t        || |j
                  fz        |j                  S )zReturn 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.
    r
   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)docxdocument_parttmpls      I/var/www/html/bid_assistant/venv/lib/python3.12/site-packages/docx/api.pyr	   r	      sn     $(<TDd);)N)NOM!!R%9%99C}'A'A BBCC!!!    c                     t         j                  j                  t              d   } t         j                  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   "   s0    ww}}X&q)H77<<+~>>r   )N)r   zstr | IO[bytes] | NonereturnDocumentObject)__doc__
__future__r   r   typingr   r   r   docx.opc.constantsr   r   docx.packager   docx.documentr	   r"   docx.parts.documentr
   r    r   r   <module>r+      s1   
 # 	 * * 1  80"?r   