
    i                         S r SSKJrJr  SSKJrJrJr  SS/rS\	S\\
S	4   S
\4S jrS\4S\\\\	4   S\S\\	\\
S	4   /\4   S
\\   4S jjrg	)zCattrs validation.    )CallableUnion   )ClassValidationErrorForbiddenExtraKeysErrorIterableValidationErrorformat_exceptiontransform_errorexctypeNreturnc                    [        U [        5      (       a  SnU$ [        U [        5      (       a7  Ub/  [        US5      (       a  UR                  O
[        U5      nSU 3nU$ Sn U$ [        U [        5      (       ac  Uc0  U R                  S   R                  S5      (       a  SnU$ SU  S	3n U$ [        US5      (       a  UR                  O
[        U5      nSU 3n U$ [        U [        5      (       a!  S
SR                  U R                  5       S	3nU$ [        U [        5      (       a'  U R                  S   R                  S5      (       a  SnU$ SU  S	3nU$ )a  The default exception formatter, handling the most common exceptions.

The following exceptions are handled specially:

* `KeyErrors` (`required field missing`)
* `ValueErrors` (`invalid value for type, expected <type>` or just `invalid value`)
* `TypeErrors` (`invalid value for type, expected <type>` and a couple special
  cases for iterables)
* `cattrs.ForbiddenExtraKeysError`
* some `AttributeErrors` (special cased for structing mappings)
zrequired field missing__name__z!invalid value for type, expected zinvalid valuer   zobject is not iterablez,invalid value for type, expected an iterablezinvalid type ()zextra fields found (z, zobject has no attribute 'items'zexpected a mappingzunknown error ()
isinstanceKeyError
ValueErrorhasattrr   repr	TypeErrorargsendswithr   joinextra_fieldsAttributeError)r   r   restns       G/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/cattrs/v.pyr	   r	      ss    #x  &4 J3 
C	$	$")$
";";dB5bT:C, J) "C( J' 
C	#	#<xx{##$<==D  J 'se1- J #*$
";";dB5bT:C J 
C0	1	1$TYYs/?/?%@$AC J 
C	(	(SXXa[-A-A). . # J  uA&J    $pathc                 l   / n[        U [        5      (       a  U R                  5       u  pEU Hv  u  pU SUR                  < S3n[        U [        [        45      (       a  UR                  [        XU5      5        MP  UR                  U" XR                  5       SU 35        Mx     U H   n UR                  U" U S5       SU 35        M"     U$ [        U [        5      (       a  U R                  5       u  pEU Ht  u  pU SUR                   3n[        U [        [        45      (       a  UR                  [        XU5      5        MN  UR                  U" XR                  5       SU 35        Mv     U H   n UR                  U" U S5       SU 35        M"     U$ UR                  U" U S5       SU 35        U$ )a  Transform an exception into a list of error messages.

To get detailed error messages, the exception should be produced by a converter
with `detailed_validation` set.

By default, the error messages are in the form of `{description} @ {path}`.

While traversing the exception and subexceptions, the path is formed:

* by appending `.{field_name}` for fields in classes
* by appending `[{int}]` for indices in iterables, like lists
* by appending `[{str}]` for keys in mappings, like dictionaries

:param exc: The exception to transform into error messages.
:param path: The root path to use.
:param format_exception: A callable to use to transform `Exceptions` into
    string descriptions of errors.

.. versionadded:: 23.1.0
[]z @ N.)
r   r   group_exceptionsindexr   extendr
   appendr   name)r   r!   r	   errors
with_noteswithoutnoteps           r   r
   r
   8   s   6 F#.//!224
#IC&$**q)A# 46MNOOoc6FGH!1#yy!A B#aSIJ $ CMM-c489TFCD  M 
C-	.	.!224
#IC&$))%A# 46MNOOoc6FGH!1#yy!A B#aSIJ $ CMM-c489TFCD  M 	)#t45S?@Mr   )__doc__typingr   r   r+   r   r   r   __all__BaseExceptionr   strr	   listr
    r   r   <module>r7      s     "  0
1'- 'uT4Z/@ 'S 'X  	2	#%<mK	L2
2 	dDj)*C/2 
#Y2r   