
    kh                         d dl Z  G d de      Z ei i i i       e_        d Z e j
                  dddg      Zd	 Z e j
                  d
dg      Zd Z	y)    Nc                   <    e Zd Zedd       Zd Zd Zd Zd Zd Z	y)	StylesNc                 @    | i } |i }|i }|i }t        | |||      S )Nparagraph_stylescharacter_stylestable_stylesnumbering_styles)r   r   s       S/var/www/teggl/fontify/venv/lib/python3.12/site-packages/mammoth/docx/styles_xml.pycreatezStyles.create   sJ    #!#!L#!--%-	
 	
    c                 <    || _         || _        || _        || _        y N)_paragraph_styles_character_styles_table_styles_numbering_styles)selfr   r   r	   r
   s        r   __init__zStyles.__init__   s"    !1!1)!1r   c                 8    | j                   j                  |      S r   )r   getr   style_ids     r   find_paragraph_style_by_idz!Styles.find_paragraph_style_by_id       %%))(33r   c                 8    | j                   j                  |      S r   )r   r   r   s     r   find_character_style_by_idz!Styles.find_character_style_by_id    r   r   c                 8    | j                   j                  |      S r   )r   r   r   s     r   find_table_style_by_idzStyles.find_table_style_by_id#   s    !!%%h//r   c                 8    | j                   j                  |      S r   )r   r   r   s     r   find_numbering_style_by_idz!Styles.find_numbering_style_by_id&   r   r   )NNNN)
__name__
__module____qualname__staticmethodr   r   r   r   r   r!    r   r   r   r      s-    
 
"24404r   r   r   c                    i }i }i }i }|||d}| j                  d      D ]]  }t        |      }|j                  d   }|dk(  rt        |      ||j                  <   ;|j                  |      }	|	O||	|j                  <   _ t        ||||      S )N)	paragraph	charactertablezw:stylezw:type	numberingr   )find_children_read_style_element
attributes_read_numbering_style_elementr   r   r   )
elementr   r   r	   r
   stylesstyle_elementstyleelement_type	style_sets
             r   read_styles_xml_elementr6   2   s    L%%F !..y9 2#M2$//9;&/L]/[U^^,

<0I$,1	%..)2 ))!)	 r   Styler   namec                     | j                   d   }| j                  d      j                   j                  d      }t        ||      S )Nz	w:styleIdzw:namew:val)r   r8   )r.   find_child_or_nullr   r7   )r0   r   r8   s      r   r-   r-   R   s@    !!+.H%%h/::>>wGD(..r   NumberingStylenum_idc                     | j                  d      j                  d      j                  d      j                  j                  d      }t        |      S )Nzw:pPrzw:numPrzw:numIdr:   )r=   )r;   r.   r   r<   )r0   r=   s     r   r/   r/   [   sE    		G	$		I	&		I	&	CCL	  ((r   )
collectionsobjectr   EMPTYr6   
namedtupler7   r-   r<   r/   r&   r   r   <module>rC      sr    #4V #4L 	: 	wV(<=/ (''(88*E)r   