Ë
    kjú  ã                   ó”  — U d dl 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diddiddidd d	œd
œdœZeeef   ed<    G d„ de«      Zdedz  dedz  fd„Z G d„ de«      Zddddddœdeedz   ed«      f   deedz   ed«      f   deedz   ed«      f   deedz   ed«      f   deedz   ed«      f   defd „Zd!Zd"Zeed#<   y)$é    )Ú	AnnotatedÚAny)ÚDoc)ÚAfterValidatorÚ	BaseModelÚFieldÚmodel_validator)ÚStreamingResponseÚobjectÚtypeÚstringÚinteger)r   Úminimum)ÚdataÚeventÚidÚretry)r   Ú
propertiesÚ_SSE_EVENT_SCHEMAc                   ó   — e Zd ZdZdZy)ÚEventSourceResponseaæ  Streaming response with `text/event-stream` media type.

    Use as `response_class=EventSourceResponse` on a *path operation* that uses `yield`
    to enable Server Sent Events (SSE) responses.

    Works with **any HTTP method** (`GET`, `POST`, etc.), which makes it compatible
    with protocols like MCP that stream SSE over `POST`.

    The actual encoding logic lives in the FastAPI routing layer. This class
    serves mainly as a marker and sets the correct `Content-Type`.
    ztext/event-streamN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
media_type© ó    úT/var/www/html/sergio/sergio-backend/venv/lib/python3.12/site-packages/fastapi/sse.pyr   r      s   „ ñ
ð %�Jr   r   ÚvNÚreturnc                 ó(   — | �d| v rt        d«      ‚| S )NÚ z)SSE 'id' must not contain null characters)Ú
ValueError)r    s    r   Ú_check_id_no_nullr%   $   s   € Ø€}˜ ™ÜÐDÓEÐEØ€Hr   c                   óF  — e Zd ZU dZdZee ed«      f   ed<   dZ	ee
dz   ed«      f   ed<   dZee
dz   ed«      f   ed<   dZee
dz   ee«       ed	«      f   ed
<   dZeedz   ed¬«       ed«      f   ed<   dZee
dz   ed«      f   ed<    ed¬«      dd„«       Zy)ÚServerSentEventat  Represents a single Server-Sent Event.

    When `yield`ed from a *path operation function* that uses
    `response_class=EventSourceResponse`, each `ServerSentEvent` is encoded
    into the [SSE wire format](https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream)
    (`text/event-stream`).

    If you yield a plain object (dict, Pydantic model, etc.) instead, it is
    automatically JSON-encoded and sent as the `data:` field.

    All `data` values **including plain strings** are JSON-serialized.

    For example, `data="hello"` produces `data: "hello"` on the wire (with
    quotes).
    NaB  
            The event payload.

            Can be any JSON-serializable value: a Pydantic model, dict, list,
            string, number, etc. It is **always** serialized to JSON: strings
            are quoted (`"hello"` becomes `data: "hello"` on the wire).

            Mutually exclusive with `raw_data`.
            r   aQ  
            Raw string to send as the `data:` field **without** JSON encoding.

            Use this when you need to send pre-formatted text, HTML fragments,
            CSV lines, or any non-JSON payload. The string is placed directly
            into the `data:` field as-is.

            Mutually exclusive with `data`.
            Úraw_datazÈ
            Optional event type name.

            Maps to `addEventListener(event, ...)` on the browser. When omitted,
            the browser dispatches on the generic `message` event.
            r   zÍ
            Optional event ID.

            The browser sends this value back as the `Last-Event-ID` header on
            automatic reconnection. **Must not contain null (`\0`) characters.**
            r   r   )Úgez×
            Optional reconnection time in **milliseconds**.

            Tells the browser how long to wait before reconnecting after the
            connection is lost. Must be a non-negative integer.
            r   zû
            Optional comment line(s).

            Comment lines start with `:` in the SSE wire format and are ignored by
            `EventSource` clients. Useful for keep-alive pings to prevent
            proxy/load-balancer timeouts.
            ÚcommentÚafter)Úmodec                 óL   — | j                   �| j                  �t        d«      ‚| S )Nz“Cannot set both 'data' and 'raw_data' on the same ServerSentEvent. Use 'data' for JSON-serialized payloads or 'raw_data' for pre-formatted strings.)r   r(   r$   )Úselfs    r   Ú_check_data_exclusivez%ServerSentEvent._check_data_exclusive‡   s.   € à�9‰9Ð  T§]¡]Ð%>Üð;óð ð
 ˆr   )r!   r'   )r   r   r   r   r   r   r   r   Ú__annotations__r(   Ústrr   r   r   r%   r   Úintr   r*   r	   r/   r   r   r   r'   r'   *   sF  … ñð: 	ð 	ˆ)ØÙðó
	
ð	ñó ð6 	ð ˆiØˆd‰
Ùðó
	
ð	ñó ð0 	ð 
ˆ9Øˆd‰
Ùðó	
ð	ñ
ó 
ð, 	ð ˆ	Øˆd‰
ÙÐ(Ó)Ùðó	
ð		ñ	ó ð. 	ð 
ˆ9Øˆd‰
Ù�ŒÙðó	
ð		ñó ð. 	ð ˆYØˆd‰
Ùðó	
ð		ñó ñ ˜'Ô"òó #ñr   r'   )Údata_strr   r   r   r*   r3   zQ
            Pre-serialized data string to use as the `data:` field.
            r   zD
            Optional event type name (`event:` field).
            r   z:
            Optional event ID (`id:` field).
            r   zV
            Optional reconnection time in milliseconds (`retry:` field).
            r*   z@
            Optional comment line(s) (`:` prefix).
            c                 óº  — g }|�)|j                  «       D ]  }|j                  d|› �«       Œ |�|j                  d|› �«       | �)| j                  «       D ]  }|j                  d|› �«       Œ |�|j                  d|› �«       |�|j                  d|› �«       |j                  d«       |j                  d«       dj                  |«      j                  d«      S )	z|Build SSE wire-format bytes from **pre-serialized** data.

    The result always ends with `

` (the event terminator).
    z: zevent: zdata: zid: zretry: Ú Ú
zutf-8)Ú
splitlinesÚappendÚjoinÚencode)r3   r   r   r   r*   ÚlinesÚlines          r   Úformat_sse_eventr=   ’   sß   € ð^ €EàÐØ×&Ñ&Ö(ˆDØ�L‰L˜2˜d˜V˜Õ%ð )ð ÐØ�‰�w˜u˜gÐ&Ô'àÐØ×'Ñ'Ö)ˆDØ�L‰L˜6 $ ˜Õ)ð *ð 
€~Ø�‰�t˜B˜4�[Ô!àÐØ�‰�w˜u˜gÐ&Ô'à	‡L�L�ÔØ	‡L�L�ÔØ�9‰9�UÓ×"Ñ" 7Ó+Ð+r   s   : ping

g      .@Ú_PING_INTERVAL)Útypingr   r   Úannotated_docr   Úpydanticr   r   r   r	   Ústarlette.responsesr
   r   Údictr1   r0   r   r%   r'   r2   Úbytesr=   ÚKEEPALIVE_COMMENTr>   Úfloatr   r   r   Ú<module>rG      sž  ðß !Ð !å ß FÓ FÝ 1ð
 à˜Ð"Ø˜(Ð#Ø�xÐ Ø#°Ñ2ñ	ñ%Ð �4˜˜S˜‘>ó ô%Ð+ô %ð ˜˜t™ð ¨¨d©
ó ôe�iô eðb 	ð 	ð 	ð 	ð 	òSD,àØˆd‰
Ùðó	
ð	ñðD,ð Øˆd‰
Ùðó	
ð	ñðD,ð$ 	Øˆd‰
Ùðó	
ð	ñ	ð%D,ð4 Øˆd‰
Ùðó	
ð	ñð5D,ðD Øˆd‰
Ùðó	
ð	ñðED,ðT óUD,ðP "Ð ð €�Ô r   