o
    i
                     @  s   d dl mZ d dlmZmZ d dlmZmZ d dlm	Z	 d dl
mZ d dlmZ er6d dlmZmZmZmZ dddZdddZdS )    )annotations)TYPE_CHECKINGcast)FillTypeLineType)offsets_from_codes)convert_lines)dechunk_lines)CoordinateArray
FillReturn
LineReturnLineReturn_ChunkCombinedNanfilledr   	fill_typer   return?tuple[list[list[CoordinateArray]], list[list[CoordinateArray]]]c                 C  s  g }g }|t jt jt jt jfv rk|t jt jfv }t|  D ]J\}}|d u r%q|r+t|}|g  |g  tt	|d D ](}||| ||d   }|d |d d df  |d |d d df  q=q||fS |t j
t jfv rt|  D ]x\}}	}
|d u rqwtt	|
d D ]e}|t j
kr|	|
| |
|d   }t||
|  }n|	|
| |
|d  d  }|g  |g  tt	|d D ](}||| ||d   }|d |d d df  |d |d d df  qqqw||fS td| d)N   r   zConversion of FillType z to Bokeh is not implemented)r   ZOuterOffsetZChunkCombinedOffsetZ	OuterCodeZChunkCombinedCodezipr   appendrangelenZChunkCombinedCodeOffsetZChunkCombinedOffsetOffsetRuntimeError)r   r   ZxsZysZ
have_codespointsoffsetsiZxysZcodes_or_offsetsZouter_offsetsjcodesk r   h/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/contourpy/util/bokeh_util.pyfilled_to_bokeh   sL   





r!   linesr   	line_typer   5tuple[CoordinateArray | None, CoordinateArray | None]c                 C  s`   t | |tj} t| tj} trtt| } | d d }|d u r dS |d d df |d d df fS )Nr   )NNr   )r   r   ZChunkCombinedNanr	   r   r   r   )r"   r#   r   r   r   r    lines_to_bokeh>   s   
 r%   N)r   r   r   r   r   r   )r"   r   r#   r   r   r$   )
__future__r   typingr   r   Z	contourpyr   r   Zcontourpy.arrayr   Zcontourpy.convertr   Zcontourpy.dechunkr	   Zcontourpy._contourpyr
   r   r   r   r!   r%   r   r   r   r    <module>   s    
+