o
    7 ¾hL  ã                   @  s@   d Z ddlmZ ddlmZ ddlmZmZ G dd„ deƒZdS )z:lxml custom element classes for text-related XML elements.é    )Úannotations)Ú	XsdString)ÚBaseOxmlElementÚOptionalAttributec                   @  sR   e Zd ZU dZedeƒZded< edeƒZded< e	dd	d
„ƒZ
e	ddd„ƒZdS )ÚCT_Hyperlinkz1Custom element class for <a:hlinkClick> elements.zr:idÚstrÚrIdÚactionú
str | NoneÚreturnúdict[str, str]c                 C  sL   | j }|du r	i S | d¡}t|ƒdkri S |d  d¡}tdd„ |D ƒƒS )a	  Query portion of the `ppaction://` URL as dict.

        For example `{'id':'0', 'return':'true'}` in 'ppaction://customshow?id=0&return=true'.

        Returns an empty dict if the URL contains no query string or if no action attribute is
        present.
        Nú?é   ú&c                 S  s   g | ]}|  d ¡‘qS )Ú=)Úsplit)Ú.0Úpair© r   úX/var/www/html/figdemos/bartoux_crm/venv/lib/python3.10/site-packages/pptx/oxml/action.pyÚ
<listcomp>$   s    z.CT_Hyperlink.action_fields.<locals>.<listcomp>)r	   r   ÚlenÚdict)ÚselfÚurlZhalvesÚkey_value_pairsr   r   r   Úaction_fields   s   	
zCT_Hyperlink.action_fieldsc                 C  s0   | j }|du r	dS | d¡d }|dd… }|S )zÞThe host portion of the `ppaction://` URL contained in the action attribute.

        For example 'customshow' in 'ppaction://customshow?id=0&return=true'. Returns |None| if no
        action attribute is present.
        Nr   r   é   )r	   r   )r   r   Zprotocol_and_hostÚhostr   r   r   Úaction_verb&   s   zCT_Hyperlink.action_verbN)r   r   )r   r
   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú__annotations__r	   Úpropertyr   r   r   r   r   r   r   	   s   
 ÿr   N)	r#   Ú
__future__r   Úpptx.oxml.simpletypesr   Úpptx.oxml.xmlchemyr   r   r   r   r   r   r   Ú<module>   s
    