Ë
    úmxi  ã                  óv   — d dl mZ d dlmZ d dlmZ d dlmZ  G d„ de«      Z G d„ de	«      Z
 G d	„ d
e«      Zy)é    )Úannotations)Úabstractmethod)ÚEnum)ÚProtocolc                  ó   — e Zd ZdZdZy)ÚMediaFileKindÚmediaÚdownloadableN)Ú__name__Ú
__module__Ú__qualname__ÚMEDIAÚDOWNLOADABLE© ó    ú[/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/runtime/media_file_storage.pyr   r      s   „ à€Eð "�Lr   r   c                  ó   — e Zd ZdZy)ÚMediaFileStorageErroraf  Exception class for errors raised by MediaFileStorage.

    When running in "development mode", the full text of these errors
    is displayed in the frontend, so errors should be human-readable
    (and actionable).

    When running in "release mode", errors are redacted on the
    frontend; we instead show a generic "Something went wrong!" message.
    N)r   r   r   Ú__doc__r   r   r   r   r      s   „ òr   r   c                  óX   — e Zd Ze	 d	 	 	 	 	 	 	 	 	 dd„«       Zedd„«       Zedd„«       Zy)	ÚMediaFileStorageNc                ó   — t         ‚)a  Load the given file path or bytes into the manager and return
        an ID that uniquely identifies it.

        It's an error to pass a URL to this function. (Media stored at
        external URLs can be served directly to the Streamlit frontend;
        there's no need to store this data in MediaFileStorage.)

        Parameters
        ----------
        path_or_data
            A path to a file, or the file's raw data as bytes.

        mimetype
            The media's mimetype. Used to set the Content-Type header when
            serving the media over HTTP.

        kind
            The kind of file this is: either MEDIA, or DOWNLOADABLE.

        filename : str or None
            Optional filename. Used to set the filename in the response header.

        Returns
        -------
        str
            The unique ID of the media file.

        Raises
        ------
        MediaFileStorageError
            Raised if the media can't be loaded (for example, if a file
            path is invalid).

        ©ÚNotImplementedError)ÚselfÚpath_or_dataÚmimetypeÚkindÚfilenames        r   Úload_and_get_idz MediaFileStorage.load_and_get_id+   s   € ôT "Ð!r   c                ó   — t         ‚)aá  Return a URL for a file in the manager.

        Parameters
        ----------
        file_id
            The file's ID, returned from load_media_and_get_id().

        Returns
        -------
        str
            A URL that the frontend can load the file from. Because this
            URL may expire, it should not be cached!

        Raises
        ------
        MediaFileStorageError
            Raised if the manager doesn't contain an object with the given ID.

        r   ©r   Úfile_ids     r   Úget_urlzMediaFileStorage.get_urlW   s
   € ô* "Ð!r   c                ó   — t         ‚)a  Delete a file from the manager.

        This should be called when a given file is no longer referenced
        by any connected client, so that the MediaFileStorage can free its
        resources.

        Calling `delete_file` on a file_id that doesn't exist is allowed,
        and is a no-op. (This means that multiple `delete_file` calls with
        the same file_id is not an error.)

        Note: implementations can choose to ignore `delete_file` calls -
        this function is a *suggestion*, not a *command*. Callers should
        not rely on file deletion happening immediately (or at all).

        Parameters
        ----------
        file_id
            The file's ID, returned from load_media_and_get_id().

        Returns
        -------
        None

        Raises
        ------
        MediaFileStorageError
            Raised if file deletion fails for any reason. Note that these
            failures will generally not be shown on the frontend (file
            deletion usually occurs on session disconnect).

        r   r"   s     r   Údelete_filezMediaFileStorage.delete_filen   s   € ôB "Ð!r   )N)
r   zstr | bytesr   Ústrr   r   r   z
str | NoneÚreturnr'   )r#   r'   r(   r'   )r#   r'   r(   ÚNone)r   r   r   r   r    r$   r&   r   r   r   r   r   *   sr   „ Øð  $ð)"à!ð)"ð ð)"ð ð	)"ð
 ð)"ð 
ò)"ó ð)"ðV ò"ó ð"ð, ò "ó ñ "r   r   N)Ú
__future__r   Úabcr   Úenumr   Útypingr   r   Ú	Exceptionr   r   r   r   r   ú<module>r/      s9   ðõ #å Ý Ý ô"�Dô "ô	˜Iô 	ôe"�xõ e"r   