
    Mi                        % S r SSKJrJr  SSKJrJr  SSKJr  S\	S\
\	   4S jrS\\\R                     \\   4   4S jr\" \R                  5      r\ V Vs0 s H/  n U " 5       R                     H  nX" 5       R"                  4U _M     M1     snn r\\\\4   \\R                     4   \S	'   \ V s0 s H  o " 5       R"                  U _M     sn r\\\\R                     4   \S
'   0 S\R.                  _S\R0                  _S\R2                  _S\R4                  _S\R6                  _S\R8                  _S\R:                  _S\R<                  _S\R>                  _S\R@                  _S\RB                  _S\RD                  _S\RF                  _S\RH                  _S\RJ                  _S\RL                  _S\RN                  _0 S\RP                  _S\RR                  _S\RR                  _S\RR                  _S \RR                  _S!\RT                  _S"\RV                  _S#\RX                  _S$\RZ                  _S%\R\                  _S&\R^                  _S'\R`                  _S(\Rb                  _S)\Rd                  _S*\Rf                  _S+\Rh                  _S,\Rj                  _E\Rl                  \R>                  \Rn                  \RB                  \Rp                  \Rr                  \Rt                  \Rv                  \Rx                  \Rz                  \R|                  \R~                  \R                  \R                  \R                  S-.ErC\\\\R                     4   \S.'   \" 5       rDg/s  snn f s  sn f )0z
This module contains mapping between:
HTML Tags <-> Elements Ontology <-> Unstructured Element classes
They are used to simplify transformations between different representations
of parsed documents
    )DictType)elementsontology)Elementclsreturnc                     U R                  5       nUR                  5       nU H  nUR                  [        U5      5        M     U$ )z
Recursively find all subclasses of a given class.

Parameters:
cls (type): The class for which to find all subclasses.

Returns:
list[type]: A list of all subclasses of the given class.
)__subclasses__copyextendget_all_subclasses)r   
subclassesall_subclassessubclasss       y/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/unstructured/documents/mappings.pyr   r      sD     ##%J__&N0:;      c                  F   0 [         R                  [        R                  _[         R                  [        R                  _[         R
                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                   [        R                  _[         R"                  [        R                  _[         R$                  [        R&                  _[         R(                  [        R(                  _0 [         R*                  [        R                  _[         R,                  [        R                  _[         R.                  [        R                  _[         R0                  [        R                  _[         R2                  [        R2                  _[         R4                  [        R4                  _[         R6                  [        R4                  _[         R8                  [        R4                  _[         R:                  [        R4                  _[         R<                  [        R4                  _[         R>                  [        R4                  _[         R@                  [        R@                  _[         RB                  [        R@                  _[         RD                  [        R                  _[         RF                  [        R                  _[         RH                  [        R@                  _[         RJ                  [        R@                  _E0 [         RL                  [        R@                  _[         RN                  [        RP                  _[         RR                  [        RP                  _[         RT                  [        RT                  _[         RV                  [        RT                  _[         RX                  [        R                  _[         RZ                  [        R                  _[         R\                  [        R                  _[         R^                  [        R                  _[         R`                  [        R                  _[         Rb                  [        R                  _[         Rd                  [        R                  _[         Rf                  [        R                  _[         Rh                  [        R                  _[         Rj                  [        R4                  _[         Rl                  [        R                  _[         Rn                  [        R                  _E0 [         Rp                  [        R                  _[         Rr                  [        R                  _[         Rt                  [        R                  _[         Rv                  [        R                  _[         Rx                  [        R                  _[         Rz                  [        R                  _[         R|                  [        R                  _[         R~                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _[         R                  [        R                  _E[         R                  [        R                  [         R                  [        R                  [         R                  [        R                  0En U $ )a5  
Get a mapping of ontology element to unstructured type.

The dictionary here was created base on ontology mapping json
Can be generated via the following code:
```
    ontology_elements_list = json.loads(
        Path("unstructured_element_ontology.json").read_text()
    )
    ontology_to_unstructured_class_mapping = {
        ontology_element["name"]: ontology_element["ontologyV1Mapping"]
        for ontology_element in ontology_elements_list
}
```

Returns:
dict: A dictionary where keys are ontology element classes
      and values are unstructured types.
)Lr   Documentr   TextSectionPageColumn	ParagraphNarrativeTextHeaderFooterSidebar	PageBreakTitleSubtitleHeadingQuoteFootnoteCaptionFigureCaption
PageNumberUncategorizedTextOrderedListUnorderedListDefinitionListListItemTableTableRow	TableCellTableCellHeader	TableBodyTableHeaderImageFigureVideoAudioBarcodeQRCodeLogo	CodeBlockCodeSnippet
InlineCodeFormulaEquationFootnoteReferenceCitationBibliographyGlossaryAuthorMetaDateKeywordsAbstract	HyperlinkTableOfContentsIndexForm	FormFieldFormFieldValueCheckboxRadioButtonButtonComment	HighlightRevisionInsertionRevisionDeletionAddressEmailAddressPhoneNumberCalendarDateTimeCurrencyMeasurement
Letterhead	Signature	WatermarkStamp)&ontology_to_unstructured_class_mappings    r   )get_ontology_to_unstructured_type_mappingr`   !   s   ,Hc8==Hc(--Hc 	x}}Hc 		Hc
 	H22Hc 	Hc 	Hc 	(--Hc 	H..Hc 	Hc 	8>>Hc 	(..Hc 	 6 6Hc 	..Hc 	8==Hc  	(00!Hc" 	X00#Hc$ 	""HMM%Hc& 	hmm'Hc( 	)Hc* 	+Hc, 	8,,-Hc. 	/Hc0 	8>>1Hc2 	HNN3Hc4 	  (..5Hc6 	HNN7Hc8 	hnn9Hc: 	;Hc< 	=Hc> 	?Hc@ 	AHcB 	(..CHcD 	EHcF 	x~~GHcH 	H00IHcJ 	X11KHcL 	(**MHcN 	8++OHcP 	""HMMQHcR 	8==SHcT 	x}}UHcV 	8==WHcX 	YHcZ 	8==[Hc\ 	8==]Hc^ 	811_Hc` 	HMMaHcb 	  (..cHcd 	eHcf 	x}}gHch 	HMMiHcj 	kHcl 	8==mHcn 	hmmoHcp 	qHcr 	(--sHct 	HMMuHcv 	""HMMwHcx 	!!8==yHcz 	(**{Hc| 	x44}Hc~ 	hmmHc@ 	x}}AHcB 	x}}CHcD 	8==EHcF 	hmmGHcH 	X__IHcJ 	HMMHMMOHc*T 21r   )HTML_TAG_AND_CSS_NAME_TO_ELEMENT_TYPE_MAPCSS_CLASS_TO_ELEMENT_TYPE_MAPaaddressasideaudio
blockquotebodybuttoncitecodedeldivdl
figcaptionfigurefooterformh1h2h3h4h5h6headerhrimginputinslabellimarkmathmetanavol)ppresectionspansubsvgtabletbodytdththeadtimetrulvideo$HTML_TAG_TO_DEFAULT_ELEMENT_TYPE_MAPN)E__doc__typingr   r   unstructured.documentsr   r   unstructured.documents.elementsr   typelistr   dictOntologyElementr`   ALL_ONTOLOGY_ELEMENT_TYPESallowed_tagscss_class_namera   tuplestr__annotations__rb   rG   rT   r   r6   r#   r   rO   r@   r:   rS   r(   r+   r%   r4   r   rJ   r    r!   r"   r   r   r3   rM   rR   rK   r,   rQ   r>   rE   rI   r)   r   r   r?   r\   r-   r1   r/   r0   r2   rX   r.   r*   r5   r   +ONTOLOGY_CLASS_TO_UNSTRUCTURED_ELEMENT_TYPE)element_typetags   00r   <module>r      s_    5 3D T$Z &`24	!	!"DM14 `2F 00H0HI  3d2~** 	,.
'
'(,6* )2d )4c3hhF^F^A_0_+`  E_LD^LLN!!</D^L tCh.F.F)G$GH 2S		2Sx2S X2S X^^	2S
 (..2S H2S hoo2S H2S H2S 
8$$2S 
8%%2S 	(
!
!2S (""2S hoo2S hoo2S  HMM!2S" 	(..#2S$ 	(

%2S& 	(

'2S( 	(

)2S* 	(

+2S, 	(

-2S. hoo/2S0 	(

12S2 
8>>32S4 X52S6 
8%%72S8 X92S: 	(

;2S< H=2S> H?2S@ HA2SB 
8>>C2SD 	(

E2SF 
		&&%%^^




"
"!!MM




 
 ^^c2S $d3X5M5M0N+N&O 2j /X.Y +}d
Ls   6M-3M3