Ë
    šÓ^j Š  ã                   ó¬  — U d Z ddlZddlZddlmZ ddlmZmZmZm	Z	m
Z
 ddlmZmZmZ ddlmZmZmZmZmZmZ ddlmZmZ dZeed	<    G d
„ d«      Z	 d%dddedddddddœ
dedededede	ed      de	e   de	eee	e   f      de	eeef      deded   dedee gdf   fd„Z!ddddedddd œd!ed"edededede	ed      de	e   d#ede	eeef      ddfd$„Z"y)&aY  Proxy utilities for deprecating Python object instances and classes.

Provides :func:`~deprecate.proxy.deprecated_instance` for wrapping any Python object with
transparent deprecation warnings and optional read-only enforcement, and
:func:`~deprecate.proxy.deprecated_class` as a class-level decorator with optional target
redirection.

Typical use cases:

- Deprecating module-level config dicts, constants, or legacy singletons
  while still allowing reads during a migration window.
- Deprecating an Enum or dataclass in favor of a replacement type, with
  automatic forwarding of all attribute, item, and call access.

Example:
    >>> import warnings
    >>> cfg = {"threshold": 0.5}
    >>> proxy = deprecated_instance(cfg, deprecated_in="1.0", remove_in="2.0", stream=None)
    >>> proxy["threshold"]
    0.5

    >>> proxy.get("threshold")
    0.5

é    N)ÚIterator)ÚAnyÚCallableÚLiteralÚOptionalÚcast)ÚDeprecationConfigÚ
TargetModeÚ_ProxyConfig)ÚTEMPLATE_ARGUMENT_MAPPINGÚTEMPLATE_WARNING_ARGUMENTSÚTEMPLATE_WARNING_CALLABLEÚTEMPLATE_WARNING_NO_TARGETÚ_validate_template_mgsÚdeprecation_warning)Ú"_update_docstring_with_deprecationÚnormalize_docstring_styleé   Ú_DEFAULT_STACKLEVEL_TO_CALLERc                   ó˜  — e Zd ZdZddddddedddddœded	ed
edeeeee   f      deeeef      dedede	dee
d      dee   dedededdfd„Zedefd„«       Zedefd„«       Zddœdee   ddfd„Zdeddfd„Zedefd„«       Zdefd „Zd!eeef   deeef   fd"„Zd!eeef   deeef   fd#„Zed	edefd$„«       Zd	edefd%„Zd	ed&eddfd'„Zd	eddfd(„Zd)edefd*„Zd)ed&eddfd+„Zd)eddfd,„Zde	fd-„Z de!e   fd.„Z"d/edefd0„Z#d1ed!edefd2„Z$d3e%defd4„Z&d3e%defd5„Z'de	fd6„Z(defd7„Z)defd8„Z*defd9„Z+d:e%defd;„Z,d<e-defd=„Z.y)>Ú_DeprecatedProxyuU
  Transparent proxy that emits deprecation warnings on attribute and item access.

    Wraps any Python object and forwards all read operations (attribute lookup, subscript, iteration, calls) to the
    underlying object â€” or to an optional *target* replacement â€” while emitting a configurable :class:`FutureWarning`.

    In *read-only* mode any attempt to mutate the proxied object via ``__setitem__``, ``__delitem__``, or
    ``__setattr__`` raises :class:`AttributeError`.

    Use :func:`~deprecate.proxy.deprecated_instance` or :func:`~deprecate.proxy.deprecated_class` to create
    instances rather than instantiating this class directly.

    Args:
        obj: The deprecated object to wrap (the *source*).
        name: Display name used in the warning message.
        deprecated_in: Version string when the object was deprecated.
        remove_in: Version string when the object will be removed.
        num_warns: Maximum number of warnings to emit. ``1`` (default) warns once; ``-1`` warns on every access.
        stream: Callable used to emit warnings. Defaults to :data:`~deprecate.deprecation.deprecation_warning`
            (:class:`FutureWarning`).  Pass ``None`` to suppress warnings.  **Note:** the built-in
            stacklevel budget assumes *stream* is :func:`warnings.warn` itself or a C-level
            :func:`functools.partial` of it; a Python-defined wrapper interposes an extra frame and
            the warning will appear to originate inside :mod:`deprecate.proxy` rather than the caller.
        template_mgs: Optional custom warning message template that overrides the built-in templates.  When ``None``
            (default), the built-in template for the active scenario is used (callable-target, no-target, or
            per-argument).  See :func:`~deprecate.proxy.deprecated_class` for the available ``%``-style placeholders.
        read_only: If ``True``, raise :class:`AttributeError` on any write attempt through the proxy.
            Only the following standard collection mutator names are intercepted: ``append``, ``clear``,
            ``discard``, ``extend``, ``insert``, ``pop``, ``remove``, ``setdefault``, ``update``, ``add``.
            Custom method names (e.g. ``register()``, ``reload()``, ``set_value()``) are not blocked.
        target: Optional replacement object.  When set, all attribute, item, and call access is forwarded to *target*
            instead of *obj*.
        args_mapping: Optional dict remapping keyword argument names when the proxy is called.  Keys are old argument
            names; values are new names, or ``None`` to drop the argument entirely.

    NÚ é   FÚauto)ÚtargetÚargs_mappingÚ
args_extraÚdeprecated_inÚ	remove_inÚ	num_warnsÚstreamÚtemplate_mgsÚ	read_onlyÚdocstring_styleÚ_misconfigured_overrideÚobjÚnamer   r   r   r   r   r    r!   ©.Nr"   r#   r$   r%   Úreturnc                ó  — t        |
«       |du xs |}t        |t        «      rt        j                  ||d¬«      }|€|rt        j
                  }t        |t        «      r|t        j                  ||||d¬«      z  }t        ||	||||
¬«      }t        j                  | d|«       t        |||||||t        |«      |
¬	«	      }t        j                  | d
|«       t        |dd«      }|rt        j                  | d|«       yy)a  Initialise the proxy with typed runtime/config dataclasses.

        ``__config`` stores private mutable runtime state in :class:`~deprecate._types._ProxyConfig` (obj, stream,
        num_warns, read_only, args_extra, warned counter).

        ``__deprecated__`` is the public metadata interface consumed by audit tools
        (:func:`~deprecate.audit.validate_deprecation_wrapper`,
        :func:`~deprecate.audit.find_deprecation_wrappers`, etc.)
        as a :class:`~deprecate._types.DeprecationConfig` instance aligned with the ``@deprecated`` schema.

        ``_misconfigured_override`` is a private hook used by :func:`~deprecate.deprecated` when it delegates to
        :func:`~deprecate.deprecated_class` for class targets: it lets the caller pre-compute misconfig signals
        (raw ``target=False`` plus NOTIFY+args_mapping / NOTIFY+args_extra detected upstream) before the proxy
        rewrites them away, so the final frozen :class:`~deprecate._types.DeprecationConfig` records every signal
        in one place.

        Fr   )r   Ú
stacklevelNé   )r   r   r+   )r&   r!   r    r#   r   r"   Ú_DeprecatedProxy__config)	r   r   r'   r   r   r   Úmisconfiguredr$   r"   Ú__deprecated__Ú__doc__)r   Ú
isinstanceÚboolr
   Ú_from_legacy_proxyÚ
ARGS_REMAPÚ	_validater   ÚobjectÚ__setattr__r	   r   Úgetattr)Úselfr&   r'   r   r   r   r   r   r    r!   r"   r#   r$   r%   r.   ÚcfgÚdep_metaÚ_docs                     úZ/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/deprecate/proxy.pyÚ__init__z_DeprecatedProxy.__init__V   s  € ôH 	˜|Ô,ð  %˜ÒBÐ+BˆÜ�fœdÔ#Ü×2Ñ2°6ÈÐabÔcˆFàˆ>™lÜ×*Ñ*ˆFô �fœjÔ)ØœZ×1Ñ1Ø˜¨<ÀJÐ[\ôñ ˆMô
 ØØØØØ!Ø%ô
ˆô 	×Ñ˜4Ð!;¸SÔAä$Ø'ØØØØ%Ø!Ø'Ü5°oÓFØ%ô

ˆô 	×Ñ˜4Ð!1°8Ô<ô �s˜I tÓ,ˆÙÜ×Ñ˜t Y°Õ5ð ó    c                 óJ   — t        t        t        j                  | d«      «      S )u¾   Private mutable runtime state (warn counter, stream, read-only flag, wrapped object).

        Private to this class â€” not part of the public API and not consumed by audit tools.

        r-   )r   r   r6   Ú__getattribute__©r9   s    r=   Ú_cfgz_DeprecatedProxy._cfg®   s   € ô ”L¤&×"9Ñ"9¸$Ð@ZÓ"[Ó\Ð\r?   c                 óJ   — t        t        t        j                  | d«      «      S )u  Static deprecation metadata (versions, name, target, args_mapping).

        Stored as ``__deprecated__`` (dunder, not name-mangled) â€” audit tools and external code may read it directly;
        this property simply provides a typed view of the same object.

        r/   )r   r	   r6   rA   rB   s    r=   Ú_depz_DeprecatedProxy._dep·   s    € ô Ô%¤v×'>Ñ'>¸tÐEUÓ'VÓWÐWr?   ©Úarg_namerG   c                óþ  — | j                   }|j                  }|sy|�;|j                  j                  |d«      }|j                  dk\  r9||j                  k\  r*y|j                  dk\  r|j
                  |j                  k\  ry| j                  }|j                  }|j                  }|j                  }|�S|rQ||v rM||   }	t        |t        |	«      dœz  }
|xs t        }||j                  |j                  |j                  |
dœz  }n�t!        |«      rQ|j"                  }|j$                  › d|› �}|xs t&        }||j                  |j                  |j                  ||dœz  }n1|xs t(        }||j                  |j                  |j                  dœz  }	  ||t*        ¬«       |�-|j                  j                  |d«      d	z   |j                  |<   y|xj
                  d	z  c_        y# t,        $ r  ||«       Y ŒXw xY w)
uV  Emit a deprecation warning if the warn budget is not exhausted.

        Args:
            arg_name: When given, use per-argument warning tracking (``cfg.warned_args``) instead of the global
                ``cfg.warned`` counter.  The warning is suppressed when the per-argument count has already reached
                ``cfg.num_warns``.  When provided alongside an ``args_mapping`` entry, the emitted message uses the
                per-argument template (`old -> new`) rather than the generic callable template â€” matching the
                decorator's argument-deprecation form.

        Nr   )Úold_argÚnew_arg)Úsource_namer   r   Úargument_mapú.)rK   r   r   Útarget_nameÚtarget_path)rK   r   r   ©r+   r   )rC   r!   Úwarned_argsÚgetr    ÚwarnedrE   r   r   r"   r   Ústrr   r'   r   r   ÚcallableÚ__name__Ú
__module__r   r   r   Ú	TypeError)r9   rG   r:   r!   Ú	arg_countÚdepr   r   Úcustom_templaterJ   rL   ÚtemplateÚmsgrN   rO   s                  r=   Ú_warnz_DeprecatedProxy._warnÁ   sö  € ð �i‰iˆØ—‘ˆÙØØÐàŸ™×+Ñ+¨H°aÓ8ˆIØ�}‰} Ò! i°3·=±=Ò&@Øð �}‰} Ò! c§j¡j°C·M±MÒ&AØØ�i‰iˆØ—j‘jˆØ×'Ñ'ˆð
 ×*Ñ*ˆð Ð¡L°XÀÑ5MØ" 8Ñ,ˆGÜ4À8ÔX[Ð\cÓXdÑ7eÑeˆLØ&ÒDÔ*DˆHØØ"Ÿx™xØ!$×!2Ñ!2Ø Ÿ]™]Ø ,ñ	ñ ‰Cô �fÔØ Ÿ/™/ˆKØ#×.Ñ.Ð/¨q°°Ð>ˆKØ&ÒCÔ*CˆHØØ"Ÿx™xØ!$×!2Ñ!2Ø Ÿ]™]Ø*Ø*ññ ‰Cð 'ÒDÔ*DˆHØØ"Ÿx™xØ!$×!2Ñ!2Ø Ÿ]™]ññ ˆCð	Ù�3Ô#@ÕAð ÐØ(+¯©×(;Ñ(;¸HÀaÓ(HÈ1Ñ(LˆC�O‰O˜HÒ%à�JŠJ˜!‰OŽJøô ò 	Ù�3ŽKð	ús   ÆG( Ç(G<Ç;G<Ú	operationc                 ó€   — | j                   j                  r(| j                  j                  }t	        d|› d|› d�«      ‚y)z¤Raise AttributeError when the proxy is in read-only mode.

        Raises:
            AttributeError: If ``read_only=True`` was set at construction time.

        ú'z' is deprecated and read-only. z/ is not allowed. Migrate away from this object.N)rC   r#   rE   r'   ÚAttributeError)r9   r_   r'   s      r=   Ú_check_read_onlyz!_DeprecatedProxy._check_read_only  sD   € ð �9‰9×ÒØŸ	™	Ÿ™ˆDÜ Ø�D�6Ð8¸¸ÐCrÐsóð ð r?   c                 ó.   — | j                   j                  S )zHThe deprecated source object this proxy wraps (audit contract accessor).)rC   r&   rB   s    r=   Úwrappedz_DeprecatedProxy.wrapped  s   € ð �y‰y�}‰}Ðr?   c                 ó‚   — | j                   j                  }|�t        |t        «      s|S | j                  j
                  S )z@Return the active object: *target* when set, otherwise *source*.)rE   r   r1   r
   rC   r&   )r9   r   s     r=   Ú_get_activez_DeprecatedProxy._get_active  s3   € à—‘×!Ñ!ˆØÐ¤j°¼Ô&DØˆMØ�y‰y�}‰}Ðr?   Úkwargsc                 ó  — | j                   j                  }|r|s|S |j                  «       D ��ch c]
  \  }}|�Œ	|’Œ }}}|j                  «       D ��ci c]   \  }}||vsŒ|j                  |«      xs ||“Œ" c}}S c c}}w c c}}w )zHApply args_mapping to *kwargs*, renaming or dropping keys as configured.)rE   r   ÚitemsrR   )r9   rh   r   ÚkÚvÚargs_to_drops         r=   Ú_apply_args_mappingz$_DeprecatedProxy._apply_args_mapping%  s€   € à—y‘y×-Ñ-ˆÙ¡6ØˆMØ&2×&8Ñ&8Ó&:×H™d˜a ¸a¹išÐHˆÑHØ:@¿,¹,».×b±$°!°QÈAÐUaÒLa�×!Ñ! !Ó$Ò)¨¨AÑ-ÓbÐbùó IùÛbs   °
A>»A>ÁBÁ"Bc                 ór   — | j                   j                  }|s|S t        |«      }|j                  |«       |S )zFMerge :attr:`_ProxyConfig.args_extra` into *kwargs*; extra values win.)rC   r   ÚdictÚupdate)r9   rh   r   Úmergeds       r=   Ú_merge_args_extraz"_DeprecatedProxy._merge_args_extra-  s3   € à—Y‘Y×)Ñ)ˆ
ÙØˆMÜ�f“ˆØ�‰�jÔ!Øˆr?   c                 ó   — h d£}| |v S )zâHeuristic to detect common mutating methods on built-in collections.

        This is intentionally conservative and only covers the most common mutating APIs on built-in container types
        (lists, dicts, sets).

        >
   ÚaddÚpopÚclearÚappendÚextendÚinsertÚremoverq   ÚdiscardÚ
setdefault© )r'   Úmutating_namess     r=   Ú_is_potential_mutatorz&_DeprecatedProxy._is_potential_mutator6  s   € ò
ˆð �~Ð%Ð%r?   c                 óð   ‡ ‡— ‰ j                  «        t        ‰ j                  «       ‰«      }‰ j                  j                  r3t        |«      r(‰ j                  ‰«      rdt        dt        ddfˆˆ fd„}|S |S )a?  Forward attribute lookup to the active object, emitting a deprecation warning.

        In read-only mode, common mutating methods on built-in collections (for example, ``append`` or ``update``) are
        wrapped so that calling them raises :class:`AttributeError` instead of mutating the underlying object.

        Úargsrh   r)   Nc                  ó0   •— ‰j                  d‰› d�«       y )NzCalling mutating method 'ra   )rc   )r‚   rh   r'   r9   s     €€r=   Ú_guarded_mutatorz6_DeprecatedProxy.__getattr__.<locals>._guarded_mutator\  s   ø€ Ø×%Ñ%Ð(AÀ$ÀÀqÐ&IÕJr?   )r^   r8   rg   rC   r#   rU   r€   r   )r9   r'   Úattrr„   s   ``  r=   Ú__getattr__z_DeprecatedProxy.__getattr__P  so   ù€ ð 	�
‰
ŒÜ�t×'Ñ'Ó)¨4Ó0ˆà�9‰9×Ò¤8¨D¤>°d×6PÑ6PÐQUÔ6VðK¬ð K´sð K¸tö Kð $Ð#Øˆr?   Úvaluec                 ód   — | j                  d|› d�«       t        | j                  «       ||«       y)z¥Forward attribute mutation to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zSetting attribute 'ra   N)rc   Úsetattrrg   )r9   r'   r‡   s      r=   r7   z_DeprecatedProxy.__setattr__b  s1   € ð 	×ÑÐ 3°D°6¸Ð;Ô<Ü�× Ñ Ó" D¨%Õ0r?   c                 ób   — | j                  d|› d�«       t        | j                  «       |«       y)z¥Forward attribute deletion to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zDeleting attribute 'ra   N)rc   Údelattrrg   )r9   r'   s     r=   Ú__delattr__z_DeprecatedProxy.__delattr__l  s/   € ð 	×ÑÐ 4°T°F¸!Ð<Ô=Ü�× Ñ Ó" DÕ)r?   Úkeyc                 óH   — | j                  «        | j                  «       |   S )zNForward subscript lookup to the active object, emitting a deprecation warning.)r^   rg   ©r9   r�   s     r=   Ú__getitem__z_DeprecatedProxy.__getitem__z  s   € à�
‰
ŒØ×ÑÓ! #Ñ&Ð&r?   c                 óT   — | j                  d|› d�«       || j                  «       |<   y)z¥Forward subscript mutation to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zSetting item 'ra   N©rc   rg   )r9   r�   r‡   s      r=   Ú__setitem__z_DeprecatedProxy.__setitem__  s.   € ð 	×Ñ ¨s¨e°1Ð5Ô6Ø"'ˆ×ÑÓ˜3Òr?   c                 óP   — | j                  d|› d�«       | j                  «       |= y)z¥Forward subscript deletion to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zDeleting item 'ra   Nr’   r�   s     r=   Ú__delitem__z_DeprecatedProxy.__delitem__‰  s,   € ð 	×Ñ °¨u°AÐ6Ô7Ø×ÑÓ˜sÑ#r?   c                 ó4   — t        | j                  «       «      S )z>Return length of the active object without emitting a warning.)Úlenrg   rB   s    r=   Ú__len__z_DeprecatedProxy.__len__—  s   € ä�4×#Ñ#Ó%Ó&Ð&r?   c                 óT   — | j                  «        t        | j                  «       «      S )z?Iterate over the active object, emitting a deprecation warning.)r^   Úiterrg   rB   s    r=   Ú__iter__z_DeprecatedProxy.__iter__›  s   € à�
‰
ŒÜ�D×$Ñ$Ó&Ó'Ð'r?   Úitemc                 ó&   — || j                  «       v S )zACheck membership in the active object without emitting a warning.)rg   )r9   rœ   s     r=   Ú__contains__z_DeprecatedProxy.__contains__   s   € à�t×'Ñ'Ó)Ð)Ð)r?   r‚   c                 óà  ‡— t         j                  | d«      }t         j                  | d«      }|j                  t        j                  u rb|j
                  xs i }|D ]  }|‰v sŒ| j                  |¬«       Œ | j                  ‰«      }| j                  |«      } |j                  |i |¤ŽS t        |j                  «      r’|j
                  r†|j
                  xs i }|D ]  }|‰v sŒ| j                  |¬«       Œ t        ˆfd„|D «       «      s| j                  «        | j                  ‰«      }| j                  |«      } |j                  |i |¤ŽS | j                  «        t        |j                  «      r! |j                  |i | j                  ‰«      ¤ŽS |j                  t        j                  u r | j                  «       |i ‰¤ŽS  | j                  «       |i | j                  ‰«      ¤ŽS )aQ  Call the active object, emitting a deprecation warning conditionally based on target mode.

        Branching logic:
        - :attr:`~deprecate._types.TargetMode.ARGS_REMAP`: warn only when a deprecated kwarg name is present in the
          call; remap, merge ``args_extra``, and call ``obj``.
        - Callable target with ``args_mapping``: warn per deprecated kwarg present; if none of the old names were
          passed still warn at the callable level (class is deprecated); remap, merge ``args_extra``, and forward to
          target.
        - Callable target without ``args_mapping``: warn (global budget), merge ``args_extra``, and forward to target.
        - :attr:`~deprecate._types.TargetMode.NOTIFY`: always warn (global budget) and forward kwargs unchanged;
          ``args_extra`` is intentionally ignored (misconfig).

        r/   r-   rF   c              3   ó&   •K  — | ]  }|‰v –— Œ
 y ­w©Nr~   )Ú.0Úold_keyrh   s     €r=   ú	<genexpr>z,_DeprecatedProxy.__call__.<locals>.<genexpr>Æ  s   øè ø€ Ò@¨W�w &Ô(Ñ@ùs   ƒ)r6   rA   r   r
   r4   r   r^   rn   rs   r&   rU   ÚanyÚNOTIFYrg   )r9   r‚   rh   rZ   r:   Úmappingr£   Úmapped_kwargss     `     r=   Ú__call__z_DeprecatedProxy.__call__¨  sÏ  ø€ ô ×%Ñ% dÐ,<Ó=ˆÜ×%Ñ% dÐ,FÓGˆà�:‰:œ×.Ñ.Ñ.Ø×&Ñ&Ò,¨"ˆGØ"ò 1�Ø˜fÒ$Ø—J‘J¨�JÕ0ð1ð !×4Ñ4°VÓ<ˆMØ ×2Ñ2°=ÓAˆMØ�3—7‘7˜DÐ2 MÑ2Ð2Ü�C—J‘JÔ C×$4Ò$4Ø×&Ñ&Ò,¨"ˆGØ"ò 1�Ø˜fÒ$Ø—J‘J¨�JÕ0ð1ô Ó@¸Ô@Ô@à—
‘
”Ø ×4Ñ4°VÓ<ˆMØ ×2Ñ2°=ÓAˆMØ�3—:‘:˜tÐ5 }Ñ5Ð5ð 	�
‰
ŒÜ�C—J‘JÔØ�3—:‘:˜tÐF t×'=Ñ'=¸fÓ'EÑFÐFà�:‰:œ×*Ñ*Ñ*Ø%�4×#Ñ#Ó% tÐ6¨vÑ6Ð6ð "ˆt×ÑÓ! 4ÐJ¨4×+AÑ+AÀ&Ó+IÑJÐJr?   Úotherc                 ó–   — | j                   j                  }t        |t        «      r|j                   j                  }t	        ||k(  «      S )z'Compare the source object for equality.)rC   r&   r1   r   r2   )r9   rª   r&   s      r=   Ú__eq__z_DeprecatedProxy.__eq__Ü  s6   € à�i‰i�m‰mˆÜ�eÔ-Ô.Ø—J‘J—N‘NˆEÜ�C˜5‘LÓ!Ð!r?   c                 ó&   — | j                  |«       S )zReturn the inverse of equality.)r¬   )r9   rª   s     r=   Ú__ne__z_DeprecatedProxy.__ne__ã  s   € à—;‘;˜uÓ%Ð%Ð%r?   c                 ó@   — t        | j                  j                  «      S )z%Return the hash of the source object.)ÚhashrC   r&   rB   s    r=   Ú__hash__z_DeprecatedProxy.__hash__ç  ó   € ä�D—I‘I—M‘MÓ"Ð"r?   c                 ó@   — t        | j                  j                  «      S )z!Return repr of the source object.)ÚreprrC   r&   rB   s    r=   Ú__repr__z_DeprecatedProxy.__repr__ï  r²   r?   c                 ó@   — t        | j                  j                  «      S )z Return str of the source object.)rT   rC   r&   rB   s    r=   Ú__str__z_DeprecatedProxy.__str__ó  s   € ä�4—9‘9—=‘=Ó!Ð!r?   c                 ó4   — t        | j                  «       «      S )z<Return bool of the active object without emitting a warning.)r2   rg   rB   s    r=   Ú__bool__z_DeprecatedProxy.__bool__÷  s   € ä�D×$Ñ$Ó&Ó'Ð'r?   Úinstancec                 ó\   — | j                  «       }t        |t        «      rt        ||«      S y)uQ  Support ``isinstance(x, proxy)`` by delegating to the active class.

        Allows a proxy used as a deprecated class alias to work transparently with ``isinstance`` without emitting a
        warning â€” type checks are structural, not a use of the deprecated API.

        Returns False when the active object is not a type.

        F)rg   r1   Útype)r9   rº   Úactives      r=   Ú__instancecheck__z"_DeprecatedProxy.__instancecheck__ÿ  s,   € ð ×!Ñ!Ó#ˆÜ�fœdÔ#ä˜h¨Ó/Ð/Ør?   Úsubclassc                 ó\   — | j                  «       }t        |t        «      rt        ||«      S y)uù   Support ``issubclass(X, proxy)`` by delegating to the active class.

        Same rationale as :meth:`~deprecate.proxy._DeprecatedProxy.__instancecheck__` â€” no warning emitted.

        Returns False when the active object is not a type.

        F)rg   r1   r¼   Ú
issubclass)r9   r¿   r½   s      r=   Ú__subclasscheck__z"_DeprecatedProxy.__subclasscheck__  s.   € ð ×!Ñ!Ó#ˆÜ�fœdÔ#ô ˜h¨Ó/Ð/Ør?   )/rV   rW   Ú__qualname__r0   r   r   rT   r   rp   Úintr   r2   r>   Úpropertyr   rC   r	   rE   r^   rc   re   rg   rn   rs   Ústaticmethodr€   r†   r7   rŒ   r�   r“   r•   r˜   r   r›   rž   r©   r6   r¬   r®   r±   rµ   r·   r¹   r¾   r¼   rÂ   r~   r?   r=   r   r   1   sD  „ ñ"ðR Ø;?Ø/3ØØØØ0CØ&*ØØ%Ø(-òQ6àðQ6ð ðQ6ð
 ðQ6ð ˜t C¨°#©Ð$6Ñ7Ñ8ðQ6ð ˜T # s (™^Ñ,ðQ6ð ðQ6ð ðQ6ð ðQ6ð ˜ )Ñ,Ñ-ðQ6ð ˜s‘mðQ6ð ðQ6ð ðQ6ð "&ðQ6ð  
ó!Q6ðp ð]�lò ]ó ð]ð ðXÐ'ò Xó ðXð 26ò I ¨#¡ð I¸$ó IðV¨#ð °$ó ð ð˜ò ó ðð˜Só ðc¨$¨s°C¨x©.ð c¸TÀ#ÀsÀ(¹^ó cð¨¨S°#¨X©ð ¸4ÀÀSÀ¹>ó ð ð& Cð &¨Dò &ó ð&ð2 ð ¨ó ð$1 ð 1¨Cð 1°Dó 1ð* ð *¨ó *ð'˜sð ' só 'ð
(˜sð (¨3ð (°4ó (ð$˜sð $ tó $ð'˜ó 'ð(˜( 3™-ó (ð
* ð *¨ó *ð.K˜cð .K¨Sð .K°Só .Kðh"˜Fð " tó "ð&˜Fð & tó &ð#˜#ó #ð#˜#ó #ð"˜ó "ð(˜$ó (ð¨&ð °Tó ð¨$ð °4ô r?   r   r   r   Fr   )
r   r   r    r!   r"   r   r   Úupdate_docstringr$   r%   r   r   r   r    r!   r(   r"   r   r   rÇ   r$   )r   ÚrstÚmkdocsÚmarkdownr%   r)   c       
         óL   ‡ ‡‡‡‡‡‡‡‡‡	‡
— dt         ddfˆ
ˆˆˆˆ	ˆˆˆˆ ˆˆfd„}|S )uï  Decorator factory for deprecating class definitions with optional target redirection.

    Apply ``@deprecated_class(...)`` to an Enum or dataclass to wrap the class in a
    :class:`~deprecate.proxy._DeprecatedProxy`.  All attribute, item, and call access on the resulting object will
    emit a deprecation warning and, if *target* is provided, will be forwarded to the replacement class.

    Args:
        target: Optional replacement class to redirect all access to.
        deprecated_in: Version string when the class was deprecated.
        remove_in: Version string when the class will be removed.
        num_warns: Maximum number of warnings to emit per proxy instance. ``1`` warns once; ``-1`` warns on every
            access.
        stream: Callable used to emit warnings. Defaults to :data:`~deprecate.deprecation.deprecation_warning`.
        template_mgs: Optional custom warning message template that overrides the built-in templates.  When ``None``
            (default), the built-in template for the active scenario is used (callable-target, no-target, or
            per-argument for ``args_mapping``).  Available ``%``-style placeholders:

            - ``%(source_name)s`` â€” the deprecated class name (taken from ``cls.__name__``)
            - ``%(deprecated_in)s`` â€” value of the ``deprecated_in`` argument
            - ``%(remove_in)s`` â€” value of the ``remove_in`` argument
            - ``%(target_name)s`` â€” target class name (only when *target* is callable)
            - ``%(target_path)s`` â€” fully-qualified target path (only when *target* is callable)
            - ``%(argument_map)s`` â€” formatted ``\`old\` -> \`new\``` string (only for per-argument warnings
              emitted by ``args_mapping``)

            Example: ``"v%(deprecated_in)s: ``%(source_name)s`` -> ``%(target_name)s``"``.
        args_mapping: Optional dict remapping keyword argument names when the decorated class is called.  Keys are
            old argument names; values are new names, or ``None`` to drop the argument entirely.  When provided
            without an explicit callable *target*, the mode auto-resolves to
            :attr:`~deprecate._types.TargetMode.ARGS_REMAP`: the proxy warns **only when an old argument name is
            actually used** in the call, matching the per-argument warning behaviour of
            ``@deprecated(target=TargetMode.ARGS_REMAP, args_mapping=...)``.  Passing ``args_mapping`` together with
            ``target=TargetMode.NOTIFY`` is a misconfiguration and emits a :class:`UserWarning` at decoration time
            (will be :class:`TypeError` in v1.0).  Similarly, ``target=TargetMode.ARGS_REMAP`` without
            ``args_mapping`` emits a :class:`UserWarning` at decoration time.
        args_extra: Optional dict of extra keyword arguments merged into the forwarded call after ``args_mapping`` has
            been applied.  Caller-supplied values override entries with the same key.  Ignored when ``target`` is
            :attr:`~deprecate._types.TargetMode.NOTIFY` (passing both emits a :class:`UserWarning` at decoration
            time; will be :class:`TypeError` in v1.0).
        update_docstring: If ``True``, inject a deprecation notice into the class docstring at decoration time (same
            behaviour as ``@deprecated(update_docstring=True)``).
        docstring_style: Output style for the injected notice when ``update_docstring=True``.  ``"auto"`` detects the
            doc engine at decoration time; ``"rst"`` emits a ``.. deprecated::`` directive; ``"mkdocs"`` /
            ``"markdown"`` emit a ``!!! warning`` admonition.

    Returns:
        A decorator that wraps the class in a :class:`~deprecate.proxy._DeprecatedProxy`.

    Examples:
        >>> from enum import Enum
        >>> class NewColor(Enum):
        ...     RED = 1
        >>> @deprecated_class(target=NewColor, deprecated_in="1.0", remove_in="2.0", stream=None)
        ... class OldColor(Enum):
        ...     RED = 1
        >>> OldColor.RED is NewColor.RED
        True
        >>> OldColor(1) is NewColor.RED
        True

        When only argument names changed, omit *target* and supply ``args_mapping``. The proxy auto-resolves to
        :attr:`~deprecate._types.TargetMode.ARGS_REMAP` and warns **only when the old argument name is passed**:

        >>> class Config:
        ...     def __init__(self, timeout: int = 0) -> None:
        ...         self.timeout = timeout
        >>> LegacyConfig = deprecated_class(
        ...     args_mapping={"time_limit": "timeout"},
        ...     deprecated_in="1.5", remove_in="2.0", stream=None,
        ... )(Config)
        >>> LegacyConfig(timeout=30).timeout     # new name â€” no remap needed
        30
        >>> LegacyConfig(time_limit=30).timeout  # old name â€” remapped to timeout
        30

    Úclsr)   r   c                 ór  •— ‰
�.‰s,‰s*t        j                  d| j                  › d�t        d¬«       t	        | | j                  ‰‰	‰‰
‰d‰‰‰‰‰¬«      }‰rat        j                  t        j                  |d«      |j                  ¬«      }t        |«       t        j                  |d|j                  «       |S )	Nz`@deprecated_class` on `ú®` has no `deprecated_in` set. Deprecation notices and generated documentation will omit the `deprecated_in` version. Pass `deprecated_in` for a meaningful deprecation notice.é   rP   F)r&   r'   r   r   r    r!   r"   r#   r   r   r   r$   r%   r0   )r0   r/   )ÚwarningsÚwarnrV   ÚUserWarningr   ÚtypesÚSimpleNamespacer6   rA   rE   r   r7   r0   )rÌ   ÚproxyÚshimr%   r   r   r   r$   r    r   r!   r   r"   rÇ   s      €€€€€€€€€€€r=   Ú	decoratorz#deprecated_class.<locals>.decoratory  sÀ   ø€ ØÐ¡m¹LÜ�M‰MØ*¨3¯<©<¨.ð 9Mð Mô Øõô !ØØ—‘Ø'ØØØØ%ØØØ%Ø!Ø+Ø$;ô
ˆñ ô ×(Ñ(´×1HÑ1HÈÐPYÓ1ZÐkp×kuÑkuÔvˆDÜ.¨tÔ4Ü×Ñ˜u i°·±Ô>Øˆr?   )r¼   )r   r   r   r    r!   r"   r   r   rÇ   r$   r%   r×   s   ``````````` r=   Údeprecated_classrØ     s'   ÿú€ ðv”tð Ð 2÷ ÷ ðB Ðr?   )r'   r   r   r    r!   r"   r#   r   r&   r'   r#   c                ó¨   — |xs t        | «      j                  }	|�$|s"|s t        j                  d|	› d�t        d¬«       t        | |	|||||||¬«	      S )u	  Wrap any Python object with deprecation warnings.

    Returns a :class:`~deprecate.proxy._DeprecatedProxy` that transparently forwards all read access to *obj* while
    emitting a :class:`FutureWarning`.  In *read-only* mode any write attempt through the proxy raises
    :class:`AttributeError`.

    Args:
        obj: The object to deprecate (dict, list, custom object, â€¦).
        name: Display name for *obj* used in the warning message. When omitted, the type name of *obj* is used
            (e.g. ``"dict"``).
        deprecated_in: Version string when *obj* was deprecated.
        remove_in: Version string when *obj* will be removed.
        num_warns: Maximum number of warnings to emit. ``1`` (default) warns once; ``-1`` warns on every access.
        stream: Callable used to emit warnings. Defaults to :data:`~deprecate.deprecation.deprecation_warning`
            (:class:`FutureWarning`).  Pass ``None`` to suppress warnings.
        template_mgs: Optional custom warning message template that overrides the built-in templates.  When ``None``
            (default), the built-in template for the active scenario is used.  See
            :func:`~deprecate.proxy.deprecated_class` for the available ``%``-style placeholders.
        read_only: If ``True``, raise :class:`AttributeError` on any write attempt through the proxy.
            Only the following standard collection mutator names are intercepted: ``append``, ``clear``,
            ``discard``, ``extend``, ``insert``, ``pop``, ``remove``, ``setdefault``, ``update``, ``add``.
            Custom method names (e.g. ``register()``, ``reload()``, ``set_value()``) are not blocked.
        args_extra: Optional dict of extra keyword arguments merged into the forwarded call when the proxy is invoked.
            Caller-supplied values override entries with the same key.

    Returns:
        A :class:`~deprecate.proxy._DeprecatedProxy` wrapping *obj*.

    Example:
        >>> cfg = {"threshold": 0.5, "enabled": True}
        >>> proxy = deprecated_instance(
        ...     cfg,
        ...     name="config_dict",
        ...     deprecated_in="1.0",
        ...     remove_in="2.0",
        ...     stream=None,
        ... )
        >>> proxy["threshold"]
        0.5
        >>> proxy.get("enabled")
        True

    z`deprecated_instance()` on `rÎ   rÏ   rP   )	r&   r'   r   r   r    r!   r"   r#   r   )r¼   rV   rÐ   rÑ   rÒ   r   )
r&   r'   r   r   r    r!   r"   r#   r   Úresolved_names
             r=   Údeprecated_instancerÛ   �  st   € ðn Ò.œD ›I×.Ñ.€MØÐ¡-¹Ü�‰Ø*¨=¨/ð :Ið Iô Øõ	
ô ØØØ#ØØØØ!ØØô
ð 
r?   r¡   )#r0   rÓ   rÐ   Úcollections.abcr   Útypingr   r   r   r   r   Údeprecate._typesr	   r
   r   Údeprecate.deprecationr   r   r   r   r   r   Údeprecate.docstring.injectr   r   r   rÄ   Ú__annotations__r   rT   rp   r2   r¼   rØ   rÛ   r~   r?   r=   ú<module>râ      sç  ðòó4 Û Ý $ß 9Õ 9ç HÑ H÷÷ ÷ eð
 &'Ð ˜sÓ &÷jñ jð\ ð|ð ØØØ,?Ø"&Ø7;Ø+/Ø"ØDJØ$)ò|Øð|ð ð|ð ð	|ð
 ð|ð �X˜iÑ(Ñ)ð|ð ˜3‘-ð|ð ˜4  X¨c¡]Ð 2Ñ3Ñ4ð|ð ˜˜c 3˜h™Ñ(ð|ð ð|ð Ð@ÑAð|ð "ð|ð ˆtˆfÐ(Ð(Ñ)ó|ðD ØØØØ,?Ø"&ØØ+/òJØ	ðJð ðJð ð	Jð
 ðJð ðJð �X˜iÑ(Ñ)ðJð ˜3‘-ðJð ðJð ˜˜c 3˜h™Ñ(ðJð ôJr?   