
    h"                        % S SK Jr  S SKJrJr  S SKJr  S SKJrJ	r	J
r
Jr  S SKJr  SrS\S'    " S	 S
\5      r " S S\5      r\ " S S5      5       rSS jrSS jrSS jrSS jrg)    )annotations)	dataclassfield)	TypedDict)ComputedField
CoreSchemaDefinitionReferenceSchema	SerSchema)	TypeAliasz&CoreSchema | SerSchema | ComputedFieldr   
AllSchemasc                  0    \ rS rSr% SrS\S'    S\S'   Srg)	GatherResult   zSchema traversing result.+dict[str, DefinitionReferenceSchema | None]collected_referenceslist[CoreSchema]deferred_discriminator_schemas N)__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r       S/var/www/html/env/lib/python3.13/site-packages/pydantic/_internal/_schema_gather.pyr   r      s    #EE %54Qr   r   c                  "    \ rS rSrSrSS jrSrg)MissingDefinitionError   z7A reference was pointing to a non-existing core schema.c                   Xl         g )Nschema_reference)selfr#   s     r   __init__MissingDefinitionError.__init__   s     0r   r"   N)r#   strreturnNone)r   r   r   r   r   r%   r   r   r   r   r   r      s
    A1r   r   c                  X    \ rS rSr% SrS\S'    \" S\S9rS\S'    \" S\	S9r
S	\S
'   Srg)GatherContext#   zyThe current context used during core schema traversing.

Context instances should only be used during schema traversing.
dict[str, CoreSchema]definitionsF)initdefault_factoryr   r   r   r   r   N)r   r   r   r   r   r   r   listr   dictr   r   r   r   r   r+   r+   #   sI    
 '&$7<%Y]7^"$4^
 INSXjnHoEor   r+   c                r    U R                  S5      nUb#  SU;   a  UR                  R                  U 5        g g g )Nmetadata%pydantic_internal_union_discriminator)getr   append)schemactxmetas      r   traverse_metadatar;   ?   s;    ::j!DCtK**11&9 Lr   c                   U S   nX!R                   ;  ac  UR                  R                  U5      nUc  [        U5      eXR                   U'   [	        X15        SU ;   a  [	        U S   U5        [        X5        g S UR                   U'   g )N
schema_refserialization)r   r.   r6   r   traverse_schemar;   )def_ref_schemar9   r=   
definitions       r   traverse_definition_refrB   E   s    -J111__((4
(44 0>  ,
(n,N?;SA.. 04  ,r   c                   U S   nUS:X  a  [        X5        g US:X  a(  [        U S   U5        U S    H  n[        X15        M     GO'US;   a  SU ;   a  [        U S   U5        GO
US:X  a  SU ;   a  U S    H  n[        XA5        M     GOUS:X  a,  S	U ;   a  [        U S	   U5        S
U ;   a  [        U S
   U5        GOUS:X  a?  U S    H4  n[        U[        5      (       a  [        US   U5        M)  [        XQ5        M6     GOnUS:X  a'  U S   R	                  5        H  n[        Xa5        M     GOAUS:X  a  U S    H  n[        Xq5        M     GO"US:X  a   [        U S   U5        [        U S   U5        GOUS:X  a   [        U S   U5        [        U S   U5        GOUS;   aY  SU ;   a  [        U S   U5        SU ;   a  U S    H  n[        XA5        M     U S   R	                  5        H  n[        XA5        M     GOwUS:X  a6  SU ;   a  U S    H  n[        XA5        M     U S    H  n[        XA5        M     GO;US:X  aF  U S    H  n[        US   U5        M     SU ;   a  [        U S   U5        SU ;   a  [        U S   U5        OUS :X  a  U S    H  n[        US   U5        M     OUS!:X  a%  [        U S   U5        S"U ;   a  [        U S"   U5        OUS#:X  a  [        U S"   U5        OUS$:X  a+  S"U ;   a  [        U S"   U5        S%U ;   a  [        U S%   U5        O[US&:X  a@  S"U ;   a  [        U S"   U5        SU ;   a  [        U S   U5        S%U ;   a  [        U S%   U5        OSU ;   a  [        U S   U5        S'U ;   a  [        U S'   U5        [        X5        g )(Ntypezdefinition-refr.   r8   >   setr1   	frozenset	generatoritems_schematupler2   keys_schemavalues_schemaunionchoicesr   ztagged-unionchainstepszlax-or-strict
lax_schemastrict_schemazjson-or-pythonjson_schemapython_schema>   
typed-dictmodel-fieldsextras_schemacomputed_fieldsfieldszdataclass-args	argumentsarguments_schemavar_args_schemavar_kwargs_schemazarguments-v3callreturn_schemazcomputed-fieldzfunction-plainjson_schema_input_schemazfunction-wrapr>   )rB   r?   
isinstancerI   valuesr;   )r8   contextschema_typerA   schoicevsteps           r   r?   r?   Z   s    .K&&0		%x('2 /JJ0 0	A	AV#F>2G<		V#N++ ,		F"F=17;f$F?3W=		Y'F&%((q	730	 (
 
	&	"))+AA' ,		7ODD* $		'|,g6/9	(	(}-w7/9	6	6f$F?3W=&-.+ /!((*AA' +	(	(&-.+ /!AA' "		#*+AAhK1 ,&F#45w?&(F#67A		&*+AAhK1 ,		12G<f$F?3W=	(	(/9	(	(f$F?3W=%/F#=>H		'f$F?3W=vF8,g6%/F#=>HvF8,g6& /9f&r   c                `    [        U5      n[        X5        UR                  UR                  S.$ )aA  Traverse the core schema and definitions and return the necessary information for schema cleaning.

During the core schema traversing, any `'definition-ref'` schema is:

- Validated: the reference must point to an existing definition. If this is not the case, a
  `MissingDefinitionError` exception is raised.
- Stored in the context: the actual reference is stored in the context. Depending on whether
  the `'definition-ref'` schema is encountered more that once, the schema itself is also
  saved in the context to be inlined (i.e. replaced by the definition it points to).
)r   r   )r+   r?   r   r   )r8   r.   rb   s      r   gather_schemas_for_cleaningri      s4     K(GF$ !( < <*1*P*P r   N)r8   r   r9   r+   r(   r)   )r@   r	   r9   r+   r(   r)   )r8   r   rb   r+   r(   r)   )r8   r   r.   r-   r(   r   )
__future__r   dataclassesr   r   typingr   pydantic_core.core_schemar   r   r	   r
   typing_extensionsr   r   r   r   LookupErrorr   r+   r;   rB   r?   ri   r   r   r   <module>rp      sj    " (  e e '@
I @R9 R1[ 1   6:4*^'Br   