ó
    pyüi„3  ã                  ó  • % S r SSKJr  SSKrSSKrSSKrSSKrSSKJ	r	  SSK
Jr  SSKJr  SSKJrJrJrJrJr  SSKJrJrJrJr  SS	KJrJr  S
SKJr  S
SKJr  S
SK J!r!J"r"  S
SKJ#r#  SSK$J%r%J&r&  SSK'J(r(  SSK)J*r*J+r+  SSK,J-r-  SSK.J/r/  SSK0J1r1  SSK2J3r3  SSK4J5r5  \(       a  SSK6J7r8  S
SK9J:r:   " S S\8\5      r; S&       S'S jjr<SSSS.           S(S  jjr=S)S! jr>S*S" jr?\@\A\R„                  \   4   rCS#\DS$'   \S+S% j5       rEg),z0Private logic for creating pydantic dataclasses.é    )ÚannotationsN)Ú	Generator)Úcontextmanager)Úpartial)ÚTYPE_CHECKINGÚAnyÚClassVarÚProtocolÚcast)Ú
ArgsKwargsÚSchemaSerializerÚSchemaValidatorÚcore_schema)Ú	TypeAliasÚTypeIsé   )ÚPydanticUndefinedAnnotation)Ú	FieldInfo)ÚPluggableSchemaValidatorÚcreate_schema_validator)ÚPydanticDeprecatedSince20é   )Ú_configÚ_decorators)Úcollect_dataclass_fields)ÚGenerateSchemaÚInvalidSchemaError)Úget_standard_typevars_map)Úset_dataclass_mocks)Ú
NsResolver)Úgenerate_pydantic_signature)ÚLazyClassAttribute)ÚDataclassInstance)Ú
ConfigDictc                  ót   • \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'   S\S'   S\S'   S\S'   \SS j5       rSrg)ÚPydanticDataclassé(   a!  A protocol containing attributes only available once a class has been decorated as a Pydantic dataclass.

Attributes:
    __pydantic_config__: Pydantic-specific configuration settings for the dataclass.
    __pydantic_complete__: Whether dataclass building is completed, or if there are still undefined fields.
    __pydantic_core_schema__: The pydantic-core schema used to build the SchemaValidator and SchemaSerializer.
    __pydantic_decorators__: Metadata containing the decorators defined on the dataclass.
    __pydantic_fields__: Metadata about the fields defined on the dataclass.
    __pydantic_serializer__: The pydantic-core SchemaSerializer used to dump instances of the dataclass.
    __pydantic_validator__: The pydantic-core SchemaValidator used to validate instances of the dataclass.
zClassVar[ConfigDict]Ú__pydantic_config__zClassVar[bool]Ú__pydantic_complete__z ClassVar[core_schema.CoreSchema]Ú__pydantic_core_schema__z$ClassVar[_decorators.DecoratorInfos]Ú__pydantic_decorators__zClassVar[dict[str, FieldInfo]]Ú__pydantic_fields__zClassVar[SchemaSerializer]Ú__pydantic_serializer__z4ClassVar[SchemaValidator | PluggableSchemaValidator]Ú__pydantic_validator__c                ó   • g ©N© ©Úclss    Ú\/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pydantic/_internal/_dataclasses.pyÚ__pydantic_fields_complete__Ú.PydanticDataclass.__pydantic_fields_complete__=   s   € Ø7:ó    r1   N)ÚreturnÚbool)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Úclassmethodr5   Ú__static_attributes__r1   r7   r4   r&   r&   (   sA   ‡ ñ
	ð 2Ó1Ø-Ó-Ø"BÓBØ!EÓEØ;Ó;Ø!;Ó;Ø TÓTà	Û:ó 
Û:r7   r&   c                ó:   • [        U 5      n[        XX1S9nX@l        g)zÆCollect and set `cls.__pydantic_fields__`.

Args:
    cls: The class.
    config_wrapper: The config wrapper instance.
    ns_resolver: Namespace resolver to use when getting dataclass annotations.
)Úns_resolverÚtypevars_mapÚconfig_wrapperN)r   r   r,   )r3   rE   rC   rD   Úfieldss        r4   Úset_dataclass_fieldsrG   A   s%   € ô -¨SÓ1€LÜ%Ø°<ñ€Fð %Õr7   TF)Úraise_errorsrC   Ú_force_buildc               ó²  • U R                   nSS jnU R                   S3Ul        X`l         UR                  U l        [	        XUS9  U(       d  UR
                  (       a  [        U 5        g[        U S5      (       a  [        R                  " S[        5        [        U 5      n[        UUUS9n[        S[        [        UU R                   UR"                  UR$                  S	S
95      U l         UR)                  U 5      n	UR/                  U R0                  S9n UR3                  U	5      n	[7        SU 5      n X�l        [;        X�U R<                  U R                  SX±R>                  5      U l         [C        X›5      U l"        S	U l#        g	! [*         a,  n
U(       a  e [        U SU
R,                   S35         Sn
A
gSn
A
ff = f! [4         a    [        U 5         gf = f)aJ  Finish building a pydantic dataclass.

This logic is called on a class which has already been wrapped in `dataclasses.dataclass()`.

This is somewhat analogous to `pydantic._internal._model_construction.complete_model_class`.

Args:
    cls: The class.
    config_wrapper: The config wrapper instance.
    raise_errors: Whether to raise errors, defaults to `True`.
    ns_resolver: The namespace resolver instance to use when collecting dataclass fields
        and during schema building.
    _force_build: Whether to force building the dataclass, no matter if
        [`defer_build`][pydantic.config.ConfigDict.defer_build] is set.

Returns:
    `True` if building a pydantic dataclass is successfully completed, `False` otherwise.

Raises:
    PydanticUndefinedAnnotation: If `raise_error` is `True` and there is an undefined annotations.
c                óR   • SnU nUR                   R                  [        X5      US9  g )NT)Úself_instance)r.   Úvalidate_pythonr   )Ú__dataclass_self__ÚargsÚkwargsÚ__tracebackhide__Úss        r4   Ú__init__Ú$complete_dataclass.<locals>.__init__v   s,   € Ø ÐØˆØ	× Ñ ×0Ñ0´¸DÓ1IÐYZÐ0Ò[r7   z	.__init__)rE   rC   FÚ__post_init_post_parse__zVSupport for `__post_init_post_parse__` has been dropped, the method will not be called)rC   rD   Ú__signature__T)ÚinitrF   Úvalidate_by_nameÚextraÚis_dataclassÚ`N)Útitleztype[PydanticDataclass]Ú	dataclass)rN   r&   rO   r   rP   r   r8   ÚNone)$rS   r<   Úconfig_dictr(   rG   Údefer_buildr   ÚhasattrÚwarningsÚwarnr   r   r   r"   r   r!   r,   rX   rY   rV   Úgenerate_schemar   ÚnameÚcore_configr:   Úclean_schemar   r   r*   r   r;   Úplugin_settingsr.   r   r-   r)   )r3   rE   rH   rC   rI   Úoriginal_initrS   rD   Ú
gen_schemaÚschemaÚerf   s               r4   Úcomplete_dataclassrm   U   sÃ  € ð: —L‘L€Mô\ð
  #×/Ñ/Ð0°	Ð:€HÔà„LØ,×8Ñ8€CÔä˜ÈÒUæ˜N×6×6Ü˜CÔ ØäˆsÐ.×/Ñ/Ü�ŠØdÜ%ô	
ô
 -¨SÓ1€LÜØØØ!ñ€Jô +ØÜÜ'ð Ø×*Ñ*Ø+×<Ñ<Ø ×&Ñ&Øñ		
ó€CÔðØ×+Ñ+¨CÓ0ˆð !×,Ñ,°3·<±<Ð,Ð@€KðØ×(Ñ(¨Ó0ˆô Ð(¨#Ó
.€Cà#)Ô Ü!8Ø�S—^‘^ S×%5Ñ%5°{ÀK×QoÑQoó"€CÔô #3°6Ó"G€CÔØ $€CÔØøô1 'ó ÞØÜ˜C 1 Q§V¡V H¨A Ô/Üûð	ûô ó Ü˜CÔ Ùðús*   Ã-F ÄF> Æ
F;Æ"F6Æ6F;Æ>GÇGc               óP   • SU R                   ;   =(       a    [        U S5      (       + $ )aJ  Returns `True` if the class is a stdlib dataclass and *not* a Pydantic dataclass.

Unlike the stdlib `dataclasses.is_dataclass()` function, this does *not* include subclasses
of a dataclass that are themselves not dataclasses.

Args:
    cls: The class.

Returns:
    `True` if the class is a stdlib dataclass, `False` otherwise.
Ú__dataclass_fields__r.   )Ú__dict__ra   r2   s    r4   Úis_stdlib_dataclassrq   Á   s#   € ð " S§\¡\Ñ1×`¼'À#ÐG_Ó:`Ô6`Ð`r7   c                ó2  • SU 0n[         R                  S:¼  a  U R                  b  U R                  US'   [         R                  S:¼  a  U R                  b  U R                  US'   U R                  SLa  U R                  US'   [
        R                  " S0 UD6$ )	NÚdefault)é   é   Údoc©rt   é
   Úkw_onlyTÚreprr1   )ÚsysÚversion_infoÚdescriptionry   rz   ÚdataclassesÚfield)Úpydantic_fieldÚ
field_argss     r4   Úas_dataclass_fieldr‚   Ð   s–   € Ø"+¨^Ð!<€Jô ×Ñ˜7Ó" ~×'AÑ'AÑ'MØ*×6Ñ6ˆ
�5Ñô ×Ñ˜7Ó" ~×'=Ñ'=Ñ'IØ .× 6Ñ 6ˆ
�9Ñð ×Ñ $Ò&Ø+×0Ñ0ˆ
�6Ñä×ÒÑ*˜zÑ*Ð*r7   r   ÚDcFieldsc           	   #  óÄ  #   • / nU R                   SS  GHf  nUR                  R                  S0 5      nUR                  5        VVs0 s Hu  u  pE[	        UR
                  [        5      (       d  M&  UR
                  R                  c6  UR
                  R                  (       d  UR
                  R                  SLd  Ms  XE_Mw     nnnU(       d  M»  UR                  X645        UR                  5        H…  u  pE[        [        UR
                  5      n[        R                  " U5      n[        R                  S:¼  a  UR                  (       a  SUl        UR                  SLa  UR                  Ul	        XƒU'   M‡     GMi      Sv •  U H"  u  pšU
R                  5        H	  u  pKX¹U'   M     M$     gs  snnf ! U H"  u  pšU
R                  5        H	  u  pKX¹U'   M     M$     f = f7f)a  Temporarily patch the stdlib dataclasses bases of `cls` if the Pydantic `Field()` function is used.

When creating a Pydantic dataclass, it is possible to inherit from stdlib dataclasses, where
the Pydantic `Field()` function is used. To create this Pydantic dataclass, we first apply
the stdlib `@dataclass` decorator on it. During the construction of the stdlib dataclass,
the `kw_only` and `repr` field arguments need to be understood by the stdlib *during* the
dataclass construction. To do so, we temporarily patch the fields dictionary of the affected
bases.

For instance, with the following example:

```python {test="skip" lint="skip"}
import dataclasses as stdlib_dc

import pydantic
import pydantic.dataclasses as pydantic_dc

@stdlib_dc.dataclass
class A:
    a: int = pydantic.Field(repr=False)

# Notice that the `repr` attribute of the dataclass field is `True`:
A.__dataclass_fields__['a']
#> dataclass.Field(default=FieldInfo(repr=False), repr=True, ...)

@pydantic_dc.dataclass
class B(A):
    b: int = pydantic.Field(repr=False)
```

When passing `B` to the stdlib `@dataclass` decorator, it will look for fields in the parent classes
and reuse them directly. When this context manager is active, `A` will be temporarily patched to be
equivalent to:

```python {test="skip" lint="skip"}
@stdlib_dc.dataclass
class A:
    a: int = stdlib_dc.field(default=Field(repr=False), repr=False)
```

!!! note
    This is only applied to the bases of `cls`, and not `cls` itself. The reason is that the Pydantic
    dataclass decorator "owns" `cls` (in the previous example, `B`). As such, we instead modify the fields
    directly (in the previous example, we simply do `setattr(B, 'b', as_dataclass_field(pydantic_field))`).

!!! note
    This approach is far from ideal, and can probably be the source of unwanted side effects/race conditions.
    The previous implemented approach was mutating the `__annotations__` dict of `cls`, which is no longer a
    safe operation in Python 3.14+, and resulted in unexpected behavior with field ordering anyway.
r   Nro   Trw   )Ú__mro__rp   ÚgetÚitemsÚ
isinstancers   r   r}   ry   rz   Úappendr   Úcopyr{   r|   )r3   Úoriginal_fields_listÚbaseÚ	dc_fieldsÚ
field_namer   Ú&dc_fields_with_pydantic_field_defaultsrs   Únew_dc_fieldrF   Úoriginal_fieldsÚoriginal_fields               r4   Úpatch_base_fieldsr“   å   s§  é € ðn =?Ðà—‘˜A˜B”ˆØ7;·}±}×7HÑ7HÐI_ÐacÓ7dˆ	ð &/§_¡_Ô%6ô2
â%6Ñ!�
Ü˜%Ÿ-™-¬×3ó ð —‘×*Ñ*Ñ6¸%¿-¹-×:O×:OÐSX×S`ÑS`×SeÑSeÐmqÐSqó	 ˆJÒÙ%6ð 	/ñ 2
÷ 2Ð1Ø ×'Ñ'¨Ð([Ô\Ø%K×%QÑ%QÖ%SÑ!�
Üœy¨%¯-©-Ó8�ô  $Ÿyšy¨Ó/�ô ×#Ñ# wÓ.°7·?·?Ø+/�LÔ(Ø—<‘< tÒ+Ø(/¯©�LÔ%Ø(4˜*Ó%ô &Tñ  ð04Ûã';Ñ#ˆFØ.=×.CÑ.CÖ.EÑ*�
Ø%3�zÓ"ó /Fò (<ùó32
øó2 (<Ñ#ˆFØ.=×.CÑ.CÖ.EÑ*�
Ø%3�zÓ"ó /Fò (<üs>   ‚AG Á%F-Á0A	F-Â=F-ÃG ÃB0G Æ F3 Æ/G Æ3*GÇG r0   )r3   ztype[StandardDataclass]rE   ú_config.ConfigWrapperrC   úNsResolver | Noner8   r^   )r3   ú	type[Any]rE   r”   rH   r9   rC   r•   rI   r9   r8   r9   )r3   r–   r8   zTypeIs[type[StandardDataclass]])r€   r   r8   zdataclasses.Field[Any])r3   r–   r8   zGenerator[None])Fr>   Ú
__future__r   Ú_annotationsrŠ   r~   r{   rb   Úcollections.abcr   Ú
contextlibr   Ú	functoolsr   Útypingr   r   r	   r
   r   Úpydantic_corer   r   r   r   Útyping_extensionsr   r   Úerrorsr   rF   r   Úplugin._schema_validatorr   r   r   Ú r   r   Ú_fieldsr   Ú_generate_schemar   r   Ú	_genericsr   Ú_mock_val_serr   Ú_namespace_utilsr    Ú
_signaturer!   Ú_utilsr"   Ú	_typeshedr#   ÚStandardDataclassÚconfigr$   r&   rG   rm   rq   r‚   ÚdictÚstrÚFieldrƒ   r?   r“   r1   r7   r4   Ú<module>r¯      s1  ðÚ 6å 2ã Û Û 
Û Ý %Ý %Ý ß ?Õ ?÷ó ÷ 0å 0Ý ß XÝ 0ß "Ý -ß @Ý 0Ý .Ý (Ý 3Ý &æÝ@å#ô;Ð-¨xô ;ð8 &*ð%Ø	 ð%à)ð%ð #ð%ð 
õ	%ð0 Ø%)ØñiØ	ðià)ðið ð	ið
 #ðið ðið 
õiôXaô+ð$ ˜3 × 1Ñ 1°#Ñ 6Ð6Ñ7€ˆ)Ó 7ð óU4ó ñU4r7   