+
    ~jl                    &   R t ^ RIHt ^ RIt^ RIHtHtHt ^ RIH	t	HtH
t
Ht ^RIHt RtRt]P                   ! ] R24      t]P                   ! ] R	] 24      t]! R
^^4      t]! R4      t]! R4      tR R ltR R ltR R ltR R ltR R ltR# )z
This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py
without the Pydantic v1 specific errors.
)annotationsN)DictUnionOptional)datedatetimetimezone	timedelta)StrBytesIntFloatz3(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})z(?P<hour>\d{1,2}):(?P<minute>\d{1,2})(?::(?P<second>\d{1,2})(?:\.(?P<microsecond>\d{1,6})\d{0,6})?)?(?P<tzinfo>Z|[+-]\d{2}(?::?\d{2})?)?$$z[T ]i  g    _Bg0)VC0Dc               $    V ^8  d   QhRRRRRR/# )   valuer
   native_expected_typestrreturnzUnion[None, int, float] )formats   "u/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/anthropic/_utils/_datetime_parse.py__annotate__r   !   s(     q q( q qH_ q    c                    \        V \        \        34      '       d   V #  \        V 4      #   \         d     R # \         d    \	        RT R24      R hi ; i)Nzinvalid type; expected z, string, bytes, int or float)
isinstanceintfloat
ValueError	TypeError)r   r   s   &&r   _get_numericr   !   s_    %#u&&qU|  q12F1GGdeflppqs   
+ AAAc                    V ^8  d   QhRRRR/# )r   secondszUnion[int, float]r   r   r   )r   s   "r   r   r   ,   s     	+ 	+ 1 	+h 	+r   c                   V \         8  d   \        P                  # V \         ) 8  d   \        P                  # \	        V 4      \
        8  d   V R ,          p K  \        \        V R7      ,           pVP                  \        P                  R7      # )i  )r   )tzinfo)
MAX_NUMBERr   maxminabsMS_WATERSHEDEPOCHr	   replacer   utc)r   dts   & r   _from_unix_secondsr+   ,   sa    ||	J;	||
g,
%4	7+	+B::X\\:**r   c                    V ^8  d   QhRRRR/# )r   r   zOptional[str]r   zUnion[None, int, timezone]r   )r   s   "r   r   r   8   s     
 
= 
-G 
r   c                   V R 8X  d   \         P                  # V eg   \        V 4      ^8  d   \        V RR 4      M^ p^<\        V R,          4      ,          V,           pV ^ ,          R8X  d   V) p\        \	        VR7      4      # R# )ZN:      N-)minutes)r   r)   lenr   r	   )r   offset_minsoffsets   &  r   _parse_timezoner7   8   sp    |||		),Uac%*oQc%*o%38s?WF	&122r   c                    V ^8  d   QhRRRR/# )r   r   z!Union[datetime, StrBytesIntFloat]r   r   r   )r   s   "r   r   r   E   s     " "; " "r   c                r   \        V \        4      '       d   V # \        V R4      pVe   \        V4      # \        V \        4      '       d   V P                  4       p \        V \        \        34      '       d   Q h\        P                  V 4      pVf   \        R4      hVP                  4       pVR,          '       d   VR,          P                  ^R4      VR&   \        VP                  R4      4      pVP                  4        UUu/ uF  w  rVVf   K  V\        V4      bK  	  pppWGR&   \        R/ VB # u uppi )aC  
Parse a datetime/int/float/string and return a datetime.datetime.

This function supports time zone offsets. When the input contains one,
the output uses a timezone with a fixed offset from UTC.

Raise ValueError if the input is well formatted but not a valid datetime.
Raise ValueError if the input isn't well formatted.
r   zinvalid datetime formatmicrosecond0r!   r   )r   r   r   r+   bytesdecoder   r   datetime_rematchr   	groupdictljustr7   popitems)r   numberr?   kwr!   kvkw_s   &       r   parse_datetimerI   E   s    %""%,F!&))%%%....e$E}233		B	-}-33As;=RVVH-.FHJ
1d
VW)!SV)
C1dM?c? 2es   D3D3c                    V ^8  d   QhRRRR/# )r   r   zUnion[date, StrBytesIntFloat]r   r   r   )r   s   "r   r   r   j   s     : :3 : :r   c                p   \        V \        4      '       d)   \        V \        4      '       d   V P                  4       # V # \        V R4      pVe   \	        V4      P                  4       # \        V \
        4      '       d   V P                  4       p \        V \        \        34      '       d   Q h\        P                  V 4      pVf   \        R4      hVP                  4       P                  4        UUu/ uF  w  r4V\        V4      bK  	  ppp \        R/ VB # u uppi   \         d    \        R4      Rhi ; i)z
Parse a date/int/float/string and return a datetime.date.

Raise ValueError if the input is well formatted but not a valid date.
Raise ValueError if the input isn't well formatted.
r   Nzinvalid date formatr   )r   r   r   r   r+   r<   r=   r   r   date_rer?   r   r@   rC   )r   rD   r?   rF   rG   rE   s   &     r   
parse_daterM   j   s    %eX&&::<L%(F!&)..00%%%....MM% E}.// % 1 7 7 9	: 9!SV) 9B	::zbz 
;  :./T9:s   1D
D D5)__doc__
__future__r   retypingr   r   r   r   r   r   r	   _typesr
   	date_expr	time_exprcompilerL   r>   r'   r   r&   r"   r   r+   r7   rI   rM   r   r   r   <module>rV      s   
 # 	 ( ( 8 8 %B	- 
 **	{!_
%jjI;d9+67 	q! 4yY
q	+
"J:r   