ó
    ýÞ jÁ  ã            	       óò   • S SK rS SK JrJr  S SKJrJr  S SKJrJ	r	J
r
  S SKJr  S SKJr  S SKJrJr  S SKJrJrJrJr  S S	KJr  S
rS rS\S\\\4   4S jrS\S\S\4S jr " S S\\   \\\\4   5      rg)é    N)ÚCallableÚSequence)ÚAnyÚGeneric)ÚNotRequiredÚRequiredÚSelf)Ú	OVERWRITE)ÚMISSING)ÚBaseChannelÚValue)ÚEmptyChannelErrorÚ	ErrorCodeÚInvalidUpdateErrorÚcreate_error_message)Ú	Overwrite)ÚBinaryOperatorAggregatec                 ó¶   • [        U S5      (       aG  U R                  [        [        4;   a  [	        U R
                  S   5      $ [	        U R                  5      $ U $ )z=Strips Annotated, Required and NotRequired from a given type.Ú
__origin__r   )Úhasattrr   r   r   Ú_strip_extrasÚ__args__)Úts    ÚR/var/www/html/gaurav/venv/lib/python3.13/site-packages/langgraph/channels/binop.pyr   r      sG   € äˆq�,×ÑØ�<‰<œH¤kÐ2Ó2Ü  §¡¨A¡Ó/Ð/Ü˜QŸ\™\Ó*Ð*Ø€Hó    ÚvalueÚreturnc                 ó  • [        U [        5      (       a  SU R                  4$ [        U [        5      (       aJ  [	        U 5      S:X  a  [
        U ;   a  SU [
           4$ U R                  S5      [
        :X  a  SU ;   a  SU S   4$ g)a÷  Inspects the given value and returns (is_overwrite, overwrite_value).

Recognises three forms:

* The typed `Overwrite` dataclass instance.
* The sentinel-keyed `{"__overwrite__": value}` dict form.
* The dataclass-erased `{"value": ..., "type": "__overwrite__"}` form that
  results from JSON-serialising an `Overwrite` (e.g. an `orjson`-encoded
  state update routed through the LangGraph API server). This keeps the
  `Overwrite` semantics intact across JSON boundaries that strip dataclass
  types.
Té   Útyper   )FN)Ú
isinstancer   r   ÚdictÚlenr
   Úget©r   s    r   Ú_get_overwriter&      sy   € ô �%œ×#Ñ#Ø�U—[‘[Ð Ð Ü�%œ×ÑÜˆu‹:˜‹?œy¨EÓ1Ø˜œyÑ)Ð)Ð)Ø�9‰9�VÓ¤	Ó)¨g¸Ó.>Ø˜˜w™Ð'Ð'Ør   ÚaÚbc                 óJ   • U R                   S:X  d  UR                   S:X  a  gXL $ )zÁReturn True if two reducer operators should be considered equal.

Lambdas all share the name '<lambda>' so identity comparison is
unreliable; treat any pairing that includes a lambda as equal.
z<lambda>T)Ú__name__)r'   r(   s     r   Ú_operators_equalr+   6   s%   € ð 	‡z�z�ZÓ 1§:¡:°Ó#;ØØˆ6€Mr   c                   ó   ^ • \ rS rSrSrSrS\\   S\\\/\4   4U 4S jjr	S\
S\4S	 jr\S\\   4S
 j5       r\S\\   4S j5       rS\4S jrS\S\4S jrS\\   S\4S jrS\4S jrS\4S jrS\4S jrSrU =r$ )r   éA   zµStores the result of applying a binary operator to the current value and each new value.

```python
import operator

total = Channels.BinaryOperatorAggregate(int, operator.add)
```
)r   ÚoperatorÚtypr.   c                 ó
  >• [         TU ]  U5        X l        [        U5      nU[        R
                  R                  [        R
                  R                  4;   a  [        nU[        R
                  R                  [        R
                  R                  4;   a  [        nU[        R
                  R                  [        R
                  R                  4;   a  [        n U" 5       U l        g ! [          a    ["        U l         g f = f©N)ÚsuperÚ__init__r.   r   ÚcollectionsÚabcr   ÚMutableSequenceÚlistÚSetÚ
MutableSetÚsetÚMappingÚMutableMappingr"   r   Ú	Exceptionr   )Úselfr/   r.   Ú	__class__s      €r   r3   Ú BinaryOperatorAggregate.__init__M   s·   ø€ Ü‰Ñ˜ÔØ Œô ˜CÓ ˆØ”;—?‘?×+Ñ+¬[¯_©_×-LÑ-LÐMÓMÜˆCØ”;—?‘?×&Ñ&¬¯©×(BÑ(BÐCÓCÜˆCØ”;—?‘?×*Ñ*¬K¯O©O×,JÑ,JÐKÓKÜˆCð	!Ù›ˆD�JøÜó 	!Ü ˆDŽJð	!ús   ÃC* Ã*DÄDr   r   c                 óp   • [        U[        5      =(       a     [        U R                  UR                  5      $ r1   )r!   r   r+   r.   )r>   r   s     r   Ú__eq__ÚBinaryOperatorAggregate.__eq__^   s,   € Ü˜%Ô!8Ó9÷ 
Ô>NØ�M‰M˜5Ÿ>™>ó?
ð 	
r   c                 ó   • U R                   $ )z,The type of the value stored in the channel.©r/   ©r>   s    r   Ú	ValueTypeÚ!BinaryOperatorAggregate.ValueTypec   ó   € ð �x‰xˆr   c                 ó   • U R                   $ )z/The type of the update received by the channel.rE   rF   s    r   Ú
UpdateTypeÚ"BinaryOperatorAggregate.UpdateTypeh   rI   r   c                 ó–   • U R                  U R                  U R                  5      nU R                  Ul        U R                  Ul        U$ )zReturn a copy of the channel.)r?   r/   r.   Úkeyr   )r>   Úemptys     r   ÚcopyÚBinaryOperatorAggregate.copym   s5   € à—‘˜tŸx™x¨¯©Ó7ˆØ—H‘HˆŒ	Ø—j‘jˆŒØˆr   Ú
checkpointc                 ó’   • U R                  U R                  U R                  5      nU R                  Ul        U[        La  Xl        U$ r1   )r?   r/   r.   rN   r   r   )r>   rR   rO   s      r   Úfrom_checkpointÚ'BinaryOperatorAggregate.from_checkpointt   s7   € Ø—‘˜tŸx™x¨¯©Ó7ˆØ—H‘HˆŒ	ØœWÒ$Ø$ŒKØˆr   Úvaluesc                 óR  • U(       d  gU R                   [        L a  US   U l         USS  nSnU Hu  n[        U5      u  pEU(       a4  U(       a#  [        S[        R
                  S9n[        U5      eXPl         SnMK  U(       a  MT  U R                  U R                   U5      U l         Mw     g)NFr   r   z4Can receive only one Overwrite value per super-step.)ÚmessageÚ
error_codeT)r   r   r&   r   r   ÚINVALID_CONCURRENT_GRAPH_UPDATEr   r.   )r>   rV   Úseen_overwriter   Úis_overwriteÚoverwrite_valueÚmsgs          r   ÚupdateÚBinaryOperatorAggregate.update{   sœ   € ÞØØ�:‰:œÒ Ø ™ˆDŒJØ˜A˜B�ZˆFØ$ˆÛˆEÜ,:¸5Ó,AÑ)ˆLÞÞ!Ü.Ø VÜ#,×#LÑ#Lñ�Cô -¨SÓ1Ð1Ø,”
Ø!%�Ùß!�>Ø!Ÿ]™]¨4¯:©:°uÓ=�–
ñ ð r   c                 óT   • U R                   [        L a
  [        5       eU R                   $ r1   )r   r   r   rF   s    r   r$   ÚBinaryOperatorAggregate.get’   s!   € Ø�:‰:œÒ Ü#Ó%Ð%Ø�z‰zÐr   c                 ó&   • U R                   [        L$ r1   )r   r   rF   s    r   Úis_availableÚ$BinaryOperatorAggregate.is_available—   s   € Ø�z‰z¤Ð(Ð(r   c                 ó   • U R                   $ r1   r%   rF   s    r   rR   Ú"BinaryOperatorAggregate.checkpointš   s   € Ø�z‰zÐr   )r.   r   )r*   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__r    r   r   r3   ÚobjectÚboolrB   ÚpropertyrG   rK   r	   rP   rT   r   r_   r$   rd   rR   Ú__static_attributes__Ú__classcell__)r?   s   @r   r   r   A   sä   ø† ñð &€Ið!˜D ™Kð !°8¸UÀE¸NÈEÐ<QÑ3R÷ !ð"
˜Fð 
 tô 
ð
 ð˜4 ™;ó ó ðð ð˜D ™Kó ó ðð�dô ð¨%ð °Dô ð˜X e™_ð °ô ð.�Uô ð
)˜dô )ð˜E÷ ò r   r   ) Úcollections.abcr4   r   r   Útypingr   r   Útyping_extensionsr   r   r	   Úlanggraph._internal._constantsr
   Úlanggraph._internal._typingr   Úlanggraph.channels.baser   r   Úlanggraph.errorsr   r   r   r   Úlanggraph.typesr   Ú__all__r   Útuplern   r&   r+   r   © r   r   Ú<module>r}      sŒ   ðÛ ß .ß ç 9Ñ 9å 4Ý /ß 6÷ó õ &à
&€òð˜#ð  %¨¨c¨	Ñ"2ô ð.˜ð  Xð °$ô ôZ˜g e™n¨k¸%ÀÈÐ:MÑ.Nõ Zr   