
    pj                        d Z ddlmZ ddlmZmZ i dddddd	d
dddddddddddddddddddddd d!d"d#Zd$ e                                D             Z G d% d&e	          Z
d1d*Zd2d-Zd3d/Zd0S )4zNamespace-related objects.    )annotations)AnyDictaz5http://schemas.openxmlformats.org/drawingml/2006/maincz6http://schemas.openxmlformats.org/drawingml/2006/chartcpzGhttp://schemas.openxmlformats.org/package/2006/metadata/core-propertiesdcz http://purl.org/dc/elements/1.1/dcmitypezhttp://purl.org/dc/dcmitype/dctermszhttp://purl.org/dc/terms/dgmz8http://schemas.openxmlformats.org/drawingml/2006/diagrammz:http://schemas.openxmlformats.org/officeDocument/2006/mathpicz8http://schemas.openxmlformats.org/drawingml/2006/picturerzChttp://schemas.openxmlformats.org/officeDocument/2006/relationshipsslz9http://schemas.openxmlformats.org/schemaLibrary/2006/mainwz<http://schemas.openxmlformats.org/wordprocessingml/2006/mainw14z4http://schemas.microsoft.com/office/word/2010/wordmlwpzFhttp://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingxmlz$http://www.w3.org/XML/1998/namespacexsiz)http://www.w3.org/2001/XMLSchema-instancec                    i | ]\  }}||	S  r   ).0keyvalues      \/lsinfo/ai/hellotax_ai/data_center/backend/venv/lib/python3.11/site-packages/docx/oxml/ns.py
<dictcomp>r      s    	5	5	5e%	5	5	5    c                       e Zd ZdZd fdZddZedd	            Zedd            Z	edd            Z
edd            Zedd            Zedd            Z xZS )NamespacePrefixedTagzNValue object that knows the semantics of an XML tag having a namespace prefix.nstagstrargsr   c                V    t          t          |                               | |          S )N)superr   __new__)clsr    r"   	__class__s      r   r%   zNamespacePrefixedTag.__new__    s$    )3//77UCCCr   c                x    |                     d          \  | _        | _        t          | j                 | _        d S )N:)split_pfx_local_partnsmap_ns_uri)selfr    s     r   __init__zNamespacePrefixedTag.__init__#   s/    &+kk#&6&6#	4#TY'r   returnc                &    d| j         d| j        S )N{})r.   r,   r/   s    r   
clark_namezNamespacePrefixedTag.clark_name'   s     <<<)9)9::r   r6   c                |    |dd                               d          \  }}t          |         d|} | |          S )N   r4   r)   )r*   pfxmap)r&   r6   nsuri
local_namer    s        r   from_clark_namez$NamespacePrefixedTag.from_clark_name+   sD    &qrrN0055z!%===**5s5zzr   c                    | j         S )z[The local part of this tag.

        E.g. "foobar" is returned for tag "f:foobar".
        )r,   r5   s    r   
local_partzNamespacePrefixedTag.local_part1   s     r   Dict[str, str]c                    | j         | j        iS )zSingle-member dict mapping prefix of this tag to it's namespace name.

        Example: `{"f": "http://foo/bar"}`. This is handy for passing to xpath calls
        and other uses.
        )r+   r.   r5   s    r   r-   zNamespacePrefixedTag.nsmap9   s     	4<((r   c                    | j         S )zeThe namespace-prefix for this tag.

        For example, "f" is returned for tag "f:foobar".
        )r+   r5   s    r   nspfxzNamespacePrefixedTag.nspfxB   s     yr   c                    | j         S )zThe namespace URI for this tag.

        For example, "http://foo/bar" would be returned for tag "f:foobar" if the "f"
        prefix maps to "http://foo/bar" in nsmap.
        )r.   r5   s    r   r:   zNamespacePrefixedTag.nsuriJ   s     |r   )r    r!   r"   r   )r    r!   )r1   r!   )r6   r!   r1   r   )r1   r?   )__name__
__module____qualname____doc__r%   r0   propertyr6   classmethodr<   r>   r-   rB   r:   __classcell__)r'   s   @r   r   r      s       XXD D D D D D( ( ( ( ; ; ; X;    [
       X  ) ) ) X)    X    X    r   r   prefixesr!   r1   c                 @    d                     d | D                       S )zNamespace declaration including each namespace-prefix in `prefixes`.

    Handy for adding required namespace declarations to a tree root element.
     c                6    g | ]}d |dt           |         dS )zxmlns:z=""r-   r   pfxs     r   
<listcomp>znsdecls.<locals>.<listcomp>Y   s+    MMMSSU3ZZZ8MMMr   )join)rK   s    r   nsdeclsrU   T   s%    
 88MMHMMMNNNr   nspfxsr?   c                     d | D             S )zSubset namespace-prefix mappings specified by *nspfxs*.

    Any number of namespace prefixes can be supplied, e.g. namespaces("a", "r", "p").
    c                *    i | ]}|t           |         S r   rP   rQ   s     r   r   znspfxmap.<locals>.<dictcomp>a   s    ...Cs...r   r   )rV   s    r   nspfxmaprY   \   s    
 /.v....r   tagc                \    |                      d          \  }}t          |         }d|d|S )a  Stands for "qualified name".

    This utility function converts a familiar namespace-prefixed tag name like "w:p"
    into a Clark-notation qualified tag name for lxml. For example, `qn("w:p")` returns
    "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}p".
    r)   r3   r4   )r*   r-   )rZ   prefixtagrooturis       r   qnr_   d   s3     iinnOFG
-CCssGG$$r   N)rK   r!   r1   r!   )rV   r!   r1   r?   )rZ   r!   r1   r!   )rG   
__future__r   typingr   r   r-   itemsr9   r!   r   rU   rY   r_   r   r   r   <module>rc      s       " " " " " "        		@		A	 	
S	 	
,		
 .	 *	 
E	 	E	 
E	 	N	 	
E	 	G	 
A	 	
R	 
1	  
6!	& 
6	5u{{}}	5	5	54 4 4 4 43 4 4 4nO O O O/ / / /	% 	% 	% 	% 	% 	%r   