from enum import Enum
from dataclasses import dataclass

from PySide6.QtGui import QColor

# ---------------------------------------------------------------------------
# Constants
# ---------------------------------------------------------------------------
FIVEMURL = "fivem://connect/prod.la-taniere.fun"
REDIRECT_URI = "http://localhost:5000/callback"
SCOPES = ["identify"]
CLIENT_ID = "1240007913175781508"
AUTENTICATION_SUCCESS_MESSAGE = """
                <html>
                <head>
                    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
                    <meta content="utf-8" http-equiv="encoding">
                </head>
                    <body>
                        <h1>Authentication réussie</h1>
                        <p>Vous pouvez maintenant fermer cette fenêtre et revenir au launcher de La Tanière.</p>
                        </body>
                </html>
            """.encode('utf-8')
# ---------------------------------------------------------------------------
# ENUMS
# ---------------------------------------------------------------------------
class Resources(Enum):
    MP3 = ':/assets/the-beat-of-nature.mp3'
    FONT = ':/assets/Avocado-Cake-Demo.otf'

class Urls(Enum):
    DISCORD = 'https://discord.gg/A7eanmSkp2'
    INTRANET = 'https://la-taniere.fun/connexion/'
    API_URL = 'https://prod.la-taniere.fun:30121/'

class ApiEndPoints(Enum):
    QUEUE_STATUS = '/queue/status/'
    QUEUE_LEAVE = '/queue/leave'
    QUEUE_JOIN = '/queue/join'
    QUEUE_REFRESH = '/queue/refresh'
    REGISTER_USER = '/api_v2/connection/register'

class Glow(Enum):
    COLOR     = QColor(255, 140, 0, 255)
    BLUR_BASE = 15
    BLUR_PEAK = 70
    ANIM_DURATION = 1200

# ---------------------------------------------------------------------------
# DATACLASS
# ---------------------------------------------------------------------------
@dataclass
class PlayerServerInfo:
    is_staff: bool = False
    is_whitelist: bool = False
    session_id: str = None
