
    g                    l    d dl mZ d dlmZ d dlmZ d dlmZ erd dl	m
Z
 ddZddZddZdd	Zdd
Zy)    )annotations)version)TYPE_CHECKING)Version)
ModuleTypec                 N   d} 	 dd l }t        d      }t        |      t        d      k\  r|S t        d      }||k7  st        |      t        |       k  rd|  d| d| d	}t        |      |S # t        $ r/}d
|  d|  d|  d|  d|j
                  d    
}t	        |      |d }~ww xY w)Nz1.5.0r   
vegafusionz2.0.0a0zvegafusion-python-embedzcThe versions of the vegafusion and vegafusion-python-embed packages must match
and must be version z# or greater.
Found:
 - vegafusion==z
 - vegafusion-python-embed==
zVThe "vegafusion" data transformer and chart.transformed_data feature requires
version z or greater of the 'vegafusion-python-embed' and 'vegafusion' packages.
These can be installed with pip using:
    pip install "vegafusion[embed]>=zR"
Or with conda using:
    conda install -c conda-forge "vegafusion-python-embed>=z" "vegafusion>="

ImportError: )r	   importlib_versionr   RuntimeErrorImportErrorargs)min_versionvfr   embed_versionmsgerrs         L/var/www/openai/venv/lib/python3.12/site-packages/altair/utils/_importers.pyimport_vegafusionr      s    K(#L17wy11I-.GHM-'77+;gk>R+R++6- 8&&-Y /33@/	E  #3''I ("m $33>- @JJU W'= )HHQK=* 	 #C'(s   'A, ?A, ,	B$5*BB$c            
         d} 	 t        d      }t        |      t        |       k  rd|  d| }t        |      dd l}|S # t        $ r,}d|  d|  d|  d	|j
                  d    }t	        |      |d }~ww xY w)
Nz1.6.0zvl-convert-pythonz.The vl-convert-python package must be version  or greater. Found version r   zKThe vl-convert Vega-Lite compiler and file export feature requires
version zz or greater of the 'vl-convert-python' package. 
This can be installed with pip using:
   pip install "vl-convert-python>=z@"
or conda:
   conda install -c conda-forge "vl-convert-python>=r   )r   r   r   
vl_convertr   r   )r   r   r   vlcr   s        r   import_vl_convertr   /   s    K(#$787gk22@ N!!(	+  s## 
 
("m $22= ?CCN- PHHQK=* 	 #C'
(s   :? 	A4'A//A4c                 T    ddl m}  dj                  | j                  d      d d       S )Nr   SCHEMA_VERSION_.   )altair.vegaliter   joinsplitr   s    r   vl_version_for_vl_convertr%   I   s(    . 88N((-bq122    c            
         d} 	 t        d      }t        |      t        |       k  rd|  d| }t        |      dd lm} |S # t
        $ r,}d|  d|  d|  d	|j                  d    }t        |      |d }~ww xY w)
Nz11.0.0pyarrowz$The pyarrow package must be version r   r   z=Usage of the DataFrame Interchange Protocol requires
version zd or greater of the pyarrow package. 
This can be installed with pip using:
   pip install "pyarrow>=z6"
or conda:
   conda install -c conda-forge "pyarrow>=r   )r   r   r   pyarrow.interchangeinterchanger   r   )r   r   r   pir   s        r   import_pyarrow_interchanger,   Q   s    K(#I.7gk226{m D!!(	+  s##(	 
("m $((3} 599D FHHQK=* 	 #C'
(s   <A 	A6
'A11A6c                 D    	 t                y# t        t        f$ r Y yw xY w)NTF)r,   r   r    r&   r   pyarrow_availabler/   l   s'    "$& s   
 N)returnr   )r0   str)r0   bool)
__future__r   importlib.metadatar   r   typingr   packaging.versionr   typesr   r   r   r%   r,   r/   r.   r&   r   <module>r8      s1    " ;   %  (F(43(6r&   