
    if3                       % 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    g/var/www/html/qgis-automation/mouza_env/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)zCollect 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1L%<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 Xl        [;        XU R<                  U R                  SXR>                  5      U l         [C        X5      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D1IYZ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   : LLM\
  #//0	:HL,88CUN66C s.//d%	

 -S1L!J +' **+<< &&		
C++C0 !,,3<<,@K((0 (#
.C#) !8S^^S%5%5{KQoQo"C #36"GC $C1 ' C1QVVHA/	  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                &   SU 0n[         R                  S:  a  U R                  b  U R                  US'   [         R                  S:  a  U R                  (       a  SUS'   U R                  SLa  U R                  US'   [
        R                  " S0 UD6$ )	Ndefault)      docrt   
   Tkw_only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"~'='= $
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	        XU'   M     GMi      Sv   U H"  u  pU
R                  5        H	  u  pKXU'   M     M$     gs  snnf ! U H"  u  pU
R                  5        H	  u  pKXU'   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 =?AB7;}}7H7HI_ac7d	 &/__%62
%6!
%--3  **6%--:O:OSXS`S`SeSemqSq	 J%6 	/ 2
 21 ''([\%K%Q%Q%S!
y%--8  $yy/ ##w.7??+/L(<<t+(/L%(4*% &T  04';#F.=.C.C.E*
%3z" /F (<32
2 (<#F.=.C.C.E*
%3z" /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   