
    Ѯh=1                    `   d dl mZ d dlZd dlmZ d dlmZmZm	Z	m
Z
 d dlmZ d dlmZ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 ddlmZ eseZerddlmZ ddlmZm Z  dZ! G d d      Z" G d d      Z# ed'i dddddddddd ddddddddddddddd dd!d"d#dd$dd%dd&d'd(d"d)dd*dd+d,d-d.d/d0d1d2d3dd4dd5d6d7dd8dd9dd:d;d<dd=dd>dd?dd@ddAdBdCddDddEd"Z$dJdFZ% e&ejN                  jQ                               Z)h dGZ*ddddd&ddd d)d3dH
Z+dKdIZ,y)L    )annotationsN)contextmanager)TYPE_CHECKINGAnyCallablecast)core_schema)LiteralSelf   )AliasGenerator)
ConfigDictExtraValuesJsonDictJsonEncoderJsonSchemaExtraCallable)PydanticUserError)PydanticDeprecatedSince20)GenerateSchema)ComputedFieldInfo	FieldInfozGSupport for class-based `config` is deprecated, use ConfigDict instead.c                     e Zd ZU dZdZded<   ded<   ded<   ded	<   ded
<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded<   ded <   d!ed"<   d#ed$<   ded%<   d&ed'<   d(ed)<   d*ed+<   d,ed-<   ded.<   ded/<   d0ed1<   ded2<   ded3<   d4ed5<   d6ed7<   d8ed9<   ded:<   d;ed<<   ded=<   d>ed?<   ded@<   dedA<   dBedC<   dDdEdLdFZedMdG       Ze	sdNdHZ
dOdIZdJ ZyK)PConfigWrapperzIInternal wrapper for Config which exposes ConfigDict items as attributes.)config_dictr   r   z
str | Nonetitleboolstr_to_lowerstr_to_upperstr_strip_whitespaceintstr_min_lengthz
int | Nonestr_max_lengthzExtraValues | Noneextrafrozenpopulate_by_nameuse_enum_valuesvalidate_assignmentarbitrary_types_allowedfrom_attributesloc_by_aliasz,Callable[[str], str] | AliasGenerator | Nonealias_generatorzCallable[[type], str] | Nonemodel_title_generatorz:Callable[[str, FieldInfo | ComputedFieldInfo], str] | Nonefield_title_generatorztuple[type, ...]ignored_typesallow_inf_nanz)JsonDict | JsonSchemaExtraCallable | Nonejson_schema_extraz&dict[type[object], JsonEncoder] | Nonejson_encodersstrictz0Literal['always', 'never', 'subclass-instances']revalidate_instanceszLiteral['iso8601', 'float']ser_json_timedeltazLiteral['utf8', 'base64']ser_json_bytesz'Literal['null', 'constants', 'strings']ser_json_inf_nanvalidate_defaultvalidate_returnztuple[str, ...]protected_namespaceshide_input_in_errorsdefer_buildz,tuple[Literal['model', 'type_adapter'], ...]experimental_defer_build_modezdict[str, object] | Noneplugin_settingsztype[GenerateSchema] | Noneschema_generator+json_schema_serialization_defaults_requiredz,Literal['validation', 'serialization', None]json_schema_mode_overridecoerce_numbers_to_strz"Literal['rust-regex', 'python-re']regex_enginevalidation_error_causeuse_attribute_docstringsz%bool | Literal['all', 'keys', 'none']cache_stringsTcheckc               T    |rt        |      | _        y t        t        |      | _        y N)prepare_configr   r   r   )selfconfigrG   s      l/home/www/academy-backend.kofcorporation.com/venv/lib/python3.12/site-packages/pydantic/_internal/_config.py__init__zConfigWrapper.__init__\   s!    -f5D#J7D    c                   t               }|D ]1  }t        |dd      }|s|j                  |j                                3 |j	                  d      }|j	                  d      }|j	                  di       }	|	j	                  d      r|st        dd      |r|rt        dd	      |xs t        |      }
|j                  |
       t        |j                               D ]  }|t        v s|j                  |      ||<   !  | |      S )
a  Build a new `ConfigWrapper` instance for a `BaseModel`.

        The config wrapper built based on (in descending order of priority):
        - options from `kwargs`
        - options from the `namespace`
        - options from the base classes (`bases`)

        Args:
            bases: A tuple of base classes.
            namespace: The namespace of the class being created.
            kwargs: The kwargs passed to the class being created.

        Returns:
            A `ConfigWrapper` instance for `BaseModel`.
        model_configNConfig__annotations__z``model_config` cannot be used as a model field name. Use `model_config` for model configuration.zmodel-config-invalid-field-name)codez3"Config" and "model_config" cannot be used togetherzconfig-both)r   getattrupdatecopygetr   rJ   listkeysconfig_keyspop)clsbases	namespacekwargs
config_newbaserL   config_class_from_namespaceconfig_dict_from_namespaceraw_annotationsconfig_from_namespaceks               rM   	for_modelzConfigWrapper.for_modelb   s
   "  \
 	1DT>48F!!&++-0	1
 '0mmH&=#%.]]>%B"#--(92>~.7Q#r6 
 '+E#$Y`mnn : inMh>i/0fkkm$ 	.AK &

1
1	. :rO   c                    	 | j                   |   S # t        $ r) 	 t        |   cY S # t        $ r t        d|      d w xY ww xY w)NzConfig has no attribute )r   KeyErrorconfig_defaultsAttributeError)rK   names     rM   __getattr__zConfigWrapper.__getattr__   sb    X''-- XX*400 X(+CD8)LMSWWXXs    	A&A?Ac                4   dd}t        j                  di  |di d| j                  j                  d      xs |xr |j                  d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d	| j                  j                  d	      d
| j                  j                  d
      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      d| j                  j                  d      }|S )a  Create a pydantic-core config, `obj` is just used to populate `title` if not set in config.

        Pass `obj=None` if you do not want to attempt to infer the `title`.

        We don't use getattr here since we don't want to populate with defaults.

        Args:
            obj: An object used to populate `title` if not set in config.

        Returns:
            A `CoreConfig` object created from config.
        c                 \    | j                         D ci c]  \  }}|	|| c}}S c c}}w rI   )items)r`   rg   vs      rM   dict_not_nonez0ConfigWrapper.core_config.<locals>.dict_not_none   s(    %+\\^ETQq}AqDEEEs   
((r   extra_fields_behaviorr#   r/   r%   r   r   r   r2   r4   r5   r6   r)   r*   r3   r7   r"   r!   r:   rA   rB   rC   rE   )r`   r   returnr    )r	   
CoreConfigr   rX   __name__)rK   objrs   core_configs       rM   rz   zConfigWrapper.core_config   s   	F ",, 
 &&**73M8L&*&6&6&:&:7&C #..22?C "&!1!1!5!56H!I	
 &*%5%5%9%9:P%Q "--11.A "--11.A ''++H5 $(#3#3#7#78L#M  $//334DE "&!1!1!5!56H!I !% 0 0 4 45F G "--11.A &*%5%5%9%9:P%Q "&!1!1!5!56H!I   $//334DE!"  $//334DE#$ &*%5%5%9%9:P%Q%& '+&6&6&:&:;R&S'( "--11.A)* (,'7'7';';<T'U+, #..22?C-
4 rO   c                n    dj                  d | j                  j                         D              }d| dS )Nz, c              3  0   K   | ]  \  }}| d |  yw)=Nrv   ).0rg   rr   s      rM   	<genexpr>z)ConfigWrapper.__repr__.<locals>.<genexpr>   s     Htq!1QElHs   zConfigWrapper())joinr   rq   )rK   cs     rM   __repr__zConfigWrapper.__repr__   s4    IIHt/?/?/E/E/GHHs!$$rO   N)rL   .ConfigDict | dict[str, Any] | type[Any] | NonerG   r   )r^   ztuple[type[Any], ...]r_   dict[str, Any]r`   r   ru   r   )rm   strru   r   )ry   r   ru   zcore_schema.CoreConfig)rx   
__module____qualname____doc__	__slots__rS   rN   classmethodrh   r   rn   rz   r   rv   rO   rM   r   r   #   s=   S I L!! AA77UU##@@99 LJJ33--==))#OO--11155KK44  ""88`d 8 + +\ 	X+Z%rO   r   c                  <    e Zd ZdZddZedd       Zedd       Zy)	ConfigWrapperStackz%A stack of `ConfigWrapper` instances.c                    |g| _         y rI   _config_wrapper_stackrK   config_wrappers     rM   rN   zConfigWrapperStack.__init__   s    ;I:J"rO   c                     | j                   d   S )Nr   )rK   s    rM   tailzConfigWrapperStack.tail   s    ))"--rO   c              #    K   |d  y t        |t              st        |d      }| j                  j                  |       	 d  | j                  j	                          y # | j                  j	                          w xY ww)NFrF   )
isinstancer   r   appendr\   r   s     rM   pushzConfigWrapperStack.push   sh     !.-8*>GN"")).9	-&&**,D&&**,s   A BA" B"A>>BN)r   r   )ru   r   )r   z!ConfigWrapper | ConfigDict | None)	rx   r   r   r   rN   propertyr   r   r   rv   rO   rM   r   r      s3    /K . . - -rO   r   r   r   Fr   r   r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   Tr+   r,   r-   r.   rv   r/   r0   r2   r3   neverr4   iso8601r5   utf8r6   nullr7   r8   r9   )model_r:   r1   r;   r<   )modelr=   r>   r?   r@   rA   rB   z
rust-regexrC   rD   rE   c                $   | 
t               S t        | t              sSt        j                  t
        t               t        |       D ci c]!  }|j                  d      r|t        | |      # } }t        t         |       }t        |       |S c c}w )zCreate a `ConfigDict` instance from an existing dict, a class (e.g. old class-based config) or None.

    Args:
        config: The input config.

    Returns:
        A ConfigDict object created from config.
    __)r   r   dictwarningswarnDEPRECATION_MESSAGEDeprecationWarningdir
startswithrU   r   check_deprecated)rL   rg   r   s      rM   rJ   rJ     sz     ~|fd#)+=>14VWAALLQUDV!WVQ''WWz6*K[!	 Xs   BB>
   fields
json_dumps
json_loadsgetter_dictsmart_unionallow_mutationpost_init_callerror_msg_templatescopy_on_model_validationunderscore_attrs_are_private)
allow_population_by_field_nameanystr_loweranystr_strip_whitespaceanystr_upperkeep_untouchedmax_anystr_lengthmin_anystr_lengthorm_modeschema_extravalidate_allc                   t         | j                         z  }t        j                         | j                         z  }|s|rt        |      D ci c]  }|t        |    }}|j	                         D cg c]  \  }}d|d| }}}t        |      D cg c]  }d|d
 }}dj                  dg|z   |z         }t        j                  |t               yyc c}w c c}}w c c}w )zjCheck for deprecated config keys and warn the user.

    Args:
        config_dict: The input config.
    z* z has been renamed to z has been removed
z%Valid config keys have changed in V2:N)	V2_REMOVED_KEYSrZ   V2_RENAMED_KEYSsortedrq   r   r   r   UserWarning)	r   deprecated_removed_keysdeprecated_renamed_keysrg   	renamingsrr   renamed_bulletsremoved_bulletsmessages	            rM   r   r   H  s     .0@0@0BB-224{7G7G7II"94:;R4STqQ**T	TLUOOL]^DAqRu$9!?^^@FG^@_`1Ru$56``))DEWZiijg{+ #:T^`s   C4CC$)rL   r   ru   r   )r   r   ru   None)-
__future__r   _annotationsr   
contextlibr   typingr   r   r   r   pydantic_corer	   typing_extensionsr
   r   aliasesr   rL   r   r   r   r   r   errorsr   r   r   #_internal._schema_generation_sharedr   r   r   r   r   r   r   rk   rJ   setrS   rZ   r[   r   r   r   rv   rO   rM   <module>r      sp   2  %  &
 % \ \ & 0 3D5_ h% h%V- -4  +
++ + 	+
 + + + + + + + "+ + +  !+" #+$ %+& '+( )+* ++, -+. !/+0 !1+2 3+4 5+6 7+8 9+: %;+< =+> ?+@ A+B #-C+D E+F G+H 16I+J #K+L  M+N O+P !Q+R #S+T U+\* *,,1134 '9"5"%))!'&,rO   