§
    PŠtj<  ã                   ó”   — d Z ddlmZ ddlmZ ddgiZd„ Zd„ Zd„ Z ed	¬
¦  «        d„ ¦   «         Z	 ed	¬
¦  «        dd„¦   «         Z
dS )z‰Module with some functions for MathML, like transforming MathML
content in MathML presentation.

To use this module, you will need lxml.
é    )ÚPath)Údoctest_depends_on)Ú	apply_xslÚc2pÚlxmlc                 ó   — d| z   dz   S )Nzì<math xmlns:mml="http://www.w3.org/1998/Math/MathML"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.w3.org/1998/Math/MathML
        http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd">z</math>© )Úss    ú]/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/utilities/mathml/__init__.pyÚadd_mathml_headersr      s(   € ðBð EFñFð IRñRð Ró    c                 ó°   — dd l }|j        dk    r6ddlm}  || ¦  «                             |¦  «                             ¦   «         S ddlm}  || |¦  «        S )Nr   )é   é
   )Úfiles)Úread_binary)ÚsysÚversion_infoÚimportlib.resourcesr   ÚjoinpathÚ
read_bytesr   )ÚpkgnameÚfilenamer   r   r   s        r   Ú_read_binaryr      sy   € Ø€J€J€Jà
Ô˜7Ò"Ð"à-Ð-Ð-Ð-Ð-Ð-Øˆu�W‰~Œ~×&Ò& xÑ0Ô0×;Ò;Ñ=Ô=Ð=ð 	4Ð3Ð3Ð3Ð3Ð3Øˆ{˜7 HÑ-Ô-Ð-r   c                 ó¦   — | dk    rd} n| dk    rd} n| dk    rd} | dv rt          d| ¦  «        }n!t          | ¦  «                             ¦   «         }|S )	Númathml/data/simple_mmlctop.xslúsimple_mmlctop.xslúmathml/data/mmlctop.xslúmmlctop.xslzmathml/data/mmltex.xslú
mmltex.xsl)r   r   r    zsympy.utilities.mathml.data)r   r   r   )ÚxslÚxslbytess     r   Ú	_read_xslr#   #   ss   € à
Ð.Ò.Ð.Ø"ˆˆØ	Ð)Ò	)Ð	)ØˆˆØ	Ð(Ò	(Ð	(Øˆà
ÐAÐAÐAÝÐ =¸sÑCÔCˆˆå˜‘9”9×'Ò'Ñ)Ô)ˆà€Or   )r   )Úmodulesc                 ó.  — ddl m} |                     d¬¦  «        }|j        j        }|                     t          |¦  «        |¬¦  «        }|                     ||¬¦  «        }|                     | |¬¦  «        } ||¦  «        }t          |¦  «        }|S )a*  Apply a xsl to a MathML string.

    Parameters
    ==========

    mml
        A string with MathML code.
    xsl
        A string giving the name of an xsl (xml stylesheet) file which can be
        found in sympy/utilities/mathml/data. The following files are supplied
        with SymPy:

        - mmlctop.xsl
        - mmltex.xsl
        - simple_mmlctop.xsl

        Alternatively, a full path to an xsl file can be given.

    Examples
    ========

    >>> from sympy.utilities.mathml import apply_xsl
    >>> xsl = 'simple_mmlctop.xsl'
    >>> mml = '<apply> <plus/> <ci>a</ci> <ci>b</ci> </apply>'
    >>> res = apply_xsl(mml,xsl)
    >>> print(res)
    <?xml version="1.0"?>
    <mrow xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>a</mi>
      <mo> + </mo>
      <mi>b</mi>
    </mrow>
    r   )ÚetreeF)Úresolve_entities)Úparser)Úaccess_control)	r   r&   Ú	XMLParserÚXSLTAccessControlÚDENY_ALLÚXMLr#   ÚXSLTÚstr)	Úmmlr!   r&   r(   Úacr
   Ú	transformÚdocÚresults	            r   r   r   4   s—   € ðF ÐÐÐÐÐà�_Š_¨eˆ_Ñ4Ô4€FØ	Ô	 Ô	)€Bà�	Š	•)˜C‘.”.¨ˆ	Ñ0Ô0€AØ—
’
˜1¨R�
Ñ0Ô0€IØ
�)Š)�C ˆ)Ñ
'Ô
'€CØˆY�s‰^Œ^€FÝˆF‰Œ€AØ€Hr   Fc                 óŽ   — |                       d¦  «        st          | ¦  «        } |rt          | d¦  «        S t          | d¦  «        S )ar  Transforms a document in MathML content (like the one that sympy produces)
    in one document in MathML presentation, more suitable for printing, and more
    widely accepted

    Examples
    ========

    >>> from sympy.utilities.mathml import c2p
    >>> mml = '<apply> <exp/> <cn>2</cn> </apply>'
    >>> c2p(mml,simple=True) != c2p(mml,simple=False)
    True

    z<mathr   r   )Ú
startswithr   r   )r0   Úsimples     r   r   r   d   sP   € ð  �>Š>˜'Ñ"Ô"ð &Ý  Ñ%Ô%ˆàð @Ý˜Ð>Ñ?Ô?Ð?å�SÐ3Ñ4Ô4Ð4r   N)F)Ú__doc__Úpathlibr   Úsympy.utilities.decoratorr   Ú__doctest_requires__r   r   r#   r   r   r	   r   r   ú<module>r<      sØ   ððð ð Ð Ð Ð Ð Ð à 8Ð 8Ð 8Ð 8Ð 8Ð 8ð -¨v¨hÐ7Ð ðRð Rð Rð
.ð 
.ð 
.ðð ð ð" Ð˜IÐ&Ñ&Ô&ð,ð ,ñ 'Ô&ð,ð^ Ð˜IÐ&Ñ&Ô&ð5ð 5ð 5ñ 'Ô&ð5ð 5ð 5r   