+
    7*im  c                  s^   R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
HtHtHt ^ RIHt ^ RIHtHtHtHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^RIH t  ^RI!H"t"H#t# ^RI$H%t% ^RI&H't' ^RI(H)t)H*t* ^RI+H,t, ^RI-H.t. ^RI/H0t0H1t1 ]'       d!   ^ RI2H3t3 ^RI4H5t5 ^RI6H7t7 ^RI8H9t9H:t: ^RI;H<t<  ! R R].4      t=R R lt>]	R R l4       t?R  R! lt@R:R" R# lltAR$ R% ltBR& R' ltCR( R) ltD0 R;mtE0 R<mtFR*R/R+ R, lltGR- R. ltHR/RR*R/R0 R1 lltIR2 R3 ltJR4 R5 ltKR6 R7 ltLR8 R9 ltMR# )=zmPrivate logic related to fields (the `Field()` function and `FieldInfo` class), and arguments to `Annotated`.)annotationsN)Mapping)cache)	Parameterismethoddescriptor	signature)Pattern)TYPE_CHECKINGAnyCallableTypeVar)PydanticUndefined)TypeIs)AnnotationSource)PydanticDeprecatedSince211)PydanticUserError)AliasGenerator)	_generics_typing_extra)ConfigWrapper)extract_docstrings_from_cls)import_cached_base_modelimport_cached_field_info)
NsResolver)Representation)can_be_positionalget_first_not_noneBaseMetadata)	FieldInfo)	BaseModel)PydanticDataclassStandardDataclass)DecoratorInfosc                  s    ] tR t^&tRtRtRtR# )PydanticMetadataz0Base class for annotation markers like `Strict`. N)__name__
__module____qualname____firstlineno____doc__Z	__slots____static_attributes__r#       ?/usr/lib/python3.14/site-packages/pydantic/_internal/_fields.pyr"   r"   &   s
    :Ir*   r"   c                    V ^8  d   QhRRRR/# )   metadatar   returnr   r#   Zformat   "r+   __annotate__r2   ,   s     	- 	-# 	-, 	-r*   c                 s"    \        4       ! V 4      # )zCreate a new `_PydanticGeneralMetadata` class with the given metadata.

Args:
    **metadata: The metadata to add.

Returns:
    The new `_PydanticGeneralMetadata` class.
)_general_metadata_cls)r.   s   ,r+   pydantic_general_metadatar4   ,   s     !"8,,r*   c                   V ^8  d   QhRR/# )r-   r/   ztype[BaseMetadata]r#   r0   r1   r+   r2   r2   9   s     
$ 
$1 
$r*   c                 s2    ^ RI Hp   ! R R\        V 4      pV# )zCDo it this way to avoid importing `annotated_types` at import time.r   c                  s&    ] tR t^=tRtR R ltRtR# )7_general_metadata_cls.<locals>._PydanticGeneralMetadataz,Pydantic general metadata like `max_digits`.c               r5   )r-   r.   r   r#   r0   r1   r+   r2   ZD_general_metadata_cls.<locals>._PydanticGeneralMetadata.__annotate__@   s     	% 	%S 	%r*   c                	s    Wn         R # N__dict__)Zselfr.   s   &&r+   __init__Z@_general_metadata_cls.<locals>._PydanticGeneralMetadata.__init__@   s    $Mr*   r8   N)r$   r%   r&   r'   r(   r:   r)   r#   r*   r+   _PydanticGeneralMetadatar6   =   s    :	% 	%r*   r;   )annotated_typesr   r"   )r   r;   s     r+   r3   r3   8   s     -%#3\ % $#r*   c          
     s,    V ^8  d   QhRRRRRRRRRR	/# )
r-   protected_namespacesztuple[str | Pattern[str], ...]ann_namestrbasesztuple[type[Any], ...]cls_namer/   Noner#   r0   r1   r+   r2   r2   F   s:     ( (8(( !( 	(
 
(r*   c                sf   \        4       pV  EF  pR p\        V\        4      '       d   VP                  V4      RJpM'\        V\        4      '       d   VP                  V4      pV'       g   Ka  V FY  p\        Wq4      '       g   K  \        Wt4      '       d   V\        VR/ 4      9   d   K;  \        RV: R\        Wq4       RV: R24      h	  . pV  F  p	\        V	\        4      '       d<   V	P                  V4      '       g#   VP                  RV	P                  : R24       KR  KT  VP                  V	4      '       d   Km  VP                  R	V	 R	24       K  	  R
RP                  V4       \        V4      ^8X  d   RMR 2p
\        P                  ! RV: RV: RV: RV
 R2	\         ^R7       EK  	  R# )FN__pydantic_fields__Field z conflicts with member z of protected namespace Z.zre.compile(Z)Z'Z(z, z,)z in z$ conflicts with protected namespace zX.

You may be able to solve this by setting the 'protected_namespaces' configuration to 
stacklevel)r   
isinstancer   Zmatchr?   
startswithhasattrZ
issubclassgetattr
ValueErrorZappendZpatternZjoinlenwarningswarnUserWarning)r=   r>   r@   rA   r   Zprotected_namespaceZns_violationZbZvalid_namespacesZpnZvalid_namespaces_strs   &&&&       r+   _check_protected_namespacesrP   F   s    )*I3)733.44X>dJL+S11#../BCL<1''&q44WQPegiEj9j($XL0GPQH\G]67J6MQP   /1 .B!"g..!xx11,33k"**q4QR  2  (22266,33at1I> / *+4995E+F*GPSTdPeijPjpsGt'u$XLXL8\]p\s tl mA  lB  BCD 	 7  4r*   c               (    V ^8  d   QhRRRRRRRR/# )	r-   clsz	type[Any]fieldsdict[str, FieldInfo]use_inspectboolr/   rB   r#   r0   r1   r+   r2   r2   q   s+     ; ;	 ;;O ;^b ;os ;r*   c                s    \        WR 7      pVP                  4        F*  w  rEVP                  e   K  WC9   g   K  W4,          Vn        K,  	  R# )rU   N)r   itemsdescription)rR   rS   rU   Zfields_docsr>   
field_info   &&&   r+   _update_fields_from_docstringsr\   q   s;    -cKK &!!)h.E%0%:J" !/r*   c               $    V ^8  d   QhRRRRRR/# )r-   title_generatorzCallable[[str, FieldInfo], str]
field_namer?   rZ   r   r#   r0   r1   r+   r2   r2   x   s&     
! 
!4
!
! 
!r*   c                s    VP                   fB   V ! W4      p\        V\        4      '       g   \        RV  RVP                   24      hW2n         R # R # )Nzfield_title_generator  must return str, not )titlerG   r?   	TypeError	__class__)r^   r_   rZ   ra      &&& r+   *_apply_field_title_generator_to_field_infore   x   sU    
 
7%%%4_4EE[\a\k\k[lmnn   r*   c               r]   )r-   alias_generatorz%Callable[[str], str] | AliasGeneratorr_   r?   rZ   r   r#   r0   r1   r+   r2   r2      s)     /V /V:/VHK/VYb/Vr*   c                s   VP                   e=   VP                   ^8:  g,   VP                  e   VP                  e   VP                  Ef,   RRRrTp\	        V \
        4      '       d   V P                  V4      w  r4pMJ\        V 4      '       d:   V ! V4      p\	        V\        4      '       g   \        RV  RVP                   24      hVP                   e   VP                   ^8:  d   ^Vn         VP                   ^8X  d'   \        WS4      Vn        \        WC4      Vn        W2n        VP                  f   W2n        VP                  f   \        WS4      Vn        VP                  f   \        WC4      Vn        R# R# R# )ab  Apply an alias generator to aliases on a `FieldInfo` instance if appropriate.

Args:
    alias_generator: A callable that takes a string and returns a string, or an `AliasGenerator` instance.
    field_name: The name of the field from which to generate the alias.
    field_info: The `FieldInfo` instance to which the alias generator is (maybe) applied.
Nzalias_generator r`   )Zalias_priorityaliasvalidation_aliasserialization_aliasrG   r   Zgenerate_aliasesZcallabler?   rb   rc   r   )rf   r_   rZ   rg   rh   ri   r[   r+   $_apply_alias_generator_to_field_inforj      s^    	!!)$$)#&&.))17;T4!4o~66;J;[;[\f;g8E%8o&&#J/EeS))"2?2CCYZ_ZiZiYj kll
 $$,
0I0IQ0N()J% $$)-?@S-[J**<=M*UJ'$ #$))1-?@S-[J*&&.*<=M*UJ' /9 2r*   c               rQ   )	r-   config_wrapperr   r_   r?   rZ   r   r/   rB   r#   r0   r1   r+   r2   r2      s0     e e] e eYb egk er*   c                s    VP                   ;'       g    V P                   pVe   \        W1V4       V P                  e   \        V P                  W4       R# R# )aX  Update the `FieldInfo` instance from the configuration set on the model it belongs to.

This will apply the title and alias generators from the configuration.

Args:
    config_wrapper: The configuration from the model.
    field_name: The field name the `FieldInfo` instance is attached to.
    field_info: The `FieldInfo` instance to update.
N)field_title_generatorre   rf   rj   )rk   r_   rZ   rl   rd   r+   update_field_from_configrm      sQ     '<<dd@d@d(23HV`a%%1,^-K-KZd 2r*   typevars_mapc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r-   rR   type[BaseModel]rk   r   ns_resolverNsResolver | Nonern   zMapping[TypeVar, Any] | Noner/   z%tuple[dict[str, FieldInfo], set[str]]r#   r0   r1   r+   r2   r2      sA     D D	D!D #D
 /D +Dr*   c               s
  aa \        4       p\        4       oV P                  p/ p\        V4       F+  p\	        VRR4      ;p'       g   K  VP                  V4       K-  	  \        P                  ! WR7      p	\        P                  ! V 4      p
/ p\        4       pV	P                  4        EF  w  pw  rVR8X  d   K  \        VP                  VVV P                  R7       \        P                  ! V4      '       d   VP                  V4       Kd  \	        W\         4      oS\         Jd   \"        ;QJ d$    VV3R l\$         4       F  '       g   K   RM	  RM! VV3R l\$         4       4      '       g]   \'        SR	4      '       dQ   \"        ;QJ d$    VV3R
 l\(         4       F  '       g   K   RM	  RM! VV3R
 l\(         4       4      '       d   \         o\+        V4      '       g   EK>  V P,                  '       d   VR8w  d   \/        RV: R24      h\	        V R/ 4      P1                  R4      pV F  p\2        P4                  ! V4      '       d   \2        P6                  ! V4      MR! Uu0 uF  pVP8                  kK  	  pp\'        W}4      '       g   Kc  VVJ d   Kk  VV9   d   Kt  W9  d   K|  \:        P<                  ! RV RV P>                   RVP>                   R2\@        ^R7       K  	  S\         J d^   W9   g   W9  d:   VPC                  V\D        PF                  R7      pV'       g   RVn$        VVn%        EM(Wm,          PM                  4       pEM\O        SV4      '       dN   \Q        SPR                  4      '       d3   SPR                  PU                  RV 4      pVSn)        VSPV                  R&   VPY                  VS\D        PF                  R7      pSVn-        V'       g   RVn$        VVn%        MeRVP\                  9   dU   VP_                  4       '       g?   \:        P<                  ! RV: RV: RV: R2\`        ^R7       VP                  V4       EK   \c        W4       V Pf                  R,          pVVPh                  9   d   \k        RV: RV P                  : R 24      hVW&   VPH                  '       g   EK  \m        WV4       EK!  	  V'       d=   VPo                  4        F(  pVPH                  '       g   K  VPq                  V4       K*  	  VPr                  '       d   \u        W4       W3# u upi   \d         d     Li ; i)"a  Collect the fields and class variables names of a nascent Pydantic model.

The fields collection process is *lenient*, meaning it won't error if string annotations
fail to evaluate. If this happens, the original annotation (and assigned value, if any)
is stored on the created `FieldInfo` instance.

The `rebuild_model_fields()` should be called at a later point (e.g. when rebuilding the model),
and will make use of these stored attributes.

Args:
    cls: BaseModel or dataclass.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting model annotations.
    typevars_map: A dictionary mapping type variables to their concrete types.

Returns:
    A two-tuple containing model fields and class variables names.

Raises:
    NameError:
        - If there is a conflict between a field name and protected namespaces.
        - If there is a field other than `root` in `RootModel`.
        - If a field shadows an attribute in the parent model.
rC   N)rq   Zmodel_config)r=   r>   r@   rA   c              3  sB   <"   T F  p\        SVR 4      SJ x  K  	  R # 5ir7   )rJ   Z.0Z	depr_name
BaseModel_assigned_value   & r+   	<genexpr>'collect_model_fields.<locals>.<genexpr>  s!     qXp9
It4FXps   TF__func__c              3  sl   <"   T F)  p\        \        SVR 4      RR 4      SP                  J x  K+  	  R # 5i)Nry   )rJ   ry   rs   rv   r+   rw   rx   "  s6      %B	 GJ	4@*dSWeWnWnn%Bs   14ZrootzUnexpected field with name z4; only 'root' is allowed as a field of a `RootModel`Z__pydantic_generic_metadata__ZoriginzField name "z" in "z"" shadows an attribute in parent "Z"rE   Z_sourcedefaultZfinalzAnnotation z= is marked as final and has a default value. Pydantic treats zz as a class variable, but it will be considered as a normal field in V3 to be aligned with dataclasses. If you still want zV to be considered as a class variable, annotate it as: `ClassVar[<type>] = <default>.`)ZcategoryrF   Z__pydantic_decorators__rD   z
 of class zf overrides symbol of same name in a parent class. This override with a computed_field is incompatible.r#   );r   r   Z	__bases__reversedrJ   Zupdater   Zget_model_type_hintssafe_get_annotationsZsetrX   rP   r=   r$   is_classvar_annotationZaddr   Zany_deprecated_method_namesrI   _deprecated_classmethod_namesis_valid_field_nameZ__pydantic_root_model__Z	NameErrorZgetdataclassesis_dataclassrS   namerM   rN   r&   rO   from_annotationr   CLASS	_complete_original_annotationZ_copyrG   r   r{   Z__get__Z_attributes_setfrom_annotated_attribute_original_assignmentZ_qualifiersZis_requiredr   ZdelattrZAttributeErrorr9   Zcomputed_fieldsrb   rm   valuesapply_typevars_mapuse_attribute_docstringsr\   )rR   rk   rq   rn   
FieldInfo_r@   Zparent_fields_lookupbaseZmodel_fieldsZ
type_hintsr    rS   Z
class_varsr>   ann_type	evaluatedZgeneric_originfielddataclass_fieldsrZ   r{   Z
decoratorsrt   ru   s   &&&$                  @@r+   collect_model_fieldsr      s   > *+J)+JMME13"4)>EE<EE ''5   33CQJ  44S9K#%F5J+5+;+;+=''8~% #!/!D!D\\		
 //99NN8$ 0AB!22CqXpqCCCqXpqqq 
33C %BCCC %B   /N"8,,&&&8v+=-h\9mn  !&ErJNNxXDEPE]E]^bEcEc););D)Aik)k )ku

)k    t&&>)// ."8*F33C3C2D E))*!- 	% 2 ..&(*N (77JZJ`J`7a
 +0J( 7?J3 2;AAC
 .*55:L^McMc:d:d )0088sC)0&<C..y9#<<X~_o_u_u<vJ /=J+',
$2:
/J222:;Q;Q;S;S!(-jksjv w""*  .DE 8  x(
& &)\\2K%L
z111Js||.> ?G G  &$^zJU ,>X ]]_E((6 % ...&s3M \ " s   &T/T44UUc          
     ro   )r-   rR   rp   rk   r   rq   r   rn   Mapping[TypeVar, Any]r/   rT   r#   r0   r1   r+   r2   r2     s<     * *	* "* 	*
 (* *r*   c          	     s   \        4       p/ pVP                  V 4      ;_uu_ 4        V P                  P                  4        F  w  rgVP                  '       d   WuV&   K  VP
                  p\        P                  ! VP                  .VP                  O5!  p	\        P                  ! W4      p	VP                  ;p
\        J d#   VP                  V	\        P                   R7      pM!VP#                  W\        P                   R7      pVP
                  e   VP
                  MTVn        \%        WV4       WV&   K  	  RRR4       V#   + '       g   i     T# ; i)a  Rebuild the (already present) model fields by trying to reevaluate annotations.

This function should be called whenever a model with incomplete fields is encountered.

Raises:
    NameError: If one of the annotations failed to evaluate.

Note:
    This function *doesn't* mutate the model fields in place, as it can be called during
    schema generation, where you don't want to mutate other model's fields.
rz   N)r   pushrC   rX   r   rY   r   	eval_typer   types_namespacer   replace_typesr   r   r   r   r   r   rm   )rR   rk   rq   rn   r   rebuilt_fieldsf_namerZ   existing_descannZassign	new_fields   &$$$        r+   rebuild_model_fieldsr     s/   $ *+J+-N			#		"%"9"9"?"?"AF###)3v& * 6 6#--33 00  --c@(===FBSS * : :3HXH^H^ : _I * C CCYiYoYo C pIAJAVAVAb	(=(=hu	%(K)2v&% #B 
* + 
	* s   DEE	rq   c          
     ro   )r-   rR   ztype[StandardDataclass]rk   r   rq   rr   rn   zdict[Any, Any] | Noner/   rT   r#   r0   r1   r+   r2   r2     sC     i i	 i "i #	i
 (i ir*   c               s(   \        4       p/ pT;'       g    \        4       pV P                  p\        V P                  4       EFW  p\
        P                  ! V4      '       g   K"  VP                  V4      ;_uu_ 4        VP                  4        EF  w  r\        P                  ! V4      p
W9  d   K$  VP                  w  r\        P                  ! V	P                  W4      w  r\        P                  ! V4      '       d   Ks  V	P                  '       g?   V	P                   \
        P"                  J d!   V	P$                  \
        P"                  J d   K  \'        V	P                   V4      '       d   V	P                   P(                  '       d/   V	P                   P                  RJ d   \+        RV R2RR7      hEK)  VP-                  WP                   \.        P0                  R7      pV	P                   Vn        M'VP-                  W\.        P0                  R7      pWn        V'       g   RVn        Wn        WV&   \9        WV4       VP                   \:        Jg   EK  \'        \=        WV4      V4      '       g   EK  \?        WVP                   4       EK  	  RRR4       EKZ  	  V'       d)   VPA                  4        F  pVPC                  V4       K  	  VPD                  '       d   \G        V V\I        V R4      '       * R	7       V#   + '       g   i     EK  ; i)
aX  Collect the fields of a dataclass.

Args:
    cls: dataclass.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting dataclass annotations.
        Defaults to an empty instance.
    typevars_map: A dictionary mapping type variables to their concrete types.

Returns:
    The dataclass fields.
FzDataclass field zD has init=False and init_var=True, but these are mutually exclusive.zclashing-init-and-init-var)Zcoderz   NZ__is_pydantic_dataclass__rW   )%r   r   Z__dataclass_fields__r|   Z__mro__r   r   r   rX   r   r}   r   Ztry_eval_typeZtyper~   Zinitr{   ZMISSINGdefault_factoryrG   Zinit_varr   r   r   	DATACLASSr   r   r   rm   r   rJ   Zsetattrr   r   r   r\   rI   )rR   rk   rq   rn   r   rS   r   r   r>   Zdataclass_fieldZ	base_annsZglobalnsZlocalnsr   r   rZ   r   s   &$$$             r+   collect_dataclass_fieldsr     s   & *+J#%F--K//
 %''--d##-=-C-C-E))>>tD	, $/$?$?!&3&A&A/BVBVX`&j# 77AA (,,,'//;3F3FF'77;;N;NN o55zBB&..777*22775@"3"28*  =A  !B%A#  !!+!D!D "9"9CSC]C] "E "J 7F6M6MJ3!+!D!D ;K;U;U "E "J 7F3 +0J(6>3#-x (:N%%->>:C:6
D D C:+=+=>m .F $#	 &z ]]_E $$\2	 % ...& $C)DEE	
 MS $##s-   =BK?A5K?	BK?#.K?K?6K??Lc          
     ro   )r-   rR   ztype[PydanticDataclass]rk   r   rq   r   rn   r   r/   rT   r#   r0   r1   r+   r2   r2   8  s<     + +	 + "+ 	+
 (+ +r*   c          	     sV   \        4       p/ pVP                  V 4      ;_uu_ 4        V P                  P                  4        F  w  rgVP                  '       d   WuV&   K  VP
                  p\        P                  ! VP                  .VP                  O5!  p	\        P                  ! W4      p	VP                  V	VP                  \        P                  R7      p
V
P
                  e   V
P
                  MTV
n        \!        WV
4       WV&   K  	  RRR4       V#   + '       g   i     T# ; i)a  Rebuild the (already present) dataclass fields by trying to reevaluate annotations.

This function should be called whenever a dataclass with incomplete fields is encountered.

Raises:
    NameError: If one of the annotations failed to evaluate.

Note:
    This function *doesn't* mutate the dataclass fields in place, as it can be called during
    schema generation, where you don't want to mutate other dataclass's fields.
rz   N)r   r   rC   rX   r   rY   r   r   r   r   r   r   r   r   r   r   rm   )rR   rk   rq   rn   r   r   r   rZ   r   r   r   s   &$$$       r+   rebuild_dataclass_fieldsr   8  s   $ *+J+-N			#		"%"9"9"?"?"AF###)3v& * 6 6#--33 00  --c@&??33,66 @ 	 BKAVAVAb	(=(=hu	%(K)2v&' #B 
, - 
	, s   C'DD(	c               r,   r-   r   r?   r/   rV   r#   r0   r1   r+   r2   r2   f  s     $ $c $d $r*   c                s.    V P                  R 4      '       * # )_rH   r      &r+   r   r   f  s    s###r*   c               r,   r   r#   r0   r1   r+   r2   r2   j  s     > >C >D >r*   c                s`    V P                  R 4      ;'       d    V P                  R4      '       * # )r   Z__r   r   r   r+   is_valid_privateattr_namer   j  s%    ??3==(=$==r*   c               r,   )r-   r   z3Callable[[], Any] | Callable[[dict[str, Any]], Any]r/   z'TypeIs[Callable[[dict[str, Any]], Any]]r#   r0   r1   r+   r2   r2   n  s      r rHr,rr*   c                s6    \        V 4      p\        TP                  P                  4       4      p\        T4      ^8H  ;'       d>    \        T^ ,          4      ;'       d$    T^ ,          P                  \        P                  J #   \        \        3 d     R# i ; i)zMWhether the provided default factory callable has a validated data parameter.F)r   rK   rb   Zlist
parametersr   rL   r   r{   r   Zempty)r   Zsigr   s   &  r+   takes_validated_data_argumentr   n  s    ( cnn++-.Jz?aqq$5jm$DqqTUI^I^bkbqbqIqq 	"  s   B BB)F>   ZcopyZdictZjsonZ_iterZ_calculate_keysZ_copy_and_set_values>
   ZschemaZfrom_ormZvalidateZ	constructZ	parse_objZ	parse_rawZ
_get_valueZ
parse_fileZschema_jsonZupdate_forward_refs)Nr(   Z
__future__r    Z_annotationsr   rM   Zcollections.abcr   Z	functoolsr   Zinspectr   r   r   Zrer   Ztypingr   r   r	   r
   Zpydantic_corer   Ztyping_extensionsr   Ztyping_inspection.introspectionr   Zpydanticr   Zpydantic.errorsr   Zaliasesr   Z r   r   Z_configr   Z_docs_extractionr   Z_import_utilsr   r   Z_namespace_utilsr   Z_reprr   Z_utilsr   r   r<   r   rS   r   Zmainr   Z_dataclassesr   r    Z_decoratorsr!   r"   r4   r3   rP   r\   re   rj   rm   r   r   r   r   r   r   r   r   r   r#   r*   r+   <module>r      s    s 2   #  < <  8 8 + $ < / - $ & " 9 M ( ! 9," B+~ 	- 
$ 
$(V;
!/Vde" h ! D
 26DN*Zi &*	i
 +/iX+\$>rr*   