§
    ZŠtjT2  ã                   óz  — d dl Z d dlZd dlZd dlmZ d dlmZmZmZ d dl	m
Z
 eeeeefZ ed¦  «        eeeeeeefZd„ Z ej        e¦  «        Zdede
j        dedz  d	e
j        eeez  ez  d
f         z  dz  fd„Zde
j        dedz  d	e
j        fd„Zdede
j        dedz  d	e
j        fd„Z G d„ de¦  «        ZdS )é    N)ÚOrderedDict)ÚMappingÚMutableMappingÚSequence)Útypesc                 ó\   — t          | dt          | dt          | ¦  «        ¦  «        ¦  «        S )NÚ__name__Ú_name)ÚgetattrÚrepr)Úts    ú_/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/opentelemetry/attributes/__init__.pyÚ
_type_namer      s&   € Ý�1�j¥'¨!¨Wµd¸1±g´gÑ">Ô">Ñ?Ô?Ð?ó    ÚkeyÚvalueÚmax_lenÚreturn.c           	      óô  — | rt          | t          ¦  «        st                               d| ¦  «         dS t          |t          ¦  «        ryt          |t
          ¦  «        rA	 |                     ¦   «         }n+# t          $ r t                               d¦  «         Y dS w xY w|�t          |t          ¦  «        r
|d|…         }|S t          |t          ¦  «        �rad}g }|D �]J}t          |t
          ¦  «        rU	 |                     ¦   «         }n?# t          $ r2 t                               d¦  «         | 	                    d¦  «         Y Œiw xY w|� t          |t          ¦  «        r|d|…         }n|€| 	                    d¦  «         Œ§t          |¦  «        }|t          vr4t                               d|j        | d„ t          D ¦   «         ¦  «          dS |€|}n=||k    r7t                               d| |j        t          |¦  «        j        ¦  «          dS | 	                    |¦  «         �ŒLt          |¦  «        S t                               dt          |¦  «        j        | d„ t          D ¦   «         ¦  «         dS )	ak  Checks if attribute value is valid and cleans it if required.

    The function returns the cleaned value or None if the value is not valid.

    An attribute value is valid if it is either:
        - A primitive type: string, boolean, double precision floating
            point (IEEE 754-1985) or integer.
        - An array of primitive type values. The array MUST be homogeneous,
            i.e. it MUST NOT contain values of different types.

    An attribute needs cleansing if:
        - Its length is greater than the maximum allowed length.
        - It needs to be encoded/decoded e.g, bytes to strings.
    ú+invalid key `%s`. must be non-empty string.Nz$Byte attribute could not be decoded.zLInvalid type %s in attribute '%s' value sequence. Expected one of %s or Nonec                 ó   — g | ]	}|j         ‘Œ
S © ©r	   ©Ú.0Ú
valid_types     r   ú
<listcomp>z$_clean_attribute.<locals>.<listcomp>c   s+   € ð ð ð à&ð #Ô+ðð ð r   z>Attribute %r mixes types %s and %s in attribute value sequencezYInvalid type %s for attribute '%s' value. Expected one of %s or a sequence of those typesc                 ó   — g | ]	}|j         ‘Œ
S r   r   r   s     r   r   z$_clean_attribute.<locals>.<listcomp>‚   s   € ÐGÐGÐG ˆÔ	ÐGÐGÐGr   )Ú
isinstanceÚstrÚ_loggerÚwarningÚ_VALID_ATTR_VALUE_TYPESÚbytesÚdecodeÚUnicodeDecodeErrorr   ÚappendÚtyper	   Útuple)r   r   r   Úsequence_first_valid_typeÚcleaned_seqÚelementÚelement_types          r   Ú_clean_attributer.   (   sÊ  € ð$ ð •J˜s¥CÑ(Ô(ð Ý�ŠÐEÀsÑKÔKÐKØˆtå�%Õ0Ñ1Ô1ð 	Ý�e�UÑ#Ô#ð 	ðØŸš™œ��øÝ%ð ð ð Ý—’Ð FÑGÔGÐGØ�t�tðøøøð Ð¥:¨eµSÑ#9Ô#9ÐØ˜(˜7˜(”OˆEØˆå�%�Ñ"Ô"ñ 2"Ø$(Ð!Øˆàð +	(ñ +	(ˆGÝ˜'¥5Ñ)Ô)ð ðØ%ŸnšnÑ.Ô.�G�GøÝ)ð ð ð Ý—O’OÐ$JÑKÔKÐKØ×&Ò& tÑ,Ô,Ð,Ø�Hðøøøð Ð"¥z°'½3Ñ'?Ô'?Ð"Ø! ( 7 (Ô+��Ø�Ø×"Ò" 4Ñ(Ô(Ð(Øå ™=œ=ˆLàÕ#:Ð:Ð:Ý—’ð!à Ô)Øðð å*Aðñ ô ñ	ô 	ð 	ð �t�tð )Ð0Ø,8Ð)Ð)àÐ!:Ò:Ð:Ý—’ØTØØ-Ô6Ý˜‘M”MÔ*ñ	ô ð ð �t�tà×Ò˜wÑ'Ô'Ð'Ñ'õ �[Ñ!Ô!Ð!å‡O‚Oð	"åˆU‰ŒÔØØGÐGÕ/FÐGÑGÔGñô ð ð ˆ4s$   Á A5 Á5$BÂBÃ8DÄ9E	ÅE	c                 óþ  — | �t          | t          ¦  «        r#|�t          | t          ¦  «        r
| d |…         } | S t          | t          ¦  «        rfi }|                      ¦   «         D ]M\  }}|rt          |t          ¦  «        st
                               d|¦  «         Œ8t          |||¬¦  «        ||<   ŒN|S t          | t          ¦  «        rßd }g }| D ]É}|€| 	                    |¦  «         Œ|�t          |t          ¦  «        r
|d |…         }t          |¦  «        }|t          vr t          ||¬¦  «        }t          |¦  «        }|€|}n<||k    r6t
                               d|j        t          |¦  «        j        ¦  «          d S | 	                    |¦  «         ŒÊt          |¦  «        S 	 t          | ¦  «        S # t          $ r8 t          dt          | ¦  «        j        › dd„ t           D ¦   «         › d�¦  «        ‚w xY w)	Nr   )r   r   r   ©r   z1Mixed types %s and %s in attribute value sequencezInvalid type z& for attribute value. Expected one of c                 ó,   — g | ]}t          |¦  «        ‘ŒS r   )r   r   s     r   r   z3_clean_extended_attribute_value.<locals>.<listcomp>Ï   s    € Ð`Ð`Ð`¸:¥
¨:Ñ 6Ô 6Ð`Ð`Ð`r   z or a sequence of those types)r   r#   r    r   Úitemsr!   r"   Ú_clean_extended_attributer   r'   r(   Ú_clean_extended_attribute_valuer	   r)   Ú	ExceptionÚ	TypeErrorÚ_VALID_ANY_VALUE_TYPES)r   r   Úcleaned_dictr   r,   r*   r+   r-   s           r   r4   r4   ‡   sn  € ð €}�
 5Õ*AÑBÔB€}ØÐ¥:¨eµSÑ#9Ô#9ÐØ˜(˜7˜(”OˆEØˆå�%�Ñ!Ô!ð Ø24ˆØ!ŸKšK™MœMð 
	ð 
	‰LˆC�àð �J s­CÑ0Ô0ð Ý—’ØAÀ3ñô ð ð å 9Ø˜w°ð!ñ !ô !ˆL˜ÑÐð Ðå�%�Ñ"Ô"ð #"Ø$(Ð!Ø,.ˆàð 	(ð 	(ˆGØˆØ×"Ò" 7Ñ+Ô+Ð+ØàÐ"¥z°'½3Ñ'?Ô'?Ð"Ø! ( 7 (Ô+�å ™=œ=ˆLØÕ#:Ð:Ð:Ý9Ø Wðñ ô �õ  $ G™}œ}�ð )Ð0Ø,8Ð)Ð)àÐ!:Ò:Ð:Ý—’ØGØ-Ô6Ý˜‘M”MÔ*ñô ð ð
 �t�tà×Ò˜wÑ'Ô'Ð'Ð'õ �[Ñ!Ô!Ð!ð
Ý�5‰zŒzÐøÝð 
ð 
ð 
Ýð&�D ™KœKÔ0ð &ð &Ø`Ð`ÕI_Ð`Ñ`Ô`ð&ð &ð &ñ
ô 
ð 	
ð
øøøs   Æ+F: Æ:AG<c                 óö   — | rt          | t          ¦  «        st                               d| ¦  «         dS 	 t	          ||¬¦  «        S # t
          $ r'}t                               d| |¦  «         Y d}~dS d}~ww xY w)a.  Checks if attribute value is valid and cleans it if required.

    The function returns the cleaned value or None if the value is not valid.

    An attribute value is valid if it is an AnyValue.
    An attribute needs cleansing if:
        - Its length is greater than the maximum allowed length.
    r   Nr0   zAttribute %s: %s)r   r    r!   r"   r4   r6   )r   r   r   Ú	exceptions       r   r3   r3   Ô   s’   € ð ð •J˜s¥CÑ(Ô(ð Ý�ŠÐEÀsÑKÔKÐKØˆtðÝ.¨u¸gÐFÑFÔFÐFøÝð ð ð Ý�ŠÐ*¨C°Ñ;Ô;Ð;Øˆtˆtˆtˆtˆtøøøøðøøøs   ¶A Á
A8ÁA3Á3A8c                   óø   — e Zd ZdZ	 	 	 	 	 ddedz  dej        dz  dededz  d	ef
d
„Zde	fd„Z
de	dej        fd„Zde	dej        ddfd„Zdd„Zde	dej        ddfd„Zde	ddfd„Zd„ Zdefd„Zdedd fd„Zd„ ZdS )ÚBoundedAttributesz†An ordered dict with a fixed max capacity.

    Oldest elements are dropped when the dict is full and a new element is
    added.
    NTFÚmaxlenÚ
attributesÚ	immutableÚmax_value_lenÚextended_attributesc                 ó$  — |�*t          |t          ¦  «        r|dk     rt          d¦  «        ‚|| _        d| _        || _        || _        i | _        t          j	        ¦   «         | _
        |r|                     ¦   «         D ]
\  }}|| |<   Œ|| _        d S )Nr   z.maxlen must be valid int greater or equal to 0)r   ÚintÚ
ValueErrorr=   Údroppedr@   Ú_extended_attributesÚ_dictÚ	threadingÚLockÚ_lockr2   Ú
_immutable)Úselfr=   r>   r?   r@   rA   r   r   s           r   Ú__init__zBoundedAttributes.__init__ò   s³   € ð ÐÝ˜f¥cÑ*Ô*ð ¨f°qªj¨jÝ ØDñô ð ð ˆŒØˆŒØ*ˆÔØ$7ˆÔ!ð ð 	Œ
õ ”^Ñ%Ô%ˆŒ
Øð 	"Ø(×.Ò.Ñ0Ô0ð "ð "‘
��UØ!��S‘	�	Ø#ˆŒˆˆr   r   c                 ó,   — t          | j        ¦  «        › S ©N)ÚdictrG   ©rL   s    r   Ú__repr__zBoundedAttributes.__repr__  s   € Ý�t”zÑ"Ô"Ð$Ð$r   r   c                 ó   — | j         |         S rO   )rG   ©rL   r   s     r   Ú__getitem__zBoundedAttributes.__getitem__  s   € ØŒz˜#ŒÐr   r   c                 ó˜  — t          | dd¦  «        rt          ‚| j        �<| j        dk    r1| j        5  | xj        dz  c_        d d d ¦  «         n# 1 swxY w Y   d S | j        rt          ||| j        ¦  «        }nt          ||| j        ¦  «        }|€d S | j        5  |  	                    ||¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )NrK   Fr   é   )
r   r6   r=   rJ   rE   rF   r3   r@   r.   Ú_setitem_locked©rL   r   r   s      r   Ú__setitem__zBoundedAttributes.__setitem__  sb  € Ý�4˜ uÑ-Ô-ð 	ÝˆOØŒ;Ð" t¤{°aÒ'7Ð'7Ø”ð "ð "Ø�” Ñ!�”ð"ð "ð "ñ "ô "ð "ð "ð "ð "ð "ð "øøøð "ð "ð "ð "àˆFØÔ$ð 	Ý-¨c°5¸$Ô:LÑMÔMˆEˆEå$ S¨%°Ô1CÑDÔDˆEØˆ}Ø�ØŒZð 	-ð 	-Ø× Ò   eÑ,Ô,Ð,ð	-ð 	-ð 	-ñ 	-ô 	-ð 	-ð 	-ð 	-ð 	-ð 	-ð 	-ð 	-øøøð 	-ð 	-ð 	-ð 	-ð 	-ð 	-s#   ²AÁAÁAÂB?Â?CÃCútypes._ExtendedAttributesc                 ó(  — t          | dd¦  «        rt          ‚| j        �I| j        dk    r>| j        5  | xj        t          |¦  «        z  c_        d d d ¦  «         n# 1 swxY w Y   d S g }|                     ¦   «         D ]S\  }}| j        rt          ||| j	        ¦  «        }nt          ||| j	        ¦  «        }|€Œ<|                     ||f¦  «         ŒT| j        5  |D ]\  }}|                      ||¦  «         Œ	 d d d ¦  «         d S # 1 swxY w Y   d S )NrK   Fr   )r   r6   r=   rJ   rE   Úlenr2   rF   r3   r@   r.   r'   rX   )rL   r>   Úcleanedr   r   Úcvs         r   Ú
_set_itemszBoundedAttributes._set_items%  s¾  € Ý�4˜ uÑ-Ô-ð 	ÝˆOØŒ;Ð" t¤{°aÒ'7Ð'7Ø”ð 0ð 0Ø�”¥ J¡¤Ñ/�”ð0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0àˆFØˆØ$×*Ò*Ñ,Ô,ð 	&ð 	&‰JˆC�ØÔ(ð Ý.¨s°E¸4Ô;MÑNÔN��å% c¨5°$Ô2DÑEÔE�Ø�:ØØ�NŠN˜C ˜9Ñ%Ô%Ð%Ð%ØŒZð 	.ð 	.Ø"ð .ð .‘��RØ×$Ò$ S¨"Ñ-Ô-Ð-Ð-ð.ð	.ð 	.ð 	.ñ 	.ô 	.ð 	.ð 	.ð 	.ð 	.ð 	.ð 	.ð 	.øøøð 	.ð 	.ð 	.ð 	.ð 	.ð 	.s#   ²AÁA Á#A ÃDÄDÄDc                 óB  — || j         v r	| j         |= n‚| j        �{t          | j         ¦  «        | j        k    r^t          | j         t          ¦  «        st	          | j         ¦  «        | _         | j                              d¬¦  «         | xj        dz  c_        || j         |<   d S )NF)ÚlastrW   )rG   r=   r]   r   r   ÚpopitemrE   rY   s      r   rX   z!BoundedAttributes._setitem_locked9  s“   € Ø�$”*ÐÐØ”
˜3��ØŒ[Ð$­¨T¬Z©¬¸D¼KÒ)GÐ)GÝ˜dœj­+Ñ6Ô6ð 5Ý(¨¬Ñ4Ô4�”
ØŒJ×Ò EÐÑ*Ô*Ð*ØˆLŒL˜AÑˆLŒLàˆŒ
�3‰ˆˆr   c                 ó†   — t          | dd¦  «        rt          ‚| j        5  | j        |= d d d ¦  «         d S # 1 swxY w Y   d S )NrK   F)r   r6   rJ   rG   rT   s     r   Ú__delitem__zBoundedAttributes.__delitem__D  s�   € Ý�4˜ uÑ-Ô-ð 	ÝˆOØŒZð 	 ð 	 Ø”
˜3�ð	 ð 	 ð 	 ñ 	 ô 	 ð 	 ð 	 ð 	 ð 	 ð 	 ð 	 ð 	 øøøð 	 ð 	 ð 	 ð 	 ð 	 ð 	 s    	6¶:½:c                 ó¼   — | j         rt          | j        ¦  «        S | j        5  t          t	          | j        ¦  «        ¦  «        cd d d ¦  «         S # 1 swxY w Y   d S rO   )rK   ÚiterrG   rJ   ÚlistrQ   s    r   Ú__iter__zBoundedAttributes.__iter__J  s�   € ØŒ?ð 	$Ý˜œ
Ñ#Ô#Ð#ØŒZð 	*ð 	*Ý�˜TœZÑ(Ô(Ñ)Ô)ð	*ð 	*ð 	*ð 	*ñ 	*ô 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*øøøð 	*ð 	*ð 	*ð 	*ð 	*ð 	*s   £!AÁAÁAc                 ó*   — t          | j        ¦  «        S rO   )r]   rG   rQ   s    r   Ú__len__zBoundedAttributes.__len__P  s   € Ý�4”:‰ŒÐr   Úmemoc                 ó  — t          | j        | j        | j        | j        ¬¦  «        }||t          | ¦  «        <   | j        5  t          j        | j	        |¦  «        |_	        | j
        |_
        d d d ¦  «         n# 1 swxY w Y   |S )N)r=   r?   r@   rA   )r<   r=   rK   r@   rF   ÚidrJ   ÚcopyÚdeepcopyrG   rE   )rL   rl   Úcopy_s      r   Ú__deepcopy__zBoundedAttributes.__deepcopy__S  sÁ   € Ý!Ø”;Ø”oØÔ,Ø $Ô 9ð	
ñ 
ô 
ˆð ˆ�R�‰XŒX‰ØŒZð 	)ð 	)õ œ-¨¬
°DÑ9Ô9ˆEŒKØ œLˆEŒMð		)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)ð
 ˆs   Á,A9Á9A=Â A=c                 ó4   — | j                              ¦   «         S rO   )rG   ro   rQ   s    r   ro   zBoundedAttributes.copyb  s   € ØŒz�ŠÑ Ô Ð r   )NNTNF)r>   r[   r   N)r	   Ú
__module__Ú__qualname__Ú__doc__rC   r   Ú_ExtendedAttributesÚboolrM   r    rR   ÚAnyValuerU   rZ   r`   rX   re   ri   rk   rP   rr   ro   r   r   r   r<   r<   ë   s¯  € € € € € ðð ð "Ø7;ØØ$(Ø$)ð$ð $à�d‘
ð$ð Ô-°Ñ4ð$ð ð	$ð
 ˜T‘zð$ð "ð$ð $ð $ð $ð:%˜#ð %ð %ð %ð %ð˜sð  u¤~ð ð ð ð ð-˜sð -¨5¬>ð -¸dð -ð -ð -ð -ð .ð .ð .ð .ð(	  3ð 	 ¨u¬~ð 	 À$ð 	 ð 	 ð 	 ð 	 ð ˜sð   tð  ð  ð  ð  ð*ð *ð *ð˜ð ð ð ð ð ð Ð*=ð ð ð ð ð!ð !ð !ð !ð !r   r<   )ro   ÚloggingrH   Úcollectionsr   Úcollections.abcr   r   r   Úopentelemetry.utilr   rx   r    r$   rC   Úfloatr#   r(   r7   r   Ú	getLoggerr	   r!   ÚAttributeValuer)   r.   ry   r4   r3   r<   r   r   r   ú<module>r�      sä  ðð €€€Ø €€€Ø Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ð =à $Ð $Ð $Ð $Ð $Ð $ð    e¨S°%Ð8Ð ð 	€Dˆ�J„JØØ	ØØ	ØØØð	Ð ð@ð @ð @ð ˆ'Ô
˜HÑ
%Ô
%€ð
\Ø	ð\ØÔ)ð\Ø47¸$±Jð\à
Ô˜E #¨¡)¨eÑ"3°SÐ"8Ô9Ñ9¸DÑ@ð\ð \ð \ð \ð~J
ØŒ>ðJ
Ø$'¨$¡JðJ
à
„^ðJ
ð J
ð J
ð J
ðZØ	ðØ”^ðØ.1°D©jðà
„^ðð ð ð ð.x!ð x!ð x!ð x!ð x!˜ñ x!ô x!ð x!ð x!ð x!r   