§
    :ˆtj«  ã                   ó<  — 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edz  fd„Zdedz  dedz  fd„Zdedz  dedz  fd„Z G d„ de¦  «        Zdedee         fd„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(<   dS ))é    )Ú	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dS )Ú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© ó    úI/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/fastapi/sse.pyr   r      s   € € € € € ð
ð 
ð %€J€J€Jr   r   ÚvNÚ
field_nameÚreturnc                 ó@   — | �d| v sd| v rt          d|› d�¦  «        ‚| S )Núú
zSSE 'z' must be a single line)Ú
ValueError)r    r!   s     r   Ú_check_single_liner'   $   s6   € Ø€}˜$ !˜)˜) t¨q y yÝÐD ÐDÐDÐDÑEÔEÐEØ€Hr   c                 ó"   — t          | d¦  «        S )Nr   )r'   ©r    s    r   Ú_check_event_single_liner*   *   s   € Ý˜a Ñ)Ô)Ð)r   c                 óL   — | �d| v rt          d¦  «        ‚t          | d¦  «        S )Nú z)SSE 'id' must not contain null charactersr   )r&   r'   r)   s    r   Ú_check_id_validr-   .   s.   € Ø€}˜ ˜˜ÝÐDÑEÔEÐEÝ˜a Ñ&Ô&Ð&r   c                   ó¼  — 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e¦  «         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dS )Ú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. Must be a
            single line.
            r   zó
            Optional event ID.

            The browser sends this value back as the `Last-Event-ID` header on
            automatic reconnection. **Must be a single line** and 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)Úmoder"   c                 ó@   — | 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   r0   r&   )Úselfs    r   Ú_check_data_exclusivez%ServerSentEvent._check_data_exclusive”   s/   € àŒ9Ð  T¤]Ð%>Ýð;ñô ð ð
 ˆr   )r"   r/   )r   r   r   r   r   r   r   r   Ú__annotations__r0   Ústrr   r   r*   r   r-   r   Úintr   r2   r	   r7   r   r   r   r/   r/   4   sò  € € € € € € ðð ð: 	ð 	ˆ)ØØˆðñ
	
ô 
	
ð	ôð ð ñ ð6 	ð ˆiØˆd‰
Øˆðñ
	
ô 
	
ð	ôð ð ñ ð4 	ð 
ˆ9Øˆd‰
ØˆÐ/Ñ0Ô0Øˆðñ	
ô 	
ð
	ôð ð ñ ð2 	ð ˆ	Øˆd‰
Øˆ�Ñ'Ô'Øˆðñ	
ô 	
ð
	ô	ð ð ñ ð0 	ð 
ˆ9Øˆd‰
Øˆ�ˆ‰ŒØˆðñ	
ô 	
ð		ôð ð ñ ð. 	ð ˆYØˆd‰
Øˆðñ	
ô 	
ð		ôð ð ñ ð €_˜'Ð"Ñ"Ô"ðð ð ñ #Ô"ðð ð r   r/   Úvaluec                 ó|   — |                       dd¦  «                              dd¦  «                             d¦  «        S )Nz
r%   r$   )ÚreplaceÚsplit)r;   s    r   Ú_split_sse_linesr?   Ÿ   s6   € ð �=Š=˜ Ñ&Ô&×.Ò.¨t°TÑ:Ô:×@Ò@ÀÑFÔFÐFr   )Údata_strr   r   r   r2   r@   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).
            r2   z@
            Optional comment line(s) (`:` prefix).
            c                 óö  — g }|�*t          |¦  «        D ]}|                     d|› �¦  «         Œ|�|                     d|› �¦  «         | �*t          | ¦  «        D ]}|                     d|› �¦  «         Œ|�|                     d|› �¦  «         |�|                     d|› �¦  «         |                     d¦  «         |                     d¦  «         d                     |¦  «                             d	¦  «        S )
z~Build SSE wire-format bytes from **pre-serialized** data.

    The result always ends with `\n\n` (the event terminator).
    Nz: zevent: zdata: zid: zretry: Ú r%   zutf-8)r?   ÚappendÚjoinÚencode)r@   r   r   r   r2   ÚlinesÚlines          r   Úformat_sse_eventrH   ¥   s  € ð^ €EàÐÝ$ WÑ-Ô-ð 	&ð 	&ˆDØ�LŠL˜˜d˜˜Ñ%Ô%Ð%Ð%àÐØ�ŠÐ&˜uÐ&Ð&Ñ'Ô'Ð'àÐÝ$ XÑ.Ô.ð 	*ð 	*ˆDØ�LŠL˜ $˜˜Ñ)Ô)Ð)Ð)à	€~Ø�Š�[˜B�[�[Ñ!Ô!Ð!àÐØ�ŠÐ&˜uÐ&Ð&Ñ'Ô'Ð'à	‡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   Údictr9   r8   r   r'   r*   r-   r/   Úlistr?   r:   ÚbytesrH   ÚKEEPALIVE_COMMENTrI   Úfloatr   r   r   ú<module>rS      s+  ðØ !Ð !Ð !Ð !Ð !Ð !Ð !Ð !Ð !à Ð Ð Ð Ð Ð Ø FÐ FÐ FÐ FÐ FÐ FÐ FÐ FÐ FÐ FÐ FÐ FØ 1Ð 1Ð 1Ð 1Ð 1Ð 1ð
 à˜Ð"Ø˜(Ð#Ø�xÐ Ø#°Ð2Ð2ð	ð ð%ð %Ð �4˜˜S˜”>ð ð ñ ð%ð %ð %ð %ð %Ð+ñ %ô %ð %ð ˜# ™*ð °#ð ¸#À¹*ð ð ð ð ð*  d¡
ð *¨s°T©zð *ð *ð *ð *ð'�s˜T‘zð ' c¨D¡jð 'ð 'ð 'ð 'ðhð hð hð hð h�iñ hô hð hðVG˜Cð G D¨¤Ið Gð Gð Gð Gð 	ð 	ð 	ð 	ð 	ðSD,ð D,ð D,àØˆd‰
Øˆðñ	
ô 	
ð	ôðD,ð Øˆd‰
Øˆðñ	
ô 	
ð	ôðD,ð$ 	Øˆd‰
Øˆðñ	
ô 	
ð	ô	ð%D,ð4 Øˆd‰
Øˆðñ	
ô 	
ð	ôð5D,ðD Øˆd‰
Øˆðñ	
ô 	
ð	ôðED,ðT ðUD,ð D,ð D,ð D,ðP "Ð ð €�Ð Ð Ñ Ð Ð r   