o
    "“iå×  ã                   @  sZ  U 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 d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZmZmZ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$m%Z%mZm
Z
m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0mZm1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmZ ddlCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZO ddlPmQZQmRZR ddlSmTZTmUZUmVZVmWZWmXZXmYZYmZZZ ddl[m\Z\m]Z]m^Z^ ddl_m`Z`maZambZb ddlcmdZdmeZemfZfmgZgmhZhmiZimjZj ddlkmhZl ddlkmiZm ddlnmoZo ddlpmqZqmrZrmsZs ddltmuZu g d¢ZvedƒZwedƒZxedeTeZ d �ZyeeXewgeZf Zzd!e{d"< ed#d$d �Z|ed%d&d �Z}ed'eTeW d �Z~eeXewgeWf Zd!e{d(< ed)d*d �Z€ed+d,d �Z�ed-eZd �Z‚ed.eWd �Zƒed/ed �Z„G d0d1„ d1eƒZ…d>d6d7„Z†G d8d9„ d9ƒZ‡G d:d;„ d;e‡ƒZˆeˆZ‰d!e{d<< d=S )?é    )Úannotations)ÚCounterÚdeque)ÚCallableÚIterable)ÚMapping)ÚMutableMapping)ÚField)ÚEnum)Ú	Signature)Ú	signature)ÚPath)ÚAnyÚOptionalÚTupleÚTypeVarÚoverload)Ú	AttributeÚresolve_types)Úhas)ÚSelfé   )#ÚANIESÚFrozenSetSubscriptabler   r   ÚMutableSequenceÚNoneTypeÚOriginAbstractSetÚOriginMutableSetÚSequenceÚSetÚ	TypeAliasÚfieldsÚget_final_baseÚget_newtype_baseÚ
get_originr   Úhas_with_genericÚis_annotatedÚis_bareÚ
is_counterÚis_dequeÚis_frozensetÚ
is_genericÚis_generic_attrsÚis_hetero_tupleÚ
is_literalÚ
is_mappingÚis_mutable_sequenceÚis_mutable_setÚis_optionalÚis_protocolÚis_tupleÚis_typeddictÚis_union_typer   )Údefaultdict_structure_factoryÚ"homogenous_tuple_structure_factoryÚis_abstract_setÚis_defaultdictÚis_namedtupleÚis_sequenceÚiterable_unstructure_factoryÚlist_structure_factoryÚmapping_structure_factoryÚmapping_unstructure_factoryÚnamedtuple_structure_factoryÚnamedtuple_unstructure_factory)Úcreate_default_dis_funcÚis_supported_union)ÚHookFactoryÚMultiStrategyDispatchÚStructuredValueÚStructureHookÚ
TargetTypeÚUnstructuredValueÚUnstructureHook)ÚIterableValidationErrorÚIterableValidationNoteÚStructureHandlerNotFoundError)Ú	PredicateÚidentityÚraise_error)ÚAttributeOverrideÚHeteroTupleUnstructureFnÚIterableUnstructureFnÚMappingUnstructureFnÚmake_dict_structure_fnÚmake_dict_unstructure_fnÚ make_hetero_tuple_unstructure_fn)rV   )rW   )Úis_literal_containing_enums)Úget_type_alias_baseÚis_type_aliasÚtype_alias_structure_factory)ÚSimpleStructureHook)ÚBaseConverterÚ	ConverterÚGenConverterÚUnstructureStrategyÚTÚVÚUnstructureHookFactory)Úboundr    ÚExtendedUnstructureHookFactoryÚAnyUnstructureHookFactoryBasezLHookFactory[UnstructureHook] | ExtendedUnstructureHookFactory[BaseConverter]ÚAnyUnstructureHookFactoryzHHookFactory[UnstructureHook] | ExtendedUnstructureHookFactory[Converter]ÚStructureHookFactoryÚExtendedStructureHookFactoryÚAnyStructureHookFactoryBasezHHookFactory[StructureHook] | ExtendedStructureHookFactory[BaseConverter]ÚAnyStructureHookFactoryzDHookFactory[StructureHook] | ExtendedStructureHookFactory[Converter]ÚUnstructureHookTÚStructureHookTÚCounterTc                   @  s   e Zd ZdZdZdZdS )ra   z)`attrs` classes unstructuring strategies.ÚasdictÚastupleN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚAS_DICTÚAS_TUPLE© rx   rx   úQ/var/www/html/premium_crap/venv/lib/python3.10/site-packages/cattrs/converters.pyra   –   s    ra   Úfactoryr   ÚreturnÚboolc                 C  s0   t | ƒ}t|jƒdkot|j ¡ ƒd jtju S )z.Does this factory also accept a converter arg?é   r   )Úinspect_signatureÚlenÚ
parametersÚlistÚvaluesÚdefaultr   Úempty)rz   Úsigrx   rx   ry   Ú_is_extended_factory�   s   þr†   c                   @  sZ  e Zd ZdZdZeejdddd„ dd„ fd¦dd„Zd§d¨dd„Z	e
d©dd„ƒZedªd!d"„ƒZed«d%d"„ƒZ	d¬d­d(d"„Zd®d+d,„Zed¯d/d0„ƒZed°d3d0„ƒZed±d5d0„ƒZd§d6d0„Z	d²d³d9d:„Zed´d=d>„ƒZedµd@d>„ƒZ	d§d¶dBd>„Zd·dCdD„Zed¸dFdG„ƒZed¹dIdG„ƒZedºdKdG„ƒZd§dLdG„Zd»dPdQ„Zd²d¼dRdS„Zd½dUdV„Zd¾dXdY„Zd¿d[d\„ZdÀd_d`„ZdÁdcdd„ZdÂdedf„ZdÃdhdi„Z	d²dÄdldm„ZedÅdndo„ƒZedpdq„ ƒZ edrds„ ƒZ!dÆdvdw„Z"dxdy„ Z#dÇdzd{„Z$dÈdd€„Z%dÉd‚dƒ„Z&dÊd†d‡„Z'e(fdËdŠd‹„Z)dÌd�dŽ„Z*dÍd�d‘„Z+d’d“„ Z,dÎd–d—„Z-		dÏdÐdœd�„Z.dÑdždŸ„Z/				dÒdÓd¤d¥„Z0dS )Ôr^   z2Converts between structured and unstructured data.)
Ú_dict_factoryÚ_prefer_attrib_convertersÚ_struct_copy_skipÚ_structure_attrsÚ_structure_funcÚ_union_struct_registryÚ_unstruct_copy_skipÚ_unstructure_attrsÚ_unstructure_funcÚdetailed_validationFTc                 C  ó   t S ©N©rP   ©Ú_rx   rx   ry   Ú<lambda>¾   ó    zBaseConverter.<lambda>c                 C  ó
   t d | ƒS r’   ©rQ   ©Útrx   rx   ry   r–   ¿   ó    ÿÚdict_factoryúCallable[[], Any]Úunstruct_stratra   Úprefer_attrib_convertersr|   r�   Úunstructure_fallback_factoryúHookFactory[UnstructureHook]Ústructure_fallback_factoryúHookFactory[StructureHook]r{   ÚNonec                   s^  t |ƒ}|ˆ _|ˆ _i ˆ _|t ju rˆ jˆ _ˆ jˆ _nˆ j	ˆ _ˆ j
ˆ _t|ˆ ƒˆ _ˆ j ttfttfttfg¡ ˆ j dd„ ‡ fdd„ft‡ fdd„fdd„ ‡ fdd„dft‡ fdd„dftˆ jftˆ jftˆ jftˆ jftˆ jfd	d„ ˆ jftˆ jftˆ j fd
d„ ˆ jfg¡ t|ˆ ƒˆ _!ˆ j! dd„ dd„ ft"ˆ j#dfdd„ ˆ j$ftt%dfdd„ ˆ j&dft'ˆ j(ftˆ j)ftt*dft+t,dft-ˆ j.ftˆ j/ft0ˆ j1ftˆ j1ft2ˆ j3ft4t5dftˆ j6fg|t ju rçt7ˆ j8dfgng ¢t9ˆ j:f‘‡ fdd„ˆ jj;df‘tˆ jf‘¡ ˆ j! tˆ j<ftˆ j<ft=ˆ j<ft>ˆ j<ft?ˆ j<ftˆ j<fg¡ |ˆ _@ˆ j A¡ ˆ _Bˆ j! A¡ ˆ _CdS )a¸  
        :param detailed_validation: Whether to use a slightly slower mode for detailed
            validation errors.
        :param unstructure_fallback_factory: A hook factory to be called when no
            registered unstructuring hooks match.
        :param structure_fallback_factory: A hook factory to be called when no
            registered structuring hooks match.

        ..  versionadded:: 23.2.0 *unstructure_fallback_factory*
        ..  versionadded:: 23.2.0 *structure_fallback_factory*
        ..  versionchanged:: 24.2.0
            The default `structure_fallback_factory` now raises errors for missing handlers
            more eagerly, surfacing problems earlier.
        c                 S  ó   t | ƒd uS r’   ©r#   rš   rx   rx   ry   r–   è   ó    z(BaseConverter.__init__.<locals>.<lambda>c                   ó   ˆ j | | jd�S ©N)Úunstructure_as©ÚunstructureÚ	__class__©Úo©Úselfrx   ry   r–   é   ó    c                   r©   rª   r¬   r¯   r±   rx   ry   r–   í   r³   c                 S  r¦   r’   ©r"   rš   rx   rx   ry   r–   ð   r¨   c                   ó   ˆ   t| ƒ¡S r’   )Úget_unstructure_hookr"   rš   r±   rx   ry   r–   ñ   ó    Tc                   rµ   r’   )r¶   rZ   rš   r±   rx   ry   r–   ö   r·   c                 S  s
   t | tƒS r’   )Ú
issubclassr
   rš   rx   rx   ry   r–   þ   ó   
 c                 S  s   | t v S r’   )r   rš   rx   rx   ry   r–     ó    c                 S  s   | t v p| tu p| d u S r’   )r   r   ©Úclrx   rx   ry   r–     s    c                 S  s   | S r’   rx   ©Úvr•   rx   rx   ry   r–     r—   c                 S  r¦   r’   r§   rš   rx   rx   ry   r–     r¨   Úextendedc                 S  r¦   r’   r´   rš   rx   rx   ry   r–     r¨   c                   s   t | ƒo| ˆ jv S r’   )r6   rŒ   rš   r±   rx   ry   r–   )  s    N)Dra   rˆ   r�   rŒ   rv   Úunstructure_attrs_asdictrŽ   Ústructure_attrs_fromdictrŠ   Úunstructure_attrs_astupleÚstructure_attrs_fromtuplerF   r�   Úregister_cls_listÚbytesrP   Ústrr   Úregister_func_listr3   r[   rY   r­   r/   Ú_unstructure_mappingr<   Ú_unstructure_seqr1   r*   Ú_unstructure_enumr   r6   Ú_unstructure_unionr‹   r,   Ú_gen_structure_genericÚ_structure_newtyper\   Ú_structure_final_factoryr.   Ú_structure_simple_literalÚ_structure_enum_literalr8   r0   r>   r)   Ú_structure_dequeÚ_structure_setr9   Ú_structure_frozensetr4   Ú_structure_tupler;   rA   Ú_structure_dictrD   Ú_gen_attrs_union_structurer2   Ú_structure_optionalÚ__getitem__Ú_structure_callÚintÚfloatr
   r‡   Úget_num_fnsr�   r‰   )r²   r�   rŸ   r    r�   r¡   r£   rx   r±   ry   Ú__init__¸   s¶   

ÿÿ
þ
þ
ý
ýåÿ#þ
ýé
ÿåã
ýâ#Ýÿ(úÿzBaseConverter.__init__NÚobjr   r«   c                 C  s$   | j  |d u r|j¡|ƒS |¡|ƒS r’   ©r�   Údispatchr®   )r²   rÞ   r«   rx   rx   ry   r­   A  s   ÿþÿþzBaseConverter.unstructurec                 C  s   | j | jkr	tjS tjS )z3The default way of unstructuring ``attrs`` classes.)rŽ   rÀ   ra   rv   rw   r±   rx   rx   ry   rŸ   F  s
   ÿÿýzBaseConverter.unstruct_stratÚclsrm   c                 C  ó   d S r’   rx   )r²   rá   rx   rx   ry   Úregister_unstructure_hookO  ó   z'BaseConverter.register_unstructure_hookÚfuncrK   c                 C  râ   r’   rx   )r²   rá   rå   rx   rx   ry   rã   R  rä   úUnstructureHook | Noneú"Callable[[UnstructureHook]] | Nonec                   sÔ   |du rˆ }t |ƒ}tt|j ¡ ƒƒj‰ |  ˆ |¡ |S tˆ ƒr$tˆ ƒ t	ˆ ƒr7| j
 ‡ fdd„|fg¡ dS tˆ ƒrJ| j
 ‡ fdd„|fg¡ dS tˆ ƒdur_| j
 ‡ fdd„|fg¡ dS | j
 ˆ |fg¡ dS )a(  Register a class-to-primitive converter function for a class.

        The converter function should take an instance of the class and return
        its Python equivalent.

        May also be used as a decorator. When used as a decorator, the first
        argument annotation from the decorated function will be used as the
        type to register the hook for.

        .. versionchanged:: 24.1.0
            This method may now be used as a decorator.
        .. versionchanged:: 25.1.0
            Modern type aliases are now supported.
        Nc                   s   | ˆ kS r’   rx   rš   ©rá   rx   ry   r–   r  rº   z9BaseConverter.register_unstructure_hook.<locals>.<lambda>c                   ó   | ˆ u S r’   rx   rš   rè   rx   ry   r–   t  rº   c                   ré   r’   rx   rš   rè   rx   ry   r–   w  rº   )r   ÚnextÚiterr€   r‚   Ú
annotationrã   Ú	attrs_hasr   r6   r�   rÇ   r[   r#   rÄ   )r²   rá   rå   r…   rx   rè   ry   rã   U  s&   ùûÿÚ
check_funcrO   c                 C  ó   | j  ||fg¡ dS ©zyRegister a class-to-primitive converter function for a class, using
        a function to check if it's a match.
        N)r�   rÇ   ©r²   rî   rå   rx   rx   ry   Úregister_unstructure_hook_func|  ó   z,BaseConverter.register_unstructure_hook_funcÚ	predicateúHCallable[[AnyUnstructureHookFactoryBase], AnyUnstructureHookFactoryBase]c                 C  râ   r’   rx   ©r²   rô   rx   rx   ry   Ú!register_unstructure_hook_factory„  ó   z/BaseConverter.register_unstructure_hook_factoryrz   rd   c                 C  râ   r’   rx   ©r²   rô   rz   rx   rx   ry   r÷   ‰  rø   ú-ExtendedUnstructureHookFactory[BaseConverter]c                 C  râ   r’   rx   rù   rx   rx   ry   r÷   Ž  s   c                   ó>   |du r‡ ‡fdd„}|S ˆj  ˆ |t|ƒrdndfg¡ |S )aí  
        Register a hook factory for a given predicate.

        The hook factory may expose an additional required parameter. In this case,
        the current converter will be provided to the hook factory as that
        parameter.

        May also be used as a decorator.

        :param predicate: A function that, given a type, returns whether the factory
            can produce a hook for that type.
        :param factory: A callable that, given a type, produces an unstructuring
            hook for that type. This unstructuring hook will be cached.

        .. versionchanged:: 24.1.0
            This method may now be used as a decorator.
            The factory may also receive the converter as a second, required argument.
        Nc                   ó8   t | ƒrˆj ˆ | dfg¡ d S ˆj ˆ | dfg¡ d S ©Nr¿   T)r†   r�   rÇ   ©rz   ©rô   r²   rx   ry   Ú	decoratorª  ó   
ÿ
ÿzBBaseConverter.register_unstructure_hook_factory.<locals>.decoratorr¿   T)r�   rÇ   r†   ©r²   rô   rz   r   rx   rÿ   ry   r÷   •  s   ýÿÿ	ÚtypeÚcache_resultc                 C  ó   |r| j  |¡S | j  |¡S )al  Get the unstructure hook for the given type.

        This hook can be manually called, or composed with other functions
        and re-registered.

        If no hook is registered, the converter unstructure fallback factory
        will be used to produce one.

        :param cache: Whether to cache the returned hook.

        .. versionadded:: 24.1.0
        )r�   rà   Údispatch_without_caching©r²   r  r  rx   rx   ry   r¶   Â  s
   ÿÿ
ýz"BaseConverter.get_unstructure_hookr¼   rn   c                 C  râ   r’   rx   ©r²   r¼   rx   rx   ry   Úregister_structure_hook×  rä   z%BaseConverter.register_structure_hookrH   c                 C  râ   r’   rx   )r²   r¼   rå   rx   rx   ry   r	  Ú  rä   úStructureHook | Nonec                   s¼   |du rˆ }t |ƒ}|  |j|¡ |S tˆ ƒrtˆ ƒ tˆ ƒr+|| jˆ < | j ¡  dS t	ˆ ƒr>| j 
‡ fdd„|fg¡ dS tˆ ƒdurS| j 
‡ fdd„|fg¡ dS | j ˆ |fg¡ dS )aá  Register a primitive-to-class converter function for a type.

        The converter function should take two arguments:
          * a Python object to be converted,
          * the type to convert to

        and return the instance of the class. The type may seem redundant, but
        is sometimes needed (for example, when dealing with generic classes).

        This method may be used as a decorator. In this case, the decorated
        hook must have a return type annotation, and this annotation will be used
        as the type for the hook.

        .. versionchanged:: 24.1.0
            This method may now be used as a decorator.
        .. versionchanged:: 25.1.0
            Modern type aliases are now supported.
        Nc                   ré   r’   rx   rš   r»   rx   ry   r–      rº   z7BaseConverter.register_structure_hook.<locals>.<lambda>c                   ré   r’   rx   rš   r»   rx   ry   r–     rº   )r   r	  Úreturn_annotationrí   r   r6   rŒ   r‹   Úclear_cacher[   rÇ   r#   rÄ   )r²   r¼   rå   r…   rx   r»   ry   r	  Ý  s&   

	øûÿc                 C  rï   rð   )r‹   rÇ   rñ   rx   rx   ry   Úregister_structure_hook_func  ró   z*BaseConverter.register_structure_hook_funcúDCallable[[AnyStructureHookFactoryBase], AnyStructureHookFactoryBase]c                 C  râ   r’   rx   rö   rx   rx   ry   Úregister_structure_hook_factory  rø   z-BaseConverter.register_structure_hook_factoryri   c                 C  râ   r’   rx   rù   rx   rx   ry   r    rø   ú+ExtendedStructureHookFactory[BaseConverter]c                 C  râ   r’   rx   rù   rx   rx   ry   r    rø   c                   rû   )aè  
        Register a hook factory for a given predicate.

        The hook factory may expose an additional required parameter. In this case,
        the current converter will be provided to the hook factory as that
        parameter.

        May also be used as a decorator.

        :param predicate: A function that, given a type, returns whether the factory
            can produce a hook for that type.
        :param factory: A callable that, given a type, produces a structuring
            hook for that type. This structuring hook will be cached.

        .. versionchanged:: 24.1.0
            This method may now be used as a decorator.
            The factory may also receive the converter as a second, required argument.
        Nc                   rü   rý   )r†   r‹   rÇ   rþ   rÿ   rx   ry   r   4  r  z@BaseConverter.register_structure_hook_factory.<locals>.decoratorr¿   T)r‹   rÇ   r†   r  rx   rÿ   ry   r    s   ýÿÿ	rJ   útype[T]rb   c                 C  s   | j  |¡||ƒS )z?Convert unstructured Python data structures to structured data.©r‹   rà   ©r²   rÞ   r¼   rx   rx   ry   Ú	structureK  s   zBaseConverter.structurec                 C  r  )ah  Get the structure hook for the given type.

        This hook can be manually called, or composed with other functions
        and re-registered.

        If no hook is registered, the converter structure fallback factory
        will be used to produce one.

        :param cache: Whether to cache the returned hook.

        .. versionadded:: 24.1.0
        )r‹   rà   r  r  rx   rx   ry   Úget_structure_hookO  s
   ÿÿ
ýz BaseConverter.get_structure_hookúdict[str, Any]c                 C  sP   t |jƒ}| jj}|  ¡ }|D ]}|j}t||ƒ}||jp|jƒ|ƒ||< q|S )z9Our version of `attrs.asdict`, so we can call back to us.)r!   r®   r�   rà   r‡   ÚnameÚgetattrr  )r²   rÞ   Úattrsrà   ÚrvÚar  r¾   rx   rx   ry   rÀ   c  s   

z&BaseConverter.unstructure_attrs_asdictútuple[Any, ...]c                 C  sR   t |jƒ}| jj}g }|D ]}|j}t||ƒ}| ||jp|jƒ|ƒ¡ qt|ƒS )z:Our version of `attrs.astuple`, so we can call back to us.)	r!   r®   r�   rà   r  r  Úappendr  Útuple)r²   rÞ   r  rà   Úresr  r  r¾   rx   rx   ry   rÂ   n  s   

z'BaseConverter.unstructure_attrs_astupler
   c                 C  s   |j S )zConvert an enum to its value.)Úvalue©r²   rÞ   rx   rx   ry   rÊ   y  s   zBaseConverter._unstructure_enumÚseqúSequence[T]c                   s    | j j‰ | ‡ fdd„|D ƒ¡S )z,Convert a sequence to primitive equivalents.c                 3  s   � | ]
}ˆ |j ƒ|ƒV  qd S r’   ©r®   ©Ú.0Úe©rà   rx   ry   Ú	<genexpr>�  s   € z1BaseConverter._unstructure_seq.<locals>.<genexpr>rß   )r²   r"  rx   r(  ry   rÉ   }  s   zBaseConverter._unstructure_seqÚmappingúMapping[T, V]c                   s$   | j j‰ | ‡ fdd„| ¡ D ƒ¡S )z;Convert a mapping of attr classes to primitive equivalents.c                 3  s0   � | ]\}}ˆ |j ƒ|ƒˆ |j ƒ|ƒfV  qd S r’   r$  ©r&  Úkr¾   r(  rx   ry   r)  ‰  s
   € ÿ
ÿz5BaseConverter._unstructure_mapping.<locals>.<genexpr>)r�   rà   r®   Úitems)r²   r*  rx   r(  ry   rÈ   ƒ  s   þz"BaseConverter._unstructure_mappingc                 C  s   | j  |j¡|ƒS )zh
        Unstructure an object as a union.

        By default, just unstructures the instance.
        rß   r!  rx   rx   ry   rË   ‘  s   z BaseConverter._unstructure_unionú)SimpleStructureHook[Mapping[str, Any], T]c                 C  ó   t || | jd�S )z2Create and return a hook for structuring generics.)Ú _cattrs_prefer_attrib_converters)rV   rˆ   r  rx   rx   ry   rÌ   ›  s   ÿz$BaseConverter._gen_structure_genericÚuse_literalsú(Callable[[Any, type[T]], type[T] | None]c                   sB   ˆj ||d�‰ t|jv }|rd‡ ‡fdd„}|S ‡ ‡fdd„}|S )	z¢
        Generate a structuring function for a union of attrs classes (and maybe None).

        :param use_literals: Whether to consider literal fields.
        )r2  r{   r¼   c                   s   | d u rd S ˆ  | ˆ | ƒ¡S r’   ©r  ©rÞ   r•   ©Údis_fnr²   rx   ry   Ústructure_attrs_union°  s   zGBaseConverter._gen_attrs_union_structure.<locals>.structure_attrs_unionc                   s   ˆ  | ˆ | ƒ¡S r’   r4  r5  r6  rx   ry   r8  ·  s   N)r{   r¼   )Ú_get_dis_funcr   Ú__args__)r²   r¼   r2  Úhas_noner8  rx   r6  ry   rÖ   £  s   

ýz(BaseConverter._gen_attrs_union_structurec                 C  s   || ƒS )zÝJust call ``cl`` with the given ``obj``.

        This is just an optimization on the ``_structure_default`` case, when
        we know we can skip the ``if`` s. Use for ``str``, ``bytes``, ``enum``,
        etc.
        rx   )rÞ   r¼   rx   rx   ry   rÙ   ¼  s   zBaseConverter._structure_callc                 C  s    | |j vrt| › d|› �ƒ‚| S )Nú not in literal )r:  Ú	Exception)Úvalr  rx   rx   ry   rÏ   Æ  s   
z'BaseConverter._structure_simple_literalc                 C  s>   dd„ |j D ƒ}z||  W S  ty   t| › d|› �ƒd ‚w )Nc                 S  s"   i | ]}t |tƒr|jn||“qS rx   )Ú
isinstancer
   r   )r&  Úxrx   rx   ry   Ú
<dictcomp>Î  ó   " z9BaseConverter._structure_enum_literal.<locals>.<dictcomp>r<  )r:  ÚKeyErrorr=  )r>  r  Úvalsrx   rx   ry   rÐ   Ì  s   
ÿz%BaseConverter._structure_enum_literalr>  rG   c                 C  s   t |ƒ}|  |¡||ƒS r’   ©r#   r  )r²   r>  r  Úbaserx   rx   ry   rÍ   Ô  s   z BaseConverter._structure_newtypec                   s"   t |ƒ}|  |¡‰ |f‡ fdd„	S )Nc                   s
   ˆ | |ƒS r’   rx   )r¾   r•   Ú_BaseConverter__base©r  rx   ry   r–   Û  r¹   z8BaseConverter._structure_final_factory.<locals>.<lambda>)r"   r  )r²   r  rF  rx   rH  ry   rÎ   Ø  s   
z&BaseConverter._structure_final_factoryc                 C  s:   g }t t|ƒ|ƒD ]\}}|  ||¡}| |¡ q	||Ž S )z,Load an attrs class from a sequence (tuple).)Úzipr!   Ú_structure_attributer  )r²   rÞ   r¼   Úconv_objr  r   Ú	convertedrx   rx   ry   rÃ   ß  s
   z'BaseConverter.structure_attrs_fromtupler  úAttribute | Fieldr   c                 C  s^   |j }t|ddƒ}| jr|r|S |du r|S z
| j |¡||ƒW S  ty.   |r-| Y S ‚ w )z%Handle an individual attrs attribute.Ú	converterN)r  r  rˆ   r‹   rà   rN   )r²   r  r   Útype_Úattrib_converterrx   rx   ry   rJ  é  s   
üz"BaseConverter._structure_attributeúMapping[str, Any]c              	   C  s\   i }t |ƒD ] }z||j }W n	 ty   Y qw |  ||¡|t|d|jƒ< q|di |¤ŽS )z1Instantiate an attrs class from a mapping (dict).ÚaliasNrx   )r!   r  rC  rJ  r  )r²   rÞ   r¼   rK  r  r>  rx   rx   ry   rÁ   ÿ  s   ÿz&BaseConverter.structure_attrs_fromdictúIterable[T]údeque[T]c                   s  t |ƒs|jd tv rt|ƒ}|S |jd ‰ | j ˆ ¡‰| jr|g }tƒ }d}|D ]F}z?z
| ˆ|ˆ ƒ¡ W n. tyc } z"t	d|› d|› �|ˆ ƒ}g t
|dg ƒ¢|‘|_| |¡ W Y d}~nd}~ww W |d7 }q(|d7 }w |rztd|›�||ƒ‚|S t‡ ‡fdd	„|D ƒƒ}|S )
z3Convert an iterable to a potentially generic deque.r   úStructuring ú	 @ index Ú	__notes__Nr   úWhile structuring c                 3  s   � | ]}ˆ|ˆ ƒV  qd S r’   rx   r%  ©Ú	elem_typeÚhandlerrx   ry   r)  *  ó   € z1BaseConverter._structure_deque.<locals>.<genexpr>)r'   r:  r   r   r‹   rà   r�   r  r=  rM   r  rW  rL   )r²   rÞ   r¼   r  ÚerrorsÚixr'  Úmsgrx   rY  ry   rÑ     s:   
éÿ€û€ÿÿzBaseConverter._structure_dequeÚstructure_toúSet[T]c           
        s:  t |ƒs|jd tv r||ƒS |jd ‰ | j ˆ ¡‰| jrƒg }tƒ }d}|D ]G}z@z
| ˆ|ˆ ƒ¡ W n/ tyb } z#t	d|j
› d|›�|ˆ ƒ}	g t|dg ƒ¢|	‘|_| |¡ W Y d}~nd}~ww W |d7 }q&|d7 }w |rytd|›�||ƒ‚|tu r|S ||ƒS |tu r‘‡ ‡fdd	„|D ƒS |‡ ‡fd
d„|D ƒƒS )z3Convert an iterable into a potentially generic set.r   rU  z @ element rW  Nr   rX  c                   s   h | ]}ˆ|ˆ ƒ’qS rx   rx   r%  rY  rx   ry   Ú	<setcomp>J  ó    z/BaseConverter._structure_set.<locals>.<setcomp>c                   s   g | ]}ˆ|ˆ ƒ‘qS rx   rx   r%  rY  rx   ry   Ú
<listcomp>K  rc  z0BaseConverter._structure_set.<locals>.<listcomp>)r'   r:  r   r‹   rà   r�   ÚsetÚaddr=  rM   rr   r  rW  r  rL   )
r²   rÞ   r¼   r`  r]  r  r^  r'  Úexcr_  rx   rY  ry   rÒ   -  s:   
ý€ù€	zBaseConverter._structure_setúFrozenSetSubscriptable[T]c                 C  s   | j ||td�S )z9Convert an iterable into a potentially generic frozenset.)r`  )rÒ   Ú	frozensetr  rx   rx   ry   rÓ   M  s   z"BaseConverter._structure_frozensetú
dict[T, V]c                   sØ  t |ƒs|jttfkrt|ƒS |j\‰‰| jr¦| j ˆ¡}| j ˆ¡}g }i }| ¡ D ]m\}}z||ˆƒ}	W n+ tya }
 zt	d|›�|ˆƒ}g t
|
dg ƒ¢|‘|
_| |
¡ W Y d}
~
q+d}
~
ww z||ˆƒ}|	||< W q+ ty˜ }
 zt	d|›�|ˆƒ}g t
|
dg ƒ¢|‘|
_| |
¡ W Y d}
~
q+d}
~
ww |r¤td|›�||ƒ‚|S ˆtv r¼| j ˆ¡‰‡‡fdd„| ¡ D ƒS ˆtv rÒ| j ˆ¡‰ ‡ ‡fdd„| ¡ D ƒS | j ˆ¡‰ | j ˆ¡‰‡ ‡‡‡fd	d„| ¡ D ƒS )
z2Convert a mapping into a potentially generic dict.z Structuring mapping value @ key rW  NzStructuring mapping key @ key rX  c                   s   i | ]
\}}|ˆ |ˆƒ“qS rx   rx   r,  )Úval_convÚval_typerx   ry   rA  z  ó    z1BaseConverter._structure_dict.<locals>.<dictcomp>c                   s   i | ]
\}}ˆ |ˆƒ|“qS rx   rx   r,  )Úkey_convÚkey_typerx   ry   rA  }  rm  c                   s"   i | ]\}}ˆ |ˆƒˆ|ˆƒ“qS rx   rx   r,  ©rn  ro  rk  rl  rx   ry   rA  €  rB  )r'   r:  r   Údictr�   r‹   rà   r.  r=  rM   r  rW  r  rL   r   )r²   rÞ   r¼   Úkey_handlerÚval_handlerr]  r  r-  r¾   r   rg  r_  Úkeyrx   rp  ry   rÕ   S  sV   
ÿ
€ú
ÿ€ûzBaseConverter._structure_dictc                 C  s@   |d u rd S |j }|d tu r|d n|d }| j |¡||ƒS )Nr   r   )r:  r   r‹   rà   )r²   rÞ   ÚunionÚunion_paramsÚotherrx   rx   ry   r×   ‚  s
   z!BaseConverter._structure_optionalr   Útupc                   sÊ  |t tfv rdn|j}|o|d tu }|du s|r#|d tv r#t|ƒS |rœ|d ‰ˆj ˆ¡‰ ˆjr�g }g }d}|D ]F}z?z
| ˆ |ˆƒ¡ W n. t	yu }	 z"t
d|› d|› �|ˆƒ}
g t|	dg ƒ¢|
‘|	_| |	¡ W Y d}	~	nd}	~	ww W |d7 }q:|d7 }w |rŒtd|›�||ƒ‚t|ƒS t‡ ‡fd	d
„|D ƒƒS t|ƒ}ˆj�r7g }g }tt||ƒƒD ]D\}\}}zˆj |¡‰ | ˆ ||ƒ¡ W q¯ t	yó }	 z"t
d|› d|› �||ƒ}
g t|	dg ƒ¢|
‘|	_| |	¡ W Y d}	~	q¯d}	~	ww t|ƒ|k�r't|ƒ|k �rdnd}t|› d|›d|›�ƒ}	d|› �}
g t|	dg ƒ¢|
‘|	_| |	¡ |�r3td|›�||ƒ‚t|ƒS t|ƒ|k�rWt|ƒt|ƒk �rIdnd}t|› d|›d|›�ƒ‚t‡fdd„t||ƒD ƒƒS )z#Deal with structuring into a tuple.Néÿÿÿÿr   rU  rV  rW  r   rX  c                 3  s   � | ]}ˆ |ˆƒV  qd S r’   rx   r%  )ÚconvÚtup_typerx   ry   r)  ©  r\  z1BaseConverter._structure_tuple.<locals>.<genexpr>z
Not enoughzToo manyz values in z to structure as c                   s"   g | ]\}}ˆ j  |¡||ƒ‘qS rx   r  )r&  r›   r'  r±   rx   ry   rd  È  rB  z2BaseConverter._structure_tuple.<locals>.<listcomp>)r   r  r:  ÚEllipsisr   r‹   rà   r�   r  r=  rM   r  rW  rL   r   Ú	enumeraterI  Ú
ValueError)r²   rÞ   rx  Ú
tup_paramsÚhas_ellipsisr]  r  r^  r'  rg  r_  Úexp_lenr›   Úproblemrx   )rz  r²   r{  ry   rÔ   Š  sz   ÿ€û€ÿÿ€û

ÿzBaseConverter._structure_tupleru  Ú	overridesú#dict[str, AttributeOverride] | NoneúCallable[[Any], type]c                 C  sh   |j }t|v rtdd„ |D ƒƒ}tdd„ |D ƒƒstd|d�‚t| g|¢R ||dur/|dœŽS ddœŽS )	z<Fetch or try creating a disambiguation function for a union.c                 s  s   � | ]	}|t ur|V  qd S r’   )r   r%  rx   rx   ry   r)  Ö  ó   € z.BaseConverter._get_dis_func.<locals>.<genexpr>c                 s  s    � | ]}t t|ƒp
|ƒV  qd S r’   )r   r$   r%  rx   rx   ry   r)  Ø  s   € zeOnly unions of attrs classes and dataclasses supported currently. Register a structure hook manually.)rO  NÚfrom_converter)r2  rƒ  )r:  r   r  ÚallrN   rC   )r²   ru  r2  rƒ  Úunion_typesrx   rx   ry   r9  Ë  s$   ýÿþ
üüzBaseConverter._get_dis_funcc                 C  s   |   ¡ S r’   )Úcopy)r²   r•   rx   rx   ry   Ú__deepcopy__æ  s   zBaseConverter.__deepcopy__úCallable[[], Any] | NoneúUnstructureStrategy | Noneúbool | Noner   c                 C  s‚   |   |dur|n| j|dur|n| j| jkrtjntj|dur!|n| j|dur)|n| j¡}| j	 
|j	| j¡ | j 
|j| j¡ |S )úÂCreate a copy of the converter, keeping all existing custom hooks.

        :param detailed_validation: Whether to use a slightly slower mode for detailed
            validation errors.
        N)r®   r‡   rŽ   rÀ   ra   rv   rw   rˆ   r�   r�   Úcopy_tor�   r‹   r‰   )r²   r�   rŸ   r    r�   r  rx   rx   ry   rŠ  é  s"   ÿÿÿÿízBaseConverter.copy)r�   rž   rŸ   ra   r    r|   r�   r|   r¡   r¢   r£   r¤   r{   r¥   r’   )rÞ   r   r«   r   r{   r   )r{   ra   )rá   rm   r{   rm   )rá   r   rå   rK   r{   r¥   ©NN)rá   r   rå   ræ   r{   rç   )rî   rO   rå   rK   r{   r¥   )rô   rO   r{   rõ   ©rô   rO   rz   rd   r{   rd   )rô   rO   rz   rú   r{   rú   )T)r  r   r  r|   r{   rK   )r¼   rn   r{   rn   )r¼   r   rå   rH   r{   r¥   )r¼   r   rå   r
  r{   r¥   )rî   rO   rå   rH   r{   r¥   )rô   rO   r{   r  ©rô   rO   rz   ri   r{   ri   )rô   rO   rz   r  r{   r  )rÞ   rJ   r¼   r  r{   rb   )r  r   r  r|   r{   rH   )rÞ   r   r{   r  )rÞ   r   r{   r  )rÞ   r
   r{   r   )r"  r#  r{   r#  )r*  r+  r{   r+  )rÞ   r   r{   r   )r¼   r  r{   r/  )r¼   r   r2  r|   r{   r3  )rÞ   r   r¼   r  r{   r   )r>  rJ   r{   rG   )rÞ   r  r¼   r  r{   rb   )r  rM  r   r   r{   r   )rÞ   rQ  r¼   r  r{   rb   )rÞ   rS  r¼   r   r{   rT  )rÞ   rS  r¼   r   r`  r  r{   ra  )rÞ   rS  r¼   r   r{   rh  )rÞ   r+  r¼   r   r{   rj  )rÞ   r   rx  r  r{   rb   )TN)ru  r   r2  r|   rƒ  r„  r{   r…  )r{   r^   )NNNN)
r�   rŒ  rŸ   r�  r    rŽ  r�   rŽ  r{   r   )1rr   rs   rt   ru   Ú	__slots__rq  ra   rv   rÝ   r­   ÚpropertyrŸ   r   rã   rò   r÷   r¶   r	  r  r  r  r  rÀ   rÂ   rÊ   rÉ   rÈ   rË   rÌ   rÖ   ÚstaticmethodrÙ   rÏ   rÐ   rÍ   rÎ   rÃ   rJ  rÁ   rÑ   re  rÒ   rÓ   rÕ   r×   rÔ   r9  r‹  rŠ  rx   rx   rx   ry   r^   ¨   s¤    ù 
ÿ
'
.ÿÿ
+

,







	ÿ	







ÿ
 
/
Dü
ûr^   c                      sd  e Zd ZdZdZeejddi i dddd„ dd„ dfdg‡ fdd„Ze	dhd d!„ƒZ
e	did$d!„ƒZ
e	djd&d!„ƒZ
dk‡ fd(d!„	Z
e	dld*d+„ƒZe	dmd-d+„ƒZe	dnd/d+„ƒZdk‡ fd0d+„	Zdod4d5„Zd6d7„ Zdpd9d:„Zdqd>d?„ZdrdAdB„ZdsdDdE„ZdtdGdH„ZdudJdK„Z	'dkdvdNdO„Z	'dkdwdQdR„Z	'	'dxdydVdW„ZdzdZd[„Zd{d]d^„Z	'	'	'	'	'	'	'	'	'd|d}dedf„Z‡  ZS )~r_   zAA converter which generates specialized un/structuring functions.)Ú_unstruct_collection_overridesÚforbid_extra_keysÚomit_if_defaultÚtype_overridesÚ	use_aliasFTc                 C  r‘   r’   r“   r”   rx   rx   ry   r–   '  r—   zConverter.<lambda>c                 C  r˜   r’   r™   rš   rx   rx   ry   r–   (  rœ   r�   rž   rŸ   ra   r™  r|   r˜  rš  ú Mapping[type, AttributeOverride]Úunstruct_collection_overridesúMapping[type, UnstructureHook]r    r�   r¡   r¢   r£   r¤   r›  c                   sŠ  t ƒ j|||||	|
d� |ˆ _|ˆ _t|ƒˆ _|ˆ _dd„ | ¡ D ƒ}|ˆ _|}t	|v r@t
|vr6|t	 |t
< t|vr@|t	 |t< t
|v rNt|vrN|t
 |t< t|v rft|vr\|t |t< t|vrf|t |t< t|v r~t|vrt|t |t< t|vr~|t |t< t|v rŒt|vrŒ|t |t< t|v ršt|vrš|t |t< t|v r¨t|vr¨|t |t< |tju r»ˆ  tˆ j¡ ˆ  tˆ j¡ ˆ  tˆ j¡ ˆ  tˆ j¡ ˆ  t ¡t!ƒ ˆ  t"ˆ j#¡ ˆ  t$ˆ j%¡ ˆ  t&‡ fdd„¡ ˆ  t'‡ fdd„¡ ˆ  t(ˆ j)¡ ˆ  t*ˆ j+¡ ˆ  dd„ ‡ fdd„¡ ˆ  tˆ j,¡ ˆ  t$ˆ j-¡ ˆ  t.ˆ j/¡ ˆ  t0t1¡ ˆ  t*ˆ j2¡ ˆ  d	d„ ˆ j3¡ ˆ j4 5¡ ˆ _6ˆ j7 5¡ ˆ _8d
S )au  
        :param detailed_validation: Whether to use a slightly slower mode for detailed
            validation errors.
        :param unstructure_fallback_factory: A hook factory to be called when no
            registered unstructuring hooks match.
        :param structure_fallback_factory: A hook factory to be called when no
            registered structuring hooks match.
        :param use_alias: Whether to use the field alias instead of the field name as
            the un/structured dictionary key by default.

        ..  versionadded:: 23.2.0 *unstructure_fallback_factory*
        ..  versionadded:: 23.2.0 *structure_fallback_factory*
        ..  versionchanged:: 24.2.0
            The default `structure_fallback_factory` now raises errors for missing handlers
            more eagerly, surfacing problems earlier.
        ..  versionadded:: 25.2.0 *use_alias*
        )r�   rŸ   r    r�   r¡   r£   c                 S  s   i | ]\}}t |ƒp||“qS rx   )r$   r,  rx   rx   ry   rA  K  s    ÿz&Converter.__init__.<locals>.<dictcomp>c                   ó   ˆ j | td�S ©N©Úunstructure_to)Úgen_unstructure_iterablere  r»   r±   rx   ry   r–   ‘  r·   z$Converter.__init__.<locals>.<lambda>c                   rŸ  r   )r£  ri  r»   r±   rx   ry   r–   •  r·   c                 S  r¦   r’   r§   rš   rx   rx   ry   r–   ž  r¨   c                   rµ   r’   )r¶   r#   rš   r±   rx   ry   r–   Ÿ  r·   c                 S  r¦   r’   r§   rš   rx   rx   ry   r–   ª  r¨   N)9ÚsuperrÝ   r™  r˜  rq  rš  r›  r.  r—  r   r   r   re  r   r   r  r�   r   r   r   r   ra   rv   r÷   r%   Úgen_unstructure_attrs_fromdictr  Úgen_structure_attrs_fromdictr&   Úgen_unstructure_annotatedr-   Úgen_unstructure_hetero_tupler;   rB   r<   r£  r/   Úgen_unstructure_mappingr1   r*   r2   Úgen_unstructure_optionalr5   Úgen_unstructure_typeddictÚgen_structure_annotatedÚgen_structure_mappingr(   Úgen_structure_counterr:   r7   Úgen_structure_typeddictÚget_structure_newtyper‹   rÜ   r‰   r�   r�   )r²   r�   rŸ   r™  r˜  rš  r�  r    r�   r¡   r£   r›  Úcor$  r±   ry   rÝ     s´   !ú
ÿ
ÿÿÿÿÿÿ
þ
þÿÿ
þÿ
ÿzConverter.__init__rô   rO   r{   ú@Callable[[AnyUnstructureHookFactory], AnyUnstructureHookFactory]c                 C  râ   r’   rx   rö   rx   rx   ry   r÷   ±  rø   z+Converter.register_unstructure_hook_factoryrz   rd   c                 C  râ   r’   rx   rù   rx   rx   ry   r÷   ¶  rø   ú)ExtendedUnstructureHookFactory[Converter]c                 C  râ   r’   rx   rù   rx   rx   ry   r÷   »  rø   Nc                   ó   t ƒ  ||¡S r’   )r¤  r÷   rù   r$  rx   ry   r÷   À  ó   ú<Callable[[AnyStructureHookFactory], AnyStructureHookFactory]c                 C  râ   r’   rx   rö   rx   rx   ry   r  Ä  rø   z)Converter.register_structure_hook_factoryri   c                 C  râ   r’   rx   rù   rx   rx   ry   r  É  rø   ú'ExtendedStructureHookFactory[Converter]c                 C  râ   r’   rx   rù   rx   rx   ry   r  Î  rø   c                   r´  r’   )r¤  r  rù   r$  rx   ry   r  Ó  rµ  r  r  úCallable[[Any, Any], T]c                   s    t |ƒ‰ |  ˆ ¡‰‡ ‡fdd„S )Nc                   s
   ˆ| ˆ ƒS r’   rx   r½   ©rF  r[  rx   ry   r–   Ú  r¹   z1Converter.get_structure_newtype.<locals>.<lambda>rE  ©r²   r  rx   r¹  ry   r°  ×  s   
zConverter.get_structure_newtypec                 C  s   |j }|  |¡S r’   )Ú
__origin__r¶   )r²   r  Úoriginrx   rx   ry   r§  Ü  s   
z#Converter.gen_unstructure_annotatedr   c                   s   |j ‰|  ˆ¡‰ ‡ ‡fdd„S )z#A hook factory for annotated types.c                   s
   ˆ | ˆƒS r’   rx   r½   ©Úhookr¼  rx   ry   r–   ä  r¹   z3Converter.gen_structure_annotated.<locals>.<lambda>)r»  r  rº  rx   r½  ry   r¬  à  s   
z!Converter.gen_structure_annotatedr¼   r   úCallable[[dict], dict]c                 C  s
   t || ƒS )zgGenerate a TypedDict unstructure function.

        Also apply converter-scored modifications.
        )Úmake_typeddict_dict_unstruct_fnr  rx   rx   ry   r«  æ  s   
z#Converter.gen_unstructure_typeddictúCallable[[T], dict[str, Any]]c                   sd   t |ƒ}t|p|ƒ}t|ƒrtdd„ |D ƒƒrt|p|ƒ ‡ fdd„|D ƒ}t|ˆ fdˆ ji|¤ŽS )Nc                 s  ó   � | ]	}t |jtƒV  qd S r’   ©r?  r  rÆ   ©r&  r  rx   rx   ry   r)  ò  r†  z;Converter.gen_unstructure_attrs_fromdict.<locals>.<genexpr>c                   ó(   i | ]}|j ˆ jv r|jˆ j|j  “qS rx   ©r  rš  r  rÄ  r±   rx   ry   rA  õ  ó
    þz<Converter.gen_unstructure_attrs_fromdict.<locals>.<dictcomp>Ú_cattrs_omit_if_default)r$   r!   rí   Úanyr   rW   r™  )r²   r¼   r¼  ÚattribsÚattrib_overridesrx   r±   ry   r¥  í  s   
þÿÿÿz(Converter.gen_unstructure_attrs_fromdictúCallable[[T], Any]c                 C  sN   |j }|d tu r|d n|d }t|tƒr| j}n|  |¡}|fdd„}|S )z2Generate an unstructuring hook for optional types.r   r   c                 S  s   | d u rd S || ƒS r’   rx   )r>  Ú_handlerrx   rx   ry   Úunstructure_optional	  s   z@Converter.gen_unstructure_optional.<locals>.unstructure_optional)r:  r   r?  r   r­   r¶   )r²   r¼   rv  rw  r[  rÎ  rx   rx   ry   rª  ÿ  s   

z"Converter.gen_unstructure_optionalúCallable[[dict, Any], dict]c                 C  r0  )zeGenerate a TypedDict structure function.

        Also apply converter-scored modifications.
        )Ú_cattrs_detailed_validation)Úmake_typeddict_dict_struct_fnr�   r  rx   rx   ry   r¯    s   ÿz!Converter.gen_structure_typeddictú%Callable[[Mapping[str, Any], Any], T]c                   st   t t|ƒrt|ƒp
|n|ƒ}t|ƒrtdd„ |D ƒƒrt|ƒ ‡ fdd„|D ƒ}t|ˆ fˆ jˆ jˆ j	ˆ j
dœ|¤ŽS )Nc                 s  rÂ  r’   rÃ  rÄ  rx   rx   ry   r)    r†  z9Converter.gen_structure_attrs_fromdict.<locals>.<genexpr>c                   rÅ  rx   rÆ  rÄ  r±   rx   ry   rA    rÇ  z:Converter.gen_structure_attrs_fromdict.<locals>.<dictcomp>)Ú_cattrs_forbid_extra_keysr1  rÐ  Ú_cattrs_use_alias)r!   r+   r$   rí   rÉ  r   rV   r˜  rˆ   r�   r›  )r²   r¼   rÊ  rË  rx   r±   ry   r¦    s&   € 
þþúùz&Converter.gen_structure_attrs_fromdictr¢  rT   c                 C  óB   | j  t|ƒp||pt¡}t|| |d�}| jj||fgdd� |S ©Nr¡  T©Údirect)r—  Úgetr$   r�   r=   r�   rÄ   ©r²   r¼   r¢  Úhrx   rx   ry   r£  -  ó   ÿz"Converter.gen_unstructure_iterablerS   c                 C  rÕ  rÖ  )r—  rÙ  r$   r  rX   r�   rÄ   rÚ  rx   rx   ry   r¨  7  rÜ  z&Converter.gen_unstructure_hetero_tuplerr  ú'Callable[[Any, Any | None], Any] | NonerU   c                 C  sD   | j  t|ƒp||pt¡}t|| ||d�}| jj||fgdd� |S )N)r¢  rr  Tr×  )r—  rÙ  r$   rq  r@   r�   rÄ   )r²   r¼   r¢  rr  rÛ  rx   rx   ry   r©  A  s   ÿÿz!Converter.gen_unstructure_mappingútype[CounterT]ú0SimpleStructureHook[Mapping[Any, Any], CounterT]c                 C  s.   t || tt| jd�}| jj||fgdd� |S )N)r`  rl  r�   Tr×  )r?   r   rÚ   r�   r‹   rÄ   )r²   r¼   rÛ  rx   rx   ry   r®  P  s   ûzConverter.gen_structure_counterú+SimpleStructureHook[Mapping[Any, Any], Any]c                 C  sL   t |ƒp|}|ttttfv rt}t|| || jd�}| jj	||fgdd� |S )N)r�   Tr×  )
r$   r   ÚAbcMutableMappingr   Ú
AbcMappingrq  r?   r�   r‹   rÄ   )r²   r¼   r`  rÛ  rx   rx   ry   r­  ]  s   ü
ÿzConverter.gen_structure_mappingrŒ  r�  rŽ  ú'Mapping[type, AttributeOverride] | Noneú%Mapping[type, UnstructureHook] | Noner   c
                 C  sØ   | j |dur|n| j|dur|n| j| jkrtjntj|dur!|n| j|dur)|n| j|dur1|n| j	|dur9|n| j
|durA|n| j|durI|n| j|	durQ|	n| jd�	}
| jj|
j| jd� | jj|
j| jd� |
S )r�  N)r›  )Úskip)r®   r‡   rŽ   rÀ   ra   rv   rw   r™  r˜  rš  r—  rˆ   r�   r›  r�   r�  r�   r‹   r‰   )r²   r�   rŸ   r™  r˜  rš  r�  r    r�   r›  r  rx   rx   ry   rŠ  n  s8   ÿÿÿÿÿÿß$ÿzConverter.copy)r�   rž   rŸ   ra   r™  r|   r˜  r|   rš  rœ  r�  rž  r    r|   r�   r|   r¡   r¢   r£   r¤   r›  r|   )rô   rO   r{   r²  r’  )rô   rO   rz   r³  r{   r³  r’   )rô   rO   r{   r¶  r“  )rô   rO   rz   r·  r{   r·  )r  r  r{   r¸  )r{   r   )r¼   r   r{   r¿  )r¼   r  r{   rÁ  )r¼   r  r{   rÌ  )r¼   r   r{   rÏ  )r¼   r  r{   rÒ  )r¼   r   r¢  r   r{   rT   )r¼   r   r¢  r   r{   rS   r‘  )r¼   r   r¢  r   rr  rÝ  r{   rU   )r¼   rÞ  r{   rß  )r¼   r   r{   rà  )	NNNNNNNNN)r�   rŒ  rŸ   r�  r™  rŽ  r˜  rŽ  rš  rã  r�  rä  r    rŽ  r�   rŽ  r›  rŽ  r{   r   )rr   rs   rt   ru   r”  rq  ra   rv   rÝ   r   r÷   r  r°  r§  r¬  r«  r¥  rª  r¯  r¦  r£  r¨  r©  r®  r­  rŠ  Ú__classcell__rx   rx   r$  ry   r_     sr    
ò 






	ÿÿü

ör_   r`   N)rz   r   r{   r|   )ŠÚ
__future__r   Úcollectionsr   r   Úcollections.abcr   r   r   râ  r   rá  Údataclassesr	   Úenumr
   Úinspectr   r   r~   Úpathlibr   Útypingr   r   r   r   r   r  r   r   r   rí   Útyping_extensionsr   Ú_compatr   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   Úcolsr7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   ÚdisambiguatorsrC   rD   rà   rE   rF   rG   rH   rI   rJ   rK   r]  rL   rM   rN   ÚfnsrO   rP   rQ   ÚgenrR   rS   rT   rU   rV   rW   rX   Úgen.typeddictsrÑ  rÀ  ÚliteralsrY   ÚtypealiasesrZ   r[   r\   Útypesr]   Ú__all__rb   rc   rd   rf   Ú__annotations__rg   rh   ri   rj   rk   rl   rm   rn   ro   ra   r†   r^   r_   r`   rx   rx   rx   ry   Ú<module>   sˆ    ”8%$	$	ÿþþþþ
      p   