
    :Qg                        U 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 d dlmZ d dlmZ d	Zd
ed<   	 ddddd	 	 	 	 	 	 	 	 	 	 	 ddZy)    )annotations)IOAnyOptional)Element)&convert_file_to_html_text_using_pandoc)FileType)exactly_one)get_last_modified_date)partition_htmlrtfstrDETECTION_ORIGINN)filemetadata_filenamemetadata_last_modifiedc          
         t        | |       | rt        |       nd}t        d| |      }t        d|d|xs | t        j
                  |xs |t        d|S )aq  Partitions an RTF document. The document is first converted to HTML and then
    partitioned using partition_html.

    Parameters
    ----------
    filename
        A string defining the target filename path.
    file
        A file-like object using "rb" mode --> open(filename, "rb").
    metadata_last_modified
        The last modified date for the document.
    )filenamer   Nr   )source_formatr   r   unicode)textencodingr   metadata_file_typer   detection_origin )r
   r   r   r   r	   RTFr   )r   r   r   r   kwargslast_modified	html_texts          W/var/www/html/answerous/venv/lib/python3.12/site-packages/unstructured/partition/rtf.pypartition_rtfr!      sl    ( -8@*84dM6hTI  +7x#<<5F)      )N)r   Optional[str]r   zOptional[IO[bytes]]r   r#   r   r#   r   r   returnzlist[Element])
__future__r   typingr   r   r   unstructured.documents.elementsr   'unstructured.file_utils.file_conversionr   unstructured.file_utils.modelr	   $unstructured.partition.common.commonr
   &unstructured.partition.common.metadatar   unstructured.partition.htmlr   r   __annotations__r!   r   r"   r    <module>r.      s    " $ $ 3 Z 2 < I 6 #  #$ !%'+,0$$ $ %	$
 *$ $ $r"   