Ë
    S>{iã ã                  óÀ  — U d Z ddlmZ ddlZddlZddlZddlZddlZddl	Z	ddl
mZmZ ddlmZmZmZ ddlmZ ddlmZ ddlmZ dd	lmZmZmZmZmZmZmZmZmZm Z  ddl!Z!dd
l!m"Z"m#Z#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z*m+Z+m,Z,m-Z- ddl.m/Z/ ddl0m1Z1m2Z2 ddl3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;m<Z< ddl=m>Z>m?Z? ddl@mAZAmBZBmCZC er ddlDmEZE ddlFmGZGmHZH ddlImJZJ ddlKmLZL ddlMmNZN ee%jž                  e%j                   f   ZQ	 eReSef   ZT	 ed   ZU	 dddœZVdeWd<   ed   ZX	  G d„ d eY«      ZZ e[«       Z\	 d!Z]	  ed"eS«      Z^ ed#eS«      Z_ ed$eS«      Z`eae^eUf   Zb ed%e¬&«      Zcd'Zd ejÊ                  dBi e8jÌ                  ¤Ž G d(„ d)«      «       Zg G d*„ d+«      Zhd,e]d-ehd.f	 	 	 	 	 	 	 	 	 	 	 	 	 dCd/„Zid,dde]d-ehd0œ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dDd1„ZjeekeleSemdead2   eaeaeSd3f   d4f   f   Znd5eWd3<   dEd6„ZodFd7„Zp ejÊ                  dBi e8jÌ                  ¤Ž G d8„ d9«      «       Zq G d:„ d;«      ZrdGd<„Zs ed=«      Ztereetd4f   Zun) ejÊ                  dBi e8jÌ                  ¤Ž G d>„ d?«      «       ZudHd@„ZvdIdA„Zwy)Ja¼  !!! abstract "Usage Documentation"
    [JSON Schema](../concepts/json_schema.md)

The `json_schema` module contains classes and functions to allow the way [JSON Schema](https://json-schema.org/)
is generated to be customized.

In general you shouldn't need to use this module directly; instead, you can use
[`BaseModel.model_json_schema`][pydantic.BaseModel.model_json_schema] and
[`TypeAdapter.json_schema`][pydantic.TypeAdapter.json_schema].
é    )ÚannotationsN)ÚCounterÚdefaultdict)ÚHashableÚIterableÚSequence)Údeepcopy)ÚEnum)ÚPattern)
ÚTYPE_CHECKINGÚ	AnnotatedÚAnyÚCallableÚLiteralÚNewTypeÚTypeVarÚUnionÚcastÚoverload)ÚMISSINGÚ
CoreSchemaÚPydanticOmitÚcore_schemaÚto_jsonable_python)ÚComputedField)Ú	TypeAliasÚassert_neverÚ
deprecatedÚfinal)Úget_literal_values)ÚPydanticDeprecatedSince26ÚPydanticDeprecatedSince29é   )Ú_configÚ_core_metadataÚ_core_utilsÚ_decoratorsÚ_internal_dataclassÚ_mock_val_serÚ_schema_generation_shared)ÚGetJsonSchemaHandler)ÚJsonDictÚ	JsonValue)ÚPydanticInvalidForJsonSchemaÚPydanticSchemaGenerationErrorÚPydanticUserError)Ú
ConfigDict)ÚCoreSchemaFieldÚCoreSchemaOrField)ÚPydanticDataclass)ÚGetJsonSchemaFunction©Ú	BaseModel)Ú
validationÚserializationÚInputÚOutputzdict[JsonSchemaMode, str]Ú_MODE_TITLE_MAPPING)úskipped-choiceúnon-serializable-defaultúskipped-discriminatorc                  ó   — e Zd ZdZy)ÚPydanticJsonSchemaWarninga  This class is used to emit warnings produced during JSON schema generation.
    See the [`GenerateJsonSchema.emit_warning`][pydantic.json_schema.GenerateJsonSchema.emit_warning] and
    [`GenerateJsonSchema.render_warning_message`][pydantic.json_schema.GenerateJsonSchema.render_warning_message]
    methods for more details; these can be overridden to control warning behavior.
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úR/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pydantic/json_schema.pyrA   rA   e   s   „ òrG   rA   z#/$defs/{model}ÚCoreRefÚDefsRefÚJsonRefÚJsonSchemaKeyT)Úbound)ÚstringÚbooleanÚnullÚintegerÚnumberc                  ó\   — e Zd ZU ded<   ded<   e	 	 	 	 	 	 	 	 d
d„«       Zdd„Zdd„Zdd„Zy	)Ú_DefinitionsRemappingzdict[DefsRef, DefsRef]Údefs_remappingzdict[JsonRef, JsonRef]Újson_remappingc                ó¶  ‡— t        |«      }d|i}t        d«      D ]±  }t        t        «      Š|D ]%  }| |   }|D ]  }‰|   j	                  ||   «       Œ Œ' ‰D ]  }t        ‰|   «      ‰|<   Œ i }	i }
|D ]+  }| |   }t        ˆfd„|D «       «      }||	|<   ||   |
||   <   Œ- t        |	|
«      }|j                  d|i«      }||k(  r|c S |}Œ³ t        d«      ‚)zä
        This function should produce a remapping that replaces complex DefsRef with the simpler ones from the
        prioritized_choices such that applying the name remapping would result in an equivalent JSON schema.
        ú$defséd   c              3  óF   •K  — | ]  }t        ‰|   «      d k(  sŒ|–— Œ y­w)r#   N)Úlen)Ú.0ÚxÚschemas_for_alternativess     €rH   ú	<genexpr>zA_DefinitionsRemapping.from_prioritized_choices.<locals>.<genexpr>±   s%   øè ø€ Ò(j¨qÄCÐH`ÐabÑHcÓDdÐhiÓDi¬Ñ(jùs   ƒ!š!z.Failed to simplify the JSON schema definitions)
r	   Úranger   ÚlistÚappendÚ_deduplicate_schemasÚnextrT   Úremap_json_schemar.   )Úprioritized_choicesÚdefs_to_jsonÚdefinitionsÚcopied_definitionsÚdefinitions_schemaÚ_iterÚdefs_refÚalternativesÚalternativerU   rV   Úoriginal_defs_refÚremapped_defs_refÚ	remappingÚnew_definitions_schemar^   s                  @rH   Úfrom_prioritized_choicesz._DefinitionsRemapping.from_prioritized_choicesŽ   sN  ø€ ô & kÓ2ÐØ%Ð'9Ð:ÐÜ˜3“Zò 	8ˆEäMXÔY]ÓM^Ð$Ø.ò _�Ø2°8Ñ<�Ø#/ò _�KØ,¨[Ñ9×@Ñ@ÐASÐT\ÑA]Õ^ñ_ð_ð 5ò n�Ü5IÐJbÐckÑJlÓ5mÐ(¨Ò2ðnð 68ˆNØ57ˆNØ%0ò bÐ!Ø2Ð3DÑE�ä$(Ó(j°LÔ(jÓ$jÐ!Ø4E�Ð0Ñ1ØBNÐO`ÑBa�˜|Ð,=Ñ>Ò?ðbô .¨n¸nÓMˆIØ%.×%@Ñ%@À'ÐK]ÐA^Ó%_Ð"Ø!Ð%;Ò;à Ò Ø!7Ñð7	8ô: +Ð+[Ó\Ð\rG   c                ó:   — | j                   j                  ||«      S ©N)rU   Úget©ÚselfÚrefs     rH   Úremap_defs_refz$_DefinitionsRemapping.remap_defs_ref½   ó   € Ø×"Ñ"×&Ñ& s¨CÓ0Ð0rG   c                ó:   — | j                   j                  ||«      S ru   )rV   rv   rw   s     rH   Úremap_json_refz$_DefinitionsRemapping.remap_json_refÀ   r{   rG   c           
     óZ  — t        |t        «      r| j                  t        |«      «      S t        |t        «      r|D �cg c]  }| j                  |«      ‘Œ c}S t        |t        «      r¶|j                  «       D ]£  \  }}|dk(  r.t        |t        «      r| j                  t        |«      «      |d<   Œ9|dk(  rR|d   j                  «       D ��ci c]/  \  }}| j                  t        |«      «      | j                  |«      “Œ1 c}}|d<   Œ�| j                  |«      ||<   Œ¥ |S c c}w c c}}w )zH
        Recursively update the JSON schema replacing all $refs
        ú$refrX   )
Ú
isinstanceÚstrr}   rK   ra   re   ÚdictÚitemsrz   rJ   )rx   ÚschemaÚitemÚkeyÚvalues        rH   re   z'_DefinitionsRemapping.remap_json_schemaÃ   s  € ô �fœcÔ"à×&Ñ&¤w¨v£Ó7Ð7Ü˜¤Ô%Ø=CÖD°T�D×*Ñ*¨4Õ0ÒDÐDÜ˜¤Ô%Ø$Ÿl™l›nò 	@‘
��UØ˜&’=¤Z°´sÔ%;Ø%)×%8Ñ%8¼À»Ó%H�F˜6’NØ˜G’^ð +1°©/×*?Ñ*?Ó*A÷'á&˜C ð ×+Ñ+¬G°C«LÓ9¸4×;QÑ;QÐRWÓ;XÑXó'�F˜7’Oð
 #'×"8Ñ"8¸Ó"?�F˜3’Kð	@ð ˆùò Eùó's   ¿D"Ã4D'N)rf   zdict[DefsRef, list[DefsRef]]rg   zdict[DefsRef, JsonRef]rh   zdict[DefsRef, JsonSchemaValue]ÚreturnrT   )ry   rJ   rˆ   rJ   )ry   rK   rˆ   rK   )r„   r   rˆ   r   )	rB   rC   rD   Ú__annotations__Ústaticmethodrs   rz   r}   re   rF   rG   rH   rT   rT   ‰   sZ   … à*Ó*Ø*Ó*àð,]Ø9ð,]à,ð,]ð 4ð,]ð 
ò	,]ó ð,]ó\1ó1ôrG   rT   c                  ó0  — e Zd ZU dZdZdhZded<   dedf	 	 	 	 	 	 	 dpd„Ze	dqd	„«       Z
e	drd
„«       Z	 	 dsd„Z	 	 	 	 dtd„Zdudvd„Zdwd„Zdxdyd„Zdxdzd„Zd{d„Zd|d„Zd}d„Zd~d„Zdd„Zd€d„Zd�d„Zd‚d„Zdƒd„Zd„d„Zd…d„Zd†d„Zd‡d„Zdˆd„Zd‰d „Z dŠd!„Z!d‹d"„Z"dŒd#„Z#d�d$„Z$dŽd%„Z% e&d&d¬'«      e'd�d(„«       «       Z( e&d)d¬'«      e'd�d*„«       «       Z)d�d+„Z*d�d,„Z+d‘d-„Z,d’d.„Z-d“d/„Z.d”d0„Z/d•d1„Z0d–d2„Z1d—d3„Z2d˜d4„Z3d™d5„Z4dšd6„Z5d›d7„Z6dœd8„Z7d�d9„Z8džd:„Z9	 	 	 	 	 	 dŸd;„Z:d d<„Z;d¡d=„Z<d¢d>„Z=d£d?„Z>e?	 	 	 	 d¤d@„«       Z@	 	 	 	 d¥dA„ZAd¦dB„ZBd§dC„ZCd¨dD„ZDd©dE„ZEdªdF„ZFd«dG„ZGd¬dH„ZHd­dI„ZId®dJ„ZJd¯dK„ZK	 	 	 	 	 	 d°dL„ZLd±dM„ZMd²dN„ZNd³dO„ZO	 	 	 	 	 	 d´dP„ZP	 	 	 	 	 	 dµdQ„ZQd¶dR„ZRd·dS„ZSd¸dT„ZTd¹dU„ZUdºdV„ZVd»dW„ZWd¼dX„ZXd½dY„ZYd¾dZ„ZZd¿d[„Z[	 	 	 	 dÀd\„Z\dÁd]„Z]dÂd^„Z^dÃd_„Z_dÂd`„Z`dÄda„ZadÅdb„Zbd­dc„ZcdÆdd„ZddÇde„Ze	 	 	 	 	 	 	 	 dÈdf„Zf G dg„ dh«      Zgd�di„ZhdÉdj„ZidÊdk„ZjdËdl„ZkdÌdm„ZldÍdn„ZmdÎdo„Zny)ÏÚGenerateJsonSchemaaþ	  !!! abstract "Usage Documentation"
        [Customizing the JSON Schema Generation Process](../concepts/json_schema.md#customizing-the-json-schema-generation-process)

    A class for generating JSON schemas.

    This class generates JSON schemas based on configured parameters. The default schema dialect
    is [https://json-schema.org/draft/2020-12/schema](https://json-schema.org/draft/2020-12/schema).
    The class uses `by_alias` to configure how fields with
    multiple names are handled and `ref_template` to format reference names.

    Attributes:
        schema_dialect: The JSON schema dialect used to generate the schema. See
            [Declaring a Dialect](https://json-schema.org/understanding-json-schema/reference/schema.html#id4)
            in the JSON Schema documentation for more information about dialects.
        ignored_warning_kinds: Warnings to ignore when generating the schema. `self.render_warning_message` will
            do nothing if its argument `kind` is in `ignored_warning_kinds`;
            this value can be modified on subclasses to easily control which warnings are emitted.
        by_alias: Whether to use field aliases when generating the schema.
        ref_template: The format string used when generating reference names.
        core_to_json_refs: A mapping of core refs to JSON refs.
        core_to_defs_refs: A mapping of core refs to definition refs.
        defs_to_core_refs: A mapping of definition refs to core refs.
        json_to_defs_refs: A mapping of JSON refs to definition refs.
        definitions: Definitions in the schema.

    Args:
        by_alias: Whether to use field aliases in the generated schemas.
        ref_template: The format string to use when generating reference names.
        union_format: The format to use when combining schemas from unions together. Can be one of:

            - `'any_of'`: Use the [`anyOf`](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
              keyword to combine schemas (the default).
            - `'primitive_type_array'`: Use the [`type`](https://json-schema.org/understanding-json-schema/reference/type)
              keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive
              type (`string`, `boolean`, `null`, `integer` or `number`) or contains constraints/metadata, falls back to
              `any_of`.

    Raises:
        JsonSchemaError: If the instance of the class is inadvertently reused after generating a schema.
    z,https://json-schema.org/draft/2020-12/schemar=   zset[JsonSchemaWarningKind]Úignored_warning_kindsTÚany_ofc                óf  — || _         || _        || _        i | _        i | _        i | _        i | _        i | _        t        j                  t        j                  i «      «      | _        d| _        i | _        t        t        «      | _        i | _        | j%                  «       | _        i | _        d| _        y )Nr8   F)Úby_aliasÚref_templateÚunion_formatÚcore_to_json_refsÚcore_to_defs_refsÚdefs_to_core_refsÚjson_to_defs_refsrh   r$   ÚConfigWrapperStackÚConfigWrapperÚ_config_wrapper_stackÚ_modeÚ_prioritized_defsref_choicesr   ÚintÚ_collision_counterÚ_collision_indexÚbuild_schema_type_to_methodÚ_schema_type_to_methodÚ"_core_defs_invalid_for_json_schemaÚ_used)rx   r�   r‘   r’   s       rH   Ú__init__zGenerateJsonSchema.__init__
  s°   € ð !ˆŒØ(ˆÔØGSˆÔà=?ˆÔØ=?ˆÔØ=?ˆÔØ9;ˆÔà;=ˆÔÜ%,×%?Ñ%?Ä×@UÑ@UÐVXÓ@YÓ%ZˆÔ"à%1ˆŒ
ð KMˆÔ)Ü2=¼cÓ2BˆÔØ02ˆÔà&*×&FÑ&FÓ&HˆÔ#ð `bˆÔ/ð ˆ�
rG   c                ó.   — | j                   j                  S ru   )r™   Útail©rx   s    rH   r$   zGenerateJsonSchema._config4  s   € à×)Ñ)×.Ñ.Ð.rG   c                ór   — | j                   j                  �| j                   j                  S | j                  S ru   )r$   Újson_schema_mode_overriderš   r¦   s    rH   ÚmodezGenerateJsonSchema.mode8  s,   € à�<‰<×1Ñ1Ð=Ø—<‘<×9Ñ9Ð9à—:‘:ÐrG   c                ó:  — i }t        t        t        «      «      }|D ]'  }|j                  dd«      › d�}	 t	        | |«      ||<   Œ) |S # t
        $ rH}t        j                  d«      rY d}~ŒOt        d|›dt        | «      j                  › d|› d	�«      |‚d}~ww xY w)
aO  Builds a dictionary mapping fields to methods for generating JSON schemas.

        Returns:
            A dictionary containing the mapping of `CoreSchemaOrFieldType` to a handler method.

        Raises:
            TypeError: If no method has been defined for generating a JSON schema for a given pydantic core schema type.
        ú-Ú_Ú_schemaÚ-PYDANTIC_PRIVATE_ALLOW_UNHANDLED_SCHEMA_TYPESNz9No method for generating JsonSchema for core_schema.type=z (expected: ú.ú))ra   r    ÚCoreSchemaOrFieldTypeÚreplaceÚgetattrÚAttributeErrorÚosÚgetenvÚ	TypeErrorÚtyperB   )rx   ÚmappingÚcore_schema_typesr†   Úmethod_nameÚes         rH   rŸ   z.GenerateJsonSchema.build_schema_type_to_method?  sÀ   € ð `bˆÜ9=Ô>PÔQfÓ>gÓ9hÐØ$ò 
	ˆCØ Ÿ[™[¨¨cÓ2Ð3°7Ð;ˆKðÜ& t¨[Ó9�˜’ð
	ð ˆøô "ò Ü—9‘9ÐLÔMÜÜØOÐPSÈwð W"Ü"& t£*×"5Ñ"5Ð!6°a¸°}ÀAðGóð ðûðús   ¶A	Á		BÁBÁ,)BÂBc                ó¶  — | j                   r$t        dt        | «      j                  › d�d¬«      ‚|D ]  \  }}}|| _        | j                  |«       Œ  | j                  «       }i }|D ]4  \  }}}|| _        | j                  |«      }|j                  |«      |||f<   Œ6 d| j                  i}|j                  |«      }d| _         || j                  |d   «      fS )a­  Generates JSON schema definitions from a list of core schemas, pairing the generated definitions with a
        mapping that links the input keys to the definition references.

        Args:
            inputs: A sequence of tuples, where:

                - The first element is a JSON schema key type.
                - The second element is the JSON mode: either 'validation' or 'serialization'.
                - The third element is a core schema.

        Returns:
            A tuple where:

                - The first element is a dictionary whose keys are tuples of JSON schema key type and JSON mode, and
                    whose values are the JSON schema corresponding to that pair of inputs. (These schemas may have
                    JsonRef references to definitions that are defined in the second returned element.)
                - The second element is a dictionary whose keys are definition references for the JSON schemas
                    from the first returned element, and whose values are the actual JSON schema definitions.

        Raises:
            PydanticUserError: Raised if the JSON schema generator has already been used to generate a JSON schema.
        únThis JSON schema generator has already been used to generate a JSON schema. You must create a new instance of ú to generate a new JSON schema.újson-schema-already-used©ÚcoderX   T)
r¢   r0   r¸   rB   rš   Úgenerate_innerÚ_build_definitions_remappingre   rh   Úsort)	rx   Úinputsr¬   r©   r„   Údefinitions_remappingÚjson_schemas_mapr†   Újson_schemas	            rH   Úgenerate_definitionsz'GenerateJsonSchema.generate_definitionsY  s  € ð2 �:Š:Ü#ð5Ü59¸$³Z×5HÑ5HÐ4IÐIhðjà/ôð ð  &ò 	(‰OˆAˆt�VØˆDŒJØ×Ñ Õ'ð	(ð !%× AÑ AÓ CÐàQSÐØ!'ò 	aÑˆC��vØˆDŒJØ×-Ñ-¨fÓ5ˆKØ,A×,SÑ,SÐT_Ó,`Ð˜c 4˜[Ò)ð	að
  × 0Ñ 0Ð1ˆØ+×=Ñ=¸kÓJˆØˆŒ
Ø §¡¨;°wÑ+?Ó!@Ð@Ð@rG   c                ó”  — || _         | j                  r$t        dt        | «      j                  › d�d¬«      ‚| j                  |«      }| j                  |«      }t        t        |j                  d«      «      }|�j| j                  |«      }||   dk(  rL|�Jt        |«      dk(  r<|j                  «       }||xx   dz  cc<   t        t        |j                  d«      «      }d}|�Œj| j                  |«       | j                  «       }| j                  r| j                  |d<   |j!                  |«      }d	| _        | j#                  |«      S )
a¤  Generates a JSON schema for a specified schema in a specified mode.

        Args:
            schema: A Pydantic model.
            mode: The mode in which to generate the schema. Defaults to 'validation'.

        Returns:
            A JSON schema representing the specified schema.

        Raises:
            PydanticUserError: If the JSON schema generator has already been used to generate a JSON schema.
        r¾   r¿   rÀ   rÁ   r   Nr#   rX   T)rš   r¢   r0   r¸   rB   rÃ   Úget_json_ref_countsr   rK   rv   Úget_schema_from_definitionsr[   ÚcopyÚ_garbage_collect_definitionsrÄ   rh   re   rÅ   )rx   r„   r©   rÉ   Újson_ref_countsry   Úref_json_schemarÇ   s           rH   ÚgeneratezGenerateJsonSchema.generateŠ  sK  € ð ˆŒ
Ø�:Š:Ü#ð5Ü59¸$³Z×5HÑ5HÐ4IÐIhðjà/ôð ð (,×':Ñ':¸6Ó'BˆØ×2Ñ2°;Ó?ˆä”7˜KŸO™O¨FÓ3Ó4ˆØˆoØ"×>Ñ>¸sÓCˆOØ˜sÑ# qÒ(¨_Ð-HÌSÐQ\ÓM]ÐabÒMbà-×2Ñ2Ó4�Ø Ó$¨Ñ)Ó$Üœ7 K§O¡O°FÓ$;Ó<�ØˆCð ‰oð 	×)Ñ)¨+Ô6Ø $× AÑ AÓ CÐà×ÒØ#'×#3Ñ#3ˆK˜Ñ à+×=Ñ=¸kÓJˆð ˆŒ
Ø�y‰y˜Ó%Ð%rG   c                ón  ‡ ‡‡‡— d|v rVt        |d   «      }|‰ j                  f}|‰ j                  v r,‰ j                  |   ‰ j                  v rd‰ j                  |   iS dˆ fd„Šdˆ fd„}t        j                  ‰ |«      }t        t        j                  |j                  di «      «      }|j                  d«      xŠr#|f	 	 	 	 	 dˆfd„}t        j                  ‰ |«      }|j                  d«      xŠr#|f	 	 	 	 	 dˆfd	„}t        j                  ‰ |«      }|j                  d
d«      D ](  }	||	f	 	 	 	 	 	 	 dˆfd„}
t        j                  ‰ |
«      }Œ* |j                  dd«      D ]&  }	||	f	 	 	 	 	 	 	 dd„}
t        j                  ‰ |
«      }Œ(  ||«      }t        j                  |«      r	 ‰||«      }|S )a±  Generates a JSON schema for a given core schema.

        Args:
            schema: The given core schema.

        Returns:
            The generated JSON schema.

        TODO: the nested function definitions here seem like bad practice, I'd like to unpack these
        in a future PR. It'd be great if we could shorten the call stack a bit for JSON schema generation,
        and I think there's potential for that here.
        ry   r   c                óô   •— d| v rrt        | d   «      }‰j                  |«      \  }}t        |d   «      }|j                  dd «      |k7  r+|‰j                  |<   ‰j
                  j                  |d «       |}|S )Nry   r   )rI   Úget_cache_defs_ref_schemarK   rv   rh   r¡   Úpop)r   rÉ   Úcore_refrl   rÑ   Újson_refrx   s         €rH   Úpopulate_defsz8GenerateJsonSchema.generate_inner.<locals>.populate_defsÑ  s„   ø€ Ø˜Ñ#Ü" ;¨uÑ#5Ó6�Ø,0×,JÑ,JÈ8Ó,TÑ)�˜/Ü" ?°6Ñ#:Ó;�ð —?‘? 6¨4Ó0°HÒ<Ø1<�D×$Ñ$ XÑ.Ø×;Ñ;×?Ñ?ÀÈ$ÔOØ-�ØÐrG   c                ón  •— d}‰j                   dk(  rLd| v rH| d   }‰j                  |«      }|�0|j                  d«      dv r| d   dk(  r‰j                  ddi|g«      }|€Tt	        j
                  | «      st	        j                  | «      r‰j                  | d      } || «      }|S t        d| › �«      ‚|S )	a@  Generate a JSON schema based on the input schema.

            Args:
                schema_or_field: The core schema to generate a JSON schema from.

            Returns:
                The generated JSON schema.

            Raises:
                TypeError: If an unexpected schema type is encountered.
            Nr9   Ú	when_used©zunless-nonezjson-unless-noner¸   ÚnullablerP   úUnexpected schema type: schema=)	r©   Ú
ser_schemarv   Úget_union_of_schemasr&   Úis_core_schemaÚis_core_schema_fieldr    r·   )Úschema_or_fieldrÉ   rß   Úgenerate_for_schema_typerx   s       €rH   Úhandler_funcz7GenerateJsonSchema.generate_inner.<locals>.handler_funcß  sß   ø€ ð 37ˆKØ�y‰y˜OÒ+°À?Ñ0Rð -¨_Ñ=�
Ø"Ÿo™o¨jÓ9�ð
  Ð+Ø"Ÿ™ {Ó3Ð7ZÑZØ'¨Ñ/°:Ò=à"&×";Ñ";¸fÀfÐ=MÈ{Ð<[Ó"\�KØÐ"Ü×-Ñ-¨oÔ>Ä+×BbÑBbÐcrÔBsØ/3×/JÑ/JÈ?Ð[aÑKbÑ/cÐ,Ù":¸?Ó"K�Kð Ðô $Ð&EÀoÐEVÐ$WÓXÐXØÐrG   ÚmetadataÚpydantic_js_updatesc                ó    •— i  || «      ¥‰¥}|S ru   rF   )rã   Úcurrent_handlerrÉ   Ú
js_updatess      €rH   Újs_updates_handler_funczBGenerateJsonSchema.generate_inner.<locals>.js_updates_handler_func  s    ø€ ð Q¡°Ó!AÐPÀZÐP�Ø"Ð"rG   Úpydantic_js_extrac                ó–   •—  || «      }t        ‰t        «      r|j                  t        ‰«      «       |S t	        ‰«      r ‰|«       |S ru   )r€   r‚   Úupdater   Úcallable)rã   ré   rÉ   Újs_extras      €rH   Újs_extra_handler_funcz@GenerateJsonSchema.generate_inner.<locals>.js_extra_handler_func  sM   ø€ ñ .¨oÓ>�Ü˜h¬Ô-Ø×&Ñ&Ô'9¸(Ó'CÔDð #Ð"ô ˜hÔ'á˜[Ô)Ø"Ð"rG   Úpydantic_js_functionsrF   c                óÆ   •—  || |«      }t        j                  | «      r	 ‰| |«      }|j                  |«      }|j                  dd «      }|r|r|j	                  |«       |S )Nr   )r&   rá   Úresolve_ref_schemarÖ   rî   )rã   ré   Újs_modify_functionrÉ   Úoriginal_schemary   rÙ   s         €rH   Únew_handler_funcz;GenerateJsonSchema.generate_inner.<locals>.new_handler_func'  sd   ø€ ñ
 1°À/ÓR�Ü×-Ñ-¨oÔ>Ù"/°ÀÓ"M�KØ"1×"DÑ"DÀ[Ó"Q�Ø!—o‘o f¨dÓ3�Ù™;Ø#×*Ñ*¨;Ô7Ø&Ð&rG   Ú pydantic_js_annotation_functionsc                ó   —  || |«      S ru   rF   )rã   ré   rõ   s      rH   r÷   z;GenerateJsonSchema.generate_inner.<locals>.new_handler_func9  s   € ñ
 *¨/¸?ÓKÐKrG   )r   r   rÉ   ÚJsonSchemaValuerˆ   rú   )rã   r3   rˆ   rú   )rã   r3   ré   r+   rˆ   rú   )rã   r3   ré   r+   rõ   r5   rˆ   rú   )rI   r©   r”   rh   r“   r*   ÚGenerateJsonSchemaHandlerr   r%   ÚCoreMetadatarv   r&   rá   )rx   r„   r×   Úcore_mode_refrå   ré   ræ   rë   rñ   rõ   r÷   rÉ   rð   rê   rÙ   s   `           @@@rH   rÃ   z!GenerateJsonSchema.generate_inner»  sE  û€ ð  �F‰?Ü˜v e™}Ó-ˆHØ% t§y¡yÐ1ˆMØ × 6Ñ 6Ñ6¸4×;QÑ;QÐR_Ñ;`Ðdh×dtÑdtÑ;tØ × 6Ñ 6°}Ñ EÐFÐFõ	õ#	ôJ 4×MÑMÈdÐT`Óaˆäœ×3Ñ3°V·Z±ZÀ
ÈBÓ5OÓPˆð "Ÿ™Ð&;Ó<Ð<ˆ:Ð<ð 9Hð#Ø!2ð#à!5ð#ð !õ#ô 8×QÑQÐRVÐXoÓpˆOà—|‘|Ð$7Ó8Ð8ˆ8Ð8ð 9Hð
#Ø!2ð
#à!5ð
#ð !õ
#ô 8×QÑQÐRVÐXmÓnˆOà"*§,¡,Ð/FÈÓ"Kò 	jÐð 9HØ<Nð'Ø!2ð'à!5ð'ð %:ð'ð !õ	'ô 8×QÑQÐRVÐXhÓi‰Oð!	jð$ #+§,¡,Ð/QÐSUÓ"Vò 		jÐð 9HØ<NðLØ!2ðLà!5ðLð %:ðLð !ó	Lô 8×QÑQÐRVÐXhÓi‰Oð		jñ & fÓ-ˆÜ×%Ñ% fÔ-Ù'¨°Ó<ˆKØÐrG   Nc                óˆ   — i }|j                  «       }|dvrt        |«      }|D ]  }| j                  ||   |¬«      ||<   Œ |S )ap  Override this method to customize the sorting of the JSON schema (e.g., don't sort at all, sort all keys unconditionally, etc.)

        By default, alphabetically sort the keys in the JSON schema, skipping the 'properties' and 'default' keys to preserve field definition order.
        This sort is recursive, so it will sort all nested dictionaries as well.
        ©Ú
propertiesÚdefault©Ú
parent_key)ÚkeysÚsortedÚ_sort_recursive)rx   r‡   r  Úsorted_dictr  r†   s         rH   rÅ   zGenerateJsonSchema.sortG  s[   € ð 35ˆØ�z‰z‹|ˆØÐ6Ñ6Ü˜$“<ˆDØò 	PˆCØ#×3Ñ3°E¸#±JÈ3Ð3ÓOˆK˜Òð	PàÐrG   c                ó  — t        |t        «      rCi }|j                  «       }|dvrt        |«      }|D ]  }| j	                  ||   |¬«      ||<   Œ |S t        |t
        «      r!|D �cg c]  }| j	                  ||«      ‘Œ }}|S |S c c}w )z%Recursively sort a JSON schema value.rÿ   r  )r€   r‚   r  r  r  ra   )rx   r‡   r  r  r  r†   r…   Úsorted_lists           rH   r  z"GenerateJsonSchema._sort_recursiveU  sŸ   € ä�eœTÔ"Ø68ˆKØ—:‘:“<ˆDØÐ!:Ñ:Ü˜d“|�Øò T�Ø#'×#7Ñ#7¸¸c¹
ÈsÐ#7Ó#S�˜CÒ ðTàÐÜ˜œtÔ$ØejÖ1kÐ]a°$×2FÑ2FÀtÈZÕ2XÐ1kˆKÐ1kØÐàˆLùò 2ls   Á(Bc                ó   — t        d«      ‚)z%Placeholder - should never be called.zKCannot generate schema for invalid_schema. This is a bug! Please report it.)ÚRuntimeError©rx   r„   s     rH   Úinvalid_schemaz!GenerateJsonSchema.invalid_schemag  s   € ô ÐhÓiÐirG   c                ó   — i S )z¥Generates a JSON schema that matches any value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rF   r  s     rH   Ú
any_schemazGenerateJsonSchema.any_schemal  s	   € ð ˆ	rG   c                ó
   — ddiS )z¢Generates a JSON schema that matches `None`.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rP   rF   r  s     rH   Únone_schemazGenerateJsonSchema.none_schemaw  s   € ð ˜ÐÐrG   c                ó
   — ddiS )z¨Generates a JSON schema that matches a bool value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rO   rF   r  s     rH   Úbool_schemazGenerateJsonSchema.bool_schema‚  s   € ð ˜	Ð"Ð"rG   c                óö   — ddi}| j                  ||| j                  j                  «       |j                  «       D ��ci c],  \  }}|t        j
                  t        j
                   hvsŒ*||“Œ. }}}|S c c}}w )z¨Generates a JSON schema that matches an int value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rQ   ©Úupdate_with_validationsÚValidationsMappingÚnumericrƒ   ÚmathÚinf©rx   r„   rÉ   ÚkÚvs        rH   Ú
int_schemazGenerateJsonSchema.int_schema�  sv   € ð (.¨yÐ&9ˆØ×$Ñ$ [°&¸$×:QÑ:Q×:YÑ:YÔZØ(3×(9Ñ(9Ó(;×^¡  1¸qÌÏÉÔTX×T\ÑT\ÐS\ÐH]Ò?]�q˜!‘tÐ^ˆÑ^ØÐùó _ó   ¿+A5Á+A5c                óö   — ddi}| j                  ||| j                  j                  «       |j                  «       D ��ci c],  \  }}|t        j
                  t        j
                   hvsŒ*||“Œ. }}}|S c c}}w )z©Generates a JSON schema that matches a float value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rR   r  r  s        rH   Úfloat_schemazGenerateJsonSchema.float_schema›  sv   € ð (.¨xÐ&8ˆØ×$Ñ$ [°&¸$×:QÑ:Q×:YÑ:YÔZØ(3×(9Ñ(9Ó(;×^¡  1¸qÌÏÉÔTX×T\ÑT\ÐS\ÐH]Ò?]�q˜!‘tÐ^ˆÑ^ØÐùó _r  c                ó(  — dd„}| j                  t        j                    ||«      ¬«      «      }| j                  dk(  rÓ|j                  d«      }|j                  d«      }|j                  d«      }|j                  d«      }|j                  d«      }d	| j	                  t        j                  |j                  d
«      |€dn
t        |«      |€dn
t        |«      |€dn
t        |«      |€dn
t        |«      |€dn
t        |«      ¬«      «      |gi}|S )z«Generates a JSON schema that matches a decimal value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        c           
     óô   — | j                  d«      }| j                  d«      }d}|�(|�&t        d||z
  «      }|d|› d|dz   › d|› d	|› d
�	z  }|S |�|€|d|› d|dz   › d�z  }|S |€|�|d|› d�z  }|S |dz  }|S )NÚ
max_digitsÚdecimal_placesz^(?!^[-+.]*$)[+-]?0*r   z(?:\d{0,z}|(?=[\d.]{1,r#   z
}0*$)\d{0,z}\.\d{0,z}0*$)z}0*$)\d*\.\d*0*$)z\d*\.?\d{0,z}0*$z
\d*\.?\d*$)rv   Úmax)r„   r$  r%  ÚpatternÚinteger_placess        rH   Úget_decimal_patternz>GenerateJsonSchema.decimal_schema.<locals>.get_decimal_pattern³  s	  € ØŸ™ LÓ1ˆJØ#ŸZ™ZÐ(8Ó9ˆNð (ð ð
 Ð%¨.Ð*DÜ!$ Q¨
°^Ñ(CÓ!D�ØðØ,Ð-ð .$à$.°¡NÐ#3ð 4Ø,Ð-¨Z¸Ð7Gð Hð	ñ�ð8 ˆNð% Ð'¨NÐ,BØðØ(˜\ð *$à$.°¡NÐ#3ð 4ðñ�ð" ˆNð Ð#¨Ð(BØ˜l¨>Ð*:¸%Ð@Ñ@�ð ˆNð ˜=Ñ(�àˆNrG   )r'  r8   Úmultiple_ofÚleÚgeÚltÚgtÚanyOfÚallow_inf_nanN)r0  r*  r+  r,  r-  r.  )r„   úcore_schema.DecimalSchemarˆ   r�   )Ú
str_schemar   r©   rv   r!  Úfloat)	rx   r„   r)  rÉ   r*  r+  r,  r-  r.  s	            rH   Údecimal_schemaz!GenerateJsonSchema.decimal_schema©  s  € ó'	ðR —o‘o¤k×&<Ñ&<ÑEXÐY_ÓE`Ô&aÓbˆØ�9‰9˜Ò$Ø Ÿ*™* ]Ó3ˆKØ—‘˜DÓ!ˆBØ—‘˜DÓ!ˆBØ—‘˜DÓ!ˆBØ—‘˜DÓ!ˆBàØ×%Ñ%Ü#×0Ñ0Ø*0¯*©*°_Ó*EØ0;Ð0C©ÌÈ{ÓI[Ø') z™t´u¸R³yØ') z™t´u¸R³yØ') z™t´u¸R³yØ') z™t´u¸R³yôó	ð  ððˆKð ÐrG   c                óÖ   — ddi}| j                  ||| j                  j                  «       t        |j	                  d«      t
        «      r|j	                  d«      j                  |d<   |S )zªGenerates a JSON schema that matches a string value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rN   r'  )r  r  rN   r€   rv   r   r'  ©rx   r„   rÉ   s      rH   r2  zGenerateJsonSchema.str_schemaô  s^   € ð ˜xÐ(ˆØ×$Ñ$ [°&¸$×:QÑ:Q×:XÑ:XÔYÜ�k—o‘o iÓ0´'Ô:à%0§_¡_°YÓ%?×%GÑ%GˆK˜	Ñ"ØÐrG   c                ó”   — d| j                   j                  dk(  rdnddœ}| j                  ||| j                  j                  «       |S )z©Generates a JSON schema that matches a bytes value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rN   Úbase64Ú	base64urlÚbinary©r¸   Úformat)r$   Úser_json_bytesr  r  Úbytesr6  s      rH   Úbytes_schemazGenerateJsonSchema.bytes_schema  sG   € ð  (À$Ç,Á,×B]ÑB]ÐaiÒBi±;ÐowÑxˆØ×$Ñ$ [°&¸$×:QÑ:Q×:WÑ:WÔXØÐrG   c                ó   — dddœS )z¨Generates a JSON schema that matches a date value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rN   Údater;  rF   r  s     rH   Údate_schemazGenerateJsonSchema.date_schema  ó   € ð !¨FÑ3Ð3rG   c                ó   — dddœS )z¨Generates a JSON schema that matches a time value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rN   Útimer;  rF   r  s     rH   Útime_schemazGenerateJsonSchema.time_schema  rC  rG   c                ó   — dddœS )z¬Generates a JSON schema that matches a datetime value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rN   z	date-timer;  rF   r  s     rH   Údatetime_schemaz"GenerateJsonSchema.datetime_schema'  s   € ð !¨KÑ8Ð8rG   c                óF   — | j                   j                  dk(  rddiS dddœS )z­Generates a JSON schema that matches a timedelta value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r3  r¸   rR   rN   Údurationr;  )r$   Úser_json_timedeltar  s     rH   Útimedelta_schemaz#GenerateJsonSchema.timedelta_schema2  s,   € ð �<‰<×*Ñ*¨gÒ5Ø˜HÐ%Ð%Ø ¨JÑ7Ð7rG   c           	     óÆ  — |d   D �cg c])  }t        t        |t        «      r|j                  n|«      ‘Œ+ }}i }t	        |«      dk(  r	|d   |d<   n||d<   |D �ch c]  }t        |«      ’Œ }}|t        hk(  rd|d<   |S |t        hk(  rd|d<   |S |t        hk(  rd	|d<   |S |t        hk(  rd
|d<   |S |t        hk(  rd|d<   |S |t        d«      hk(  rd|d<   |S c c}w c c}w )z«Generates a JSON schema that matches a literal value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        Úexpectedr#   r   ÚconstÚenumrN   r¸   rQ   rR   rO   ÚarrayNrP   )r   r€   r
   r‡   r[   r¸   r�   rœ   r3  Úboolra   )rx   r„   r  rN  Úresultr¼   Útypess          rH   Úliteral_schemaz!GenerateJsonSchema.literal_schema?  s"  € ð X^Ð^hÑWiÖjÐRSÔ&´*¸QÄÔ2E q§w¢wÈ1ÕMÐjˆÐjà!#ˆÜˆx‹=˜AÒØ& q™kˆF�7ŠOà%ˆF�6‰Nà"*Ö+˜Q”�a•Ð+ˆÐ+Ø”S�EŠ>Ø%ˆF�6‰Nð ˆð ”s�eŠ^Ø&ˆF�6‰Nð ˆð ”u�gÒØ%ˆF�6‰Nð ˆð ”t�fŠ_Ø&ˆF�6‰Nð
 ˆð	 ”t�fŠ_Ø$ˆF�6‰Nð ˆð ”t˜D“z�lÒ"Ø#ˆF�6‰NØˆùò+ kùò ,s   ˆ.CÁCc                ó   — t         ‚)z¸Generates a JSON schema that matches the `MISSING` sentinel value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ©r   r  s     rH   Úmissing_sentinel_schemaz*GenerateJsonSchema.missing_sentinel_schema_  s
   € ô ÐrG   c                óŒ  — |d   }|j                   sdnt        j                  |j                   «      }|dk(  rd}|j                  |dœ}|j	                  «       D ��ci c]  \  }}|€Œ	||“Œ }}}|d   D �cg c]  }t        |j                  «      ‘Œ }}||d<   |D �ch c]  }t        |«      ’Œ }	}t        |t        «      s
|	t        hk(  rd|d<   |S t        |t        «      s
|	t        hk(  rd	|d<   |S t        |t        «      s
|	t        hk(  rd
|d<   |S |	t        hk(  rd|d<   |S |	t        hk(  rd|d<   |S c c}}w c c}w c c}w )z©Generates a JSON schema that matches an Enum value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ÚclsNzAn enumeration.)ÚtitleÚdescriptionÚmembersrP  rN   r¸   rQ   rR   rO   rQ  )rE   ÚinspectÚcleandocrB   rƒ   r   r‡   r¸   r€   r�   rœ   r3  rR  ra   )
rx   r„   Ú	enum_typer\  rS  r  r  rN  r¼   rT  s
             rH   Úenum_schemazGenerateJsonSchema.enum_schemaj  s_  € ð ˜5‘Mˆ	Ø"+×"3Ò"3‘d¼×9IÑ9IÈ)×J[ÑJ[Ó9\ˆàÐ,Ò,àˆKØ+4×+=Ñ+=ÈkÑ!ZˆØ#)§<¡<£>×C™4˜1˜a°Q±]�!�Q‘$ÐCˆÑCà9?À	Ñ9JÖK°AÔ& q§w¡wÕ/ÐKˆÐKà!ˆˆv‰à"*Ö+˜Q”�a•Ð+ˆÐ+Ü�i¤Ô%¨´3°%ªØ%ˆF�6‰Nð ˆô ˜	¤3Ô'¨5´S°Eª>Ø&ˆF�6‰Nð ˆô ˜	¤5Ô)¨U´u°gÒ-=Ø%ˆF�6‰Nð ˆð ”t�fŠ_Ø&ˆF�6‰Nð ˆð ”t�fŠ_Ø$ˆF�6‰Nàˆùó% DùâKùò ,s   Á
D6Á'D6Á6D<ÂEc                ó4   — | j                  |d|d   › d�«      S )a  Handles JSON schema generation for a core schema that checks if a value is an instance of a class.

        Unless overridden in a subclass, this raises an error.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        zcore_schema.IsInstanceSchema (rZ  r°   ©Úhandle_invalid_for_json_schemar  s     rH   Úis_instance_schemaz%GenerateJsonSchema.is_instance_schemaŽ  s*   € ð ×2Ñ2°6Ð=[Ð\bÐchÑ\iÐ[jÐjkÐ;lÓmÐmrG   c                ó   — i S )aI  Handles JSON schema generation for a core schema that checks if a value is a subclass of a class.

        For backwards compatibility with v1, this does not raise an error, but can be overridden to change this.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rF   r  s     rH   Úis_subclass_schemaz%GenerateJsonSchema.is_subclass_schema›  s	   € ð ˆ	rG   c                ó&   — | j                  |d«      S )zìGenerates a JSON schema that matches a callable value.

        Unless overridden in a subclass, this raises an error.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        úcore_schema.CallableSchemarc  r  s     rH   Úcallable_schemaz"GenerateJsonSchema.callable_schema©  s   € ð ×2Ñ2°6Ð;WÓXÐXrG   c                ó’   — d|vri n| j                  |d   «      }d|dœ}| j                  ||| j                  j                  «       |S )z¢Returns a schema that matches a list schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        Úitems_schemarQ  ©r¸   rƒ   ©rÃ   r  r  rQ  ©rx   r„   rl  rÉ   s       rH   Úlist_schemazGenerateJsonSchema.list_schema¶  óR   € ð ,°6Ñ9‘r¸t×?RÑ?RÐSYÐZhÑSiÓ?jˆØ&°Ñ>ˆØ×$Ñ$ [°&¸$×:QÑ:Q×:WÑ:WÔXØÐrG   úD`tuple_positional_schema` is deprecated. Use `tuple_schema` instead.)Úcategoryc                ó\   — t        j                  dt        d¬«       | j                  |«      S )úReplaced by `tuple_schema`.rr  é   ©Ú
stacklevel©ÚwarningsÚwarnr!   Útuple_schemar  s     rH   Útuple_positional_schemaz*GenerateJsonSchema.tuple_positional_schemaÄ  s,   € ô 	�‰ØRÜ%Øõ	
ð
 × Ñ  Ó(Ð(rG   úB`tuple_variable_schema` is deprecated. Use `tuple_schema` instead.c                ó\   — t        j                  dt        d¬«       | j                  |«      S )ru  r~  rv  rw  ry  r  s     rH   Útuple_variable_schemaz(GenerateJsonSchema.tuple_variable_schemaÏ  s,   € ô 	�‰ØPÜ%Øõ	
ð
 × Ñ  Ó(Ð(rG   c                óØ  — ddi}d|v rl|d   }|dkD  r-||d<   |d   d| D �cg c]  }| j                  |«      ‘Œ c}|d<   |d	z   t        |d   «      k(  r| j                  |d   |   «      |d
<   nJd|d
<   nD|d   D �cg c]  }| j                  |«      ‘Œ }}|r||d<   t        |«      |d<   t        |«      |d<   | j                  ||| j                  j                  «       |S c c}w c c}w )zäGenerates a JSON schema that matches a tuple schema e.g. `tuple[int,
        str, bool]` or `tuple[int, ...]`.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rQ  Úvariadic_item_indexr   ÚminItemsrl  NÚprefixItemsr#   rƒ   TÚmaxItems)rÃ   r[   r  r  rQ  )rx   r„   rÉ   r‚  r…   r„  s         rH   r|  zGenerateJsonSchema.tuple_schemaÚ  s)  € ð )/°Ð'8ˆØ  FÑ*Ø"(Ð)>Ñ"?ÐØ" QÒ&Ø*=�˜JÑ'à:@ÀÑ:PÐQeÐReÐ:fö.Ø26�D×'Ñ'¨Õ-ò.�˜MÑ*ð # QÑ&¬#¨f°^Ñ.DÓ*EÒEà'+×':Ñ':¸6À.Ñ;QÐReÑ;fÓ'g�˜GÒ$ð
 (,�˜GÒ$àAGÈÑAWÖX¸˜4×.Ñ.¨tÕ4ÐXˆKÐXÙØ-8�˜MÑ*Ü&)¨+Ó&6ˆK˜
Ñ#Ü&)¨+Ó&6ˆK˜
Ñ#Ø×$Ñ$ [°&¸$×:QÑ:Q×:WÑ:WÔXØÐùò%.ùò Ys   ¢C"Á<C'c                ó$   — | j                  |«      S )z¨Generates a JSON schema that matches a set schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ©Ú_common_set_schemar  s     rH   Ú
set_schemazGenerateJsonSchema.set_schemaý  ó   € ð ×&Ñ& vÓ.Ð.rG   c                ó$   — | j                  |«      S )z®Generates a JSON schema that matches a frozenset schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r‡  r  s     rH   Úfrozenset_schemaz#GenerateJsonSchema.frozenset_schema  rŠ  rG   c                ó”   — d|vri n| j                  |d   «      }dd|dœ}| j                  ||| j                  j                  «       |S )Nrl  rQ  T)r¸   ÚuniqueItemsrƒ   rn  ro  s       rH   rˆ  z%GenerateJsonSchema._common_set_schema  sR   € Ø+°6Ñ9‘r¸t×?RÑ?RÐSYÐZhÑSiÓ?jˆØ&°tÀlÑSˆØ×$Ñ$ [°&¸$×:QÑ:Q×:WÑ:WÔXØÐrG   c                ó’   — d|vri n| j                  |d   «      }d|dœ}| j                  ||| j                  j                  «       |S )z´Returns a JSON schema that represents the provided GeneratorSchema.

        Args:
            schema: The schema.

        Returns:
            The generated JSON schema.
        rl  rQ  rm  rn  ro  s       rH   Úgenerator_schemaz#GenerateJsonSchema.generator_schema  rq  rG   c                ó"  — ddi}d|v r"| j                  |d   «      j                  «       ni }d|vr%|j                  dd«      }|j                  dd«       nd}d|v r"| j                  |d   «      j                  «       ni }|j                  dd«       |s|�|€||d	<   n||i|d
<   nd|d	<   |j                  d«      dk(  rt	        |«      dkD  sd|v r|j                  dd«       ||d<   | j                  ||| j                  j                  «       |S )z©Generates a JSON schema that matches a dict schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   ÚobjectÚkeys_schemar   r'  Nr[  Úvalues_schemaÚadditionalPropertiesÚpatternPropertiesTrN   r#   ÚpropertyNames)rÃ   rÎ   rÖ   rv   r[   r  r  r’  )rx   r„   rÉ   r“  Úkeys_patternr”  s         rH   Údict_schemazGenerateJsonSchema.dict_schema'  s4  € ð )/°Ð'9ˆàKXÐ\bÑKb�d×)Ñ)¨&°Ñ*?Ó@×EÑEÔGÐhjˆØ˜Ñ$Ø&Ÿ?™?¨9°dÓ;ˆLà�O‰O˜G TÕ*ð  ˆLàO^ÐbhÑOh˜×+Ñ+¨F°?Ñ,CÓD×IÑIÔKÐnpˆà×Ñ˜' 4Ô(á˜LÐ4ØÐ#Ø6C�Ð2Ò3à4@À-Ð3P�Ð/Ò0à26ˆKÐ.Ñ/ð �_‰_˜VÓ$¨Ò0´S¸Ó5EÈÒ5Ià˜Ñ$à�O‰O˜F DÔ)Ø+6ˆK˜Ñ(à×$Ñ$ [°&¸$×:QÑ:Q×:XÑ:XÔYØÐrG   c                ó�   — | j                   dk(  r$|j                  d«      x}r| j                  |«      S | j                  |d   «      S )z´Generates a JSON schema that matches a function-before schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8   Újson_schema_input_schemar„   ©r©   rv   rÃ   ©rx   r„   Úinput_schemas      rH   Úfunction_before_schemaz)GenerateJsonSchema.function_before_schemaW  óK   € ð �9‰9˜Ò$¸&¿*¹*ÐE_Ó:`Ð*`¨,Ð*`Ø×&Ñ& |Ó4Ð4à×"Ñ" 6¨(Ñ#3Ó4Ð4rG   c                ó*   — | j                  |d   «      S )z³Generates a JSON schema that matches a function-after schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r„   ©rÃ   r  s     rH   Úfunction_after_schemaz(GenerateJsonSchema.function_after_schemae  ó   € ð ×"Ñ" 6¨(Ñ#3Ó4Ð4rG   c                óš   — | j                   dk(  r$|j                  d«      x}r| j                  |«      S | j                  |d|d   › d�«      S )z³Generates a JSON schema that matches a function-plain schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8   r›  z*core_schema.PlainValidatorFunctionSchema (Úfunctionr°   )r©   rv   rÃ   rd  r�  s      rH   Úfunction_plain_schemaz(GenerateJsonSchema.function_plain_schemap  s^   € ð �9‰9˜Ò$¸&¿*¹*ÐE_Ó:`Ð*`¨,Ð*`Ø×&Ñ& |Ó4Ð4à×2Ñ2ØÐ@ÀÈ
ÑASÐ@TÐTUÐVó
ð 	
rG   c                ó�   — | j                   dk(  r$|j                  d«      x}r| j                  |«      S | j                  |d   «      S )z²Generates a JSON schema that matches a function-wrap schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8   r›  r„   rœ  r�  s      rH   Úfunction_wrap_schemaz'GenerateJsonSchema.function_wrap_schema€  r   rG   c                óò  — | j                  |d   «      }| j                  |«      }|t        u s|t        u r|S | j                  dk(  rAt        |d   «      }|�1|j                  d«      x}r|€|j                  d«      dv s		  ||«      }	 | j                  |«      }||d<   |S # t        $ r | j                  dd|›d�«       |cY S w xY w# t        j                  $ r | j                  dd	|› d
�«       |cY S w xY w)z¹Generates a JSON schema that matches a schema with a default value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r„   r9   r¦  rÛ   rÜ   r>   zUnable to serialize value z> with the plain serializer; excluding default from JSON schemazDefault value z= is not JSON serializable; excluding default from JSON schemar  )rÃ   Úget_default_valueÚ	NoDefaultr   r©   Ú!_get_ser_schema_for_default_valuerv   Ú	ExceptionÚemit_warningÚencode_defaultÚpydantic_coreÚPydanticSerializationError)rx   r„   rÉ   r  rß   Úser_funcÚencoded_defaults          rH   Údefault_schemaz!GenerateJsonSchema.default_schemaŽ  s6  € ð ×)Ñ)¨&°Ñ*:Ó;ˆà×(Ñ(¨Ó0ˆØ”iÑ 7¬gÑ#5ØÐð
 �9‰9˜Ò'ä:¸6À(Ñ;KÓLˆJàÐ&Ø!+§¡°
Ó!;Ð;�XÐ;Ø ˜¨Z¯^©^¸KÓ-HÐLoÑ-oð'Ù& wÓ/�Gð	Ø"×1Ñ1°'Ó:ˆOð "1ˆ�IÑØÐøô1 !ò 'ð ×%Ñ%Ø2Ø4°W°KÐ?}Ð~ôð 'Ò&ð'ûô ×7Ñ7ò 	Ø×ÑØ*Ø   	Ð)fÐgôð
 Òð	ús$   Â B! Â	C Â!!CÃCÃ+C6Ã5C6c                ó.   — |j                  dt        «      S )aó  Get the default value to be used when generating a JSON Schema for a core schema with a default.

        The default implementation is to use the statically defined default value. This method can be overridden
        if you want to make use of the default factory.

        Args:
            schema: The `'with-default'` core schema.

        Returns:
            The default value to use, or [`NoDefault`][pydantic.json_schema.NoDefault] if no default
                value is available.
        r  )rv   r¬  r  s     rH   r«  z$GenerateJsonSchema.get_default_valueÄ  s   € ð �z‰z˜)¤YÓ/Ð/rG   c                óf   — ddi}| j                  |d   «      }||k(  r|S | j                  ||g«      S )z¼Generates a JSON schema that matches a schema that allows null values.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rP   r„   )rÃ   rà   )rx   r„   Únull_schemaÚinner_json_schemas       rH   Únullable_schemaz"GenerateJsonSchema.nullable_schemaÓ  sI   € ð ˜vÐ&ˆØ ×/Ñ/°°xÑ0@ÓAÐà Ò+ØÐà×,Ñ,Ð.?ÀÐ-MÓNÐNrG   c                óN  — g }|d   }|D ]:  }t        |t        «      r|d   n|}	 |j                  | j                  |«      «       Œ< t        |«      dk(  r|d   S | j                  |«      S # t        $ r Y Œlt
        $ r&}| j                  d|j                  «       Y d}~Œ•d}~ww xY w)zÙGenerates a JSON schema that matches a schema that allows values matching any of the given schemas.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        Úchoicesr   r=   Nr#   )
r€   Útuplerb   rÃ   r   r.   r¯  Úmessager[   rà   )rx   r„   Ú	generatedr¼  ÚchoiceÚchoice_schemaÚexcs          rH   Úunion_schemazGenerateJsonSchema.union_schemaä  s·   € ð ,.ˆ	à˜Ñ#ˆØò 	AˆFä)3°F¼EÔ)B˜F 1šIÈˆMðAØ× Ñ  ×!4Ñ!4°]Ó!CÕDð		Aô ˆy‹>˜QÒØ˜Q‘<ÐØ×(Ñ(¨Ó3Ð3øô  ò ÙÜ/ò AØ×!Ñ!Ð"2°C·K±K×@Ñ@ûðAús   ¥ A+Á+	B$Á6B$Á>BÂB$c                óN  — | j                   dk(  r†g }|D ]_  }|j                  d«      }|€ njt        |t        «      s|g}t	        d„ |D «       «      s nCt        |«      dk7  r n3|j                  |«       Œa dt        t        j                  |«      «      iS | j                  |«      S )aF  Returns the JSON Schema representation for the union of the provided JSON Schemas.

        The result depends on the configured `'union_format'`.

        Args:
            schemas: The list of JSON Schemas to be included in the union.

        Returns:
            The JSON Schema representing the union of schemas.
        Úprimitive_type_arrayr¸   c              3  ó,   K  — | ]  }|t         v –— Œ y ­wru   )Ú_PRIMITIVE_JSON_SCHEMA_TYPES)r\   Úts     rH   r_   z:GenerateJsonSchema.get_union_of_schemas.<locals>.<genexpr>  s   è ø€ ÒSÀ˜1Ô <Ô<ÑSùs   ‚r#   )
r’   rv   r€   ra   Úallr[   Úextendr‚   ÚfromkeysÚget_flattened_anyof)rx   ÚschemasrT  r„   Úschema_typess        rH   rà   z'GenerateJsonSchema.get_union_of_schemasý  s©   € ð ×ÑÐ 6Ò6Ø!ˆEØ!ò <�Ø7=·z±zÀ&Ó7I�ØÐ'áÜ! ,´Ô5Ø$0 >�LÜÑSÀlÔSÔSÙÜ�v“; !Ò#ñ
 à—‘˜\Õ*ð!<ð& ¤¤T§]¡]°5Ó%9Ó :Ð;Ð;à×'Ñ'¨Ó0Ð0rG   c           
     ó*  — i }|d   j                  «       D ]M  \  }}t        |t        «      r|j                  }	 | j	                  |«      j                  «       |t        |«      <   ŒO t        |j                  «       «      }d|i}| j                  ||«      }|�:||j                  «       D ��ci c]  \  }}||j                  d|«      “Œ c}}dœ|d<   |S # t        $ r Y ŒÈt        $ r&}| j                  d|j                  «       Y d}~Œñd}~ww xY wc c}}w )ac  Generates a JSON schema that matches a schema that allows values matching any of the given schemas, where
        the schemas are tagged with a discriminator field that indicates which schema should be used to validate
        the value.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¼  r=   NÚoneOfr   )ÚpropertyNamer¹   Údiscriminator)rƒ   r€   r
   r‡   rÃ   rÎ   r�   r   r.   r¯  r¾  rc   ÚvaluesÚ_extract_discriminatorrv   )	rx   r„   r¿  r  r  rÂ  Úone_of_choicesrÉ   Úopenapi_discriminators	            rH   Útagged_union_schemaz&GenerateJsonSchema.tagged_union_schema!  s  € ð 13ˆ	Ø˜9Ñ%×+Ñ+Ó-ò 
	A‰DˆAˆqÜ˜!œTÔ"Ø—G‘G�ðAð %)×$7Ñ$7¸Ó$:×$?Ñ$?Ó$A�	œ#˜a›&Ò!ð
	Aô .¨i×.>Ñ.>Ó.@ÓAˆØ(/°Ð'@ˆð !%× ;Ñ ;¸FÀNÓ SÐØ Ð,à 5Ø<E¿O¹OÓ<M×N±D°A°q˜A˜qŸu™u V¨QÓ/Ñ/ÓNñ,ˆK˜Ñ(ð
 Ðøô!  ò ÙÜ/ò AØ×!Ñ!Ð"2°C·K±K×@Ñ@ûðAüó Os#   ¹+CÂ+DÃ	DÃDÃ&DÄDc           	     ó@  — d}t        |d   t        «      r|d   S t        |d   t        «      r½t        |d   «      dk(  rt        |d   d   t        «      r|d   d   S |d   D ]†  }t        |t        «      s |S t        |«      dk7  rŒ%|d   }t        |t        «      sŒ;d}|D ]>  }	 | j	                  |«      }|j                  di «      }	t        |	t        «      r||	vsŒ<d} n |sŒƒ|} |S  |S # t
        $ r'}| j                  dt        |«      «       i }Y d}~Œbd}~ww xY w)	zvExtract a compatible OpenAPI discriminator from the schema and one_of choices that end up in the final
        schema.NrÒ  r#   r   Tr?   r   F)	r€   r�   ra   r[   rô   r  r¯  rv   r‚   )
rx   r„   rÕ  rÖ  Ú
alias_pathÚaliasÚalias_is_present_on_all_choicesrÀ  rÂ  r   s
             rH   rÔ  z)GenerateJsonSchema._extract_discriminatorF  s\  € ð
 -1Ðä�f˜_Ñ-¬sÔ3Ø˜/Ñ*Ð*ä�f˜_Ñ-¬tÔ4ä�6˜/Ñ*Ó+¨qÒ0´ZÀÀÑ@WÐXYÑ@ZÔ\_Ô5`Ø˜oÑ.¨qÑ1Ð1ð
 % _Ñ5ò �
Ü! *¬dÔ3Øð. %Ð$ô- �z“? aÒ'ØØ" 1™�Ü! %¬Ô-ØØ26Ð/Ø,ò �Fð$Ø!%×!8Ñ!8¸Ó!@˜ð "(§¡¨L¸"Ó!=�JÜ% j´$Ô7¸5È
Ò;RØ:?Ð7Ùðò 3Ø,1Ð)ØØ$Ð$ð3ð2 %Ð$øô (ò $ð ×)Ñ)Ð*AÄ3ÀsÃ8ÔLØ!#�ûð$ús   Â%C-Ã-	DÃ6DÄDc                óV   — | j                   dk(  rdnd}| j                  |d   |   «      S )a�  Generates a JSON schema that matches a core_schema.ChainSchema.

        When generating a schema for validation, we return the validation JSON schema for the first step in the chain.
        For serialization, we return the serialization JSON schema for the last step in the chain.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r8   r   éÿÿÿÿÚsteps)r©   rÃ   )rx   r„   Ú
step_indexs      rH   Úchain_schemazGenerateJsonSchema.chain_schemas  s0   € ð Ÿ)™) |Ò3‘Q¸ˆ
Ø×"Ñ" 6¨'¡?°:Ñ#>Ó?Ð?rG   c                óz   — |j                  dd«      }|r| j                  |d   «      S | j                  |d   «      S )zóGenerates a JSON schema that matches a schema that allows values matching either the lax schema or the
        strict schema.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ÚstrictFÚstrict_schemaÚ
lax_schema)rv   rÃ   )rx   r„   Ú
use_stricts      rH   Úlax_or_strict_schemaz'GenerateJsonSchema.lax_or_strict_schema‚  sE   € ð —Z‘Z ¨%Ó0ˆ
ñ Ø×&Ñ& v¨oÑ'>Ó?Ð?à×&Ñ& v¨lÑ';Ó<Ð<rG   c                ó*   — | j                  |d   «      S )a‚  Generates a JSON schema that matches a schema that allows values matching either the JSON schema or the
        Python schema.

        The JSON schema is used instead of the Python schema. If you want to use the Python schema, you should override
        this method.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rÉ   r¢  r  s     rH   Újson_or_python_schemaz(GenerateJsonSchema.json_or_python_schema•  s   € ð ×"Ñ" 6¨-Ñ#8Ó9Ð9rG   c           	     óV  — |j                  dd«      }|d   j                  «       D ��cg c]+  \  }}| j                  |«      r|| j                  ||«      |f‘Œ- }}}| j                  dk(  r0|j                  | j                  |j                  dg «      «      «       |j                  d«      }t        |«      }| j                  j                  |«      5  | j                  |«      }ddd«       |j                  d«      d	k(  rd
d<   n?|j                  d«      dk(  r+d|v r"|d   ddik7  r| j                  |d   «      d<   ndd<   |�| j                  ||«       |S dvr7|j                  di «      j                  d«      }	|	d	k(  rd
|d<   |S |	dk(  rd|d<   |S c c}}w # 1 sw Y   Œ¼xY w)z¾Generates a JSON schema that matches a schema that defines a typed dict.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ÚtotalTÚfieldsr9   Úcomputed_fieldsrZ  NÚextra_behaviorÚforbidFr•  ÚallowÚextras_schemar¸   ÚanyÚconfigÚextra_fields_behavior)rv   rƒ   Úfield_is_presentÚfield_is_requiredr©   rÊ  Ú_name_required_computed_fieldsÚ_get_typed_dict_configr™   ÚpushÚ_named_required_fields_schemarÃ   Ú_update_class_schema)
rx   r„   rê  ÚnameÚfieldÚnamed_required_fieldsrZ  rò  rÉ   Úextras
             rH   Útyped_dict_schemaz$GenerateJsonSchema.typed_dict_schema¤  sê  € ð —
‘
˜7 DÓ)ˆð  & hÑ/×5Ñ5Ó7÷J
á��eØ×$Ñ$ UÔ+ð �4×)Ñ)¨%°Ó7¸Ò?ðJ
Ðñ J
ð
 �9‰9˜Ò'Ø!×(Ñ(¨×)LÑ)LÈVÏZÉZÐXiÐkmÓMnÓ)oÔpØ�j‰j˜ÓˆÜ'¨Ó,ˆØ×'Ñ'×,Ñ,¨VÓ4ñ 	TØ×<Ñ<Ð=RÓSˆK÷	Tð �:‰:Ð&Ó'¨8Ò3Ø27ˆKÐ.Ò/Ø�Z‰ZÐ(Ó)¨WÒ4Ø &Ñ(¨V°OÑ-DÈÐQVÈÒ-WØ6:×6IÑ6IÈ&ÐQ`ÑJaÓ6b�Ð2Ò3à6:�Ð2Ñ3àˆ?ð ×%Ñ% k°3¸Ô?ð Ðð $¨;Ñ6Ø—J‘J˜x¨Ó,×0Ñ0Ð1HÓIˆEØ˜Ò Ø6;�Ð2Ñ3ð Ðð ˜'Ò!Ø6:�Ð2Ñ3àÐùóKJ
÷	Tð 	Tús   ©0FÃFÆF(c                ó8   — | D �cg c]
  }|d   d|f‘Œ c}S c c}w )NÚproperty_nameTrF   )rì  rü  s     rH   rö  z1GenerateJsonSchema._name_required_computed_fieldsÕ  s&   € ð DSÖS¸%��Ñ'¨¨uÒ5ÒSÐSùÒSs   …c                ó€  — i }g }|D ]™  \  }}}| j                   r| j                  ||«      }	 | j                  |«      j                  «       }d|vr'| j                  |«      r| j                  |«      }||d<   | j                  |«      }|||<   |sŒ‰|j                  |«       Œ› d|dœ}	|r||	d<   |	S # t        $ r Y Œµw xY w)Nr[  r’  ©r¸   r   Úrequired)	r�   Ú_get_alias_namerÃ   rÎ   r   Úfield_title_should_be_setÚget_title_from_nameÚhandle_ref_overridesrb   )
rx   rý  r   Úrequired_fieldsrû  r  rü  Úfield_json_schemar[  rÉ   s
             rH   rù  z0GenerateJsonSchema._named_required_fields_schemaÛ  sð   € ð 24ˆ
Ø%'ˆØ%:ò 	-Ñ!ˆD�(˜EØ�}Š}Ø×+Ñ+¨E°4Ó8�ðØ$(×$7Ñ$7¸Ó$>×$CÑ$CÓ$EÐ!ð Ð/Ñ/°D×4RÑ4RÐSXÔ4YØ×0Ñ0°Ó6�Ø-2Ð! 'Ñ*Ø $× 9Ñ 9Ð:KÓ LÐØ0ˆJ�tÑÚØ×&Ñ& tÕ,ð	-ð  (°zÑBˆÙØ&5ˆK˜
Ñ#ØÐøô  ò Ùðús   ­B1Â1	B=Â<B=c                ó¢  — |d   dk(  r|j                  d|«      }n4| j                  dk(  r|j                  d|«      }n|j                  d|«      }t        |t        «      r|}|S t        |t        «      rPt        d|«      }|D ]=  }t        |t        «      sŒt        |«      dk(  sŒ#t        |d	   t        «      sŒ7|d	   } |S  |S t        |«       |S )
Nr¸   úcomputed-fieldrÚ  r8   Úvalidation_aliasÚserialization_aliaszlist[str] | strr#   r   )rv   r©   r€   r�   ra   r   r[   r   )rx   rü  rû  rÚ  Úpaths        rH   r  z"GenerateJsonSchema._get_alias_nameô  sÙ   € Ø�‰=Ð,Ò,ØŸ™ 7¨DÓ1‰EØ�Y‰Y˜,Ò&Ø—I‘IÐ0°$Ó7‰Eà—I‘IÐ3°TÓ:ˆEÜ�eœSÔ!ØˆDð ˆô ˜œtÔ$ÜÐ*¨EÓ2ˆEØò �Ü˜d¤DÕ)¬c°$«i¸1«nÄÈDÐQRÉGÔUXÕAYð   ™7�DØð ˆðð ˆô ˜ÔØˆrG   c                ó*   — | j                  |d   «      S )zÄGenerates a JSON schema that matches a schema that defines a typed dict field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r„   r¢  r  s     rH   Útyped_dict_field_schemaz*GenerateJsonSchema.typed_dict_field_schema	  r¤  rG   c                ó*   — | j                  |d   «      S )zÃGenerates a JSON schema that matches a schema that defines a dataclass field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r„   r¢  r  s     rH   Údataclass_field_schemaz)GenerateJsonSchema.dataclass_field_schema  r¤  rG   c                ó*   — | j                  |d   «      S )z¿Generates a JSON schema that matches a schema that defines a model field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r„   r¢  r  s     rH   Úmodel_field_schemaz%GenerateJsonSchema.model_field_schema  r¤  rG   c                ó*   — | j                  |d   «      S )zÂGenerates a JSON schema that matches a schema that defines a computed field.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        Úreturn_schemar¢  r  s     rH   Úcomputed_field_schemaz(GenerateJsonSchema.computed_field_schema*  s   € ð ×"Ñ" 6¨/Ñ#:Ó;Ð;rG   c                óê   — t        d|d   «      }|j                  }| j                  j                  |«      5  | j	                  |d   «      }ddd«       | j                  ||«       |S # 1 sw Y   ŒxY w)z¹Generates a JSON schema that matches a schema that defines a model.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ztype[BaseModel]rZ  r„   N)r   Úmodel_configr™   rø  rÃ   rú  )rx   r„   rZ  rò  rÉ   s        rH   Úmodel_schemazGenerateJsonSchema.model_schema5  s|   € ô Ð$ f¨U¡mÓ4ˆØ×!Ñ!ˆà×'Ñ'×,Ñ,¨VÓ4ñ 	@Ø×-Ñ-¨f°XÑ.>Ó?ˆK÷	@ð 	×!Ñ! +¨s°FÔ;àÐ÷	@ð 	@ús   ·A)Á)A2c                ó¶  — ddl m} ddlm} |j	                  d«      x}�|j                  d|«       nX|j	                  d«      x}rE ||«      }t        |t        «      st        d|› d|j                  › �«      ‚|j                  d|«       d|vr|j                  |d<   ||u st        j                  |«      rdn|j                  }	|	r&|j                  d	t        j                  |	«      «       n9t!        ||«      r-|j"                  d
   j$                  x}
r|j                  d	|
«       |j	                  d«      }d|vr|dk(  rd|d<   n
|dk(  rd|d<   |j	                  d«      }t!        ||«      r8|j&                  r,|j(                  d
   j*                  }|r|rt-        d«      ‚|r|}t        |t.        t0        f«      r|j3                  |«      }t        |t4        «      r|j7                  |«       nZt9        |«      r>t;        t        j<                  |«      j>                  «      dkD  r
 |||«       n ||«       n|�t-        d|› d�«      ‚tA        |d«      rd|d<   yy)a�  Update json_schema with the following, extracted from `config` and `cls`:

        * title
        * description
        * additional properties
        * json_schema_extra
        * deprecated

        Done in place, hence there's no return value as the original json_schema is mutated.
        No ref resolving is involved here, as that's not appropriate for simple updates.
        r#   r6   )Ú	RootModelr[  NÚmodel_title_generatorzmodel_title_generator z must return str, not r\  Úrootrþ  r•  rï  Trî  FÚjson_schema_extrazz"model_config['json_schema_extra']" and "Field.json_schema_extra" on "RootModel.root" field must not be set simultaneouslyz"model_config['json_schema_extra']=z$ should be a dict, callable, or NoneÚ__deprecated__r   )!Úmainr7   Ú
root_modelr  rv   Ú
setdefaultr€   r�   r·   Ú	__class__rB   ÚdataclassesÚis_dataclassrE   r^  r_  Ú
issubclassÚ__pydantic_fields__r\  Ú__pydantic_root_model__Úmodel_fieldsr   Ú
ValueErrorrŠ   ÚclassmethodÚ__get__r‚   rî   rï   r[   Ú	signatureÚ
parametersÚhasattr)rx   rÉ   rZ  rò  r7   r  Úconfig_titler  r[  Ú	docstringÚroot_descriptionrþ  r   Úroot_json_schema_extras                 rH   rú  z'GenerateJsonSchema._update_class_schemaJ  sg  € õ 	$Ý)à"ŸJ™J wÓ/Ð/ˆLÐ<Ø×"Ñ" 7¨LÕ9Ø&,§j¡jÐ1HÓ&IÐIÐ"ÐIÙ)¨#Ó.ˆEÜ˜e¤SÔ)ÜÐ"8Ð9NÐ8OÐOeÐfk×fuÑfuÐevÐ wÓxÐxØ×"Ñ" 7¨EÔ2Ø˜+Ñ%Ø#&§<¡<ˆK˜Ñ ð   9Ñ,´×0HÑ0HÈÔ0M‘DÐSV×S^ÑS^ˆ	áØ×"Ñ" =´'×2BÑ2BÀ9Ó2MÕNÜ˜˜YÔ'À×AXÑAXÐY_ÑA`×AlÑAlÐ-lÐ-=Ð-lØ×"Ñ" =Ð2BÔCà—
‘
˜7Ó#ˆØ!¨Ñ4Ø˜ÒØ6:�Ð2Ò3Ø˜(Ò"Ø6;�Ð2Ñ3à"ŸJ™JÐ':Ó;ÐÜ�c˜9Ô%¨#×*EÒ*EØ%(×%5Ñ%5°fÑ%=×%OÑ%OÐ"Ù Ñ%;Ü ð<óð ñ &Ø$:Ð!äÐ'¬,¼Ð)DÔEà 1× 9Ñ 9¸#Ó >ÐäÐ'¬Ô.Ø×ÑÐ0Õ1ÜÐ'Ô(ä”7×$Ñ$Ð%6Ó7×BÑBÓCÀaÒGÙ! +¨sÕ3á! +Õ.ØÐ*ÜØ4Ð5FÐ4GÐGkÐlóð ô �3Ð(Ô)Ø(,ˆK˜Ò%ð *rG   c                óz   — d|v r6|d   }| j                  t        |«      «      }|€t        d|› �«      ‚|}d|v rŒ6|S )a$  Resolve a JsonSchemaValue to the non-ref schema if it is a $ref schema.

        Args:
            json_schema: The schema to resolve.

        Returns:
            The resolved schema.

        Raises:
            RuntimeError: If the schema reference can't be found in definitions.
        r   z(Cannot update undefined schema for $ref=)rÍ   rK   r  )rx   rÉ   ry   Úschema_to_updates       rH   rô   z%GenerateJsonSchema.resolve_ref_schema‘  s[   € ð ˜Ñ#Ø˜fÑ%ˆCØ#×?Ñ?ÄÈÃÓMÐØÐ'Ü"Ð%MÈcÈUÐ#SÓTÐTØ*ˆKð ˜Ò#ð ÐrG   c           	     ó¸  — |d   j                  «       D ��cg c],  \  }}| j                  |«      r|| j                  |d¬«      |f‘Œ. }}}| j                  dk(  r0|j	                  | j                  |j                  dg «      «      «       | j                  |«      }|j                  dd«      }|�%| j                  |«      }| j                  |«      |d<   |S c c}}w )	zÂGenerates a JSON schema that matches a schema that defines a model's fields.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rë  T©rê  r9   rì  rð  Nr•  )
rƒ   rô  rõ  r©   rÊ  rö  rv   rù  rô   rÃ   )rx   r„   rû  rü  rý  rÉ   rð  r7  s           rH   Úmodel_fields_schemaz&GenerateJsonSchema.model_fields_schema¥  së   € ð  & hÑ/×5Ñ5Ó7÷J
á��eØ×$Ñ$ UÔ+ð �4×)Ñ)¨%°tÐ)Ó<¸eÒDðJ
Ðñ J
ð
 �9‰9˜Ò'Ø!×(Ñ(¨×)LÑ)LÈVÏZÉZÐXiÐkmÓMnÓ)oÔpØ×8Ñ8Ð9NÓOˆØŸ
™
 ?°DÓ9ˆØÐ$Ø#×6Ñ6°{ÓCÐØ7;×7JÑ7JÈ=Ó7YÐÐ3Ñ4ØÐùóJ
s   —1Cc                ó�   — | j                   dk(  r|j                  d«       S | j                   dk(  ryt        | j                   «       y)a  Whether the field should be included in the generated JSON schema.

        Args:
            field: The schema for the field itself.

        Returns:
            `True` if the field should be included in the generated JSON schema, `False` otherwise.
        r9   Úserialization_excluder8   TN)r©   rv   r   )rx   rü  s     rH   rô  z#GenerateJsonSchema.field_is_present¼  s@   € ð �9‰9˜Ò'ð —y‘yÐ!8Ó9Ð9Ð9Ø�Y‰Y˜,Ò&Øä˜Ÿ™Õ#rG   c                óÖ   — |d   dk(  r|j                  d|«      }n|d   d   dk7  }| j                  dk(  r3|j                  d«      du}| j                  j                  r| S |xr | S |S )	aY  Whether the field should be marked as required in the generated JSON schema.
        (Note that this is irrelevant if the field is not present in the JSON schema.).

        Args:
            field: The schema for the field itself.
            total: Only applies to `TypedDictField`s.
                Indicates if the `TypedDict` this field belongs to is total, in which case any fields that don't
                explicitly specify `required=False` are required.

        Returns:
            `True` if the field should be marked as required in the generated JSON schema, `False` otherwise.
        r¸   ztyped-dict-fieldr  r„   r  r9   Úserialization_exclude_ifN)rv   r©   r$   Ú+json_schema_serialization_defaults_required)rx   rü  rê  r  Úhas_exclude_ifs        rH   rõ  z$GenerateJsonSchema.field_is_requiredÎ  s}   € ð" �‰=Ð.Ò.Ø—y‘y ¨UÓ3‰Hà˜X‘ vÑ.°)Ñ;ˆHà�9‰9˜Ò'Ø"ŸY™YÐ'AÓBÈ$ÐNˆNØ�|‰|×GÒGØ)Ð)Ð)àÒ6¨Ð$6Ð6àˆOrG   c                ó   — |d   D �cg c],  }| j                  |«      r|d   | j                  |d¬«      |f‘Œ. }}| j                  dk(  r0|j                  | j	                  |j                  dg «      «      «       | j                  |«      S c c}w )zÕGenerates a JSON schema that matches a schema that defines a dataclass's constructor arguments.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rë  rû  Tr9  r9   rì  )rô  rõ  r©   rÊ  rö  rv   rù  )rx   r„   rü  rý  s       rH   Údataclass_args_schemaz(GenerateJsonSchema.dataclass_args_schemaí  sŸ   € ð   Ñ)öJ
àØ×$Ñ$ UÔ+ð �6‰]˜D×2Ñ2°5ÀÐ2ÓEÀuÒMðJ
Ðð J
ð
 �9‰9˜Ò'Ø!×(Ñ(¨×)LÑ)LÈVÏZÉZÐXiÐkmÓMnÓ)oÔpØ×1Ñ1Ð2GÓHÐHùòJ
s   ˆ1Bc                ó’  — ddl m} |d   }t        |dt        di «      «      }| j                  j                  |«      5  | j                  |d   «      j                  «       }ddd«       | j                  ||«        ||«      rd}n-|j                  €dnt        j                  |j                  «      }|r||d<   |S # 1 sw Y   Œ]xY w)	z½Generates a JSON schema that matches a schema that defines a dataclass.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r#   )Úis_stdlib_dataclassrZ  Ú__pydantic_config__r1   r„   Nr\  )Ú_internal._dataclassesrD  r³   r   r™   rø  rÃ   rÎ   rú  rE   r^  r_  )rx   r„   rD  rZ  rò  rÉ   r\  s          rH   Údataclass_schemaz#GenerateJsonSchema.dataclass_schemaÿ  sÈ   € õ 	@à�U‰mˆÜ$ SÐ*?ÄÀlÐTVÓAWÓXˆà×'Ñ'×,Ñ,¨VÓ4ñ 	GØ×-Ñ-¨f°XÑ.>Ó?×DÑDÓFˆK÷	Gð 	×!Ñ! +¨s°FÔ;ñ ˜sÔ#à‰Kà"%§+¡+Ð"5™$¼7×;KÑ;KÈCÏKÉKÓ;XˆKÙØ)4ˆK˜Ñ&àÐ÷	Gð 	Gús   ¾#B=Â=Cc                ó^  — |j                  di «      j                  d«      }|d   }|D �cg c]  }|j                  d«      dk(  sŒ|‘Œ }}|D �cg c]  }|j                  d«      dv sŒ|‘Œ }}|D �cg c]  }|j                  d«      dk(  sŒ|‘Œ }}|j                  d«      }|j                  d	«      }	|r| xr |	 }
|
r| j                  ||z   |«      S | xr | }|r| j                  ||z   |	«      S |s| xr |	 }
|
r| j                  ||z   |«      S t        d
«      ‚c c}w c c}w c c}w )úÈGenerates a JSON schema that matches a schema that defines a function's arguments.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        ræ   Ú'pydantic_js_prefer_positional_argumentsÚarguments_schemar©   Úkeyword_only>   NÚpositional_or_keywordÚpositional_onlyÚvar_args_schemaÚvar_kwargs_schemazfUnable to generate JSON schema for arguments validator with positional-only and keyword-only arguments)rv   Úp_arguments_schemaÚkw_arguments_schemar.   )rx   r„   Úprefer_positionalÚ	argumentsÚaÚkw_only_argumentsÚkw_or_p_argumentsÚp_only_argumentsrO  rP  Úpositional_possibleÚkeyword_possibles               rH   rK  z#GenerateJsonSchema.arguments_schema  sg  € ð #ŸJ™J z°2Ó6×:Ñ:Ð;dÓeÐàÐ-Ñ.ˆ	Ø(1ÖU 1°Q·U±U¸6³]ÀnÓ5TšQÐUÐÐUØ(1Öf 1°Q·U±U¸6³]ÐFeÒ5ešQÐfÐÐfØ'0ÖW !°A·E±E¸&³MÐEVÓ4VšAÐWÐÐWØ Ÿ*™*Ð%6Ó7ˆØ"ŸJ™JÐ':Ó;ÐáØ&7Ð"7Ò"QÐ@QÐ<QÐÙ"Ø×.Ñ.Ð/?ÐBSÑ/SÐUdÓeÐeà/Ð/ÒG¸Ð4GÐÙØ×+Ñ+Ð,=Ð@QÑ,QÐSdÓeÐeá Ø&7Ð"7Ò"QÐ@QÐ<QÐÙ"Ø×.Ñ.Ð/?ÐBSÑ/SÐUdÓeÐeä*Øtó
ð 	
ùò) VùÚfùÚWs#   «D ÁD ÁD%Á(D%Á2D*ÂD*c                óx  — i }g }|D ]ƒ  }| j                  |«      }| j                  |d   «      j                  «       }d|vr(| j                  |d   «      r| j	                  |«      |d<   |||<   |d   d   dk7  sŒs|j                  |«       Œ… d|dœ}|r||d<   |r| j                  |«      }	|	r|	|d<   |S d	|d<   |S )
zÓGenerates a JSON schema that matches a schema that defines a function's keyword arguments.

        Args:
            arguments: The core schema.

        Returns:
            The generated JSON schema.
        r„   r[  r¸   r  r’  r  r  r•  F)Úget_argument_namerÃ   rÎ   r  r  rb   )
rx   rT  rP  r   r  Úargumentrû  Úargument_schemarÉ   Úadditional_properties_schemas
             rH   rR  z&GenerateJsonSchema.kw_arguments_schemaA  sý   € ð 24ˆ
Ø ˆØ!ò 	&ˆHØ×)Ñ)¨(Ó3ˆDØ"×1Ñ1°(¸8Ñ2DÓE×JÑJÓLˆOØ˜oÑ-°$×2PÑ2PÐQYÐZbÑQcÔ2dØ+/×+CÑ+CÀDÓ+I� Ñ(Ø.ˆJ�tÑà˜Ñ! &Ñ)¨YÓ6ð —‘ Õ%ð	&ð 19È
Ñ'SˆÙØ&.ˆK˜
Ñ#áØ+/×+>Ñ+>Ð?PÓ+QÐ(Ù+Ø6R�Ð2Ñ3ð Ðð 38ˆKÐ.Ñ/ØÐrG   c                ó–  — g }d}|D ]ƒ  }| j                  |«      }| j                  |d   «      j                  «       }d|vr(| j                  |d   «      r| j	                  |«      |d<   |j                  |«       |d   d   dk7  sŒ|dz  }Œ… ddi}|r||d<   |r||d	<   |r| j                  |«      }	|	r|	|d
<   |S t        |«      |d<   |S )zÖGenerates a JSON schema that matches a schema that defines a function's positional arguments.

        Args:
            arguments: The core schema.

        Returns:
            The generated JSON schema.
        r   r„   r[  r¸   r  r#   rQ  r„  rƒ  rƒ   r…  )r\  rÃ   rÎ   r  r  rb   r[   )
rx   rT  rO  Úprefix_itemsÚ	min_itemsr]  rû  r^  rÉ   rl  s
             rH   rQ  z%GenerateJsonSchema.p_arguments_schemag  s  € ð /1ˆØˆ	à!ò 	ˆHØ×)Ñ)¨(Ó3ˆDà"×1Ñ1°(¸8Ñ2DÓE×JÑJÓLˆOØ˜oÑ-°$×2PÑ2PÐQYÐZbÑQcÔ2dØ+/×+CÑ+CÀDÓ+I� Ñ(Ø×Ñ Ô0à˜Ñ! &Ñ)¨YÓ6ð ˜Q‘‘	ð	ð )/°Ð'8ˆÙØ)5ˆK˜Ñ&ÙØ&/ˆK˜
Ñ#áØ×.Ñ.¨Ó?ˆLÙØ'3�˜GÑ$ð Ðô '*¨,Ó&7ˆK˜
Ñ#àÐrG   c                ót   — |d   }| j                   r&|j                  d«      }t        |t        «      r|}|S 	 |S )z™Retrieves the name of an argument.

        Args:
            argument: The core schema.

        Returns:
            The name of the argument.
        rû  rÚ  )r�   rv   r€   r�   )rx   r]  rû  rÚ  s       rH   r\  z$GenerateJsonSchema.get_argument_name’  sC   € ð ˜ÑˆØ�=Š=Ø—L‘L Ó)ˆEÜ˜%¤Ô%Ø�ð ˆð ØˆrG   c                ó”  — |d   }i }g }|D ]­  }|j                  dd«      }| j                  |«      }| j                  |d   «      j                  «       }|dk(  rd|dœ}n
|dk(  rd	|d
œ}|j	                  d| j                  |«      «       |||<   |dk(  rd|v s|dvsŒ‘|d   d   dk7  sŒ�|j                  |«       Œ¯ d	|dœ}	|r||	d<   |	S )rI  rK  r©   rM  r„   Úvar_argsrQ  rm  Úvar_kwargs_uniformr’  )r¸   r•  r[  Úvar_kwargs_unpacked_typed_dictr  >   re  rf  rg  r¸   r  r  )rv   r\  rÃ   rÎ   r$  r  rb   )
rx   r„   rT  r   r  r]  r©   rû  r^  rÉ   s
             rH   Úarguments_v3_schemaz&GenerateJsonSchema.arguments_v3_schema¤  s  € ð Ð-Ñ.ˆ	Ø13ˆ
Ø ˆØ!ò 	&ˆHØ—<‘< Ð(?Ó@ˆDØ×)Ñ)¨(Ó3ˆDØ"×1Ñ1°(¸8Ñ2DÓE×JÑJÓLˆOØ�zÒ!Ø+2¸_Ñ"M‘ØÐ-Ò-Ø+3È_Ñ"]�à×&Ñ& w°×0HÑ0HÈÓ0NÔOØ.ˆJ�tÑð Ð9Ò9¸jÈOÑ>[ØÐcÒcØ˜XÑ& vÑ.°)Ó;ð
 —‘ Õ%ð)	&ð, 19È
Ñ'SˆÙØ&.ˆK˜
Ñ#ØÐrG   c                ó*   — | j                  |d   «      S )zÁGenerates a JSON schema that matches a schema that defines a function call.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rK  r¢  r  s     rH   Úcall_schemazGenerateJsonSchema.call_schemaË  s   € ð ×"Ñ" 6Ð*<Ñ#=Ó>Ð>rG   c                ó*   — | j                  |d   «      S )zÀGenerates a JSON schema that matches a schema that defines a custom error.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r„   r¢  r  s     rH   Úcustom_error_schemaz&GenerateJsonSchema.custom_error_schemaÖ  r¤  rG   c                ó    — |j                  d«      xs t        j                  «       }| j                  |«      }| j                  dk(  rdd|dœS |S )z¿Generates a JSON schema that matches a schema that defines a JSON object.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r„   r8   rN   zapplication/json)r¸   ÚcontentMediaTypeÚcontentSchema)rv   r   r  rÃ   r©   )rx   r„   Úcontent_core_schemaÚcontent_json_schemas       rH   rÉ   zGenerateJsonSchema.json_schemaá  sV   € ð %Ÿj™j¨Ó2ÒN´k×6LÑ6LÓ6NÐØ"×1Ñ1Ð2EÓFÐØ�9‰9˜Ò$Ø$Ð:LÐ_rÑsÐsð 'Ð&rG   c                ó`   — ddddœ}| j                  ||| j                  j                  «       |S )z·Generates a JSON schema that matches a schema that defines a URL.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rN   Úurir#   ©r¸   r<  Ú	minLength©r  r  rN   r6  s      rH   Ú
url_schemazGenerateJsonSchema.url_schemaò  s4   € ð  (°5ÀqÑIˆØ×$Ñ$ [°&¸$×:QÑ:Q×:XÑ:XÔYØÐrG   c                ó`   — ddddœ}| j                  ||| j                  j                  «       |S )zÜGenerates a JSON schema that matches a schema that defines a URL that can be used with multiple hosts.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rN   zmulti-host-urir#   rt  rv  r6  s      rH   Úmulti_host_url_schemaz(GenerateJsonSchema.multi_host_url_schemaÿ  s6   € ð  (Ð3CÐRSÑTˆØ×$Ñ$ [°&¸$×:QÑ:Q×:XÑ:XÔYØÐrG   c                ó   — dddœS )z¢Generates a JSON schema that matches a UUID.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rN   Úuuidr;  rF   r  s     rH   Úuuid_schemazGenerateJsonSchema.uuid_schema  rC  rG   c                óþ   — |d   D ]  }	 | j                  |«       Œ | j                  |d   «      S # t        $ rB}t        |d   «      }|| j                  | j	                  || j
                  f«      <   Y d}~Œqd}~ww xY w)zÐGenerates a JSON schema that matches a schema that defines a JSON object with definitions.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        rh   ry   Nr„   )rÃ   r.   rI   r¡   Úget_defs_refr©   )rx   r„   Ú
definitionr¼   r×   s        rH   rj   z%GenerateJsonSchema.definitions_schema  sŽ   € ð ! Ñ/ò 	ˆJðØ×#Ñ# JÕ/ð	ð ×"Ñ" 6¨(Ñ#3Ó4Ð4øô	 0ò Ü$+¨J°uÑ,=Ó$>�Øde�×7Ñ7¸×8IÑ8IÈ8ÐUY×U^ÑU^ÐJ_Ó8`ÑaÜûðús   Š1±	A<º8A7Á7A<c                óJ   — t        |d   «      }| j                  |«      \  }}|S )zÁGenerates a JSON schema that matches a schema that references a definition.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        Ú
schema_ref)rI   rÕ   )rx   r„   r×   r¬   rÑ   s        rH   Údefinition_ref_schemaz(GenerateJsonSchema.definition_ref_schema*  s.   € ô ˜6 ,Ñ/Ó0ˆØ!×;Ñ;¸HÓEÑˆˆ?ØÐrG   c                óþ   — |d   }|dk(  s|dk(  r%|j                  d«      }|�| j                  |«      S y|dk(  s|dk(  r#| j                  t        j                  «       «      S |d   dk(  r| j                  |d	   «      S y)
zÅGenerates a JSON schema that matches a schema that defines a serialized object.

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   úfunction-plainzfunction-wrapr  Nr<  z	to-stringÚmodelr„   )rv   rÃ   r2  r   )rx   r„   Úschema_typer  s       rH   rß   zGenerateJsonSchema.ser_schema7  s•   € ð ˜V‘nˆØÐ*Ò*¨k¸_Ò.Là"ŸJ™J Ó7ˆMØÐ(Ø×*Ñ*¨=Ó9Ð9ð ð ˜HÒ$¨°{Ò(Bà—?‘?¤;×#9Ñ#9Ó#;Ó<Ð<Ø�F‰^˜wÒ&à×&Ñ& v¨hÑ'7Ó8Ð8ØrG   c                ó
   — ddiS )aõ  Generates a JSON schema that matches a complex number.

        JSON has no standard way to represent complex numbers. Complex number is not a numeric
        type. Here we represent complex number as strings following the rule defined by Python.
        For instance, '1+2j' is an accepted complex string. Details can be found in
        [Python's `complex` documentation][complex].

        Args:
            schema: The core schema.

        Returns:
            The generated JSON schema.
        r¸   rN   rF   r  s     rH   Úcomplex_schemaz!GenerateJsonSchema.complex_schemaP  s   € ð ˜Ð!Ð!rG   c                ó^   — |j                  «       j                  dd«      j                  «       S )z”Retrieves a title from a name.

        Args:
            name: The name to retrieve a title from.

        Returns:
            The title.
        r¬   ú )r[  r²   Ústrip©rx   rû  s     rH   r  z&GenerateJsonSchema.get_title_from_nameb  s&   € ð �z‰z‹|×#Ñ# C¨Ó-×3Ñ3Ó5Ð5rG   c                óz  — t        j                  |«      r$|d   dk(  r|d   }n|d   }| j                  |«      S t        j                  |«      r`|j	                  d«      ry|d   dv r| j                  |d   «      S t        j
                  |«      r| j                  |d   «      S |d   dk(  ryy	t        d
|› �«      ‚)aÉ  Returns true if a field with the given schema should have a title set based on the field name.

        Intuitively, we want this to return true for schemas that wouldn't otherwise provide their own title
        (e.g., int, float, str), and false for those that would (e.g., BaseModel subclasses).

        Args:
            schema: The schema to check.

        Returns:
            `True` if the field should have a title set, `False` otherwise.
        r¸   r  r  r„   ry   F>   r  rÝ   rh   zdefinition-refTrÞ   )r&   râ   r  rá   rv   Úis_function_with_inner_schemar.   )rx   r„   Úfield_schemas      rH   r  z,GenerateJsonSchema.field_title_should_be_setm  sÔ   € ô ×+Ñ+¨FÔ3Ø�f‰~Ð!1Ò1Ø% oÑ6‘à% hÑ/�Ø×1Ñ1°,Ó?Ð?ä×'Ñ'¨Ô/Ø�z‰z˜%Ô ØØ�f‰~Ð!GÑGØ×5Ñ5°f¸XÑ6FÓGÐGÜ×8Ñ8¸Ô@Ø×5Ñ5°f¸XÑ6FÓGÐGØ�f‰~Ð!1Ò1ð Øô /Ð1PÐQWÐPXÐ/YÓZÐZrG   c                óP   — t        j                  dd|«      j                  dd«      S )zªNormalizes a name to be used as a key in a dictionary.

        Args:
            name: The name to normalize.

        Returns:
            The normalized name.
        z[^a-zA-Z0-9.\-_]r¬   r¯   Ú__)ÚreÚsubr²   rŒ  s     rH   Únormalize_namez!GenerateJsonSchema.normalize_name�  s%   € ô �v‰vÐ)¨3°Ó5×=Ñ=¸cÀ4ÓHÐHrG   c                ó<  — |\  }}t        j                  d|«      }|D �cg c]  }|j                  dd«      d   ‘Œ }}dj                  |«      }|D �cg c]  }t        j                  dd|«      ‘Œ }}dj                  |«      }t
        |   }t        | j                  |«      «      }	t        | j                  |«      d|› �z   «      }
t        | j                  |«      «      }t        |› d|› �«      }t        | j                  |«      «      }| j                  j                  |«      }|€5| j                  |xx   dz  cc<   | j                  |   x}| j                  |<   t        |› d	|› �«      }t        |› d	|› �«      }|	|
||||g| j                  |<   |S c c}w c c}w )
zÛOverride this method to change the way that definitions keys are generated from a core reference.

        Args:
            core_mode_ref: The core reference.

        Returns:
            The definitions key.
        z([\][,])ú:r#   r   Ú z(?:[^.[\]]+\.)+((?:[^.[\]]+))z\1r«   r‘  )r’  ÚsplitÚrsplitÚjoinr“  r<   rJ   r”  rž   rv   r�   r›   )rx   rý   r×   r©   Ú
componentsr]   Úcore_ref_no_idÚ	short_refÚ
mode_titlerû  Ú	name_modeÚmodule_qualnameÚmodule_qualname_modeÚmodule_qualname_idÚoccurrence_indexÚmodule_qualname_occurrenceÚmodule_qualname_occurrence_modes                    rH   r~  zGenerateJsonSchema.get_defs_ref›  sÇ  € ð '‰ˆ�$Ü—X‘X˜k¨8Ó4ˆ
à3=Ö>¨a�a—h‘h˜s AÓ& qÓ)Ð>ˆ
Ð>ØŸ™ Ó,ˆàR\Ö]ÈQ”b—f‘fÐ=¸uÀaÕHÐ]ˆ
Ð]Ø—G‘G˜JÓ'ˆ	ä(¨Ñ.ˆ
ô
 �t×*Ñ*¨9Ó5Ó6ˆÜ˜D×/Ñ/°	Ó:¸qÀÀÐ=MÑMÓNˆ	Ü! $×"5Ñ"5°nÓ"EÓFˆÜ&¨/Ð):¸!¸J¸<Ð'HÓIÐÜ$ T×%8Ñ%8¸Ó%BÓCÐØ×0Ñ0×4Ñ4Ð5GÓHÐØÐ#Ø×#Ñ# OÓ4¸Ñ9Ó4ØKO×KbÑKbÐcrÑKsÐsÐ˜t×4Ñ4Ð5GÑHä%,°Ð/@ÀÐCSÐBTÐ-UÓ%VÐ"Ü*1Ð5IÐ4JÈ"ÐM]ÐL^Ð2_Ó*`Ð'ð ØØØ Ø&Ø+ðN
ˆ×)Ñ)Ð*IÑJð /Ð.ùòC ?ùò ^s    FÁFc                óv  — || j                   f}| j                  j                  |«      }|�| j                  |   }|d|ifS | j	                  |«      }|| j                  |<   || j
                  |<   t        | j                  j                  |¬«      «      }|| j                  |<   || j                  |<   d|i}||fS )a“  This method wraps the get_defs_ref method with some cache-lookup/population logic,
        and returns both the produced defs_ref and the JSON schema that will refer to the right definition.

        Args:
            core_ref: The core reference to get the definitions reference for.

        Returns:
            A tuple of the definitions reference and the JSON schema that will refer to it.
        r   ©r…  )
r©   r”   rv   r“   r~  r•   rK   r‘   r<  r–   )rx   r×   rý   Úmaybe_defs_refrØ   rl   rÑ   s          rH   rÕ   z,GenerateJsonSchema.get_cache_defs_ref_schemaË  sÓ   € ð " 4§9¡9Ð-ˆØ×/Ñ/×3Ñ3°MÓBˆØÐ%Ø×-Ñ-¨mÑ<ˆHØ! F¨HÐ#5Ð5Ð5à×$Ñ$ ]Ó3ˆð 19ˆ×Ñ˜}Ñ-Ø+8ˆ×Ñ˜xÑ(ä˜4×,Ñ,×3Ñ3¸(Ð3ÓCÓDˆØ08ˆ×Ñ˜}Ñ-Ø+3ˆ×Ñ˜xÑ(Ø! 8Ð,ˆØ˜Ð(Ð(rG   c                óà   — d|v ri|j                  «       }| j                  t        |d   «      «      }|€|S t        |j	                  «       «      D ]  \  }}|dk(  rŒ||v sŒ||   |k(  sŒ||= Œ |S )z÷Remove any sibling keys that are redundant with the referenced schema.

        Args:
            json_schema: The schema to remove redundant sibling keys from.

        Returns:
            The schema with redundant sibling keys removed.
        r   )rÎ   rÍ   rK   ra   rƒ   )rx   rÉ   Úreferenced_json_schemar  r  s        rH   r  z'GenerateJsonSchema.handle_ref_overridesç  s•   € ð �[Ñ à%×*Ñ*Ó,ˆKà%)×%EÑ%EÄgÈkÐZ`ÑNaÓFbÓ%cÐ"Ø%Ð-ð #Ð"Ü˜[×.Ñ.Ó0Ó1ò '‘��1Ø˜’;ØØÐ.Ò.Ð3IÈ!Ñ3LÐPQÓ3QØ# A™ð	'ð ÐrG   c                óÖ   — 	 | j                   |   }|| j                  v r| j                  |   ‚| j                  j                  |d «      S # t        $ r |j                  d«      rY y ‚ w xY w©N©zhttp://zhttps://)r–   r¡   rh   rv   ÚKeyErrorÚ
startswith)rx   rØ   Údef_refs      rH   rÍ   z.GenerateJsonSchema.get_schema_from_definitions	  ss   € ð	Ø×,Ñ,¨XÑ6ˆGØ˜$×AÑAÑAØ×=Ñ=¸gÑFÐFØ×#Ñ#×'Ñ'¨°Ó6Ð6øÜò 	Ø×"Ñ"Ð#:Ô;ÙØð	ús   ‚AA
 Á
A(Á&A(c                ó|  — ddl m}m} | j                  }	  |t	        |«      «      r|n8 |t	        |«      |j
                  ¬«      j                  || j                  d¬«      }t        j                  ||j                  |j                  | j                  ¬«      S # t        $ r t        j                  d|› �«      ‚w xY w)a  Encode a default value to a JSON-serializable value.

        This is used to encode default values for fields in the generated JSON schema.

        Args:
            dft: The default value to encode.

        Returns:
            The encoded default value.
        r#   )ÚTypeAdapterÚ_type_has_config)rò  Újson)r�   r©   zUnable to encode default value )Útimedelta_modeÚ
bytes_moder�   )Útype_adapterr²  r³  r$   r¸   Úconfig_dictÚdump_pythonr�   r/   r±  r²  r   rK  r=  )rx   Údftr²  r³  rò  r  s         rH   r°  z!GenerateJsonSchema.encode_default	  s¾   € ÷ 	@à—‘ˆð		dñ $¤D¨£IÔ.ñ á ¤ c£°6×3EÑ3EÔF×RÑRØ $§-¡-°fð Só ð ô ×/Ñ/Ø F×$=Ñ$=È&×J_ÑJ_Ðjn×jwÑjwô
ð 	
øô -ò 	dÜ×:Ñ:Ð=\Ð]`Ð\aÐ;bÓcÐcð	dús   –AB Â"B;c                óN   — |j                  «       D ]  \  }}||v sŒ||   ||<   Œ y)aÊ  Update the json_schema with the corresponding validations specified in the core_schema,
        using the provided mapping to translate keys in core_schema to the appropriate keys for a JSON schema.

        Args:
            json_schema: The JSON schema to update.
            core_schema: The core schema to get the validations from.
            mapping: A mapping from core_schema attribute names to the corresponding JSON schema attribute names.
        N)rƒ   )rx   rÉ   r   r¹   Úcore_keyÚjson_schema_keys         rH   r  z*GenerateJsonSchema.update_with_validations*	  s7   € ð *1¯©«ò 	EÑ%ˆH�oØ˜;Ò&Ø/:¸8Ñ/D�˜OÒ,ñ	ErG   c                  óJ   — e Zd ZdZddddddœZdd	d
œZdd	ddœZddd
œZddd
œZy)ú%GenerateJsonSchema.ValidationsMappingag  This class just contains mappings from core_schema attribute names to the corresponding
        JSON schema attribute names. While I suspect it is unlikely to be necessary, you can in
        principle override this class in a subclass of GenerateJsonSchema (by inheriting from
        GenerateJsonSchema.ValidationsMapping) to change these mappings.
        Ú
multipleOfÚmaximumÚminimumÚexclusiveMaximumÚexclusiveMinimum)r*  r+  r,  r-  r.  ru  Ú	maxLength)Ú
min_lengthÚ
max_lengthr'  )rÆ  rÇ  r'  rƒ  r…  ÚminPropertiesÚmaxPropertiesN)	rB   rC   rD   rE   r  r>  rN   rQ  r’  rF   rG   rH   r  r¿  9	  s^   „ ñ	ð (ØØØ$Ø$ñ
ˆð &Ø%ñ
ˆð
 &Ø%Ø ñ
ˆð %Ø$ñ
ˆð
 *Ø)ñ
‰rG   r  c                óÈ   — g }|D ]:  }t        |«      dk(  rd|v r|j                  |d   «       Œ*|j                  |«       Œ< t        |«      }t        |«      dk(  r|d   S d|iS )Nr#   r/  r   )r[   rÊ  rb   rc   )rx   rÍ  r]  r„   s       rH   rÌ  z&GenerateJsonSchema.get_flattened_anyofY	  sr   € ØˆØò 	'ˆFÜ�6‹{˜aÒ G¨vÑ$5Ø—‘˜v g™Õ/à—‘˜vÕ&ð		'ô
 ' wÓ/ˆÜˆw‹<˜1ÒØ˜1‘:ÐØ˜Ð!Ð!rG   c                ó@   ‡ ‡‡— t        «       Šdˆˆˆ fd„Š ‰|«       ‰S )zKGet all values corresponding to the key '$ref' anywhere in the json_schema.c                ó  •— t        | t        «      r°d| v rut        | d   «      }t        |t        «      sy |‰v }‰|xx   dz  cc<   |ry 	 ‰j                  |   }|‰j
                  v r‰j
                  |   ‚ ‰‰j                  |   «       | j                  «       D ]#  \  }}|dk(  rt        |t        «      rŒ ‰|«       Œ% y t        | t        «      r| D ]
  } ‰|«       Œ y y # t        $ r |j                  d«      s‚ Y Œuw xY w)Nr   r#   r­  Úexamples)r€   r‚   rK   r�   r–   r¡   rh   r®  r¯  rƒ   ra   )	r„   rØ   Úalready_visitedrl   r  r  Ú_add_json_refsÚ	json_refsrx   s	         €€€rH   rÏ  z>GenerateJsonSchema.get_json_ref_counts.<locals>._add_json_refsi	  s   ø€ Ü˜&¤$Ô'Ø˜VÑ#Ü& v¨f¡~Ó6�HÜ% h´Ô4ØØ&.°)Ð&;�OØ˜hÓ'¨1Ñ,Ó'Ù&Øð"Ø#'×#9Ñ#9¸(Ñ#C˜Ø# t×'NÑ'NÑNØ"&×"IÑ"IÈ(Ñ"SÐSÙ& t×'7Ñ'7¸Ñ'AÔBð
 #ŸL™L›Nò &‘D�A�qØ˜J’¬:°a¼Ô+>ð !Ù" 1Õ%ñ&ô ˜F¤DÔ)Øò &�AÙ" 1Õ%ñ&ð *øô $ò "Ø'×2Ñ2Ð3JÔKØ!ñ  Lð"ús   Á
AC# Ã#DÄ D)r„   r   rˆ   ÚNone)r   )rx   rÉ   rÏ  rÐ  s   ` @@rH   rÌ   z&GenerateJsonSchema.get_json_ref_countse	  s   ú€ ä(/«	ˆ	÷	&ñ: 	�{Ô#ØÐrG   c                ó   — t        d|› �«      ‚)Nz!Cannot generate a JsonSchema for )r.   )rx   r„   Ú
error_infos      rH   rd  z1GenerateJsonSchema.handle_invalid_for_json_schema‰	  s   € Ü*Ð-NÈzÈlÐ+[Ó\Ð\rG   c                ób   — | j                  ||«      }|�t        j                  |t        «       yy)zfThis method simply emits PydanticJsonSchemaWarnings based on handling in the `warning_message` method.N)Úrender_warning_messagerz  r{  rA   )rx   ÚkindÚdetailr¾  s       rH   r¯  zGenerateJsonSchema.emit_warningŒ	  s.   € à×-Ñ-¨d°FÓ;ˆØÐÜ�M‰M˜'Ô#<Õ=ð rG   c                ó0   — || j                   v ry|› d|› d�S )am  This method is responsible for ignoring warnings as desired, and for formatting the warning messages.

        You can override the value of `ignored_warning_kinds` in a subclass of GenerateJsonSchema
        to modify what warnings are generated. If you want more control, you can override this method;
        just return None in situations where you don't want warnings to be emitted.

        Args:
            kind: The kind of warning to render. It can be one of the following:

                - 'skipped-choice': A choice field was skipped because it had no valid choices.
                - 'non-serializable-default': A default value was skipped because it was not JSON-serializable.
            detail: A string with additional details about the warning.

        Returns:
            The formatted warning message, or `None` if no warning should be emitted.
        Nz [ú])r�   )rx   rÖ  r×  s      rH   rÕ  z)GenerateJsonSchema.render_warning_message’	  s(   € ð" �4×-Ñ-Ñ-ØØ�˜˜D˜6 Ð#Ð#rG   c                óü   — i }| j                   j                  «       D ]3  }|D ],  }t        | j                  j	                  |¬«      «      }|||<   Œ. Œ5 t
        j                  | j                   || j                  «      S )Nr§  )r›   rÓ  rK   r‘   r<  rT   rs   rh   )rx   rg   Ú	defs_refsrl   rØ   s        rH   rÄ   z/GenerateJsonSchema._build_definitions_remapping§	  s„   € Ø/1ˆØ×:Ñ:×AÑAÓCò 	2ˆIØ%ò 2�Ü" 4×#4Ñ#4×#;Ñ#;À(Ð#;Ó#KÓL�Ø)1�˜XÒ&ñ2ð	2ô
 %×=Ñ=Ø×-Ñ-¨|¸T×=MÑ=Mó
ð 	
rG   c                ó°  — t        «       }t        |«      }|r`|j                  «       }	 | j                  |   }||v rŒ'|j	                  |«       |j                  t        | j                  |   «      «       |rŒ`| j                  j                  «       D ��ci c]  \  }}||v sŒ||“Œ c}}| _        y # t        $ r |j                  d«      s‚ Y ŒYw xY wc c}}w r¬  )
ÚsetÚ_get_all_json_refsrÖ   r–   Úaddrî   rh   r®  r¯  rƒ   )rx   r„   Úvisited_defs_refsÚunvisited_json_refsÚnext_json_refÚnext_defs_refr  r  s           rH   rÏ   z/GenerateJsonSchema._garbage_collect_definitions²	  sÛ   € Ü*-«%ÐÜ0°Ó8ÐÙ!Ø/×3Ñ3Ó5ˆMðØ $× 6Ñ 6°}Ñ E�Ø Ð$5Ñ5ØØ!×%Ñ% mÔ4Ø#×*Ñ*Ô+=¸d×>NÑ>NÈ}Ñ>]Ó+^Ô_ò "ð .2×-=Ñ-=×-CÑ-CÓ-E×`¡T Q¨ÈÐN_ÒI_˜A˜q™DÓ`ˆÕøô	 ò Ø$×/Ñ/Ð0GÔHØñ Iðüó as"   ©B1 ½8B1 ÂCÂ"CÂ1CÃC)r�   rR  r‘   r�   r’   ú)Literal['any_of', 'primitive_type_array']rˆ   rÑ  )rˆ   z_config.ConfigWrapper)rˆ   ÚJsonSchemaMode)rˆ   zKdict[CoreSchemaOrFieldType, Callable[[CoreSchemaOrField], JsonSchemaValue]])rÆ   zGSequence[tuple[JsonSchemaKeyT, JsonSchemaMode, core_schema.CoreSchema]]rˆ   zctuple[dict[tuple[JsonSchemaKeyT, JsonSchemaMode], JsonSchemaValue], dict[DefsRef, JsonSchemaValue]])r8   )r„   r   r©   rå  rˆ   rú   )r„   r3   rˆ   rú   ru   )r‡   rú   r  ú
str | Nonerˆ   rú   )r‡   r   r  ræ  rˆ   r   )r„   zcore_schema.InvalidSchemarˆ   rú   )r„   zcore_schema.AnySchemarˆ   rú   )r„   zcore_schema.NoneSchemarˆ   rú   )r„   zcore_schema.BoolSchemarˆ   rú   )r„   zcore_schema.IntSchemarˆ   rú   )r„   zcore_schema.FloatSchemarˆ   rú   )r„   r1  rˆ   rú   )r„   zcore_schema.StringSchemarˆ   rú   )r„   zcore_schema.BytesSchemarˆ   rú   )r„   zcore_schema.DateSchemarˆ   rú   )r„   zcore_schema.TimeSchemarˆ   rú   )r„   zcore_schema.DatetimeSchemarˆ   rú   )r„   zcore_schema.TimedeltaSchemarˆ   rú   )r„   zcore_schema.LiteralSchemarˆ   rú   )r„   z!core_schema.MissingSentinelSchemarˆ   rú   )r„   zcore_schema.EnumSchemarˆ   rú   )r„   zcore_schema.IsInstanceSchemarˆ   rú   )r„   zcore_schema.IsSubclassSchemarˆ   rú   )r„   ri  rˆ   rú   )r„   zcore_schema.ListSchemarˆ   rú   )r„   zcore_schema.TupleSchemarˆ   rú   )r„   zcore_schema.SetSchemarˆ   rú   )r„   zcore_schema.FrozenSetSchemarˆ   rú   )r„   z3core_schema.SetSchema | core_schema.FrozenSetSchemarˆ   rú   )r„   zcore_schema.GeneratorSchemarˆ   rú   )r„   zcore_schema.DictSchemarˆ   rú   )r„   z)core_schema.BeforeValidatorFunctionSchemarˆ   rú   )r„   z(core_schema.AfterValidatorFunctionSchemarˆ   rú   )r„   z(core_schema.PlainValidatorFunctionSchemarˆ   rú   )r„   z'core_schema.WrapValidatorFunctionSchemarˆ   rú   )r„   úcore_schema.WithDefaultSchemarˆ   rú   )r„   rç  rˆ   r   )r„   zcore_schema.NullableSchemarˆ   rú   )r„   zcore_schema.UnionSchemarˆ   rú   )rÍ  zlist[JsonSchemaValue]rˆ   rú   )r„   úcore_schema.TaggedUnionSchemarˆ   rú   )r„   rè  rÕ  úlist[JsonDict]rˆ   ræ  )r„   zcore_schema.ChainSchemarˆ   rú   )r„   zcore_schema.LaxOrStrictSchemarˆ   rú   )r„   zcore_schema.JsonOrPythonSchemarˆ   rú   )r„   zcore_schema.TypedDictSchemarˆ   rú   )rì  zlist[ComputedField]rˆ   z1list[tuple[str, bool, core_schema.ComputedField]])rý  z+Sequence[tuple[str, bool, CoreSchemaField]]rˆ   rú   )rü  r2   rû  r�   rˆ   r�   )r„   zcore_schema.TypedDictFieldrˆ   rú   )r„   zcore_schema.DataclassFieldrˆ   rú   )r„   zcore_schema.ModelFieldrˆ   rú   )r„   zcore_schema.ComputedFieldrˆ   rú   )r„   zcore_schema.ModelSchemarˆ   rú   )rÉ   rú   rZ  z	type[Any]rò  r1   rˆ   rÑ  )rÉ   rú   rˆ   rú   )r„   zcore_schema.ModelFieldsSchemarˆ   rú   )rü  r2   rˆ   rR  )rü  zPcore_schema.ModelField | core_schema.DataclassField | core_schema.TypedDictFieldrê  rR  rˆ   rR  )r„   zcore_schema.DataclassArgsSchemarˆ   rú   )r„   zcore_schema.DataclassSchemarˆ   rú   )r„   zcore_schema.ArgumentsSchemarˆ   rú   )rT  ú$list[core_schema.ArgumentsParameter]rP  úCoreSchema | Nonerˆ   rú   )rT  rê  rO  rë  rˆ   rú   )r]  zAcore_schema.ArgumentsParameter | core_schema.ArgumentsV3Parameterrˆ   r�   )r„   zcore_schema.ArgumentsV3Schemarˆ   rú   )r„   zcore_schema.CallSchemarˆ   rú   )r„   zcore_schema.CustomErrorSchemarˆ   rú   )r„   zcore_schema.JsonSchemarˆ   rú   )r„   zcore_schema.UrlSchemarˆ   rú   )r„   zcore_schema.MultiHostUrlSchemarˆ   rú   )r„   zcore_schema.UuidSchemarˆ   rú   )r„   zcore_schema.DefinitionsSchemarˆ   rú   )r„   z%core_schema.DefinitionReferenceSchemarˆ   rú   )r„   zVcore_schema.SerSchema | core_schema.IncExSeqSerSchema | core_schema.IncExDictSerSchemarˆ   úJsonSchemaValue | None)r„   zcore_schema.ComplexSchemarˆ   rú   )rû  r�   rˆ   r�   )r„   r3   rˆ   rR  )rý   ÚCoreModeRefrˆ   rJ   )r×   rI   rˆ   ztuple[DefsRef, JsonSchemaValue])rØ   rK   rˆ   rì  )rº  r   rˆ   r   )rÉ   rú   r   r   r¹   zdict[str, str]rˆ   rÑ  )rÉ   rú   rˆ   zdict[JsonRef, int])r„   r3   rÓ  r�   rˆ   rú   )rÖ  ÚJsonSchemaWarningKindr×  r�   rˆ   rÑ  )rÖ  rî  r×  r�   rˆ   ræ  )rˆ   rT   )r„   rú   rˆ   rÑ  )orB   rC   rD   rE   Úschema_dialectr�   r‰   ÚDEFAULT_REF_TEMPLATEr£   Úpropertyr$   r©   rŸ   rÊ   rÒ   rÃ   rÅ   r  r  r  r  r  r  r!  r4  r2  r?  rB  rF  rH  rL  rU  rX  ra  re  rg  rj  rp  r   r   r}  r€  r|  r‰  rŒ  rˆ  r�  r™  rŸ  r£  r§  r©  rµ  r«  rº  rÃ  rà   r×  rÔ  rà  ræ  rè  rÿ  rŠ   rö  rù  r  r  r  r  r  r  rú  rô   r:  rô  rõ  rB  rG  rK  rR  rQ  r\  rh  rj  rl  rÉ   rw  ry  r|  rj   r‚  rß   rˆ  r  r  r”  r~  rÕ   r  rÍ   r°  r  r  rÌ  rÌ   rd  r¯  rÕ  rÄ   rÏ   rF   rG   rH   rŒ   rŒ   Ú   s³  … ñ'ðR D€Nð :JÐ8JÐÐ5ÓJð Ø0ØBJð	(àð(ð ð(ð @ð	(ð
 
ó(ðT ò/ó ð/ð òó ððà	Tóð4/AØ]ð/Aà	ló/Aôb/&óbJôXôó$jó
	ó	 ó	#óóóIóVó ó	4ó	4ó	9ó8óó@	ó"óHnóóYóñ ÐVÐaeÔfØ
ò)ó ó gð)ñ ÐTÐ_cÔdØ
ò)ó ó eð)ó!óF	/ó	/óóó.ó`5ó	5ó
ó 5ó4ól0óOó"4ó2"1óH#ðJ+%Ø3ð+%ØESð+%à	ó+%óZ@ó=ó&:ó/ðb ðTØ,ðTà	:òTó ðTð
Ø%Pðà	óó2ó*	5ó	5ó	5ó	<óó*E-óNó(ó.$ð$à_ðð ðð 
ó	ó>Ió$ó<"
ðH$Ø=ð$ØRcð$à	ó$ðL)Ø=ð)ØPað)à	ó)óVó$%óN	?ó	5ó'ó"óó	4ó5ó$ðØlðà	óó2"ó$	6ó![óF	Ió./ó`)ó8ó6	ó
ð:EØ*ðEØ9CðEØN\ðEà	óE÷
ñ 
ó@
"ó"óH]ó>ó$ó*	
ôarG   rŒ   TrŽ   r8   c                óN  — ddl m}  ||||¬«      }t        | j                  t        j
                  «      r| j                  j                  «        | |u rt        d«      ‚t        | j                  t        j
                  «      rJ d«       ‚|j                  | j                  |¬«      S )a˜  Utility function to generate a JSON Schema for a model.

    Args:
        cls: The model class to generate a JSON Schema for.
        by_alias: If `True` (the default), fields will be serialized according to their alias.
            If `False`, fields will be serialized according to their attribute name.
        ref_template: The template to use for generating JSON Schema references.
        union_format: The format to use when combining schemas from unions together. Can be one of:

            - `'any_of'`: Use the [`anyOf`](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
              keyword to combine schemas (the default).
            - `'primitive_type_array'`: Use the [`type`](https://json-schema.org/understanding-json-schema/reference/type)
              keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive
              type (`string`, `boolean`, `null`, `integer` or `number`) or contains constraints/metadata, falls back to
              `any_of`.
        schema_generator: The class to use for generating the JSON Schema.
        mode: The mode to use for generating the JSON Schema. It can be one of the following:

            - 'validation': Generate a JSON Schema for validating data.
            - 'serialization': Generate a JSON Schema for serializing data.

    Returns:
        The generated JSON Schema.
    r#   r6   ©r�   r‘   r’   zTmodel_json_schema() must be called on a subclass of BaseModel, not BaseModel itself.zthis is a bug! please report it)r©   )	r"  r7   r€   Ú__pydantic_core_schema__r)   ÚMockCoreSchemaÚrebuildr´   rÒ   )rZ  r�   r‘   r’   Úschema_generatorr©   r7   Úschema_generator_instances           rH   Úmodel_json_schemarù  Ç	  s—   € õ@  á 0Ø¨À<ô!Ðô �#×.Ñ.´×0LÑ0LÔMØ×$Ñ$×,Ñ,Ô.à
ˆiÑÜÐsÓtÐtä˜#×6Ñ6¼×8TÑ8TÔUÐxÐWxÓxÐUØ$×-Ñ-¨c×.JÑ.JÐQUÐ-ÓVÐVrG   )r�   r[  r\  r‘   r’   r÷  c               óV  — | D ]D  \  }}t        |j                  t        j                  «      sŒ+|j                  j	                  «        ŒF  ||||¬«      }	| D �
�cg c]  \  }
}|
||
j                  f‘Œ }}
}|	j                  |«      \  }}i }|r||d<   |r||d<   |r||d<   ||fS c c}}
w )aà  Utility function to generate a JSON Schema for multiple models.

    Args:
        models: A sequence of tuples of the form (model, mode).
        by_alias: Whether field aliases should be used as keys in the generated JSON Schema.
        title: The title of the generated JSON Schema.
        description: The description of the generated JSON Schema.
        ref_template: The reference template to use for generating JSON Schema references.
        union_format: The format to use when combining schemas from unions together. Can be one of:

            - `'any_of'`: Use the [`anyOf`](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
              keyword to combine schemas (the default).
            - `'primitive_type_array'`: Use the [`type`](https://json-schema.org/understanding-json-schema/reference/type)
              keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive
              type (`string`, `boolean`, `null`, `integer` or `number`) or contains constraints/metadata, falls back to
              `any_of`.
        schema_generator: The schema generator to use for generating the JSON Schema.

    Returns:
        A tuple where:
            - The first element is a dictionary whose keys are tuples of JSON schema key type and JSON mode, and
                whose values are the JSON schema corresponding to that pair of inputs. (These schemas may have
                JsonRef references to definitions that are defined in the second returned element.)
            - The second element is a JSON schema containing all definitions referenced in the first returned
                    element, along with the optional title and description keys.
    ró  rX   r[  r\  )r€   rô  r)   rõ  rö  rÊ   )Úmodelsr�   r[  r\  r‘   r’   r÷  rZ  r¬   ÚinstanceÚmr©   rÆ   rÈ   rh   rÉ   s                   rH   Úmodels_json_schemarþ  ÷	  sÔ   € ðH ò 3‰ˆˆQÜ�c×2Ñ2´M×4PÑ4PÕQØ×(Ñ(×0Ñ0Õ2ð3ñ  ¨ÀÐ[gÔh€Hà=C÷bÙ29°!°TˆˆD�!×,Ñ,Ò-ðb€Fñ bð %-×$AÑ$AÀ&Ó$IÑ!Ð�kà"$€KÙØ*ˆ�GÑÙØ$ˆ�GÑÙØ%0ˆ�MÑ"à˜[Ð(Ð(ùóbs   ÁB%)Ú_HashableJsonValue.rÿ  .r   c                ón   — t        | D �ci c]  }t        |«      |“Œ c}j                  «       «      S c c}w ru   )ra   Ú_make_json_hashablerÓ  )rÍ  r„   s     rH   rc   rc   8
  s/   € ÜÀ7ÖK¸Ô$ VÓ,¨fÑ4ÒK×RÑRÓTÓUÐUùÒKs   Š2c                ó¼   — t        | t        «      r)t        t        d„ | j	                  «       D «       «      «      S t        | t
        «      rt        d„ | D «       «      S | S )Nc              3  ó<   K  — | ]  \  }}|t        |«      f–— Œ y ­wru   ©r  )r\   r  r  s      rH   r_   z&_make_json_hashable.<locals>.<genexpr>>
  s   è ø€ ÒR¹D¸A¸q˜QÔ 3°AÓ 6Ô7ÑRùs   ‚c              3  ó2   K  — | ]  }t        |«      –— Œ y ­wru   r  )r\   r  s     rH   r_   z&_make_json_hashable.<locals>.<genexpr>@
  s   è ø€ Ò;°Ô(¨×+Ñ;ùs   ‚)r€   r‚   r½  r  rƒ   ra   )r‡   s    rH   r  r  <
  sH   € Ü�%œÔÜ”VÑRÀEÇKÁKÃMÔRÓRÓSÐSÜ	�Eœ4Ô	 ÜÑ;°UÔ;Ó;Ð;àˆrG   c                  óF   — e Zd ZU dZded<   dZded<   	 	 	 	 	 	 d	d„Zd
d„Zy)ÚWithJsonSchemaaQ  !!! abstract "Usage Documentation"
        [`WithJsonSchema` Annotation](../concepts/json_schema.md#withjsonschema-annotation)

    Add this as an annotation on a field to override the (base) JSON schema that would be generated for that field.
    This provides a way to set a JSON schema for types that would otherwise raise errors when producing a JSON schema,
    such as Callable, or types that have an is-instance core schema, without needing to go so far as creating a
    custom subclass of pydantic.json_schema.GenerateJsonSchema.
    Note that any _modifications_ to the schema that would normally be made (such as setting the title for model fields)
    will still be performed.

    If `mode` is set this will only apply to that schema generation mode, allowing you
    to set different json schemas for validation and serialization.
    rì  rÉ   Nú-Literal['validation', 'serialization'] | Noner©   c                ó¼   — | j                   xs |j                   }||j                   k7  r ||«      S | j                  €t        ‚| j                  j                  «       S ru   )r©   rÉ   r   rÎ   )rx   r   Úhandlerr©   s       rH   Ú__get_pydantic_json_schema__z+WithJsonSchema.__get_pydantic_json_schema__X
  sT   € ð �y‰yÒ(˜GŸL™LˆØ�7—<‘<ÒÙ˜;Ó'Ð'Ø×ÑÐ#äÐà×#Ñ#×(Ñ(Ó*Ð*rG   c                ó>   — t        t        | j                  «      «      S ru   ©Úhashr¸   r©   r¦   s    rH   Ú__hash__zWithJsonSchema.__hash__d
  ó   € Ü”D˜Ÿ™“OÓ$Ð$rG   ©r   zcore_schema.CoreSchemar
  r+   rˆ   rú   ©rˆ   rœ   )rB   rC   rD   rE   r‰   r©   r  r  rF   rG   rH   r  r  E
  s<   … ñð (Ó'Ø:>€DÐ
7Ó>ð
+Ø1ð
+Ø<Pð
+à	ó
+ô%rG   r  c                  óŒ   — e Zd ZdZe ed«      	 d		 	 	 	 	 d
d„«       «       Zed	dd„«       Z	 d		 	 	 	 	 dd„Z	 	 	 	 	 	 dd„Zdd„Zy)ÚExamplesa  Add examples to a JSON schema.

    If the JSON Schema already contains examples, the provided examples
    will be appended.

    If `mode` is set this will only apply to that schema generation mode,
    allowing you to add different examples for validation and serialization.
    zeUsing a dict for `examples` is deprecated since v2.9 and will be removed in v3.0. Use a list instead.Nc                 ó   — y ru   rF   ©rx   rÍ  r©   s      rH   r£   zExamples.__init__r
  s   € ð rG   c                 ó   — y ru   rF   r  s      rH   r£   zExamples.__init__x
  s   € ØqtrG   c                óx   — t        |t        «      rt        j                  dt        d¬«       || _        || _        y )Nz>Using a dict for `examples` is deprecated, use a list instead.rv  rw  )r€   r‚   rz  r{  r"   rÍ  r©   r  s      rH   r£   zExamples.__init__{
  s3   € ô �h¤Ô%Ü�M‰MØPÜ)Øõð
 !ˆŒØˆ�	rG   c           	     ó’  — | j                   xs |j                   } ||«      }||j                   k7  r|S |j                  d«      }|€t        | j                  «      |d<   t	        |t
        «      r‘t	        | j                  t        «      r[t        j                  dt        «       t        |j                  «       D ��cg c]  }|D ]  }|‘Œ Œ c}}| j                  z   «      |d<   nt        i |¥| j                  ¥«      |d<   t	        |t        «      r«t	        | j                  t        «      rt        || j                  z   «      |d<   |S t	        | j                  t
        «      rZt        j                  dt        «       t        || j                  j                  «       D ��cg c]  }|D ]  }|‘Œ Œ c}}z   «      |d<   |S c c}}w c c}}w )NrÍ  zÒUpdating existing JSON Schema examples of type dict with examples of type list. Only the existing examples values will be retained. Note that dict support for examples is deprecated and will be removed in v3.0.zÉUpdating existing JSON Schema examples of type list with examples of type dict. Only the examples values will be retained. Note that dict support for examples is deprecated and will be removed in v3.0.)r©   rv   r   rÍ  r€   r‚   ra   rz  r{  ÚUserWarningrÓ  )rx   r   r
  r©   rÉ   rÍ  r‡   Úexs           rH   r  z%Examples.__get_pydantic_json_schema__‡
  s”  € ð �y‰yÒ(˜GŸL™LˆÙ˜kÓ*ˆØ�7—<‘<ÒØÐØ—?‘? :Ó.ˆØÐÜ&8¸¿¹Ó&GˆK˜
Ñ#Ü�h¤Ô%Ü˜$Ÿ-™-¬Ô.Ü—‘ðJô  ô	ô +=Ø%-§_¡_Ó%6×G˜EÀÒG¸2’RÐG�RÓGÈ$Ï-É-ÑWó+�˜JÒ'ô +=Ð=ZÀÐ=ZÈDÏMÉMÐ=ZÓ*[�˜JÑ'Ü�h¤Ô%Ü˜$Ÿ-™-¬Ô.Ü*<¸XÈÏÉÑ=UÓ*V�˜JÑ'ð Ðô ˜DŸM™M¬4Ô0Ü—‘ðJô  ô	ô +=Ø°·±×0DÑ0DÓ0F×W uÐQVÒWÈ2¢ÐW ÓWÑWó+�˜JÑ'ð Ðùó% Hùó  Xs   Â;F=
ÆGc                ó>   — t        t        | j                  «      «      S ru   r  r¦   s    rH   r  zExamples.__hash__®
  r  rG   ru   )rÍ  údict[str, Any]r©   r  rˆ   rÑ  )rÍ  z	list[Any]r©   r  rˆ   rÑ  )rÍ  zdict[str, Any] | list[Any]r©   r  rˆ   rÑ  r  r  )	rB   rC   rD   rE   r   r   r£   r  r  rF   rG   rH   r  r  h
  sœ   „ ñð ÙÐwÓxà^bðØ&ðØ.[ðà	òó yó ðð Ûtó Øtð koð
Ø2ð
Ø:gð
à	ó
ð%Ø1ð%Ø<Pð%à	ó%ôN%rG   r  c                óò  — t        «       }| g}|rç|j                  «       }t        |t        «      r£|j	                  «       D ]�  \  }}|dk(  rt        |t
        «      rŒ|dk(  r+t        |t        «      r|j                  t        |«      «       ŒLt        |t        «      r|j                  |«       Œnt        |t
        «      sŒ|j                  |«       Œ‘ n!t        |t
        «      r|j                  |«       |rŒç|S )z6Get all the definitions references from a JSON schema.rÍ  r   )rÝ  rÖ   r€   r‚   rƒ   ra   r�   rß  rK   rb   rÊ  )r…   ÚrefsÚstackÚcurrentr†   r‡   s         rH   rÞ  rÞ  ²
  sÇ   € ä›€DØˆF€Eá
Ø—)‘)“+ˆÜ�gœtÔ$Ø%Ÿm™m›oò (‘
��UØ˜*Ò$¬°E¼4Ô)@ð Ø˜&’=¤Z°´sÔ%;Ø—H‘HœW U›^Õ,Ü ¤tÔ,Ø—L‘L Õ'Ü ¤tÕ,Ø—L‘L Õ'ñ(ô ˜¤Ô&Ø�L‰L˜Ô!ò% ð( €KrG   ÚAnyTypec                  ó4   — e Zd ZdZdd„Z	 	 	 	 	 	 dd„Zdd„Zy)	ÚSkipJsonSchemaaH  !!! abstract "Usage Documentation"
            [`SkipJsonSchema` Annotation](../concepts/json_schema.md#skipjsonschema-annotation)

        Add this as an annotation on a field to skip generating a JSON schema for that field.

        Example:
            ```python
            from pprint import pprint
            from typing import Union

            from pydantic import BaseModel
            from pydantic.json_schema import SkipJsonSchema

            class Model(BaseModel):
                a: Union[int, None] = None  # (1)!
                b: Union[int, SkipJsonSchema[None]] = None  # (2)!
                c: SkipJsonSchema[Union[int, None]] = None  # (3)!

            pprint(Model.model_json_schema())
            '''
            {
                'properties': {
                    'a': {
                        'anyOf': [
                            {'type': 'integer'},
                            {'type': 'null'}
                        ],
                        'default': None,
                        'title': 'A'
                    },
                    'b': {
                        'default': None,
                        'title': 'B',
                        'type': 'integer'
                    }
                },
                'title': 'Model',
                'type': 'object'
            }
            '''
            ```

            1. The integer and null types are both included in the schema for `a`.
            2. The integer type is the only type included in the schema for `b`.
            3. The entirety of the `c` field is omitted from the schema.
        c                ó"   — t         | | «       f   S ru   )r   )rZ  r…   s     rH   Ú__class_getitem__z SkipJsonSchema.__class_getitem__  s   € Ü˜T¡3£5˜[Ñ)Ð)rG   c                ó   — t         ‚ru   rW  )rx   r   r
  s      rH   r  z+SkipJsonSchema.__get_pydantic_json_schema__  s
   € ô ÐrG   c                ó*   — t        t        | «      «      S ru   )r  r¸   r¦   s    rH   r  zSkipJsonSchema.__hash__  s   € Üœ˜T›
Ó#Ð#rG   N)r…   r"  rˆ   r"  )r   r   r
  r+   rˆ   rú   r  )rB   rC   rD   rE   r&  r  r  rF   rG   rH   r$  r$  Ô
  s/   „ ñ-	ó^	*ð	Ø)ð	Ø4Hð	àó	ô
	$rG   r$  c                óX   — | �	 t        j                  | d«      S i S # t        $ r Y i S w xY w)NrE  )r'   Úget_attribute_from_basesr´   )rZ  s    rH   r÷  r÷    s@   € Ø
€ð	Ü×7Ñ7¸Ð=RÓSÐSð €Iøô ò 	ØØ€Ið	ús   „ œ	)¨)c                ó¦   — | j                  d«      x}r|d   dk(  r|j                  d«      s|S t        j                  | «      rt        | d   «      S y)zÁGet a `'function-plain'` serialization schema that can be used to serialize a default value.

    This takes into account having the serialization schema nested under validation schema(s).
    r9   r¸   r„  Úinfo_argr„   N)rv   r&   rŽ  r­  )r„   rß   s     rH   r­  r­    s[   € ð —z‘z /Ó2Ð	2ˆÐ	2Ø�vÑÐ"2Ò2Ø—‘˜zÔ*àÐÜ×0Ñ0°Ô8Ü0°¸Ñ1AÓBÐBð 9rG   rF   )rZ  z)type[BaseModel] | type[PydanticDataclass]r�   rR  r‘   r�   r’   rä  r÷  útype[GenerateJsonSchema]r©   rå  rˆ   r  )rû  zJSequence[tuple[type[BaseModel] | type[PydanticDataclass], JsonSchemaMode]]r�   rR  r[  ræ  r\  ræ  r‘   r�   r’   rä  r÷  r-  rˆ   zotuple[dict[tuple[type[BaseModel] | type[PydanticDataclass], JsonSchemaMode], JsonSchemaValue], JsonSchemaValue])rÍ  zIterable[JsonDict]rˆ   ré  )r‡   r-   rˆ   rÿ  )r…   r   rˆ   zset[JsonRef])rZ  ztype[Any] | Nonerˆ   r1   )r„   r   rˆ   z3core_schema.PlainSerializerFunctionSerSchema | None)xrE   Ú
__future__r   Ú_annotationsr&  r^  r  rµ   r’  rz  Úcollectionsr   r   Úcollections.abcr   r   r   rÎ   r	   rP  r
   r   Útypingr   r   r   r   r   r   r   r   r   r   r±  r   r   r   r   r   Úpydantic_core.core_schemar   Útyping_extensionsr   r   r   r   Útyping_inspection.introspectionr    Úpydantic.warningsr!   r"   Ú	_internalr$   r%   r&   r'   r(   r)   r*   Úannotated_handlersr+   rò  r,   r-   Úerrorsr.   r/   r0   r—  r1   Ú_internal._core_utilsr2   r3   rF  r4   Ú#_internal._schema_generation_sharedr5   r"  r7   ÚCoreSchemaTypeÚCoreSchemaFieldTyper±   r‚   r�   rú   rå  r<   r‰   rî  r  rA   r’  r¬  rð  rI   rJ   rK   r½  rí  rL   rÇ  Ú	dataclassÚ
slots_truerT   rŒ   rù  rþ  rœ   r3  rR  rÿ  rc   r  r  r  rÞ  r"  r$  r÷  r­  rF   rG   rH   ú<module>r@     se  ðò	õ 3ã Û Û Û 	Û 	Û ß ,ß 8Ñ 8Ý Ý Ý ÷÷ ÷ ó ß \Õ \Ý 3ß HÓ HÝ >ç R÷÷ ñ õ 5ß 'ß bÑ báÝßIÝ9ÝJÝð   × :Ñ :¸K×<[Ñ<[Ð [Ñ\Ð ðð �s˜C�x‘.€ðð Ð6Ñ7€ðð AHÐZbÑ1cÐ Ð.Ó cð  Ð eÑfÐ ðô ô ñ ‹H€	ðð )Ð Ø Añ
 �)˜SÓ
!€ñ �)˜SÓ
!€ñ �)˜SÓ
!€à�G˜^Ð+Ñ,€ÙÐ)°Ô:€àQÐ ð €×ÑÑ8Ð,×7Ñ7Ñ8÷Mð Mó 9ðM÷`g#añ g#að^G Ø,Ø>FØ1CØ'ð-WØ	2ð-Wàð-Wð ð-Wð <ð	-Wð
 /ð-Wð ð-Wð ó-Wðf ØØ"Ø,Ø>FØ1Cñ6)ØVð6)ð ð6)ð ð	6)ð
 ð6)ð ð6)ð <ð6)ð /ð6)ð uó6)ðx !&Øˆ��T˜4 Ð'@Ñ!AÀ5ÈÈsÐThÐOhÑIiÐknÐInÑCoÐoñ!Ð �Ió ó
Vóð €×ÑÑ8Ð,×7Ñ7Ñ8÷%ð %ó 9ð%÷DG%ñ G%óTñ8 �)Ó
€áØ˜w¨˜|Ñ,�Nð €[×ÑÑ<Ð0×;Ñ;Ñ<÷9$ð 9$ó =ð9$óxôCrG   