Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Add firewall management API and service

Juan Denis9def699bee5c
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
index 8605eb20..ab49d37a 100644
--- a/backend/app/__init__.py
+++ b/backend/app/__init__.py
@@ -1,5 +1,5 @@
import os
-from flask import Flask
+from flask import Flask, send_from_directory
from flask_sqlalchemy import SQLAlchemy
from flask_jwt_extended import JWTManager
from flask_cors import CORS
@@ -13,6 +13,9 @@ jwt = JWTManager()
limiter = Limiter(key_func=get_remote_address, default_limits=["100 per minute"])
socketio = None
+# Path to frontend dist folder (relative to backend folder)
+FRONTEND_DIST = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'frontend', 'dist')
+
def create_app(config_name=None):
global socketio
@@ -20,14 +23,25 @@ def create_app(config_name=None):
if config_name is None:
config_name = os.environ.get('FLASK_ENV', 'development')
- app = Flask(__name__)
+ # Configure Flask to serve static files from frontend dist
+ app = Flask(
+ __name__,
+ static_folder=FRONTEND_DIST,
+ static_url_path=''
+ )
app.config.from_object(config[config_name])
# Initialize extensions
db.init_app(app)
jwt.init_app(app)
limiter.init_app(app)
- CORS(app, origins=app.config['CORS_ORIGINS'], supports_credentials=True)
+ CORS(
+ app,
+ origins=app.config['CORS_ORIGINS'],
+ supports_credentials=True,
+ allow_headers=['Content-Type', 'Authorization', 'X-Requested-With'],
+ methods=['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'PATCH']
+ )
# Register security headers middleware
from app.middleware.security import register_security_headers
@@ -99,10 +113,29 @@ def create_app(config_name=None):
from app.api.ftp import ftp_bp
app.register_blueprint(ftp_bp, url_prefix='/api/v1/ftp')
+ # Register blueprints - Firewall
+ from app.api.firewall import firewall_bp
+ app.register_blueprint(firewall_bp, url_prefix='/api/v1/firewall')
+
# Create database tables
with app.app_context():
db.create_all()
+ # Serve frontend for root path
+ @app.route('/')
+ def serve_index():
+ return send_from_directory(app.static_folder, 'index.html')
+
+ # Catch-all route for SPA - must be after all other routes
+ @app.errorhandler(404)
+ def not_found(e):
+ # If it's an API request, return JSON 404
+ from flask import request
+ if request.path.startswith('/api/'):
+ return {'error': 'Not found'}, 404
+ # Otherwise serve the SPA index.html for client-side routing
+ return send_from_directory(app.static_folder, 'index.html')
+
return app
diff --git a/backend/app/api/firewall.py b/backend/app/api/firewall.py
new file mode 100644
index 00000000..a68ff2d6
--- /dev/null
+++ b/backend/app/api/firewall.py
@@ -0,0 +1,246 @@
+"""Firewall API endpoints for managing firewalld and ufw."""
+
+from flask import Blueprint, request, jsonify
+from flask_jwt_extended import jwt_required
+from ..services.firewall_service import FirewallService
+
+firewall_bp = Blueprint('firewall', __name__)
+
+
+@firewall_bp.route('/status', methods=['GET'])
+@jwt_required()
+def get_status():
+ """Get firewall status."""
+ result = FirewallService.get_status()
+ return jsonify(result), 200
+
+
+@firewall_bp.route('/enable', methods=['POST'])
+@jwt_required()
+def enable_firewall():
+ """Enable the firewall."""
+ data = request.get_json() or {}
+ firewall = data.get('firewall')
+
+ result = FirewallService.enable(firewall)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/disable', methods=['POST'])
+@jwt_required()
+def disable_firewall():
+ """Disable the firewall."""
+ data = request.get_json() or {}
+ firewall = data.get('firewall')
+
+ result = FirewallService.disable(firewall)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/rules', methods=['GET'])
+@jwt_required()
+def get_rules():
+ """Get all firewall rules."""
+ firewall = request.args.get('firewall')
+ result = FirewallService.get_rules(firewall)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/rules', methods=['POST'])
+@jwt_required()
+def add_rule():
+ """Add a firewall rule."""
+ data = request.get_json()
+
+ if not data:
+ return jsonify({'success': False, 'error': 'Request body required'}), 400
+
+ rule_type = data.get('type')
+ if not rule_type:
+ return jsonify({'success': False, 'error': 'Rule type required'}), 400
+
+ # Extract parameters based on rule type
+ kwargs = {k: v for k, v in data.items() if k != 'type'}
+
+ result = FirewallService.add_rule(rule_type, **kwargs)
+
+ if result.get('success'):
+ return jsonify(result), 201
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/rules', methods=['DELETE'])
+@jwt_required()
+def remove_rule():
+ """Remove a firewall rule."""
+ data = request.get_json()
+
+ if not data:
+ return jsonify({'success': False, 'error': 'Request body required'}), 400
+
+ rule_type = data.get('type')
+ if not rule_type:
+ return jsonify({'success': False, 'error': 'Rule type required'}), 400
+
+ kwargs = {k: v for k, v in data.items() if k != 'type'}
+
+ result = FirewallService.remove_rule(rule_type, **kwargs)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/block-ip', methods=['POST'])
+@jwt_required()
+def block_ip():
+ """Quick block an IP address."""
+ data = request.get_json()
+
+ if not data:
+ return jsonify({'success': False, 'error': 'Request body required'}), 400
+
+ ip = data.get('ip')
+ if not ip:
+ return jsonify({'success': False, 'error': 'IP address required'}), 400
+
+ permanent = data.get('permanent', True)
+
+ result = FirewallService.block_ip(ip, permanent)
+
+ if result.get('success'):
+ return jsonify(result), 201
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/unblock-ip', methods=['POST'])
+@jwt_required()
+def unblock_ip():
+ """Unblock an IP address."""
+ data = request.get_json()
+
+ if not data:
+ return jsonify({'success': False, 'error': 'Request body required'}), 400
+
+ ip = data.get('ip')
+ if not ip:
+ return jsonify({'success': False, 'error': 'IP address required'}), 400
+
+ permanent = data.get('permanent', True)
+
+ result = FirewallService.unblock_ip(ip, permanent)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/blocked-ips', methods=['GET'])
+@jwt_required()
+def get_blocked_ips():
+ """Get list of blocked IP addresses."""
+ result = FirewallService.get_blocked_ips()
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/allow-port', methods=['POST'])
+@jwt_required()
+def allow_port():
+ """Allow a port through the firewall."""
+ data = request.get_json()
+
+ if not data:
+ return jsonify({'success': False, 'error': 'Request body required'}), 400
+
+ port = data.get('port')
+ if not port:
+ return jsonify({'success': False, 'error': 'Port number required'}), 400
+
+ protocol = data.get('protocol', 'tcp')
+ permanent = data.get('permanent', True)
+
+ result = FirewallService.allow_port(port, protocol, permanent)
+
+ if result.get('success'):
+ return jsonify(result), 201
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/deny-port', methods=['POST'])
+@jwt_required()
+def deny_port():
+ """Remove a port from the firewall."""
+ data = request.get_json()
+
+ if not data:
+ return jsonify({'success': False, 'error': 'Request body required'}), 400
+
+ port = data.get('port')
+ if not port:
+ return jsonify({'success': False, 'error': 'Port number required'}), 400
+
+ protocol = data.get('protocol', 'tcp')
+ permanent = data.get('permanent', True)
+
+ result = FirewallService.deny_port(port, protocol, permanent)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/zones', methods=['GET'])
+@jwt_required()
+def get_zones():
+ """Get firewalld zones."""
+ result = FirewallService.get_zones()
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/zones/default', methods=['POST'])
+@jwt_required()
+def set_default_zone():
+ """Set default firewalld zone."""
+ data = request.get_json()
+
+ if not data:
+ return jsonify({'success': False, 'error': 'Request body required'}), 400
+
+ zone = data.get('zone')
+ if not zone:
+ return jsonify({'success': False, 'error': 'Zone name required'}), 400
+
+ result = FirewallService.set_default_zone(zone)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
+
+
+@firewall_bp.route('/install', methods=['POST'])
+@jwt_required()
+def install_firewall():
+ """Install a firewall (ufw or firewalld)."""
+ data = request.get_json() or {}
+ firewall = data.get('firewall', 'ufw')
+
+ result = FirewallService.install_firewall(firewall)
+
+ if result.get('success'):
+ return jsonify(result), 200
+ return jsonify(result), 400
diff --git a/backend/app/services/file_service.py b/backend/app/services/file_service.py
index 916fc83a..497115c8 100644
--- a/backend/app/services/file_service.py
+++ b/backend/app/services/file_service.py
@@ -1,6 +1,7 @@
"""File management service for browsing, editing, and managing files."""
import os
+import sys
import shutil
import stat
import mimetypes
@@ -8,9 +9,18 @@ import hashlib
from pathlib import Path
from typing import Dict, List, Optional, Tuple
from datetime import datetime
-import pwd
-import grp
+try:
+ import pwd
+except ImportError:
+ # Provide a Windows-compatible alternative here
+ pwd = None
+
+if sys.platform != "win32":
+ import grp
+else:
+ # Use Windows-specific logic or a placeholder
+ grp = None
class FileService:
"""Service for file system operations."""
diff --git a/backend/app/services/firewall_service.py b/backend/app/services/firewall_service.py
new file mode 100644
index 00000000..d04b28ec
--- /dev/null
+++ b/backend/app/services/firewall_service.py
@@ -0,0 +1,659 @@
+"""Firewall management service for firewalld and ufw."""
+
+import subprocess
+import re
+from typing import Dict, List, Optional
+from datetime import datetime
+
+
+class FirewallService:
+ """Service for managing firewall (firewalld or ufw)."""
+
+ @classmethod
+ def get_status(cls) -> Dict:
+ """Get firewall status and detect which firewall is in use."""
+ firewalld = cls._check_firewalld()
+ ufw = cls._check_ufw()
+
+ active_firewall = None
+ if firewalld['installed'] and firewalld['running']:
+ active_firewall = 'firewalld'
+ elif ufw['installed'] and ufw['active']:
+ active_firewall = 'ufw'
+ elif firewalld['installed']:
+ active_firewall = 'firewalld'
+ elif ufw['installed']:
+ active_firewall = 'ufw'
+
+ return {
+ 'firewalld': firewalld,
+ 'ufw': ufw,
+ 'active_firewall': active_firewall,
+ 'any_installed': firewalld['installed'] or ufw['installed'],
+ 'any_active': firewalld['running'] or ufw['active']
+ }
+
+ @classmethod
+ def _check_firewalld(cls) -> Dict:
+ """Check firewalld status."""
+ try:
+ # Check if installed
+ result = subprocess.run(['which', 'firewall-cmd'], capture_output=True, text=True)
+ installed = result.returncode == 0
+
+ running = False
+ default_zone = None
+
+ if installed:
+ # Check if running
+ result = subprocess.run(
+ ['firewall-cmd', '--state'],
+ capture_output=True, text=True
+ )
+ running = 'running' in result.stdout.lower()
+
+ if running:
+ # Get default zone
+ result = subprocess.run(
+ ['firewall-cmd', '--get-default-zone'],
+ capture_output=True, text=True
+ )
+ default_zone = result.stdout.strip()
+
+ return {
+ 'installed': installed,
+ 'running': running,
+ 'default_zone': default_zone
+ }
+ except Exception:
+ return {'installed': False, 'running': False, 'default_zone': None}
+
+ @classmethod
+ def _check_ufw(cls) -> Dict:
+ """Check ufw status."""
+ try:
+ # Check if installed
+ result = subprocess.run(['which', 'ufw'], capture_output=True, text=True)
+ installed = result.returncode == 0
+
+ active = False
+ if installed:
+ result = subprocess.run(
+ ['sudo', 'ufw', 'status'],
+ capture_output=True, text=True
+ )
+ active = 'Status: active' in result.stdout
+
+ return {
+ 'installed': installed,
+ 'active': active
+ }
+ except Exception:
+ return {'installed': False, 'active': False}
+
+ @classmethod
+ def enable(cls, firewall: str = None) -> Dict:
+ """Enable the firewall."""
+ if firewall is None:
+ status = cls.get_status()
+ firewall = status['active_firewall']
+
+ if firewall == 'firewalld':
+ return cls._enable_firewalld()
+ elif firewall == 'ufw':
+ return cls._enable_ufw()
+ else:
+ return {'success': False, 'error': 'No firewall detected'}
+
+ @classmethod
+ def _enable_firewalld(cls) -> Dict:
+ """Enable firewalld."""
+ try:
+ subprocess.run(['sudo', 'systemctl', 'enable', 'firewalld'], capture_output=True)
+ result = subprocess.run(
+ ['sudo', 'systemctl', 'start', 'firewalld'],
+ capture_output=True, text=True
+ )
+ if result.returncode == 0:
+ return {'success': True, 'message': 'Firewalld enabled and started'}
+ return {'success': False, 'error': result.stderr or 'Failed to start firewalld'}
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def _enable_ufw(cls) -> Dict:
+ """Enable ufw."""
+ try:
+ result = subprocess.run(
+ ['sudo', 'ufw', '--force', 'enable'],
+ capture_output=True, text=True
+ )
+ if result.returncode == 0:
+ return {'success': True, 'message': 'UFW enabled'}
+ return {'success': False, 'error': result.stderr or 'Failed to enable UFW'}
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def disable(cls, firewall: str = None) -> Dict:
+ """Disable the firewall."""
+ if firewall is None:
+ status = cls.get_status()
+ firewall = status['active_firewall']
+
+ if firewall == 'firewalld':
+ return cls._disable_firewalld()
+ elif firewall == 'ufw':
+ return cls._disable_ufw()
+ else:
+ return {'success': False, 'error': 'No firewall detected'}
+
+ @classmethod
+ def _disable_firewalld(cls) -> Dict:
+ """Disable firewalld."""
+ try:
+ result = subprocess.run(
+ ['sudo', 'systemctl', 'stop', 'firewalld'],
+ capture_output=True, text=True
+ )
+ if result.returncode == 0:
+ return {'success': True, 'message': 'Firewalld stopped'}
+ return {'success': False, 'error': result.stderr or 'Failed to stop firewalld'}
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def _disable_ufw(cls) -> Dict:
+ """Disable ufw."""
+ try:
+ result = subprocess.run(
+ ['sudo', 'ufw', 'disable'],
+ capture_output=True, text=True
+ )
+ if result.returncode == 0:
+ return {'success': True, 'message': 'UFW disabled'}
+ return {'success': False, 'error': result.stderr or 'Failed to disable UFW'}
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def get_rules(cls, firewall: str = None) -> Dict:
+ """Get all firewall rules."""
+ if firewall is None:
+ status = cls.get_status()
+ firewall = status['active_firewall']
+
+ if firewall == 'firewalld':
+ return cls._get_firewalld_rules()
+ elif firewall == 'ufw':
+ return cls._get_ufw_rules()
+ else:
+ return {'success': False, 'error': 'No firewall detected'}
+
+ @classmethod
+ def _get_firewalld_rules(cls) -> Dict:
+ """Get firewalld rules."""
+ try:
+ rules = []
+
+ # Get default zone
+ result = subprocess.run(
+ ['firewall-cmd', '--get-default-zone'],
+ capture_output=True, text=True
+ )
+ default_zone = result.stdout.strip()
+
+ # Get services
+ result = subprocess.run(
+ ['firewall-cmd', '--list-services'],
+ capture_output=True, text=True
+ )
+ services = result.stdout.strip().split() if result.stdout.strip() else []
+ for service in services:
+ rules.append({
+ 'type': 'service',
+ 'service': service,
+ 'zone': default_zone,
+ 'permanent': True
+ })
+
+ # Get ports
+ result = subprocess.run(
+ ['firewall-cmd', '--list-ports'],
+ capture_output=True, text=True
+ )
+ ports = result.stdout.strip().split() if result.stdout.strip() else []
+ for port in ports:
+ port_num, protocol = port.split('/') if '/' in port else (port, 'tcp')
+ rules.append({
+ 'type': 'port',
+ 'port': port_num,
+ 'protocol': protocol,
+ 'zone': default_zone,
+ 'permanent': True
+ })
+
+ # Get rich rules (includes IP blocks)
+ result = subprocess.run(
+ ['firewall-cmd', '--list-rich-rules'],
+ capture_output=True, text=True
+ )
+ rich_rules = result.stdout.strip().split('\n') if result.stdout.strip() else []
+ for rule in rich_rules:
+ if rule:
+ rules.append({
+ 'type': 'rich',
+ 'rule': rule,
+ 'zone': default_zone
+ })
+
+ return {
+ 'success': True,
+ 'firewall': 'firewalld',
+ 'default_zone': default_zone,
+ 'rules': rules
+ }
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def _get_ufw_rules(cls) -> Dict:
+ """Get ufw rules."""
+ try:
+ result = subprocess.run(
+ ['sudo', 'ufw', 'status', 'numbered'],
+ capture_output=True, text=True
+ )
+
+ rules = []
+ lines = result.stdout.strip().split('\n')
+
+ for line in lines:
+ # Parse rules like: [ 1] 22/tcp ALLOW IN Anywhere
+ match = re.match(r'\[\s*(\d+)\]\s+(.+?)\s+(ALLOW|DENY|REJECT)\s+(IN|OUT)?\s*(.+)?', line)
+ if match:
+ rules.append({
+ 'number': int(match.group(1)),
+ 'port': match.group(2),
+ 'action': match.group(3),
+ 'direction': match.group(4) or 'IN',
+ 'from': match.group(5) or 'Anywhere'
+ })
+
+ return {
+ 'success': True,
+ 'firewall': 'ufw',
+ 'rules': rules
+ }
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def add_rule(cls, rule_type: str, **kwargs) -> Dict:
+ """Add a firewall rule."""
+ status = cls.get_status()
+ firewall = status['active_firewall']
+
+ if firewall == 'firewalld':
+ return cls._add_firewalld_rule(rule_type, **kwargs)
+ elif firewall == 'ufw':
+ return cls._add_ufw_rule(rule_type, **kwargs)
+ else:
+ return {'success': False, 'error': 'No firewall detected'}
+
+ @classmethod
+ def _add_firewalld_rule(cls, rule_type: str, **kwargs) -> Dict:
+ """Add a firewalld rule."""
+ try:
+ permanent = kwargs.get('permanent', True)
+ perm_flag = ['--permanent'] if permanent else []
+
+ if rule_type == 'service':
+ service = kwargs.get('service')
+ if not service:
+ return {'success': False, 'error': 'Service name required'}
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [f'--add-service={service}']
+
+ elif rule_type == 'port':
+ port = kwargs.get('port')
+ protocol = kwargs.get('protocol', 'tcp')
+ if not port:
+ return {'success': False, 'error': 'Port number required'}
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [f'--add-port={port}/{protocol}']
+
+ elif rule_type == 'block_ip':
+ ip = kwargs.get('ip')
+ if not ip:
+ return {'success': False, 'error': 'IP address required'}
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [
+ f'--add-rich-rule=rule family="ipv4" source address="{ip}" reject'
+ ]
+
+ elif rule_type == 'allow_ip':
+ ip = kwargs.get('ip')
+ port = kwargs.get('port')
+ if not ip:
+ return {'success': False, 'error': 'IP address required'}
+ if port:
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [
+ f'--add-rich-rule=rule family="ipv4" source address="{ip}" port port="{port}" protocol="tcp" accept'
+ ]
+ else:
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [
+ f'--add-rich-rule=rule family="ipv4" source address="{ip}" accept'
+ ]
+
+ else:
+ return {'success': False, 'error': f'Unknown rule type: {rule_type}'}
+
+ result = subprocess.run(cmd, capture_output=True, text=True)
+
+ if result.returncode == 0:
+ # Reload if permanent
+ if permanent:
+ subprocess.run(['sudo', 'firewall-cmd', '--reload'], capture_output=True)
+ return {'success': True, 'message': 'Rule added successfully'}
+
+ return {'success': False, 'error': result.stderr or 'Failed to add rule'}
+
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def _add_ufw_rule(cls, rule_type: str, **kwargs) -> Dict:
+ """Add a ufw rule."""
+ try:
+ if rule_type == 'port':
+ port = kwargs.get('port')
+ protocol = kwargs.get('protocol', 'tcp')
+ action = kwargs.get('action', 'allow')
+ if not port:
+ return {'success': False, 'error': 'Port number required'}
+ cmd = ['sudo', 'ufw', action, f'{port}/{protocol}']
+
+ elif rule_type == 'service':
+ service = kwargs.get('service')
+ action = kwargs.get('action', 'allow')
+ if not service:
+ return {'success': False, 'error': 'Service name required'}
+ cmd = ['sudo', 'ufw', action, service]
+
+ elif rule_type == 'block_ip':
+ ip = kwargs.get('ip')
+ if not ip:
+ return {'success': False, 'error': 'IP address required'}
+ cmd = ['sudo', 'ufw', 'deny', 'from', ip]
+
+ elif rule_type == 'allow_ip':
+ ip = kwargs.get('ip')
+ port = kwargs.get('port')
+ if not ip:
+ return {'success': False, 'error': 'IP address required'}
+ if port:
+ cmd = ['sudo', 'ufw', 'allow', 'from', ip, 'to', 'any', 'port', str(port)]
+ else:
+ cmd = ['sudo', 'ufw', 'allow', 'from', ip]
+
+ else:
+ return {'success': False, 'error': f'Unknown rule type: {rule_type}'}
+
+ result = subprocess.run(cmd, capture_output=True, text=True)
+
+ if result.returncode == 0:
+ return {'success': True, 'message': 'Rule added successfully'}
+
+ return {'success': False, 'error': result.stderr or 'Failed to add rule'}
+
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def remove_rule(cls, rule_type: str, **kwargs) -> Dict:
+ """Remove a firewall rule."""
+ status = cls.get_status()
+ firewall = status['active_firewall']
+
+ if firewall == 'firewalld':
+ return cls._remove_firewalld_rule(rule_type, **kwargs)
+ elif firewall == 'ufw':
+ return cls._remove_ufw_rule(rule_type, **kwargs)
+ else:
+ return {'success': False, 'error': 'No firewall detected'}
+
+ @classmethod
+ def _remove_firewalld_rule(cls, rule_type: str, **kwargs) -> Dict:
+ """Remove a firewalld rule."""
+ try:
+ permanent = kwargs.get('permanent', True)
+ perm_flag = ['--permanent'] if permanent else []
+
+ if rule_type == 'service':
+ service = kwargs.get('service')
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [f'--remove-service={service}']
+
+ elif rule_type == 'port':
+ port = kwargs.get('port')
+ protocol = kwargs.get('protocol', 'tcp')
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [f'--remove-port={port}/{protocol}']
+
+ elif rule_type == 'block_ip':
+ ip = kwargs.get('ip')
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [
+ f'--remove-rich-rule=rule family="ipv4" source address="{ip}" reject'
+ ]
+
+ elif rule_type == 'rich':
+ rule = kwargs.get('rule')
+ cmd = ['sudo', 'firewall-cmd'] + perm_flag + [f'--remove-rich-rule={rule}']
+
+ else:
+ return {'success': False, 'error': f'Unknown rule type: {rule_type}'}
+
+ result = subprocess.run(cmd, capture_output=True, text=True)
+
+ if result.returncode == 0:
+ if permanent:
+ subprocess.run(['sudo', 'firewall-cmd', '--reload'], capture_output=True)
+ return {'success': True, 'message': 'Rule removed successfully'}
+
+ return {'success': False, 'error': result.stderr or 'Failed to remove rule'}
+
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def _remove_ufw_rule(cls, rule_type: str, **kwargs) -> Dict:
+ """Remove a ufw rule."""
+ try:
+ rule_number = kwargs.get('number')
+ if rule_number:
+ # Remove by number
+ result = subprocess.run(
+ ['sudo', 'ufw', '--force', 'delete', str(rule_number)],
+ capture_output=True, text=True
+ )
+ else:
+ # Remove by specification
+ if rule_type == 'port':
+ port = kwargs.get('port')
+ protocol = kwargs.get('protocol', 'tcp')
+ action = kwargs.get('action', 'allow')
+ result = subprocess.run(
+ ['sudo', 'ufw', 'delete', action, f'{port}/{protocol}'],
+ capture_output=True, text=True
+ )
+ elif rule_type == 'block_ip':
+ ip = kwargs.get('ip')
+ result = subprocess.run(
+ ['sudo', 'ufw', 'delete', 'deny', 'from', ip],
+ capture_output=True, text=True
+ )
+ else:
+ return {'success': False, 'error': 'Rule number or specification required'}
+
+ if result.returncode == 0:
+ return {'success': True, 'message': 'Rule removed successfully'}
+
+ return {'success': False, 'error': result.stderr or 'Failed to remove rule'}
+
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def block_ip(cls, ip: str, permanent: bool = True) -> Dict:
+ """Quick method to block an IP address."""
+ # Validate IP format
+ if not cls._is_valid_ip(ip):
+ return {'success': False, 'error': 'Invalid IP address format'}
+
+ return cls.add_rule('block_ip', ip=ip, permanent=permanent)
+
+ @classmethod
+ def unblock_ip(cls, ip: str, permanent: bool = True) -> Dict:
+ """Quick method to unblock an IP address."""
+ return cls.remove_rule('block_ip', ip=ip, permanent=permanent)
+
+ @classmethod
+ def allow_port(cls, port: int, protocol: str = 'tcp', permanent: bool = True) -> Dict:
+ """Quick method to allow a port."""
+ return cls.add_rule('port', port=port, protocol=protocol, permanent=permanent)
+
+ @classmethod
+ def deny_port(cls, port: int, protocol: str = 'tcp', permanent: bool = True) -> Dict:
+ """Quick method to deny a port."""
+ return cls.remove_rule('port', port=port, protocol=protocol, permanent=permanent)
+
+ @classmethod
+ def get_blocked_ips(cls) -> Dict:
+ """Get list of blocked IP addresses."""
+ status = cls.get_status()
+ firewall = status['active_firewall']
+
+ blocked_ips = []
+
+ if firewall == 'firewalld':
+ result = subprocess.run(
+ ['firewall-cmd', '--list-rich-rules'],
+ capture_output=True, text=True
+ )
+ for line in result.stdout.strip().split('\n'):
+ if 'reject' in line.lower() or 'drop' in line.lower():
+ match = re.search(r'source address="([^"]+)"', line)
+ if match:
+ blocked_ips.append({
+ 'ip': match.group(1),
+ 'rule': line
+ })
+
+ elif firewall == 'ufw':
+ result = subprocess.run(
+ ['sudo', 'ufw', 'status', 'numbered'],
+ capture_output=True, text=True
+ )
+ for line in result.stdout.strip().split('\n'):
+ if 'DENY' in line:
+ # Parse IP from rule
+ match = re.search(r'from\s+(\d+\.\d+\.\d+\.\d+(?:/\d+)?)', line)
+ if match:
+ blocked_ips.append({
+ 'ip': match.group(1),
+ 'rule': line
+ })
+
+ return {
+ 'success': True,
+ 'firewall': firewall,
+ 'blocked_ips': blocked_ips
+ }
+
+ @classmethod
+ def get_zones(cls) -> Dict:
+ """Get firewalld zones (firewalld only)."""
+ try:
+ # Get all zones
+ result = subprocess.run(
+ ['firewall-cmd', '--get-zones'],
+ capture_output=True, text=True
+ )
+ zones = result.stdout.strip().split()
+
+ # Get default zone
+ result = subprocess.run(
+ ['firewall-cmd', '--get-default-zone'],
+ capture_output=True, text=True
+ )
+ default_zone = result.stdout.strip()
+
+ zone_details = []
+ for zone in zones:
+ result = subprocess.run(
+ ['firewall-cmd', f'--zone={zone}', '--list-all'],
+ capture_output=True, text=True
+ )
+ zone_details.append({
+ 'name': zone,
+ 'is_default': zone == default_zone,
+ 'details': result.stdout
+ })
+
+ return {
+ 'success': True,
+ 'zones': zone_details,
+ 'default_zone': default_zone
+ }
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def set_default_zone(cls, zone: str) -> Dict:
+ """Set default firewalld zone."""
+ try:
+ result = subprocess.run(
+ ['sudo', 'firewall-cmd', f'--set-default-zone={zone}'],
+ capture_output=True, text=True
+ )
+ if result.returncode == 0:
+ return {'success': True, 'message': f'Default zone set to {zone}'}
+ return {'success': False, 'error': result.stderr or 'Failed to set default zone'}
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @classmethod
+ def install_firewall(cls, firewall: str = 'ufw') -> Dict:
+ """Install a firewall."""
+ if firewall not in ['ufw', 'firewalld']:
+ return {'success': False, 'error': 'Invalid firewall. Use ufw or firewalld'}
+
+ try:
+ # Update package list
+ subprocess.run(['sudo', 'apt-get', 'update'], capture_output=True, timeout=120)
+
+ # Install
+ result = subprocess.run(
+ ['sudo', 'apt-get', 'install', '-y', firewall],
+ capture_output=True, text=True, timeout=300
+ )
+
+ if result.returncode == 0:
+ return {'success': True, 'message': f'{firewall} installed successfully'}
+ return {'success': False, 'error': result.stderr or 'Installation failed'}
+
+ except subprocess.TimeoutExpired:
+ return {'success': False, 'error': 'Installation timed out'}
+ except Exception as e:
+ return {'success': False, 'error': str(e)}
+
+ @staticmethod
+ def _is_valid_ip(ip: str) -> bool:
+ """Validate IP address format."""
+ # IPv4 pattern
+ ipv4_pattern = r'^(\d{1,3}\.){3}\d{1,3}(/\d{1,2})?$'
+ # IPv6 pattern (simplified)
+ ipv6_pattern = r'^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}(/\d{1,3})?$'
+
+ if re.match(ipv4_pattern, ip):
+ # Validate each octet
+ parts = ip.split('/')[0].split('.')
+ return all(0 <= int(part) <= 255 for part in parts)
+
+ return bool(re.match(ipv6_pattern, ip))
diff --git a/backend/app/services/ftp_service.py b/backend/app/services/ftp_service.py
index 3c11e4db..22f36bf1 100644
--- a/backend/app/services/ftp_service.py
+++ b/backend/app/services/ftp_service.py
@@ -3,8 +3,14 @@
import os
import subprocess
import re
-import pwd
-import crypt
+try:
+ import pwd
+except ImportError:
+ # Provide a Windows-compatible alternative here
+ pwd = None
+#import crypt
+from passlib.hash import sha512_crypt # Or your preferred hash scheme
+import platform
import secrets
from typing import Dict, List, Optional
from datetime import datetime
diff --git a/backend/config.py b/backend/config.py
index 474ffe04..c58a0a5e 100644
--- a/backend/config.py
+++ b/backend/config.py
@@ -23,8 +23,8 @@ class Config:
JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1)
JWT_REFRESH_TOKEN_EXPIRES = timedelta(days=30)
- # CORS
- CORS_ORIGINS = os.environ.get('CORS_ORIGINS', 'http://localhost:5173').split(',')
+ # CORS - Allow both dev server and Flask server
+ CORS_ORIGINS = os.environ.get('CORS_ORIGINS', 'http://localhost:5173,http://localhost:5000,http://127.0.0.1:5173,http://127.0.0.1:5000').split(',')
class DevelopmentConfig(Config):
diff --git a/backend/requirements.txt b/backend/requirements.txt
index 3f462a6c..1736130c 100644
--- a/backend/requirements.txt
+++ b/backend/requirements.txt
@@ -37,3 +37,7 @@ Flask-Limiter==3.5.0
# CLI
click==8.1.7
+
+schedule
+passlib
+bcrypt
\ No newline at end of file
diff --git a/frontend/dist/assets/index-BT_A2C8f.js b/frontend/dist/assets/index-BT_A2C8f.js
new file mode 100644
index 00000000..3fd9bd61
--- /dev/null
+++ b/frontend/dist/assets/index-BT_A2C8f.js
@@ -0,0 +1,225 @@
+function Vh(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function Hh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ed={exports:{}},xa={},td={exports:{}},Z={};/**
+ * @license React
+ * react.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Qn=Symbol.for("react.element"),Wh=Symbol.for("react.portal"),Qh=Symbol.for("react.fragment"),Kh=Symbol.for("react.strict_mode"),Gh=Symbol.for("react.profiler"),Yh=Symbol.for("react.provider"),Xh=Symbol.for("react.context"),Jh=Symbol.for("react.forward_ref"),Zh=Symbol.for("react.suspense"),em=Symbol.for("react.memo"),tm=Symbol.for("react.lazy"),To=Symbol.iterator;function sm(e){return e===null||typeof e!="object"?null:(e=To&&e[To]||e["@@iterator"],typeof e=="function"?e:null)}var sd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nd=Object.assign,rd={};function Ys(e,t,n){this.props=e,this.context=t,this.refs=rd,this.updater=n||sd}Ys.prototype.isReactComponent={};Ys.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ys.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ad(){}ad.prototype=Ys.prototype;function wl(e,t,n){this.props=e,this.context=t,this.refs=rd,this.updater=n||sd}var kl=wl.prototype=new ad;kl.constructor=wl;nd(kl,Ys.prototype);kl.isPureReactComponent=!0;var Lo=Array.isArray,id=Object.prototype.hasOwnProperty,Sl={current:null},ld={key:!0,ref:!0,__self:!0,__source:!0};function od(e,t,n){var r,a={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)id.call(t,r)&&!ld.hasOwnProperty(r)&&(a[r]=t[r]);var c=arguments.length-2;if(c===1)a.children=n;else if(1<c){for(var o=Array(c),u=0;u<c;u++)o[u]=arguments[u+2];a.children=o}if(e&&e.defaultProps)for(r in c=e.defaultProps,c)a[r]===void 0&&(a[r]=c[r]);return{$$typeof:Qn,type:e,key:i,ref:l,props:a,_owner:Sl.current}}function nm(e,t){return{$$typeof:Qn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Cl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qn}function rm(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Do=/\/+/g;function qa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?rm(""+e.key):t.toString(36)}function Sr(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Qn:case Wh:l=!0}}if(l)return l=e,a=a(l),e=r===""?"."+qa(l,0):r,Lo(a)?(n="",e!=null&&(n=e.replace(Do,"$&/")+"/"),Sr(a,t,n,"",function(u){return u})):a!=null&&(Cl(a)&&(a=nm(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(Do,"$&/")+"/")+e)),t.push(a)),1;if(l=0,r=r===""?".":r+":",Lo(e))for(var c=0;c<e.length;c++){i=e[c];var o=r+qa(i,c);l+=Sr(i,t,n,o,a)}else if(o=sm(e),typeof o=="function")for(e=o.call(e),c=0;!(i=e.next()).done;)i=i.value,o=r+qa(i,c++),l+=Sr(i,t,n,o,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function ar(e,t,n){if(e==null)return e;var r=[],a=0;return Sr(e,r,"","",function(i){return t.call(n,i,a++)}),r}function am(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Be={current:null},Cr={transition:null},im={ReactCurrentDispatcher:Be,ReactCurrentBatchConfig:Cr,ReactCurrentOwner:Sl};function cd(){throw Error("act(...) is not supported in production builds of React.")}Z.Children={map:ar,forEach:function(e,t,n){ar(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ar(e,function(){t++}),t},toArray:function(e){return ar(e,function(t){return t})||[]},only:function(e){if(!Cl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Z.Component=Ys;Z.Fragment=Qh;Z.Profiler=Gh;Z.PureComponent=wl;Z.StrictMode=Kh;Z.Suspense=Zh;Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=im;Z.act=cd;Z.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=nd({},e.props),a=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=Sl.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(o in t)id.call(t,o)&&!ld.hasOwnProperty(o)&&(r[o]=t[o]===void 0&&c!==void 0?c[o]:t[o])}var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){c=Array(o);for(var u=0;u<o;u++)c[u]=arguments[u+2];r.children=c}return{$$typeof:Qn,type:e.type,key:a,ref:i,props:r,_owner:l}};Z.createContext=function(e){return e={$$typeof:Xh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Yh,_context:e},e.Consumer=e};Z.createElement=od;Z.createFactory=function(e){var t=od.bind(null,e);return t.type=e,t};Z.createRef=function(){return{current:null}};Z.forwardRef=function(e){return{$$typeof:Jh,render:e}};Z.isValidElement=Cl;Z.lazy=function(e){return{$$typeof:tm,_payload:{_status:-1,_result:e},_init:am}};Z.memo=function(e,t){return{$$typeof:em,type:e,compare:t===void 0?null:t}};Z.startTransition=function(e){var t=Cr.transition;Cr.transition={};try{e()}finally{Cr.transition=t}};Z.unstable_act=cd;Z.useCallback=function(e,t){return Be.current.useCallback(e,t)};Z.useContext=function(e){return Be.current.useContext(e)};Z.useDebugValue=function(){};Z.useDeferredValue=function(e){return Be.current.useDeferredValue(e)};Z.useEffect=function(e,t){return Be.current.useEffect(e,t)};Z.useId=function(){return Be.current.useId()};Z.useImperativeHandle=function(e,t,n){return Be.current.useImperativeHandle(e,t,n)};Z.useInsertionEffect=function(e,t){return Be.current.useInsertionEffect(e,t)};Z.useLayoutEffect=function(e,t){return Be.current.useLayoutEffect(e,t)};Z.useMemo=function(e,t){return Be.current.useMemo(e,t)};Z.useReducer=function(e,t,n){return Be.current.useReducer(e,t,n)};Z.useRef=function(e){return Be.current.useRef(e)};Z.useState=function(e){return Be.current.useState(e)};Z.useSyncExternalStore=function(e,t,n){return Be.current.useSyncExternalStore(e,t,n)};Z.useTransition=function(){return Be.current.useTransition()};Z.version="18.3.1";td.exports=Z;var d=td.exports;const qr=Hh(d),lm=Vh({__proto__:null,default:qr},[d]);/**
+ * @license React
+ * react-jsx-runtime.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var om=d,cm=Symbol.for("react.element"),dm=Symbol.for("react.fragment"),um=Object.prototype.hasOwnProperty,hm=om.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,mm={key:!0,ref:!0,__self:!0,__source:!0};function dd(e,t,n){var r,a={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)um.call(t,r)&&!mm.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:cm,type:e,key:i,ref:l,props:a,_owner:hm.current}}xa.Fragment=dm;xa.jsx=dd;xa.jsxs=dd;ed.exports=xa;var s=ed.exports,yi={},ud={exports:{}},Xe={},hd={exports:{}},md={};/**
+ * @license React
+ * scheduler.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */(function(e){function t(R,_){var I=R.length;R.push(_);e:for(;0<I;){var Q=I-1>>>1,Y=R[Q];if(0<a(Y,_))R[Q]=_,R[I]=Y,I=Q;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var _=R[0],I=R.pop();if(I!==_){R[0]=I;e:for(var Q=0,Y=R.length,ve=Y>>>1;Q<ve;){var ne=2*(Q+1)-1,C=R[ne],G=ne+1,F=R[G];if(0>a(C,I))G<Y&&0>a(F,C)?(R[Q]=F,R[G]=I,Q=G):(R[Q]=C,R[ne]=I,Q=ne);else if(G<Y&&0>a(F,I))R[Q]=F,R[G]=I,Q=G;else break e}}return _}function a(R,_){var I=R.sortIndex-_.sortIndex;return I!==0?I:R.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var o=[],u=[],f=1,h=null,p=3,v=!1,N=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(R){for(var _=n(u);_!==null;){if(_.callback===null)r(u);else if(_.startTime<=R)r(u),_.sortIndex=_.expirationTime,t(o,_);else break;_=n(u)}}function y(R){if(j=!1,g(R),!N)if(n(o)!==null)N=!0,z(S);else{var _=n(u);_!==null&&J(y,_.startTime-R)}}function S(R,_){N=!1,j&&(j=!1,m(P),P=-1),v=!0;var I=p;try{for(g(_),h=n(o);h!==null&&(!(h.expirationTime>_)||R&&!L());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,p=h.priorityLevel;var Y=Q(h.expirationTime<=_);_=e.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(o)&&r(o),g(_)}else r(o);h=n(o)}if(h!==null)var ve=!0;else{var ne=n(u);ne!==null&&J(y,ne.startTime-_),ve=!1}return ve}finally{h=null,p=I,v=!1}}var E=!1,T=null,P=-1,O=5,w=-1;function L(){return!(e.unstable_now()-w<O)}function U(){if(T!==null){var R=e.unstable_now();w=R;var _=!0;try{_=T(!0,R)}finally{_?V():(E=!1,T=null)}}else E=!1}var V;if(typeof x=="function")V=function(){x(U)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,B=H.port2;H.port1.onmessage=U,V=function(){B.postMessage(null)}}else V=function(){k(U,0)};function z(R){T=R,E||(E=!0,V())}function J(R,_){P=k(function(){R(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){N||v||(N=!0,z(S))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(o)},e.unstable_next=function(R){switch(p){case 1:case 2:case 3:var _=3;break;default:_=p}var I=p;p=_;try{return R()}finally{p=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,_){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var I=p;p=R;try{return _()}finally{p=I}},e.unstable_scheduleCallback=function(R,_,I){var Q=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Q+I:Q):I=Q,R){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=I+Y,R={id:f++,callback:_,priorityLevel:R,startTime:I,expirationTime:Y,sortIndex:-1},I>Q?(R.sortIndex=I,t(u,R),n(o)===null&&R===n(u)&&(j?(m(P),P=-1):j=!0,J(y,I-Q))):(R.sortIndex=Y,t(o,R),N||v||(N=!0,z(S))),R},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(R){var _=p;return function(){var I=p;p=_;try{return R.apply(this,arguments)}finally{p=I}}}})(md);hd.exports=md;var pm=hd.exports;/**
+ * @license React
+ * react-dom.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var fm=d,Ye=pm;function M(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var pd=new Set,_n={};function ys(e,t){Us(e,t),Us(e+"Capture",t)}function Us(e,t){for(_n[e]=t,e=0;e<t.length;e++)pd.add(t[e])}var _t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ji=Object.prototype.hasOwnProperty,xm=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Fo={},Mo={};function vm(e){return ji.call(Mo,e)?!0:ji.call(Fo,e)?!1:xm.test(e)?Mo[e]=!0:(Fo[e]=!0,!1)}function gm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ym(e,t,n,r){if(t===null||typeof t>"u"||gm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ie(e,t,n,r,a,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Le={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Le[e]=new Ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Le[t]=new Ie(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Le[e]=new Ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Le[e]=new Ie(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Le[e]=new Ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Le[e]=new Ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Le[e]=new Ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Le[e]=new Ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Le[e]=new Ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pl=/[\-:]([a-z])/g;function _l(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Pl,_l);Le[t]=new Ie(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pl,_l);Le[t]=new Ie(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pl,_l);Le[t]=new Ie(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Le[e]=new Ie(e,1,!1,e.toLowerCase(),null,!1,!1)});Le.xlinkHref=new Ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Le[e]=new Ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function El(e,t,n,r){var a=Le.hasOwnProperty(t)?Le[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(ym(t,n,a,r)&&(n=null),r||a===null?vm(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Dt=fm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ir=Symbol.for("react.element"),ks=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),Tl=Symbol.for("react.strict_mode"),Ni=Symbol.for("react.profiler"),fd=Symbol.for("react.provider"),xd=Symbol.for("react.context"),Ll=Symbol.for("react.forward_ref"),bi=Symbol.for("react.suspense"),wi=Symbol.for("react.suspense_list"),Dl=Symbol.for("react.memo"),At=Symbol.for("react.lazy"),vd=Symbol.for("react.offscreen"),Ao=Symbol.iterator;function nn(e){return e===null||typeof e!="object"?null:(e=Ao&&e[Ao]||e["@@iterator"],typeof e=="function"?e:null)}var he=Object.assign,Ua;function mn(e){if(Ua===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ua=t&&t[1]||""}return`
+`+Ua+e}var za=!1;function Va(e,t){if(!e||za)return"";za=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var a=u.stack.split(`
+`),i=r.stack.split(`
+`),l=a.length-1,c=i.length-1;1<=l&&0<=c&&a[l]!==i[c];)c--;for(;1<=l&&0<=c;l--,c--)if(a[l]!==i[c]){if(l!==1||c!==1)do if(l--,c--,0>c||a[l]!==i[c]){var o=`
+`+a[l].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=l&&0<=c);break}}}finally{za=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?mn(e):""}function jm(e){switch(e.tag){case 5:return mn(e.type);case 16:return mn("Lazy");case 13:return mn("Suspense");case 19:return mn("SuspenseList");case 0:case 2:case 15:return e=Va(e.type,!1),e;case 11:return e=Va(e.type.render,!1),e;case 1:return e=Va(e.type,!0),e;default:return""}}function ki(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ss:return"Fragment";case ks:return"Portal";case Ni:return"Profiler";case Tl:return"StrictMode";case bi:return"Suspense";case wi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xd:return(e.displayName||"Context")+".Consumer";case fd:return(e._context.displayName||"Context")+".Provider";case Ll:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dl:return t=e.displayName||null,t!==null?t:ki(e.type)||"Memo";case At:t=e._payload,e=e._init;try{return ki(e(t))}catch{}}return null}function Nm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ki(t);case 8:return t===Tl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Jt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bm(e){var t=gd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lr(e){e._valueTracker||(e._valueTracker=bm(e))}function yd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=gd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ur(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Si(e,t){var n=t.checked;return he({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function $o(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function jd(e,t){t=t.checked,t!=null&&El(e,"checked",t,!1)}function Ci(e,t){jd(e,t);var n=Jt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Pi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Pi(e,t.type,Jt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ro(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Pi(e,t,n){(t!=="number"||Ur(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pn=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Jt(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function _i(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return he({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Oo(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(M(92));if(pn(n)){if(1<n.length)throw Error(M(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Jt(n)}}function Nd(e,t){var n=Jt(t.value),r=Jt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Bo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function bd(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ei(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?bd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var or,wd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(or=or||document.createElement("div"),or.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=or.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function En(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var gn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wm=["Webkit","ms","Moz","O"];Object.keys(gn).forEach(function(e){wm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),gn[t]=gn[e]})});function kd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||gn.hasOwnProperty(e)&&gn[e]?(""+t).trim():t+"px"}function Sd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=kd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var km=he({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ti(e,t){if(t){if(km[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function Li(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Di=null;function Fl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fi=null,Rs=null,Os=null;function Io(e){if(e=Yn(e)){if(typeof Fi!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Na(t),Fi(e.stateNode,e.type,t))}}function Cd(e){Rs?Os?Os.push(e):Os=[e]:Rs=e}function Pd(){if(Rs){var e=Rs,t=Os;if(Os=Rs=null,Io(e),t)for(e=0;e<t.length;e++)Io(t[e])}}function _d(e,t){return e(t)}function Ed(){}var Ha=!1;function Td(e,t,n){if(Ha)return e(t,n);Ha=!0;try{return _d(e,t,n)}finally{Ha=!1,(Rs!==null||Os!==null)&&(Ed(),Pd())}}function Tn(e,t){var n=e.stateNode;if(n===null)return null;var r=Na(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(M(231,t,typeof n));return n}var Mi=!1;if(_t)try{var rn={};Object.defineProperty(rn,"passive",{get:function(){Mi=!0}}),window.addEventListener("test",rn,rn),window.removeEventListener("test",rn,rn)}catch{Mi=!1}function Sm(e,t,n,r,a,i,l,c,o){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var yn=!1,zr=null,Vr=!1,Ai=null,Cm={onError:function(e){yn=!0,zr=e}};function Pm(e,t,n,r,a,i,l,c,o){yn=!1,zr=null,Sm.apply(Cm,arguments)}function _m(e,t,n,r,a,i,l,c,o){if(Pm.apply(this,arguments),yn){if(yn){var u=zr;yn=!1,zr=null}else throw Error(M(198));Vr||(Vr=!0,Ai=u)}}function js(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ld(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function qo(e){if(js(e)!==e)throw Error(M(188))}function Em(e){var t=e.alternate;if(!t){if(t=js(e),t===null)throw Error(M(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return qo(a),e;if(i===r)return qo(a),t;i=i.sibling}throw Error(M(188))}if(n.return!==r.return)n=a,r=i;else{for(var l=!1,c=a.child;c;){if(c===n){l=!0,n=a,r=i;break}if(c===r){l=!0,r=a,n=i;break}c=c.sibling}if(!l){for(c=i.child;c;){if(c===n){l=!0,n=i,r=a;break}if(c===r){l=!0,r=i,n=a;break}c=c.sibling}if(!l)throw Error(M(189))}}if(n.alternate!==r)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?e:t}function Dd(e){return e=Em(e),e!==null?Fd(e):null}function Fd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Fd(e);if(t!==null)return t;e=e.sibling}return null}var Md=Ye.unstable_scheduleCallback,Uo=Ye.unstable_cancelCallback,Tm=Ye.unstable_shouldYield,Lm=Ye.unstable_requestPaint,xe=Ye.unstable_now,Dm=Ye.unstable_getCurrentPriorityLevel,Ml=Ye.unstable_ImmediatePriority,Ad=Ye.unstable_UserBlockingPriority,Hr=Ye.unstable_NormalPriority,Fm=Ye.unstable_LowPriority,$d=Ye.unstable_IdlePriority,va=null,vt=null;function Mm(e){if(vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(va,e,void 0,(e.current.flags&128)===128)}catch{}}var ut=Math.clz32?Math.clz32:Rm,Am=Math.log,$m=Math.LN2;function Rm(e){return e>>>=0,e===0?32:31-(Am(e)/$m|0)|0}var cr=64,dr=4194304;function fn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var c=l&~a;c!==0?r=fn(c):(i&=l,i!==0&&(r=fn(i)))}else l=n&~a,l!==0?r=fn(l):i!==0&&(r=fn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ut(t),a=1<<n,r|=e[n],t&=~a;return r}function Om(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Bm(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-ut(i),c=1<<l,o=a[l];o===-1?(!(c&n)||c&r)&&(a[l]=Om(c,t)):o<=t&&(e.expiredLanes|=c),i&=~c}}function $i(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Rd(){var e=cr;return cr<<=1,!(cr&4194240)&&(cr=64),e}function Wa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Kn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ut(t),e[t]=n}function Im(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-ut(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function Al(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ut(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var se=0;function Od(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Bd,$l,Id,qd,Ud,Ri=!1,ur=[],Ut=null,zt=null,Vt=null,Ln=new Map,Dn=new Map,Rt=[],qm="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function zo(e,t){switch(e){case"focusin":case"focusout":Ut=null;break;case"dragenter":case"dragleave":zt=null;break;case"mouseover":case"mouseout":Vt=null;break;case"pointerover":case"pointerout":Ln.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dn.delete(t.pointerId)}}function an(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Yn(t),t!==null&&$l(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Um(e,t,n,r,a){switch(t){case"focusin":return Ut=an(Ut,e,t,n,r,a),!0;case"dragenter":return zt=an(zt,e,t,n,r,a),!0;case"mouseover":return Vt=an(Vt,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return Ln.set(i,an(Ln.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,Dn.set(i,an(Dn.get(i)||null,e,t,n,r,a)),!0}return!1}function zd(e){var t=cs(e.target);if(t!==null){var n=js(t);if(n!==null){if(t=n.tag,t===13){if(t=Ld(n),t!==null){e.blockedOn=t,Ud(e.priority,function(){Id(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Di=r,n.target.dispatchEvent(r),Di=null}else return t=Yn(n),t!==null&&$l(t),e.blockedOn=n,!1;t.shift()}return!0}function Vo(e,t,n){Pr(e)&&n.delete(t)}function zm(){Ri=!1,Ut!==null&&Pr(Ut)&&(Ut=null),zt!==null&&Pr(zt)&&(zt=null),Vt!==null&&Pr(Vt)&&(Vt=null),Ln.forEach(Vo),Dn.forEach(Vo)}function ln(e,t){e.blockedOn===t&&(e.blockedOn=null,Ri||(Ri=!0,Ye.unstable_scheduleCallback(Ye.unstable_NormalPriority,zm)))}function Fn(e){function t(a){return ln(a,e)}if(0<ur.length){ln(ur[0],e);for(var n=1;n<ur.length;n++){var r=ur[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ut!==null&&ln(Ut,e),zt!==null&&ln(zt,e),Vt!==null&&ln(Vt,e),Ln.forEach(t),Dn.forEach(t),n=0;n<Rt.length;n++)r=Rt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rt.length&&(n=Rt[0],n.blockedOn===null);)zd(n),n.blockedOn===null&&Rt.shift()}var Bs=Dt.ReactCurrentBatchConfig,Qr=!0;function Vm(e,t,n,r){var a=se,i=Bs.transition;Bs.transition=null;try{se=1,Rl(e,t,n,r)}finally{se=a,Bs.transition=i}}function Hm(e,t,n,r){var a=se,i=Bs.transition;Bs.transition=null;try{se=4,Rl(e,t,n,r)}finally{se=a,Bs.transition=i}}function Rl(e,t,n,r){if(Qr){var a=Oi(e,t,n,r);if(a===null)si(e,t,r,Kr,n),zo(e,r);else if(Um(a,e,t,n,r))r.stopPropagation();else if(zo(e,r),t&4&&-1<qm.indexOf(e)){for(;a!==null;){var i=Yn(a);if(i!==null&&Bd(i),i=Oi(e,t,n,r),i===null&&si(e,t,r,Kr,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else si(e,t,r,null,n)}}var Kr=null;function Oi(e,t,n,r){if(Kr=null,e=Fl(r),e=cs(e),e!==null)if(t=js(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ld(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Kr=e,null}function Vd(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Dm()){case Ml:return 1;case Ad:return 4;case Hr:case Fm:return 16;case $d:return 536870912;default:return 16}default:return 16}}var Bt=null,Ol=null,_r=null;function Hd(){if(_r)return _r;var e,t=Ol,n=t.length,r,a="value"in Bt?Bt.value:Bt.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===a[i-r];r++);return _r=a.slice(e,1<r?1-r:void 0)}function Er(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hr(){return!0}function Ho(){return!1}function Je(e){function t(n,r,a,i,l){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var c in e)e.hasOwnProperty(c)&&(n=e[c],this[c]=n?n(i):i[c]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?hr:Ho,this.isPropagationStopped=Ho,this}return he(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=hr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=hr)},persist:function(){},isPersistent:hr}),t}var Xs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=Je(Xs),Gn=he({},Xs,{view:0,detail:0}),Wm=Je(Gn),Qa,Ka,on,ga=he({},Gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Il,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==on&&(on&&e.type==="mousemove"?(Qa=e.screenX-on.screenX,Ka=e.screenY-on.screenY):Ka=Qa=0,on=e),Qa)},movementY:function(e){return"movementY"in e?e.movementY:Ka}}),Wo=Je(ga),Qm=he({},ga,{dataTransfer:0}),Km=Je(Qm),Gm=he({},Gn,{relatedTarget:0}),Ga=Je(Gm),Ym=he({},Xs,{animationName:0,elapsedTime:0,pseudoElement:0}),Xm=Je(Ym),Jm=he({},Xs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zm=Je(Jm),ep=he({},Xs,{data:0}),Qo=Je(ep),tp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},np={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=np[e])?!!t[e]:!1}function Il(){return rp}var ap=he({},Gn,{key:function(e){if(e.key){var t=tp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Er(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?sp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Il,charCode:function(e){return e.type==="keypress"?Er(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Er(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ip=Je(ap),lp=he({},ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ko=Je(lp),op=he({},Gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Il}),cp=Je(op),dp=he({},Xs,{propertyName:0,elapsedTime:0,pseudoElement:0}),up=Je(dp),hp=he({},ga,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),mp=Je(hp),pp=[9,13,27,32],ql=_t&&"CompositionEvent"in window,jn=null;_t&&"documentMode"in document&&(jn=document.documentMode);var fp=_t&&"TextEvent"in window&&!jn,Wd=_t&&(!ql||jn&&8<jn&&11>=jn),Go=" ",Yo=!1;function Qd(e,t){switch(e){case"keyup":return pp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function xp(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(Yo=!0,Go);case"textInput":return e=t.data,e===Go&&Yo?null:e;default:return null}}function vp(e,t){if(Cs)return e==="compositionend"||!ql&&Qd(e,t)?(e=Hd(),_r=Ol=Bt=null,Cs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wd&&t.locale!=="ko"?null:t.data;default:return null}}var gp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gp[e.type]:t==="textarea"}function Gd(e,t,n,r){Cd(r),t=Gr(t,"onChange"),0<t.length&&(n=new Bl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Nn=null,Mn=null;function yp(e){iu(e,0)}function ya(e){var t=Es(e);if(yd(t))return e}function jp(e,t){if(e==="change")return t}var Yd=!1;if(_t){var Ya;if(_t){var Xa="oninput"in document;if(!Xa){var Jo=document.createElement("div");Jo.setAttribute("oninput","return;"),Xa=typeof Jo.oninput=="function"}Ya=Xa}else Ya=!1;Yd=Ya&&(!document.documentMode||9<document.documentMode)}function Zo(){Nn&&(Nn.detachEvent("onpropertychange",Xd),Mn=Nn=null)}function Xd(e){if(e.propertyName==="value"&&ya(Mn)){var t=[];Gd(t,Mn,e,Fl(e)),Td(yp,t)}}function Np(e,t,n){e==="focusin"?(Zo(),Nn=t,Mn=n,Nn.attachEvent("onpropertychange",Xd)):e==="focusout"&&Zo()}function bp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ya(Mn)}function wp(e,t){if(e==="click")return ya(t)}function kp(e,t){if(e==="input"||e==="change")return ya(t)}function Sp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mt=typeof Object.is=="function"?Object.is:Sp;function An(e,t){if(mt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!ji.call(t,a)||!mt(e[a],t[a]))return!1}return!0}function ec(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tc(e,t){var n=ec(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ec(n)}}function Jd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zd(){for(var e=window,t=Ur();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ur(e.document)}return t}function Ul(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Cp(e){var t=Zd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Jd(n.ownerDocument.documentElement,n)){if(r!==null&&Ul(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=tc(n,i);var l=tc(n,r);a&&l&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Pp=_t&&"documentMode"in document&&11>=document.documentMode,Ps=null,Bi=null,bn=null,Ii=!1;function sc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ii||Ps==null||Ps!==Ur(r)||(r=Ps,"selectionStart"in r&&Ul(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bn&&An(bn,r)||(bn=r,r=Gr(Bi,"onSelect"),0<r.length&&(t=new Bl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ps)))}function mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _s={animationend:mr("Animation","AnimationEnd"),animationiteration:mr("Animation","AnimationIteration"),animationstart:mr("Animation","AnimationStart"),transitionend:mr("Transition","TransitionEnd")},Ja={},eu={};_t&&(eu=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function ja(e){if(Ja[e])return Ja[e];if(!_s[e])return e;var t=_s[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in eu)return Ja[e]=t[n];return e}var tu=ja("animationend"),su=ja("animationiteration"),nu=ja("animationstart"),ru=ja("transitionend"),au=new Map,nc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function es(e,t){au.set(e,t),ys(t,[e])}for(var Za=0;Za<nc.length;Za++){var ei=nc[Za],_p=ei.toLowerCase(),Ep=ei[0].toUpperCase()+ei.slice(1);es(_p,"on"+Ep)}es(tu,"onAnimationEnd");es(su,"onAnimationIteration");es(nu,"onAnimationStart");es("dblclick","onDoubleClick");es("focusin","onFocus");es("focusout","onBlur");es(ru,"onTransitionEnd");Us("onMouseEnter",["mouseout","mouseover"]);Us("onMouseLeave",["mouseout","mouseover"]);Us("onPointerEnter",["pointerout","pointerover"]);Us("onPointerLeave",["pointerout","pointerover"]);ys("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ys("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ys("onBeforeInput",["compositionend","keypress","textInput","paste"]);ys("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ys("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tp=new Set("cancel close invalid load scroll toggle".split(" ").concat(xn));function rc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,_m(r,t,void 0,e),e.currentTarget=null}function iu(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var l=r.length-1;0<=l;l--){var c=r[l],o=c.instance,u=c.currentTarget;if(c=c.listener,o!==i&&a.isPropagationStopped())break e;rc(a,c,u),i=o}else for(l=0;l<r.length;l++){if(c=r[l],o=c.instance,u=c.currentTarget,c=c.listener,o!==i&&a.isPropagationStopped())break e;rc(a,c,u),i=o}}}if(Vr)throw e=Ai,Vr=!1,Ai=null,e}function ie(e,t){var n=t[Hi];n===void 0&&(n=t[Hi]=new Set);var r=e+"__bubble";n.has(r)||(lu(t,e,2,!1),n.add(r))}function ti(e,t,n){var r=0;t&&(r|=4),lu(n,e,r,t)}var pr="_reactListening"+Math.random().toString(36).slice(2);function $n(e){if(!e[pr]){e[pr]=!0,pd.forEach(function(n){n!=="selectionchange"&&(Tp.has(n)||ti(n,!1,e),ti(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pr]||(t[pr]=!0,ti("selectionchange",!1,t))}}function lu(e,t,n,r){switch(Vd(t)){case 1:var a=Vm;break;case 4:a=Hm;break;default:a=Rl}n=a.bind(null,t,n,e),a=void 0,!Mi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function si(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var c=r.stateNode.containerInfo;if(c===a||c.nodeType===8&&c.parentNode===a)break;if(l===4)for(l=r.return;l!==null;){var o=l.tag;if((o===3||o===4)&&(o=l.stateNode.containerInfo,o===a||o.nodeType===8&&o.parentNode===a))return;l=l.return}for(;c!==null;){if(l=cs(c),l===null)return;if(o=l.tag,o===5||o===6){r=i=l;continue e}c=c.parentNode}}r=r.return}Td(function(){var u=i,f=Fl(n),h=[];e:{var p=au.get(e);if(p!==void 0){var v=Bl,N=e;switch(e){case"keypress":if(Er(n)===0)break e;case"keydown":case"keyup":v=ip;break;case"focusin":N="focus",v=Ga;break;case"focusout":N="blur",v=Ga;break;case"beforeblur":case"afterblur":v=Ga;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=Wo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=Km;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=cp;break;case tu:case su:case nu:v=Xm;break;case ru:v=up;break;case"scroll":v=Wm;break;case"wheel":v=mp;break;case"copy":case"cut":case"paste":v=Zm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=Ko}var j=(t&4)!==0,k=!j&&e==="scroll",m=j?p!==null?p+"Capture":null:p;j=[];for(var x=u,g;x!==null;){g=x;var y=g.stateNode;if(g.tag===5&&y!==null&&(g=y,m!==null&&(y=Tn(x,m),y!=null&&j.push(Rn(x,y,g)))),k)break;x=x.return}0<j.length&&(p=new v(p,N,null,n,f),h.push({event:p,listeners:j}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",p&&n!==Di&&(N=n.relatedTarget||n.fromElement)&&(cs(N)||N[Et]))break e;if((v||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,v?(N=n.relatedTarget||n.toElement,v=u,N=N?cs(N):null,N!==null&&(k=js(N),N!==k||N.tag!==5&&N.tag!==6)&&(N=null)):(v=null,N=u),v!==N)){if(j=Wo,y="onMouseLeave",m="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(j=Ko,y="onPointerLeave",m="onPointerEnter",x="pointer"),k=v==null?p:Es(v),g=N==null?p:Es(N),p=new j(y,x+"leave",v,n,f),p.target=k,p.relatedTarget=g,y=null,cs(f)===u&&(j=new j(m,x+"enter",N,n,f),j.target=g,j.relatedTarget=k,y=j),k=y,v&&N)t:{for(j=v,m=N,x=0,g=j;g;g=bs(g))x++;for(g=0,y=m;y;y=bs(y))g++;for(;0<x-g;)j=bs(j),x--;for(;0<g-x;)m=bs(m),g--;for(;x--;){if(j===m||m!==null&&j===m.alternate)break t;j=bs(j),m=bs(m)}j=null}else j=null;v!==null&&ac(h,p,v,j,!1),N!==null&&k!==null&&ac(h,k,N,j,!0)}}e:{if(p=u?Es(u):window,v=p.nodeName&&p.nodeName.toLowerCase(),v==="select"||v==="input"&&p.type==="file")var S=jp;else if(Xo(p))if(Yd)S=kp;else{S=bp;var E=Np}else(v=p.nodeName)&&v.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=wp);if(S&&(S=S(e,u))){Gd(h,S,n,f);break e}E&&E(e,p,u),e==="focusout"&&(E=p._wrapperState)&&E.controlled&&p.type==="number"&&Pi(p,"number",p.value)}switch(E=u?Es(u):window,e){case"focusin":(Xo(E)||E.contentEditable==="true")&&(Ps=E,Bi=u,bn=null);break;case"focusout":bn=Bi=Ps=null;break;case"mousedown":Ii=!0;break;case"contextmenu":case"mouseup":case"dragend":Ii=!1,sc(h,n,f);break;case"selectionchange":if(Pp)break;case"keydown":case"keyup":sc(h,n,f)}var T;if(ql)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Cs?Qd(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Wd&&n.locale!=="ko"&&(Cs||P!=="onCompositionStart"?P==="onCompositionEnd"&&Cs&&(T=Hd()):(Bt=f,Ol="value"in Bt?Bt.value:Bt.textContent,Cs=!0)),E=Gr(u,P),0<E.length&&(P=new Qo(P,e,null,n,f),h.push({event:P,listeners:E}),T?P.data=T:(T=Kd(n),T!==null&&(P.data=T)))),(T=fp?xp(e,n):vp(e,n))&&(u=Gr(u,"onBeforeInput"),0<u.length&&(f=new Qo("onBeforeInput","beforeinput",null,n,f),h.push({event:f,listeners:u}),f.data=T))}iu(h,t)})}function Rn(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gr(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Tn(e,n),i!=null&&r.unshift(Rn(e,i,a)),i=Tn(e,t),i!=null&&r.push(Rn(e,i,a))),e=e.return}return r}function bs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ac(e,t,n,r,a){for(var i=t._reactName,l=[];n!==null&&n!==r;){var c=n,o=c.alternate,u=c.stateNode;if(o!==null&&o===r)break;c.tag===5&&u!==null&&(c=u,a?(o=Tn(n,i),o!=null&&l.unshift(Rn(n,o,c))):a||(o=Tn(n,i),o!=null&&l.push(Rn(n,o,c)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var Lp=/\r\n?/g,Dp=/\u0000|\uFFFD/g;function ic(e){return(typeof e=="string"?e:""+e).replace(Lp,`
+`).replace(Dp,"")}function fr(e,t,n){if(t=ic(t),ic(e)!==t&&n)throw Error(M(425))}function Yr(){}var qi=null,Ui=null;function zi(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vi=typeof setTimeout=="function"?setTimeout:void 0,Fp=typeof clearTimeout=="function"?clearTimeout:void 0,lc=typeof Promise=="function"?Promise:void 0,Mp=typeof queueMicrotask=="function"?queueMicrotask:typeof lc<"u"?function(e){return lc.resolve(null).then(e).catch(Ap)}:Vi;function Ap(e){setTimeout(function(){throw e})}function ni(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Fn(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Fn(t)}function Ht(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function oc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Js=Math.random().toString(36).slice(2),xt="__reactFiber$"+Js,On="__reactProps$"+Js,Et="__reactContainer$"+Js,Hi="__reactEvents$"+Js,$p="__reactListeners$"+Js,Rp="__reactHandles$"+Js;function cs(e){var t=e[xt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=oc(e);e!==null;){if(n=e[xt])return n;e=oc(e)}return t}e=n,n=e.parentNode}return null}function Yn(e){return e=e[xt]||e[Et],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function Na(e){return e[On]||null}var Wi=[],Ts=-1;function ts(e){return{current:e}}function le(e){0>Ts||(e.current=Wi[Ts],Wi[Ts]=null,Ts--)}function ae(e,t){Ts++,Wi[Ts]=e.current,e.current=t}var Zt={},$e=ts(Zt),Ve=ts(!1),ps=Zt;function zs(e,t){var n=e.type.contextTypes;if(!n)return Zt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function He(e){return e=e.childContextTypes,e!=null}function Xr(){le(Ve),le($e)}function cc(e,t,n){if($e.current!==Zt)throw Error(M(168));ae($e,t),ae(Ve,n)}function ou(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(M(108,Nm(e)||"Unknown",a));return he({},n,r)}function Jr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zt,ps=$e.current,ae($e,e),ae(Ve,Ve.current),!0}function dc(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=ou(e,t,ps),r.__reactInternalMemoizedMergedChildContext=e,le(Ve),le($e),ae($e,e)):le(Ve),ae(Ve,n)}var kt=null,ba=!1,ri=!1;function cu(e){kt===null?kt=[e]:kt.push(e)}function Op(e){ba=!0,cu(e)}function ss(){if(!ri&&kt!==null){ri=!0;var e=0,t=se;try{var n=kt;for(se=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}kt=null,ba=!1}catch(a){throw kt!==null&&(kt=kt.slice(e+1)),Md(Ml,ss),a}finally{se=t,ri=!1}}return null}var Ls=[],Ds=0,Zr=null,ea=0,Ze=[],et=0,fs=null,St=1,Ct="";function ls(e,t){Ls[Ds++]=ea,Ls[Ds++]=Zr,Zr=e,ea=t}function du(e,t,n){Ze[et++]=St,Ze[et++]=Ct,Ze[et++]=fs,fs=e;var r=St;e=Ct;var a=32-ut(r)-1;r&=~(1<<a),n+=1;var i=32-ut(t)+a;if(30<i){var l=a-a%5;i=(r&(1<<l)-1).toString(32),r>>=l,a-=l,St=1<<32-ut(t)+a|n<<a|r,Ct=i+e}else St=1<<i|n<<a|r,Ct=e}function zl(e){e.return!==null&&(ls(e,1),du(e,1,0))}function Vl(e){for(;e===Zr;)Zr=Ls[--Ds],Ls[Ds]=null,ea=Ls[--Ds],Ls[Ds]=null;for(;e===fs;)fs=Ze[--et],Ze[et]=null,Ct=Ze[--et],Ze[et]=null,St=Ze[--et],Ze[et]=null}var Ge=null,Ke=null,oe=!1,dt=null;function uu(e,t){var n=st(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ge=e,Ke=Ht(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ge=e,Ke=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=fs!==null?{id:St,overflow:Ct}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=st(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ge=e,Ke=null,!0):!1;default:return!1}}function Qi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ki(e){if(oe){var t=Ke;if(t){var n=t;if(!uc(e,t)){if(Qi(e))throw Error(M(418));t=Ht(n.nextSibling);var r=Ge;t&&uc(e,t)?uu(r,n):(e.flags=e.flags&-4097|2,oe=!1,Ge=e)}}else{if(Qi(e))throw Error(M(418));e.flags=e.flags&-4097|2,oe=!1,Ge=e}}}function hc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ge=e}function xr(e){if(e!==Ge)return!1;if(!oe)return hc(e),oe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!zi(e.type,e.memoizedProps)),t&&(t=Ke)){if(Qi(e))throw hu(),Error(M(418));for(;t;)uu(e,t),t=Ht(t.nextSibling)}if(hc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ke=Ht(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ke=null}}else Ke=Ge?Ht(e.stateNode.nextSibling):null;return!0}function hu(){for(var e=Ke;e;)e=Ht(e.nextSibling)}function Vs(){Ke=Ge=null,oe=!1}function Hl(e){dt===null?dt=[e]:dt.push(e)}var Bp=Dt.ReactCurrentBatchConfig;function cn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(M(309));var r=n.stateNode}if(!r)throw Error(M(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var c=a.refs;l===null?delete c[i]:c[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(M(284));if(!n._owner)throw Error(M(290,e))}return e}function vr(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mc(e){var t=e._init;return t(e._payload)}function mu(e){function t(m,x){if(e){var g=m.deletions;g===null?(m.deletions=[x],m.flags|=16):g.push(x)}}function n(m,x){if(!e)return null;for(;x!==null;)t(m,x),x=x.sibling;return null}function r(m,x){for(m=new Map;x!==null;)x.key!==null?m.set(x.key,x):m.set(x.index,x),x=x.sibling;return m}function a(m,x){return m=Gt(m,x),m.index=0,m.sibling=null,m}function i(m,x,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<x?(m.flags|=2,x):g):(m.flags|=2,x)):(m.flags|=1048576,x)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function c(m,x,g,y){return x===null||x.tag!==6?(x=ui(g,m.mode,y),x.return=m,x):(x=a(x,g),x.return=m,x)}function o(m,x,g,y){var S=g.type;return S===Ss?f(m,x,g.props.children,y,g.key):x!==null&&(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===At&&mc(S)===x.type)?(y=a(x,g.props),y.ref=cn(m,x,g),y.return=m,y):(y=$r(g.type,g.key,g.props,null,m.mode,y),y.ref=cn(m,x,g),y.return=m,y)}function u(m,x,g,y){return x===null||x.tag!==4||x.stateNode.containerInfo!==g.containerInfo||x.stateNode.implementation!==g.implementation?(x=hi(g,m.mode,y),x.return=m,x):(x=a(x,g.children||[]),x.return=m,x)}function f(m,x,g,y,S){return x===null||x.tag!==7?(x=ms(g,m.mode,y,S),x.return=m,x):(x=a(x,g),x.return=m,x)}function h(m,x,g){if(typeof x=="string"&&x!==""||typeof x=="number")return x=ui(""+x,m.mode,g),x.return=m,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ir:return g=$r(x.type,x.key,x.props,null,m.mode,g),g.ref=cn(m,null,x),g.return=m,g;case ks:return x=hi(x,m.mode,g),x.return=m,x;case At:var y=x._init;return h(m,y(x._payload),g)}if(pn(x)||nn(x))return x=ms(x,m.mode,g,null),x.return=m,x;vr(m,x)}return null}function p(m,x,g,y){var S=x!==null?x.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:c(m,x,""+g,y);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ir:return g.key===S?o(m,x,g,y):null;case ks:return g.key===S?u(m,x,g,y):null;case At:return S=g._init,p(m,x,S(g._payload),y)}if(pn(g)||nn(g))return S!==null?null:f(m,x,g,y,null);vr(m,g)}return null}function v(m,x,g,y,S){if(typeof y=="string"&&y!==""||typeof y=="number")return m=m.get(g)||null,c(x,m,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ir:return m=m.get(y.key===null?g:y.key)||null,o(x,m,y,S);case ks:return m=m.get(y.key===null?g:y.key)||null,u(x,m,y,S);case At:var E=y._init;return v(m,x,g,E(y._payload),S)}if(pn(y)||nn(y))return m=m.get(g)||null,f(x,m,y,S,null);vr(x,y)}return null}function N(m,x,g,y){for(var S=null,E=null,T=x,P=x=0,O=null;T!==null&&P<g.length;P++){T.index>P?(O=T,T=null):O=T.sibling;var w=p(m,T,g[P],y);if(w===null){T===null&&(T=O);break}e&&T&&w.alternate===null&&t(m,T),x=i(w,x,P),E===null?S=w:E.sibling=w,E=w,T=O}if(P===g.length)return n(m,T),oe&&ls(m,P),S;if(T===null){for(;P<g.length;P++)T=h(m,g[P],y),T!==null&&(x=i(T,x,P),E===null?S=T:E.sibling=T,E=T);return oe&&ls(m,P),S}for(T=r(m,T);P<g.length;P++)O=v(T,m,P,g[P],y),O!==null&&(e&&O.alternate!==null&&T.delete(O.key===null?P:O.key),x=i(O,x,P),E===null?S=O:E.sibling=O,E=O);return e&&T.forEach(function(L){return t(m,L)}),oe&&ls(m,P),S}function j(m,x,g,y){var S=nn(g);if(typeof S!="function")throw Error(M(150));if(g=S.call(g),g==null)throw Error(M(151));for(var E=S=null,T=x,P=x=0,O=null,w=g.next();T!==null&&!w.done;P++,w=g.next()){T.index>P?(O=T,T=null):O=T.sibling;var L=p(m,T,w.value,y);if(L===null){T===null&&(T=O);break}e&&T&&L.alternate===null&&t(m,T),x=i(L,x,P),E===null?S=L:E.sibling=L,E=L,T=O}if(w.done)return n(m,T),oe&&ls(m,P),S;if(T===null){for(;!w.done;P++,w=g.next())w=h(m,w.value,y),w!==null&&(x=i(w,x,P),E===null?S=w:E.sibling=w,E=w);return oe&&ls(m,P),S}for(T=r(m,T);!w.done;P++,w=g.next())w=v(T,m,P,w.value,y),w!==null&&(e&&w.alternate!==null&&T.delete(w.key===null?P:w.key),x=i(w,x,P),E===null?S=w:E.sibling=w,E=w);return e&&T.forEach(function(U){return t(m,U)}),oe&&ls(m,P),S}function k(m,x,g,y){if(typeof g=="object"&&g!==null&&g.type===Ss&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ir:e:{for(var S=g.key,E=x;E!==null;){if(E.key===S){if(S=g.type,S===Ss){if(E.tag===7){n(m,E.sibling),x=a(E,g.props.children),x.return=m,m=x;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===At&&mc(S)===E.type){n(m,E.sibling),x=a(E,g.props),x.ref=cn(m,E,g),x.return=m,m=x;break e}n(m,E);break}else t(m,E);E=E.sibling}g.type===Ss?(x=ms(g.props.children,m.mode,y,g.key),x.return=m,m=x):(y=$r(g.type,g.key,g.props,null,m.mode,y),y.ref=cn(m,x,g),y.return=m,m=y)}return l(m);case ks:e:{for(E=g.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===g.containerInfo&&x.stateNode.implementation===g.implementation){n(m,x.sibling),x=a(x,g.children||[]),x.return=m,m=x;break e}else{n(m,x);break}else t(m,x);x=x.sibling}x=hi(g,m.mode,y),x.return=m,m=x}return l(m);case At:return E=g._init,k(m,x,E(g._payload),y)}if(pn(g))return N(m,x,g,y);if(nn(g))return j(m,x,g,y);vr(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,x!==null&&x.tag===6?(n(m,x.sibling),x=a(x,g),x.return=m,m=x):(n(m,x),x=ui(g,m.mode,y),x.return=m,m=x),l(m)):n(m,x)}return k}var Hs=mu(!0),pu=mu(!1),ta=ts(null),sa=null,Fs=null,Wl=null;function Ql(){Wl=Fs=sa=null}function Kl(e){var t=ta.current;le(ta),e._currentValue=t}function Gi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Is(e,t){sa=e,Wl=Fs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ze=!0),e.firstContext=null)}function rt(e){var t=e._currentValue;if(Wl!==e)if(e={context:e,memoizedValue:t,next:null},Fs===null){if(sa===null)throw Error(M(308));Fs=e,sa.dependencies={lanes:0,firstContext:e}}else Fs=Fs.next=e;return t}var ds=null;function Gl(e){ds===null?ds=[e]:ds.push(e)}function fu(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Gl(t)):(n.next=a.next,a.next=n),t.interleaved=n,Tt(e,r)}function Tt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var $t=!1;function Yl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Pt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,te&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Tt(e,n)}return a=r.interleaved,a===null?(t.next=t,Gl(r)):(t.next=a.next,a.next=t),r.interleaved=t,Tt(e,n)}function Tr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Al(e,n)}}function pc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function na(e,t,n,r){var a=e.updateQueue;$t=!1;var i=a.firstBaseUpdate,l=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var o=c,u=o.next;o.next=null,l===null?i=u:l.next=u,l=o;var f=e.alternate;f!==null&&(f=f.updateQueue,c=f.lastBaseUpdate,c!==l&&(c===null?f.firstBaseUpdate=u:c.next=u,f.lastBaseUpdate=o))}if(i!==null){var h=a.baseState;l=0,f=u=o=null,c=i;do{var p=c.lane,v=c.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:v,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var N=e,j=c;switch(p=t,v=n,j.tag){case 1:if(N=j.payload,typeof N=="function"){h=N.call(v,h,p);break e}h=N;break e;case 3:N.flags=N.flags&-65537|128;case 0:if(N=j.payload,p=typeof N=="function"?N.call(v,h,p):N,p==null)break e;h=he({},h,p);break e;case 2:$t=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[c]:p.push(c))}else v={eventTime:v,lane:p,tag:c.tag,payload:c.payload,callback:c.callback,next:null},f===null?(u=f=v,o=h):f=f.next=v,l|=p;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;p=c,c=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(f===null&&(o=h),a.baseState=o,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do l|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);vs|=l,e.lanes=l,e.memoizedState=h}}function fc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(M(191,a));a.call(r)}}}var Xn={},gt=ts(Xn),Bn=ts(Xn),In=ts(Xn);function us(e){if(e===Xn)throw Error(M(174));return e}function Xl(e,t){switch(ae(In,t),ae(Bn,e),ae(gt,Xn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ei(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ei(t,e)}le(gt),ae(gt,t)}function Ws(){le(gt),le(Bn),le(In)}function vu(e){us(In.current);var t=us(gt.current),n=Ei(t,e.type);t!==n&&(ae(Bn,e),ae(gt,n))}function Jl(e){Bn.current===e&&(le(gt),le(Bn))}var ce=ts(0);function ra(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ai=[];function Zl(){for(var e=0;e<ai.length;e++)ai[e]._workInProgressVersionPrimary=null;ai.length=0}var Lr=Dt.ReactCurrentDispatcher,ii=Dt.ReactCurrentBatchConfig,xs=0,de=null,we=null,Pe=null,aa=!1,wn=!1,qn=0,Ip=0;function Fe(){throw Error(M(321))}function eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mt(e[n],t[n]))return!1;return!0}function to(e,t,n,r,a,i){if(xs=i,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Lr.current=e===null||e.memoizedState===null?Vp:Hp,e=n(r,a),wn){i=0;do{if(wn=!1,qn=0,25<=i)throw Error(M(301));i+=1,Pe=we=null,t.updateQueue=null,Lr.current=Wp,e=n(r,a)}while(wn)}if(Lr.current=ia,t=we!==null&&we.next!==null,xs=0,Pe=we=de=null,aa=!1,t)throw Error(M(300));return e}function so(){var e=qn!==0;return qn=0,e}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?de.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function at(){if(we===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Pe===null?de.memoizedState:Pe.next;if(t!==null)Pe=t,we=e;else{if(e===null)throw Error(M(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Pe===null?de.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function Un(e,t){return typeof t=="function"?t(e):t}function li(e){var t=at(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=we,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var l=a.next;a.next=i.next,i.next=l}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var c=l=null,o=null,u=i;do{var f=u.lane;if((xs&f)===f)o!==null&&(o=o.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};o===null?(c=o=h,l=r):o=o.next=h,de.lanes|=f,vs|=f}u=u.next}while(u!==null&&u!==i);o===null?l=r:o.next=c,mt(r,t.memoizedState)||(ze=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=o,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,de.lanes|=i,vs|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function oi(e){var t=at(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var l=a=a.next;do i=e(i,l.action),l=l.next;while(l!==a);mt(i,t.memoizedState)||(ze=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function gu(){}function yu(e,t){var n=de,r=at(),a=t(),i=!mt(r.memoizedState,a);if(i&&(r.memoizedState=a,ze=!0),r=r.queue,no(bu.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Pe!==null&&Pe.memoizedState.tag&1){if(n.flags|=2048,zn(9,Nu.bind(null,n,r,a,t),void 0,null),_e===null)throw Error(M(349));xs&30||ju(n,t,a)}return a}function ju(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=de.updateQueue,t===null?(t={lastEffect:null,stores:null},de.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nu(e,t,n,r){t.value=n,t.getSnapshot=r,wu(t)&&ku(e)}function bu(e,t,n){return n(function(){wu(t)&&ku(e)})}function wu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mt(e,n)}catch{return!0}}function ku(e){var t=Tt(e,1);t!==null&&ht(t,e,1,-1)}function xc(e){var t=ft();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:e},t.queue=e,e=e.dispatch=zp.bind(null,de,e),[t.memoizedState,e]}function zn(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=de.updateQueue,t===null?(t={lastEffect:null,stores:null},de.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Su(){return at().memoizedState}function Dr(e,t,n,r){var a=ft();de.flags|=e,a.memoizedState=zn(1|t,n,void 0,r===void 0?null:r)}function wa(e,t,n,r){var a=at();r=r===void 0?null:r;var i=void 0;if(we!==null){var l=we.memoizedState;if(i=l.destroy,r!==null&&eo(r,l.deps)){a.memoizedState=zn(t,n,i,r);return}}de.flags|=e,a.memoizedState=zn(1|t,n,i,r)}function vc(e,t){return Dr(8390656,8,e,t)}function no(e,t){return wa(2048,8,e,t)}function Cu(e,t){return wa(4,2,e,t)}function Pu(e,t){return wa(4,4,e,t)}function _u(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Eu(e,t,n){return n=n!=null?n.concat([e]):null,wa(4,4,_u.bind(null,t,e),n)}function ro(){}function Tu(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Lu(e,t){var n=at();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&eo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Du(e,t,n){return xs&21?(mt(n,t)||(n=Rd(),de.lanes|=n,vs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ze=!0),e.memoizedState=n)}function qp(e,t){var n=se;se=n!==0&&4>n?n:4,e(!0);var r=ii.transition;ii.transition={};try{e(!1),t()}finally{se=n,ii.transition=r}}function Fu(){return at().memoizedState}function Up(e,t,n){var r=Kt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Mu(e))Au(t,n);else if(n=fu(e,t,n,r),n!==null){var a=Oe();ht(n,e,r,a),$u(n,t,r)}}function zp(e,t,n){var r=Kt(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Mu(e))Au(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,c=i(l,n);if(a.hasEagerState=!0,a.eagerState=c,mt(c,l)){var o=t.interleaved;o===null?(a.next=a,Gl(t)):(a.next=o.next,o.next=a),t.interleaved=a;return}}catch{}finally{}n=fu(e,t,a,r),n!==null&&(a=Oe(),ht(n,e,r,a),$u(n,t,r))}}function Mu(e){var t=e.alternate;return e===de||t!==null&&t===de}function Au(e,t){wn=aa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $u(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Al(e,n)}}var ia={readContext:rt,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},Vp={readContext:rt,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:vc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dr(4194308,4,_u.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dr(4,2,e,t)},useMemo:function(e,t){var n=ft();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ft();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Up.bind(null,de,e),[r.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:xc,useDebugValue:ro,useDeferredValue:function(e){return ft().memoizedState=e},useTransition:function(){var e=xc(!1),t=e[0];return e=qp.bind(null,e[1]),ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=de,a=ft();if(oe){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),_e===null)throw Error(M(349));xs&30||ju(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,vc(bu.bind(null,r,i,e),[e]),r.flags|=2048,zn(9,Nu.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ft(),t=_e.identifierPrefix;if(oe){var n=Ct,r=St;n=(r&~(1<<32-ut(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qn++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Ip++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Hp={readContext:rt,useCallback:Tu,useContext:rt,useEffect:no,useImperativeHandle:Eu,useInsertionEffect:Cu,useLayoutEffect:Pu,useMemo:Lu,useReducer:li,useRef:Su,useState:function(){return li(Un)},useDebugValue:ro,useDeferredValue:function(e){var t=at();return Du(t,we.memoizedState,e)},useTransition:function(){var e=li(Un)[0],t=at().memoizedState;return[e,t]},useMutableSource:gu,useSyncExternalStore:yu,useId:Fu,unstable_isNewReconciler:!1},Wp={readContext:rt,useCallback:Tu,useContext:rt,useEffect:no,useImperativeHandle:Eu,useInsertionEffect:Cu,useLayoutEffect:Pu,useMemo:Lu,useReducer:oi,useRef:Su,useState:function(){return oi(Un)},useDebugValue:ro,useDeferredValue:function(e){var t=at();return we===null?t.memoizedState=e:Du(t,we.memoizedState,e)},useTransition:function(){var e=oi(Un)[0],t=at().memoizedState;return[e,t]},useMutableSource:gu,useSyncExternalStore:yu,useId:Fu,unstable_isNewReconciler:!1};function lt(e,t){if(e&&e.defaultProps){t=he({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Yi(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:he({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ka={isMounted:function(e){return(e=e._reactInternals)?js(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Oe(),a=Kt(e),i=Pt(r,a);i.payload=t,n!=null&&(i.callback=n),t=Wt(e,i,a),t!==null&&(ht(t,e,a,r),Tr(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Oe(),a=Kt(e),i=Pt(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wt(e,i,a),t!==null&&(ht(t,e,a,r),Tr(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Oe(),r=Kt(e),a=Pt(n,r);a.tag=2,t!=null&&(a.callback=t),t=Wt(e,a,r),t!==null&&(ht(t,e,r,n),Tr(t,e,r))}};function gc(e,t,n,r,a,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,l):t.prototype&&t.prototype.isPureReactComponent?!An(n,r)||!An(a,i):!0}function Ru(e,t,n){var r=!1,a=Zt,i=t.contextType;return typeof i=="object"&&i!==null?i=rt(i):(a=He(t)?ps:$e.current,r=t.contextTypes,i=(r=r!=null)?zs(e,a):Zt),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ka,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ka.enqueueReplaceState(t,t.state,null)}function Xi(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Yl(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=rt(i):(i=He(t)?ps:$e.current,a.context=zs(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Yi(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&ka.enqueueReplaceState(a,a.state,null),na(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Qs(e,t){try{var n="",r=t;do n+=jm(r),r=r.return;while(r);var a=n}catch(i){a=`
+Error generating stack: `+i.message+`
+`+i.stack}return{value:e,source:t,stack:a,digest:null}}function ci(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ji(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Qp=typeof WeakMap=="function"?WeakMap:Map;function Ou(e,t,n){n=Pt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){oa||(oa=!0,ol=r),Ji(e,t)},n}function Bu(e,t,n){n=Pt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Ji(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ji(e,t),typeof r!="function"&&(Qt===null?Qt=new Set([this]):Qt.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function jc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qp;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=of.bind(null,e,t,n),t.then(e,e))}function Nc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function bc(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Pt(-1,1),t.tag=2,Wt(n,t,1))),n.lanes|=1),e)}var Kp=Dt.ReactCurrentOwner,ze=!1;function Re(e,t,n,r){t.child=e===null?pu(t,null,n,r):Hs(t,e.child,n,r)}function wc(e,t,n,r,a){n=n.render;var i=t.ref;return Is(t,a),r=to(e,t,n,r,i,a),n=so(),e!==null&&!ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Lt(e,t,a)):(oe&&n&&zl(t),t.flags|=1,Re(e,t,r,a),t.child)}function kc(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!mo(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Iu(e,t,i,r,a)):(e=$r(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:An,n(l,r)&&e.ref===t.ref)return Lt(e,t,a)}return t.flags|=1,e=Gt(i,r),e.ref=t.ref,e.return=t,t.child=e}function Iu(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(An(i,r)&&e.ref===t.ref)if(ze=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(ze=!0);else return t.lanes=e.lanes,Lt(e,t,a)}return Zi(e,t,n,r,a)}function qu(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ae(As,Qe),Qe|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ae(As,Qe),Qe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ae(As,Qe),Qe|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ae(As,Qe),Qe|=r;return Re(e,t,a,n),t.child}function Uu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Zi(e,t,n,r,a){var i=He(n)?ps:$e.current;return i=zs(t,i),Is(t,a),n=to(e,t,n,r,i,a),r=so(),e!==null&&!ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Lt(e,t,a)):(oe&&r&&zl(t),t.flags|=1,Re(e,t,n,a),t.child)}function Sc(e,t,n,r,a){if(He(n)){var i=!0;Jr(t)}else i=!1;if(Is(t,a),t.stateNode===null)Fr(e,t),Ru(t,n,r),Xi(t,n,r,a),r=!0;else if(e===null){var l=t.stateNode,c=t.memoizedProps;l.props=c;var o=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=rt(u):(u=He(n)?ps:$e.current,u=zs(t,u));var f=n.getDerivedStateFromProps,h=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function";h||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==r||o!==u)&&yc(t,l,r,u),$t=!1;var p=t.memoizedState;l.state=p,na(t,r,l,a),o=t.memoizedState,c!==r||p!==o||Ve.current||$t?(typeof f=="function"&&(Yi(t,n,f,r),o=t.memoizedState),(c=$t||gc(t,n,c,r,p,o,u))?(h||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=o),l.props=r,l.state=o,l.context=u,r=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,xu(e,t),c=t.memoizedProps,u=t.type===t.elementType?c:lt(t.type,c),l.props=u,h=t.pendingProps,p=l.context,o=n.contextType,typeof o=="object"&&o!==null?o=rt(o):(o=He(n)?ps:$e.current,o=zs(t,o));var v=n.getDerivedStateFromProps;(f=typeof v=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==h||p!==o)&&yc(t,l,r,o),$t=!1,p=t.memoizedState,l.state=p,na(t,r,l,a);var N=t.memoizedState;c!==h||p!==N||Ve.current||$t?(typeof v=="function"&&(Yi(t,n,v,r),N=t.memoizedState),(u=$t||gc(t,n,u,r,p,N,o)||!1)?(f||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,N,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,N,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=N),l.props=r,l.state=N,l.context=o,r=u):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return el(e,t,n,r,i,a)}function el(e,t,n,r,a,i){Uu(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return a&&dc(t,n,!1),Lt(e,t,i);r=t.stateNode,Kp.current=t;var c=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Hs(t,e.child,null,i),t.child=Hs(t,null,c,i)):Re(e,t,c,i),t.memoizedState=r.state,a&&dc(t,n,!0),t.child}function zu(e){var t=e.stateNode;t.pendingContext?cc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cc(e,t.context,!1),Xl(e,t.containerInfo)}function Cc(e,t,n,r,a){return Vs(),Hl(a),t.flags|=256,Re(e,t,n,r),t.child}var tl={dehydrated:null,treeContext:null,retryLane:0};function sl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vu(e,t,n){var r=t.pendingProps,a=ce.current,i=!1,l=(t.flags&128)!==0,c;if((c=l)||(c=e!==null&&e.memoizedState===null?!1:(a&2)!==0),c?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ae(ce,a&1),e===null)return Ki(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,i?(r=t.mode,i=t.child,l={mode:"hidden",children:l},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=Pa(l,r,0,null),e=ms(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=sl(n),t.memoizedState=tl,e):ao(t,l));if(a=e.memoizedState,a!==null&&(c=a.dehydrated,c!==null))return Gp(e,t,l,r,c,a,n);if(i){i=r.fallback,l=t.mode,a=e.child,c=a.sibling;var o={mode:"hidden",children:r.children};return!(l&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=o,t.deletions=null):(r=Gt(a,o),r.subtreeFlags=a.subtreeFlags&14680064),c!==null?i=Gt(c,i):(i=ms(i,l,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,l=e.child.memoizedState,l=l===null?sl(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=tl,r}return i=e.child,e=i.sibling,r=Gt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ao(e,t){return t=Pa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function gr(e,t,n,r){return r!==null&&Hl(r),Hs(t,e.child,null,n),e=ao(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gp(e,t,n,r,a,i,l){if(n)return t.flags&256?(t.flags&=-257,r=ci(Error(M(422))),gr(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=Pa({mode:"visible",children:r.children},a,0,null),i=ms(i,a,l,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Hs(t,e.child,null,l),t.child.memoizedState=sl(l),t.memoizedState=tl,i);if(!(t.mode&1))return gr(e,t,l,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var c=r.dgst;return r=c,i=Error(M(419)),r=ci(i,r,void 0),gr(e,t,l,r)}if(c=(l&e.childLanes)!==0,ze||c){if(r=_e,r!==null){switch(l&-l){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|l)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Tt(e,a),ht(r,e,a,-1))}return ho(),r=ci(Error(M(421))),gr(e,t,l,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=cf.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Ke=Ht(a.nextSibling),Ge=t,oe=!0,dt=null,e!==null&&(Ze[et++]=St,Ze[et++]=Ct,Ze[et++]=fs,St=e.id,Ct=e.overflow,fs=t),t=ao(t,r.children),t.flags|=4096,t)}function Pc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function di(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function Hu(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(Re(e,t,r.children,n),r=ce.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pc(e,n,t);else if(e.tag===19)Pc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ae(ce,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&ra(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),di(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ra(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}di(t,!0,n,null,i);break;case"together":di(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fr(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Lt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,n=Gt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yp(e,t,n){switch(t.tag){case 3:zu(t),Vs();break;case 5:vu(t);break;case 1:He(t.type)&&Jr(t);break;case 4:Xl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;ae(ta,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ae(ce,ce.current&1),t.flags|=128,null):n&t.child.childLanes?Vu(e,t,n):(ae(ce,ce.current&1),e=Lt(e,t,n),e!==null?e.sibling:null);ae(ce,ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Hu(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ae(ce,ce.current),r)break;return null;case 22:case 23:return t.lanes=0,qu(e,t,n)}return Lt(e,t,n)}var Wu,nl,Qu,Ku;Wu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};nl=function(){};Qu=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,us(gt.current);var i=null;switch(n){case"input":a=Si(e,a),r=Si(e,r),i=[];break;case"select":a=he({},a,{value:void 0}),r=he({},r,{value:void 0}),i=[];break;case"textarea":a=_i(e,a),r=_i(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Yr)}Ti(n,r);var l;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var c=a[u];for(l in c)c.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(_n.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var o=r[u];if(c=a!=null?a[u]:void 0,r.hasOwnProperty(u)&&o!==c&&(o!=null||c!=null))if(u==="style")if(c){for(l in c)!c.hasOwnProperty(l)||o&&o.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in o)o.hasOwnProperty(l)&&c[l]!==o[l]&&(n||(n={}),n[l]=o[l])}else n||(i||(i=[]),i.push(u,n)),n=o;else u==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,c=c?c.__html:void 0,o!=null&&c!==o&&(i=i||[]).push(u,o)):u==="children"?typeof o!="string"&&typeof o!="number"||(i=i||[]).push(u,""+o):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(_n.hasOwnProperty(u)?(o!=null&&u==="onScroll"&&ie("scroll",e),i||c===o||(i=[])):(i=i||[]).push(u,o))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Ku=function(e,t,n,r){n!==r&&(t.flags|=4)};function dn(e,t){if(!oe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Xp(e,t,n){var r=t.pendingProps;switch(Vl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return He(t.type)&&Xr(),Me(t),null;case 3:return r=t.stateNode,Ws(),le(Ve),le($e),Zl(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,dt!==null&&(ul(dt),dt=null))),nl(e,t),Me(t),null;case 5:Jl(t);var a=us(In.current);if(n=t.type,e!==null&&t.stateNode!=null)Qu(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return Me(t),null}if(e=us(gt.current),xr(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[xt]=t,r[On]=i,e=(t.mode&1)!==0,n){case"dialog":ie("cancel",r),ie("close",r);break;case"iframe":case"object":case"embed":ie("load",r);break;case"video":case"audio":for(a=0;a<xn.length;a++)ie(xn[a],r);break;case"source":ie("error",r);break;case"img":case"image":case"link":ie("error",r),ie("load",r);break;case"details":ie("toggle",r);break;case"input":$o(r,i),ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ie("invalid",r);break;case"textarea":Oo(r,i),ie("invalid",r)}Ti(n,i),a=null;for(var l in i)if(i.hasOwnProperty(l)){var c=i[l];l==="children"?typeof c=="string"?r.textContent!==c&&(i.suppressHydrationWarning!==!0&&fr(r.textContent,c,e),a=["children",c]):typeof c=="number"&&r.textContent!==""+c&&(i.suppressHydrationWarning!==!0&&fr(r.textContent,c,e),a=["children",""+c]):_n.hasOwnProperty(l)&&c!=null&&l==="onScroll"&&ie("scroll",r)}switch(n){case"input":lr(r),Ro(r,i,!0);break;case"textarea":lr(r),Bo(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Yr)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=bd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[xt]=t,e[On]=r,Wu(e,t,!1,!1),t.stateNode=e;e:{switch(l=Li(n,r),n){case"dialog":ie("cancel",e),ie("close",e),a=r;break;case"iframe":case"object":case"embed":ie("load",e),a=r;break;case"video":case"audio":for(a=0;a<xn.length;a++)ie(xn[a],e);a=r;break;case"source":ie("error",e),a=r;break;case"img":case"image":case"link":ie("error",e),ie("load",e),a=r;break;case"details":ie("toggle",e),a=r;break;case"input":$o(e,r),a=Si(e,r),ie("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=he({},r,{value:void 0}),ie("invalid",e);break;case"textarea":Oo(e,r),a=_i(e,r),ie("invalid",e);break;default:a=r}Ti(n,a),c=a;for(i in c)if(c.hasOwnProperty(i)){var o=c[i];i==="style"?Sd(e,o):i==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&wd(e,o)):i==="children"?typeof o=="string"?(n!=="textarea"||o!=="")&&En(e,o):typeof o=="number"&&En(e,""+o):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(_n.hasOwnProperty(i)?o!=null&&i==="onScroll"&&ie("scroll",e):o!=null&&El(e,i,o,l))}switch(n){case"input":lr(e),Ro(e,r,!1);break;case"textarea":lr(e),Bo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Jt(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?$s(e,!!r.multiple,i,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Yr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Me(t),null;case 6:if(e&&t.stateNode!=null)Ku(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(n=us(In.current),us(gt.current),xr(t)){if(r=t.stateNode,n=t.memoizedProps,r[xt]=t,(i=r.nodeValue!==n)&&(e=Ge,e!==null))switch(e.tag){case 3:fr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fr(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xt]=t,t.stateNode=r}return Me(t),null;case 13:if(le(ce),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(oe&&Ke!==null&&t.mode&1&&!(t.flags&128))hu(),Vs(),t.flags|=98560,i=!1;else if(i=xr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(M(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(M(317));i[xt]=t}else Vs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Me(t),i=!1}else dt!==null&&(ul(dt),dt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ce.current&1?ke===0&&(ke=3):ho())),t.updateQueue!==null&&(t.flags|=4),Me(t),null);case 4:return Ws(),nl(e,t),e===null&&$n(t.stateNode.containerInfo),Me(t),null;case 10:return Kl(t.type._context),Me(t),null;case 17:return He(t.type)&&Xr(),Me(t),null;case 19:if(le(ce),i=t.memoizedState,i===null)return Me(t),null;if(r=(t.flags&128)!==0,l=i.rendering,l===null)if(r)dn(i,!1);else{if(ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=ra(e),l!==null){for(t.flags|=128,dn(i,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ae(ce,ce.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>Ks&&(t.flags|=128,r=!0,dn(i,!1),t.lanes=4194304)}else{if(!r)if(e=ra(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!oe)return Me(t),null}else 2*xe()-i.renderingStartTime>Ks&&n!==1073741824&&(t.flags|=128,r=!0,dn(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=xe(),t.sibling=null,n=ce.current,ae(ce,r?n&1|2:n&1),t):(Me(t),null);case 22:case 23:return uo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qe&1073741824&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function Jp(e,t){switch(Vl(t),t.tag){case 1:return He(t.type)&&Xr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ws(),le(Ve),le($e),Zl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jl(t),null;case 13:if(le(ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Vs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ce),null;case 4:return Ws(),null;case 10:return Kl(t.type._context),null;case 22:case 23:return uo(),null;case 24:return null;default:return null}}var yr=!1,Ae=!1,Zp=typeof WeakSet=="function"?WeakSet:Set,q=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){pe(e,t,r)}else n.current=null}function rl(e,t,n){try{n()}catch(r){pe(e,t,r)}}var _c=!1;function ef(e,t){if(qi=Qr,e=Zd(),Ul(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,c=-1,o=-1,u=0,f=0,h=e,p=null;t:for(;;){for(var v;h!==n||a!==0&&h.nodeType!==3||(c=l+a),h!==i||r!==0&&h.nodeType!==3||(o=l+r),h.nodeType===3&&(l+=h.nodeValue.length),(v=h.firstChild)!==null;)p=h,h=v;for(;;){if(h===e)break t;if(p===n&&++u===a&&(c=l),p===i&&++f===r&&(o=l),(v=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=v}n=c===-1||o===-1?null:{start:c,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ui={focusedElem:e,selectionRange:n},Qr=!1,q=t;q!==null;)if(t=q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var N=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(N!==null){var j=N.memoizedProps,k=N.memoizedState,m=t.stateNode,x=m.getSnapshotBeforeUpdate(t.elementType===t.type?j:lt(t.type,j),k);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(y){pe(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return N=_c,_c=!1,N}function kn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&rl(t,n,i)}a=a.next}while(a!==r)}}function Sa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function al(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Gu(e){var t=e.alternate;t!==null&&(e.alternate=null,Gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xt],delete t[On],delete t[Hi],delete t[$p],delete t[Rp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Yu(e){return e.tag===5||e.tag===3||e.tag===4}function Ec(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yr));else if(r!==4&&(e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function ll(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ll(e,t,n),e=e.sibling;e!==null;)ll(e,t,n),e=e.sibling}var Ee=null,ot=!1;function Mt(e,t,n){for(n=n.child;n!==null;)Xu(e,t,n),n=n.sibling}function Xu(e,t,n){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(va,n)}catch{}switch(n.tag){case 5:Ae||Ms(n,t);case 6:var r=Ee,a=ot;Ee=null,Mt(e,t,n),Ee=r,ot=a,Ee!==null&&(ot?(e=Ee,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ee.removeChild(n.stateNode));break;case 18:Ee!==null&&(ot?(e=Ee,n=n.stateNode,e.nodeType===8?ni(e.parentNode,n):e.nodeType===1&&ni(e,n),Fn(e)):ni(Ee,n.stateNode));break;case 4:r=Ee,a=ot,Ee=n.stateNode.containerInfo,ot=!0,Mt(e,t,n),Ee=r,ot=a;break;case 0:case 11:case 14:case 15:if(!Ae&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&rl(n,t,l),a=a.next}while(a!==r)}Mt(e,t,n);break;case 1:if(!Ae&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){pe(n,t,c)}Mt(e,t,n);break;case 21:Mt(e,t,n);break;case 22:n.mode&1?(Ae=(r=Ae)||n.memoizedState!==null,Mt(e,t,n),Ae=r):Mt(e,t,n);break;default:Mt(e,t,n)}}function Tc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Zp),t.forEach(function(r){var a=df.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,l=t,c=l;e:for(;c!==null;){switch(c.tag){case 5:Ee=c.stateNode,ot=!1;break e;case 3:Ee=c.stateNode.containerInfo,ot=!0;break e;case 4:Ee=c.stateNode.containerInfo,ot=!0;break e}c=c.return}if(Ee===null)throw Error(M(160));Xu(i,l,a),Ee=null,ot=!1;var o=a.alternate;o!==null&&(o.return=null),a.return=null}catch(u){pe(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ju(t,e),t=t.sibling}function Ju(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(it(t,e),pt(e),r&4){try{kn(3,e,e.return),Sa(3,e)}catch(j){pe(e,e.return,j)}try{kn(5,e,e.return)}catch(j){pe(e,e.return,j)}}break;case 1:it(t,e),pt(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(it(t,e),pt(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var a=e.stateNode;try{En(a,"")}catch(j){pe(e,e.return,j)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,l=n!==null?n.memoizedProps:i,c=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{c==="input"&&i.type==="radio"&&i.name!=null&&jd(a,i),Li(c,l);var u=Li(c,i);for(l=0;l<o.length;l+=2){var f=o[l],h=o[l+1];f==="style"?Sd(a,h):f==="dangerouslySetInnerHTML"?wd(a,h):f==="children"?En(a,h):El(a,f,h,u)}switch(c){case"input":Ci(a,i);break;case"textarea":Nd(a,i);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?$s(a,!!i.multiple,v,!1):p!==!!i.multiple&&(i.defaultValue!=null?$s(a,!!i.multiple,i.defaultValue,!0):$s(a,!!i.multiple,i.multiple?[]:"",!1))}a[On]=i}catch(j){pe(e,e.return,j)}}break;case 6:if(it(t,e),pt(e),r&4){if(e.stateNode===null)throw Error(M(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(j){pe(e,e.return,j)}}break;case 3:if(it(t,e),pt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fn(t.containerInfo)}catch(j){pe(e,e.return,j)}break;case 4:it(t,e),pt(e);break;case 13:it(t,e),pt(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(oo=xe())),r&4&&Tc(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Ae=(u=Ae)||f,it(t,e),Ae=u):it(t,e),pt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(q=e,f=e.child;f!==null;){for(h=q=f;q!==null;){switch(p=q,v=p.child,p.tag){case 0:case 11:case 14:case 15:kn(4,p,p.return);break;case 1:Ms(p,p.return);var N=p.stateNode;if(typeof N.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,N.props=t.memoizedProps,N.state=t.memoizedState,N.componentWillUnmount()}catch(j){pe(r,n,j)}}break;case 5:Ms(p,p.return);break;case 22:if(p.memoizedState!==null){Dc(h);continue}}v!==null?(v.return=p,q=v):Dc(h)}f=f.sibling}e:for(f=null,h=e;;){if(h.tag===5){if(f===null){f=h;try{a=h.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(c=h.stateNode,o=h.memoizedProps.style,l=o!=null&&o.hasOwnProperty("display")?o.display:null,c.style.display=kd("display",l))}catch(j){pe(e,e.return,j)}}}else if(h.tag===6){if(f===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(j){pe(e,e.return,j)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:it(t,e),pt(e),r&4&&Tc(e);break;case 21:break;default:it(t,e),pt(e)}}function pt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Yu(n)){var r=n;break e}n=n.return}throw Error(M(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(En(a,""),r.flags&=-33);var i=Ec(e);ll(e,i,a);break;case 3:case 4:var l=r.stateNode.containerInfo,c=Ec(e);il(e,c,l);break;default:throw Error(M(161))}}catch(o){pe(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tf(e,t,n){q=e,Zu(e)}function Zu(e,t,n){for(var r=(e.mode&1)!==0;q!==null;){var a=q,i=a.child;if(a.tag===22&&r){var l=a.memoizedState!==null||yr;if(!l){var c=a.alternate,o=c!==null&&c.memoizedState!==null||Ae;c=yr;var u=Ae;if(yr=l,(Ae=o)&&!u)for(q=a;q!==null;)l=q,o=l.child,l.tag===22&&l.memoizedState!==null?Fc(a):o!==null?(o.return=l,q=o):Fc(a);for(;i!==null;)q=i,Zu(i),i=i.sibling;q=a,yr=c,Ae=u}Lc(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,q=i):Lc(e)}}function Lc(e){for(;q!==null;){var t=q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ae||Sa(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ae)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:lt(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&fc(t,i,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}fc(t,l,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&n.focus();break;case"img":o.src&&(n.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var h=f.dehydrated;h!==null&&Fn(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}Ae||t.flags&512&&al(t)}catch(p){pe(t,t.return,p)}}if(t===e){q=null;break}if(n=t.sibling,n!==null){n.return=t.return,q=n;break}q=t.return}}function Dc(e){for(;q!==null;){var t=q;if(t===e){q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,q=n;break}q=t.return}}function Fc(e){for(;q!==null;){var t=q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Sa(4,t)}catch(o){pe(t,n,o)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(o){pe(t,a,o)}}var i=t.return;try{al(t)}catch(o){pe(t,i,o)}break;case 5:var l=t.return;try{al(t)}catch(o){pe(t,l,o)}}}catch(o){pe(t,t.return,o)}if(t===e){q=null;break}var c=t.sibling;if(c!==null){c.return=t.return,q=c;break}q=t.return}}var sf=Math.ceil,la=Dt.ReactCurrentDispatcher,io=Dt.ReactCurrentOwner,nt=Dt.ReactCurrentBatchConfig,te=0,_e=null,ye=null,Te=0,Qe=0,As=ts(0),ke=0,Vn=null,vs=0,Ca=0,lo=0,Sn=null,Ue=null,oo=0,Ks=1/0,wt=null,oa=!1,ol=null,Qt=null,jr=!1,It=null,ca=0,Cn=0,cl=null,Mr=-1,Ar=0;function Oe(){return te&6?xe():Mr!==-1?Mr:Mr=xe()}function Kt(e){return e.mode&1?te&2&&Te!==0?Te&-Te:Bp.transition!==null?(Ar===0&&(Ar=Rd()),Ar):(e=se,e!==0||(e=window.event,e=e===void 0?16:Vd(e.type)),e):1}function ht(e,t,n,r){if(50<Cn)throw Cn=0,cl=null,Error(M(185));Kn(e,n,r),(!(te&2)||e!==_e)&&(e===_e&&(!(te&2)&&(Ca|=n),ke===4&&Ot(e,Te)),We(e,r),n===1&&te===0&&!(t.mode&1)&&(Ks=xe()+500,ba&&ss()))}function We(e,t){var n=e.callbackNode;Bm(e,t);var r=Wr(e,e===_e?Te:0);if(r===0)n!==null&&Uo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Uo(n),t===1)e.tag===0?Op(Mc.bind(null,e)):cu(Mc.bind(null,e)),Mp(function(){!(te&6)&&ss()}),n=null;else{switch(Od(r)){case 1:n=Ml;break;case 4:n=Ad;break;case 16:n=Hr;break;case 536870912:n=$d;break;default:n=Hr}n=lh(n,eh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function eh(e,t){if(Mr=-1,Ar=0,te&6)throw Error(M(327));var n=e.callbackNode;if(qs()&&e.callbackNode!==n)return null;var r=Wr(e,e===_e?Te:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=da(e,r);else{t=r;var a=te;te|=2;var i=sh();(_e!==e||Te!==t)&&(wt=null,Ks=xe()+500,hs(e,t));do try{af();break}catch(c){th(e,c)}while(!0);Ql(),la.current=i,te=a,ye!==null?t=0:(_e=null,Te=0,t=ke)}if(t!==0){if(t===2&&(a=$i(e),a!==0&&(r=a,t=dl(e,a))),t===1)throw n=Vn,hs(e,0),Ot(e,r),We(e,xe()),n;if(t===6)Ot(e,r);else{if(a=e.current.alternate,!(r&30)&&!nf(a)&&(t=da(e,r),t===2&&(i=$i(e),i!==0&&(r=i,t=dl(e,i))),t===1))throw n=Vn,hs(e,0),Ot(e,r),We(e,xe()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:os(e,Ue,wt);break;case 3:if(Ot(e,r),(r&130023424)===r&&(t=oo+500-xe(),10<t)){if(Wr(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Oe(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Vi(os.bind(null,e,Ue,wt),t);break}os(e,Ue,wt);break;case 4:if(Ot(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var l=31-ut(r);i=1<<l,l=t[l],l>a&&(a=l),r&=~i}if(r=a,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sf(r/1960))-r,10<r){e.timeoutHandle=Vi(os.bind(null,e,Ue,wt),r);break}os(e,Ue,wt);break;case 5:os(e,Ue,wt);break;default:throw Error(M(329))}}}return We(e,xe()),e.callbackNode===n?eh.bind(null,e):null}function dl(e,t){var n=Sn;return e.current.memoizedState.isDehydrated&&(hs(e,t).flags|=256),e=da(e,t),e!==2&&(t=Ue,Ue=n,t!==null&&ul(t)),e}function ul(e){Ue===null?Ue=e:Ue.push.apply(Ue,e)}function nf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!mt(i(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ot(e,t){for(t&=~lo,t&=~Ca,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ut(t),r=1<<n;e[n]=-1,t&=~r}}function Mc(e){if(te&6)throw Error(M(327));qs();var t=Wr(e,0);if(!(t&1))return We(e,xe()),null;var n=da(e,t);if(e.tag!==0&&n===2){var r=$i(e);r!==0&&(t=r,n=dl(e,r))}if(n===1)throw n=Vn,hs(e,0),Ot(e,t),We(e,xe()),n;if(n===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,os(e,Ue,wt),We(e,xe()),null}function co(e,t){var n=te;te|=1;try{return e(t)}finally{te=n,te===0&&(Ks=xe()+500,ba&&ss())}}function gs(e){It!==null&&It.tag===0&&!(te&6)&&qs();var t=te;te|=1;var n=nt.transition,r=se;try{if(nt.transition=null,se=1,e)return e()}finally{se=r,nt.transition=n,te=t,!(te&6)&&ss()}}function uo(){Qe=As.current,le(As)}function hs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Fp(n)),ye!==null)for(n=ye.return;n!==null;){var r=n;switch(Vl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Xr();break;case 3:Ws(),le(Ve),le($e),Zl();break;case 5:Jl(r);break;case 4:Ws();break;case 13:le(ce);break;case 19:le(ce);break;case 10:Kl(r.type._context);break;case 22:case 23:uo()}n=n.return}if(_e=e,ye=e=Gt(e.current,null),Te=Qe=t,ke=0,Vn=null,lo=Ca=vs=0,Ue=Sn=null,ds!==null){for(t=0;t<ds.length;t++)if(n=ds[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var l=i.next;i.next=a,r.next=l}n.pending=r}ds=null}return e}function th(e,t){do{var n=ye;try{if(Ql(),Lr.current=ia,aa){for(var r=de.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}aa=!1}if(xs=0,Pe=we=de=null,wn=!1,qn=0,io.current=null,n===null||n.return===null){ke=1,Vn=t,ye=null;break}e:{var i=e,l=n.return,c=n,o=t;if(t=Te,c.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var u=o,f=c,h=f.tag;if(!(f.mode&1)&&(h===0||h===11||h===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var v=Nc(l);if(v!==null){v.flags&=-257,bc(v,l,c,i,t),v.mode&1&&jc(i,u,t),t=v,o=u;var N=t.updateQueue;if(N===null){var j=new Set;j.add(o),t.updateQueue=j}else N.add(o);break e}else{if(!(t&1)){jc(i,u,t),ho();break e}o=Error(M(426))}}else if(oe&&c.mode&1){var k=Nc(l);if(k!==null){!(k.flags&65536)&&(k.flags|=256),bc(k,l,c,i,t),Hl(Qs(o,c));break e}}i=o=Qs(o,c),ke!==4&&(ke=2),Sn===null?Sn=[i]:Sn.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=Ou(i,o,t);pc(i,m);break e;case 1:c=o;var x=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Qt===null||!Qt.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var y=Bu(i,c,t);pc(i,y);break e}}i=i.return}while(i!==null)}rh(n)}catch(S){t=S,ye===n&&n!==null&&(ye=n=n.return);continue}break}while(!0)}function sh(){var e=la.current;return la.current=ia,e===null?ia:e}function ho(){(ke===0||ke===3||ke===2)&&(ke=4),_e===null||!(vs&268435455)&&!(Ca&268435455)||Ot(_e,Te)}function da(e,t){var n=te;te|=2;var r=sh();(_e!==e||Te!==t)&&(wt=null,hs(e,t));do try{rf();break}catch(a){th(e,a)}while(!0);if(Ql(),te=n,la.current=r,ye!==null)throw Error(M(261));return _e=null,Te=0,ke}function rf(){for(;ye!==null;)nh(ye)}function af(){for(;ye!==null&&!Tm();)nh(ye)}function nh(e){var t=ih(e.alternate,e,Qe);e.memoizedProps=e.pendingProps,t===null?rh(e):ye=t,io.current=null}function rh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Jp(n,t),n!==null){n.flags&=32767,ye=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ke=6,ye=null;return}}else if(n=Xp(n,t,Qe),n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);ke===0&&(ke=5)}function os(e,t,n){var r=se,a=nt.transition;try{nt.transition=null,se=1,lf(e,t,n,r)}finally{nt.transition=a,se=r}return null}function lf(e,t,n,r){do qs();while(It!==null);if(te&6)throw Error(M(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(M(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Im(e,i),e===_e&&(ye=_e=null,Te=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||jr||(jr=!0,lh(Hr,function(){return qs(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=nt.transition,nt.transition=null;var l=se;se=1;var c=te;te|=4,io.current=null,ef(e,n),Ju(n,e),Cp(Ui),Qr=!!qi,Ui=qi=null,e.current=n,tf(n),Lm(),te=c,se=l,nt.transition=i}else e.current=n;if(jr&&(jr=!1,It=e,ca=a),i=e.pendingLanes,i===0&&(Qt=null),Mm(n.stateNode),We(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(oa)throw oa=!1,e=ol,ol=null,e;return ca&1&&e.tag!==0&&qs(),i=e.pendingLanes,i&1?e===cl?Cn++:(Cn=0,cl=e):Cn=0,ss(),null}function qs(){if(It!==null){var e=Od(ca),t=nt.transition,n=se;try{if(nt.transition=null,se=16>e?16:e,It===null)var r=!1;else{if(e=It,It=null,ca=0,te&6)throw Error(M(331));var a=te;for(te|=4,q=e.current;q!==null;){var i=q,l=i.child;if(q.flags&16){var c=i.deletions;if(c!==null){for(var o=0;o<c.length;o++){var u=c[o];for(q=u;q!==null;){var f=q;switch(f.tag){case 0:case 11:case 15:kn(8,f,i)}var h=f.child;if(h!==null)h.return=f,q=h;else for(;q!==null;){f=q;var p=f.sibling,v=f.return;if(Gu(f),f===u){q=null;break}if(p!==null){p.return=v,q=p;break}q=v}}}var N=i.alternate;if(N!==null){var j=N.child;if(j!==null){N.child=null;do{var k=j.sibling;j.sibling=null,j=k}while(j!==null)}}q=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,q=l;else e:for(;q!==null;){if(i=q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:kn(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,q=m;break e}q=i.return}}var x=e.current;for(q=x;q!==null;){l=q;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,q=g;else e:for(l=x;q!==null;){if(c=q,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Sa(9,c)}}catch(S){pe(c,c.return,S)}if(c===l){q=null;break e}var y=c.sibling;if(y!==null){y.return=c.return,q=y;break e}q=c.return}}if(te=a,ss(),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(va,e)}catch{}r=!0}return r}finally{se=n,nt.transition=t}}return!1}function Ac(e,t,n){t=Qs(n,t),t=Ou(e,t,1),e=Wt(e,t,1),t=Oe(),e!==null&&(Kn(e,1,t),We(e,t))}function pe(e,t,n){if(e.tag===3)Ac(e,e,n);else for(;t!==null;){if(t.tag===3){Ac(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qt===null||!Qt.has(r))){e=Qs(n,e),e=Bu(t,e,1),t=Wt(t,e,1),e=Oe(),t!==null&&(Kn(t,1,e),We(t,e));break}}t=t.return}}function of(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Oe(),e.pingedLanes|=e.suspendedLanes&n,_e===e&&(Te&n)===n&&(ke===4||ke===3&&(Te&130023424)===Te&&500>xe()-oo?hs(e,0):lo|=n),We(e,t)}function ah(e,t){t===0&&(e.mode&1?(t=dr,dr<<=1,!(dr&130023424)&&(dr=4194304)):t=1);var n=Oe();e=Tt(e,t),e!==null&&(Kn(e,t,n),We(e,n))}function cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ah(e,n)}function df(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),ah(e,n)}var ih;ih=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ve.current)ze=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ze=!1,Yp(e,t,n);ze=!!(e.flags&131072)}else ze=!1,oe&&t.flags&1048576&&du(t,ea,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fr(e,t),e=t.pendingProps;var a=zs(t,$e.current);Is(t,n),a=to(null,t,r,e,a,n);var i=so();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,He(r)?(i=!0,Jr(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Yl(t),a.updater=ka,t.stateNode=a,a._reactInternals=t,Xi(t,r,e,n),t=el(null,t,r,!0,i,n)):(t.tag=0,oe&&i&&zl(t),Re(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fr(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=hf(r),e=lt(r,e),a){case 0:t=Zi(null,t,r,e,n);break e;case 1:t=Sc(null,t,r,e,n);break e;case 11:t=wc(null,t,r,e,n);break e;case 14:t=kc(null,t,r,lt(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:lt(r,a),Zi(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:lt(r,a),Sc(e,t,r,a,n);case 3:e:{if(zu(t),e===null)throw Error(M(387));r=t.pendingProps,i=t.memoizedState,a=i.element,xu(e,t),na(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Qs(Error(M(423)),t),t=Cc(e,t,r,n,a);break e}else if(r!==a){a=Qs(Error(M(424)),t),t=Cc(e,t,r,n,a);break e}else for(Ke=Ht(t.stateNode.containerInfo.firstChild),Ge=t,oe=!0,dt=null,n=pu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vs(),r===a){t=Lt(e,t,n);break e}Re(e,t,r,n)}t=t.child}return t;case 5:return vu(t),e===null&&Ki(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,l=a.children,zi(r,a)?l=null:i!==null&&zi(r,i)&&(t.flags|=32),Uu(e,t),Re(e,t,l,n),t.child;case 6:return e===null&&Ki(t),null;case 13:return Vu(e,t,n);case 4:return Xl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Hs(t,null,r,n):Re(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:lt(r,a),wc(e,t,r,a,n);case 7:return Re(e,t,t.pendingProps,n),t.child;case 8:return Re(e,t,t.pendingProps.children,n),t.child;case 12:return Re(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,l=a.value,ae(ta,r._currentValue),r._currentValue=l,i!==null)if(mt(i.value,l)){if(i.children===a.children&&!Ve.current){t=Lt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var c=i.dependencies;if(c!==null){l=i.child;for(var o=c.firstContext;o!==null;){if(o.context===r){if(i.tag===1){o=Pt(-1,n&-n),o.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?o.next=o:(o.next=f.next,f.next=o),u.pending=o}}i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Gi(i.return,n,t),c.lanes|=n;break}o=o.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(M(341));l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Gi(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Re(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Is(t,n),a=rt(a),r=r(a),t.flags|=1,Re(e,t,r,n),t.child;case 14:return r=t.type,a=lt(r,t.pendingProps),a=lt(r.type,a),kc(e,t,r,a,n);case 15:return Iu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:lt(r,a),Fr(e,t),t.tag=1,He(r)?(e=!0,Jr(t)):e=!1,Is(t,n),Ru(t,r,a),Xi(t,r,a,n),el(null,t,r,!0,e,n);case 19:return Hu(e,t,n);case 22:return qu(e,t,n)}throw Error(M(156,t.tag))};function lh(e,t){return Md(e,t)}function uf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function st(e,t,n,r){return new uf(e,t,n,r)}function mo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hf(e){if(typeof e=="function")return mo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ll)return 11;if(e===Dl)return 14}return 2}function Gt(e,t){var n=e.alternate;return n===null?(n=st(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $r(e,t,n,r,a,i){var l=2;if(r=e,typeof e=="function")mo(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Ss:return ms(n.children,a,i,t);case Tl:l=8,a|=8;break;case Ni:return e=st(12,n,t,a|2),e.elementType=Ni,e.lanes=i,e;case bi:return e=st(13,n,t,a),e.elementType=bi,e.lanes=i,e;case wi:return e=st(19,n,t,a),e.elementType=wi,e.lanes=i,e;case vd:return Pa(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fd:l=10;break e;case xd:l=9;break e;case Ll:l=11;break e;case Dl:l=14;break e;case At:l=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=st(l,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function ms(e,t,n,r){return e=st(7,e,r,t),e.lanes=n,e}function Pa(e,t,n,r){return e=st(22,e,r,t),e.elementType=vd,e.lanes=n,e.stateNode={isHidden:!1},e}function ui(e,t,n){return e=st(6,e,null,t),e.lanes=n,e}function hi(e,t,n){return t=st(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mf(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wa(0),this.expirationTimes=Wa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wa(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function po(e,t,n,r,a,i,l,c,o){return e=new mf(e,t,n,c,o),t===1?(t=1,i===!0&&(t|=8)):t=0,i=st(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yl(i),e}function pf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function oh(e){if(!e)return Zt;e=e._reactInternals;e:{if(js(e)!==e||e.tag!==1)throw Error(M(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(He(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(M(171))}if(e.tag===1){var n=e.type;if(He(n))return ou(e,n,t)}return t}function ch(e,t,n,r,a,i,l,c,o){return e=po(n,r,!0,e,a,i,l,c,o),e.context=oh(null),n=e.current,r=Oe(),a=Kt(n),i=Pt(r,a),i.callback=t??null,Wt(n,i,a),e.current.lanes=a,Kn(e,a,r),We(e,r),e}function _a(e,t,n,r){var a=t.current,i=Oe(),l=Kt(a);return n=oh(n),t.context===null?t.context=n:t.pendingContext=n,t=Pt(i,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wt(a,t,l),e!==null&&(ht(e,a,l,i),Tr(e,a,l)),l}function ua(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function $c(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fo(e,t){$c(e,t),(e=e.alternate)&&$c(e,t)}function ff(){return null}var dh=typeof reportError=="function"?reportError:function(e){console.error(e)};function xo(e){this._internalRoot=e}Ea.prototype.render=xo.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));_a(e,t,null,null)};Ea.prototype.unmount=xo.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gs(function(){_a(null,e,null,null)}),t[Et]=null}};function Ea(e){this._internalRoot=e}Ea.prototype.unstable_scheduleHydration=function(e){if(e){var t=qd();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&t!==0&&t<Rt[n].priority;n++);Rt.splice(n,0,e),n===0&&zd(e)}};function vo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ta(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rc(){}function xf(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var u=ua(l);i.call(u)}}var l=ch(t,r,e,0,null,!1,!1,"",Rc);return e._reactRootContainer=l,e[Et]=l.current,$n(e.nodeType===8?e.parentNode:e),gs(),l}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var c=r;r=function(){var u=ua(o);c.call(u)}}var o=po(e,0,!1,null,null,!1,!1,"",Rc);return e._reactRootContainer=o,e[Et]=o.current,$n(e.nodeType===8?e.parentNode:e),gs(function(){_a(t,o,n,r)}),o}function La(e,t,n,r,a){var i=n._reactRootContainer;if(i){var l=i;if(typeof a=="function"){var c=a;a=function(){var o=ua(l);c.call(o)}}_a(t,l,e,a)}else l=xf(n,t,e,a,r);return ua(l)}Bd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fn(t.pendingLanes);n!==0&&(Al(t,n|1),We(t,xe()),!(te&6)&&(Ks=xe()+500,ss()))}break;case 13:gs(function(){var r=Tt(e,1);if(r!==null){var a=Oe();ht(r,e,1,a)}}),fo(e,1)}};$l=function(e){if(e.tag===13){var t=Tt(e,134217728);if(t!==null){var n=Oe();ht(t,e,134217728,n)}fo(e,134217728)}};Id=function(e){if(e.tag===13){var t=Kt(e),n=Tt(e,t);if(n!==null){var r=Oe();ht(n,e,t,r)}fo(e,t)}};qd=function(){return se};Ud=function(e,t){var n=se;try{return se=e,t()}finally{se=n}};Fi=function(e,t,n){switch(t){case"input":if(Ci(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=Na(r);if(!a)throw Error(M(90));yd(r),Ci(r,a)}}}break;case"textarea":Nd(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};_d=co;Ed=gs;var vf={usingClientEntryPoint:!1,Events:[Yn,Es,Na,Cd,Pd,co]},un={findFiberByHostInstance:cs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gf={bundleType:un.bundleType,version:un.version,rendererPackageName:un.rendererPackageName,rendererConfig:un.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Dd(e),e===null?null:e.stateNode},findFiberByHostInstance:un.findFiberByHostInstance||ff,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nr.isDisabled&&Nr.supportsFiber)try{va=Nr.inject(gf),vt=Nr}catch{}}Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vf;Xe.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vo(t))throw Error(M(200));return pf(e,t,null,n)};Xe.createRoot=function(e,t){if(!vo(e))throw Error(M(299));var n=!1,r="",a=dh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=po(e,1,!1,null,null,n,!1,r,a),e[Et]=t.current,$n(e.nodeType===8?e.parentNode:e),new xo(t)};Xe.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=Dd(t),e=e===null?null:e.stateNode,e};Xe.flushSync=function(e){return gs(e)};Xe.hydrate=function(e,t,n){if(!Ta(t))throw Error(M(200));return La(null,e,t,!0,n)};Xe.hydrateRoot=function(e,t,n){if(!vo(e))throw Error(M(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",l=dh;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=ch(t,null,e,1,n??null,a,!1,i,l),e[Et]=t.current,$n(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Ea(t)};Xe.render=function(e,t,n){if(!Ta(t))throw Error(M(200));return La(null,e,t,!1,n)};Xe.unmountComponentAtNode=function(e){if(!Ta(e))throw Error(M(40));return e._reactRootContainer?(gs(function(){La(null,null,e,!1,function(){e._reactRootContainer=null,e[Et]=null})}),!0):!1};Xe.unstable_batchedUpdates=co;Xe.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ta(n))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return La(e,t,n,!1,r)};Xe.version="18.3.1-next-f1338f8080-20240426";function uh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uh)}catch(e){console.error(e)}}uh(),ud.exports=Xe;var yf=ud.exports,Oc=yf;yi.createRoot=Oc.createRoot,yi.hydrateRoot=Oc.hydrateRoot;/**
+ * @remix-run/router v1.23.2
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function Hn(){return Hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hn.apply(this,arguments)}var qt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(qt||(qt={}));const Bc="popstate";function jf(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:l,hash:c}=r.location;return hl("",{pathname:i,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:ha(a)}return bf(t,n,null,e)}function ue(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function go(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Nf(){return Math.random().toString(36).substr(2,8)}function Ic(e,t){return{usr:e.state,key:e.key,idx:t}}function hl(e,t,n,r){return n===void 0&&(n=null),Hn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Zs(t):t,{state:n,key:t&&t.key||r||Nf()})}function ha(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Zs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function bf(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,l=a.history,c=qt.Pop,o=null,u=f();u==null&&(u=0,l.replaceState(Hn({},l.state,{idx:u}),""));function f(){return(l.state||{idx:null}).idx}function h(){c=qt.Pop;let k=f(),m=k==null?null:k-u;u=k,o&&o({action:c,location:j.location,delta:m})}function p(k,m){c=qt.Push;let x=hl(j.location,k,m);u=f()+1;let g=Ic(x,u),y=j.createHref(x);try{l.pushState(g,"",y)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;a.location.assign(y)}i&&o&&o({action:c,location:j.location,delta:1})}function v(k,m){c=qt.Replace;let x=hl(j.location,k,m);u=f();let g=Ic(x,u),y=j.createHref(x);l.replaceState(g,"",y),i&&o&&o({action:c,location:j.location,delta:0})}function N(k){let m=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof k=="string"?k:ha(k);return x=x.replace(/ $/,"%20"),ue(m,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,m)}let j={get action(){return c},get location(){return e(a,l)},listen(k){if(o)throw new Error("A history only accepts one active listener");return a.addEventListener(Bc,h),o=k,()=>{a.removeEventListener(Bc,h),o=null}},createHref(k){return t(a,k)},createURL:N,encodeLocation(k){let m=N(k);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:p,replace:v,go(k){return l.go(k)}};return j}var qc;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(qc||(qc={}));function wf(e,t,n){return n===void 0&&(n="/"),kf(e,t,n)}function kf(e,t,n,r){let a=typeof t=="string"?Zs(t):t,i=Gs(a.pathname||"/",n);if(i==null)return null;let l=hh(e);Sf(l);let c=null;for(let o=0;c==null&&o<l.length;++o){let u=$f(i);c=Mf(l[o],u)}return c}function hh(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,l,c)=>{let o={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};o.relativePath.startsWith("/")&&(ue(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(r.length));let u=Yt([r,o.relativePath]),f=n.concat(o);i.children&&i.children.length>0&&(ue(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),hh(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Df(u,i.index),routesMeta:f})};return e.forEach((i,l)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,l);else for(let o of mh(i.path))a(i,l,o)}),t}function mh(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let l=mh(r.join("/")),c=[];return c.push(...l.map(o=>o===""?i:[i,o].join("/"))),a&&c.push(...l),c.map(o=>e.startsWith("/")&&o===""?"/":o)}function Sf(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ff(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Cf=/^:[\w-]+$/,Pf=3,_f=2,Ef=1,Tf=10,Lf=-2,Uc=e=>e==="*";function Df(e,t){let n=e.split("/"),r=n.length;return n.some(Uc)&&(r+=Lf),t&&(r+=_f),n.filter(a=>!Uc(a)).reduce((a,i)=>a+(Cf.test(i)?Pf:i===""?Ef:Tf),r)}function Ff(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Mf(e,t,n){let{routesMeta:r}=e,a={},i="/",l=[];for(let c=0;c<r.length;++c){let o=r[c],u=c===r.length-1,f=i==="/"?t:t.slice(i.length)||"/",h=ml({path:o.relativePath,caseSensitive:o.caseSensitive,end:u},f),p=o.route;if(!h)return null;Object.assign(a,h.params),l.push({params:a,pathname:Yt([i,h.pathname]),pathnameBase:qf(Yt([i,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(i=Yt([i,h.pathnameBase]))}return l}function ml(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Af(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((u,f,h)=>{let{paramName:p,isOptional:v}=f;if(p==="*"){let j=c[h]||"";l=i.slice(0,i.length-j.length).replace(/(.)\/+$/,"$1")}const N=c[h];return v&&!N?u[p]=void 0:u[p]=(N||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:l,pattern:e}}function Af(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),go(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,o)=>(r.push({paramName:c,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function $f(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return go(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Gs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const Rf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Of=e=>Rf.test(e);function Bf(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Zs(e):e,i;if(n)if(Of(n))i=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),go(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?i=zc(n.substring(1),"/"):i=zc(n,t)}else i=t;return{pathname:i,search:Uf(r),hash:zf(a)}}function zc(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function mi(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function If(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yo(e,t){let n=If(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function jo(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Zs(e):(a=Hn({},e),ue(!a.pathname||!a.pathname.includes("?"),mi("?","pathname","search",a)),ue(!a.pathname||!a.pathname.includes("#"),mi("#","pathname","hash",a)),ue(!a.search||!a.search.includes("#"),mi("#","search","hash",a)));let i=e===""||a.pathname==="",l=i?"/":a.pathname,c;if(l==null)c=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),h-=1;a.pathname=p.join("/")}c=h>=0?t[h]:"/"}let o=Bf(a,c),u=l&&l!=="/"&&l.endsWith("/"),f=(i||l===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(u||f)&&(o.pathname+="/"),o}const Yt=e=>e.join("/").replace(/\/\/+/g,"/"),qf=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Uf=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zf=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Vf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ph=["post","put","patch","delete"];new Set(ph);const Hf=["get",...ph];new Set(Hf);/**
+ * React Router v6.30.3
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function Wn(){return Wn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wn.apply(this,arguments)}const Da=d.createContext(null),fh=d.createContext(null),Ft=d.createContext(null),Fa=d.createContext(null),Nt=d.createContext({outlet:null,matches:[],isDataRoute:!1}),xh=d.createContext(null);function Wf(e,t){let{relative:n}=t===void 0?{}:t;en()||ue(!1);let{basename:r,navigator:a}=d.useContext(Ft),{hash:i,pathname:l,search:c}=Ma(e,{relative:n}),o=l;return r!=="/"&&(o=l==="/"?r:Yt([r,l])),a.createHref({pathname:o,search:c,hash:i})}function en(){return d.useContext(Fa)!=null}function tn(){return en()||ue(!1),d.useContext(Fa).location}function vh(e){d.useContext(Ft).static||d.useLayoutEffect(e)}function ns(){let{isDataRoute:e}=d.useContext(Nt);return e?ox():Qf()}function Qf(){en()||ue(!1);let e=d.useContext(Da),{basename:t,future:n,navigator:r}=d.useContext(Ft),{matches:a}=d.useContext(Nt),{pathname:i}=tn(),l=JSON.stringify(yo(a,n.v7_relativeSplatPath)),c=d.useRef(!1);return vh(()=>{c.current=!0}),d.useCallback(function(u,f){if(f===void 0&&(f={}),!c.current)return;if(typeof u=="number"){r.go(u);return}let h=jo(u,JSON.parse(l),i,f.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Yt([t,h.pathname])),(f.replace?r.replace:r.push)(h,f.state,f)},[t,r,l,i,e])}const Kf=d.createContext(null);function Gf(e){let t=d.useContext(Nt).outlet;return t&&d.createElement(Kf.Provider,{value:e},t)}function Yf(){let{matches:e}=d.useContext(Nt),t=e[e.length-1];return t?t.params:{}}function Ma(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=d.useContext(Ft),{matches:a}=d.useContext(Nt),{pathname:i}=tn(),l=JSON.stringify(yo(a,r.v7_relativeSplatPath));return d.useMemo(()=>jo(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Xf(e,t){return Jf(e,t)}function Jf(e,t,n,r){en()||ue(!1);let{navigator:a}=d.useContext(Ft),{matches:i}=d.useContext(Nt),l=i[i.length-1],c=l?l.params:{};l&&l.pathname;let o=l?l.pathnameBase:"/";l&&l.route;let u=tn(),f;if(t){var h;let k=typeof t=="string"?Zs(t):t;o==="/"||(h=k.pathname)!=null&&h.startsWith(o)||ue(!1),f=k}else f=u;let p=f.pathname||"/",v=p;if(o!=="/"){let k=o.replace(/^\//,"").split("/");v="/"+p.replace(/^\//,"").split("/").slice(k.length).join("/")}let N=wf(e,{pathname:v}),j=nx(N&&N.map(k=>Object.assign({},k,{params:Object.assign({},c,k.params),pathname:Yt([o,a.encodeLocation?a.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?o:Yt([o,a.encodeLocation?a.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),i,n,r);return t&&j?d.createElement(Fa.Provider,{value:{location:Wn({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:qt.Pop}},j):j}function Zf(){let e=lx(),t=Vf(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),n?d.createElement("pre",{style:a},n):null,null)}const ex=d.createElement(Zf,null);class tx extends d.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?d.createElement(Nt.Provider,{value:this.props.routeContext},d.createElement(xh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function sx(e){let{routeContext:t,match:n,children:r}=e,a=d.useContext(Da);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),d.createElement(Nt.Provider,{value:t},r)}function nx(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,c=(a=n)==null?void 0:a.errors;if(c!=null){let f=l.findIndex(h=>h.route.id&&(c==null?void 0:c[h.route.id])!==void 0);f>=0||ue(!1),l=l.slice(0,Math.min(l.length,f+1))}let o=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<l.length;f++){let h=l[f];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=f),h.route.id){let{loaderData:p,errors:v}=n,N=h.route.loader&&p[h.route.id]===void 0&&(!v||v[h.route.id]===void 0);if(h.route.lazy||N){o=!0,u>=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((f,h,p)=>{let v,N=!1,j=null,k=null;n&&(v=c&&h.route.id?c[h.route.id]:void 0,j=h.route.errorElement||ex,o&&(u<0&&p===0?(cx("route-fallback"),N=!0,k=null):u===p&&(N=!0,k=h.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,p+1)),x=()=>{let g;return v?g=j:N?g=k:h.route.Component?g=d.createElement(h.route.Component,null):h.route.element?g=h.route.element:g=f,d.createElement(sx,{match:h,routeContext:{outlet:f,matches:m,isDataRoute:n!=null},children:g})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?d.createElement(tx,{location:n.location,revalidation:n.revalidation,component:j,error:v,children:x(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):x()},null)}var gh=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(gh||{}),yh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(yh||{});function rx(e){let t=d.useContext(Da);return t||ue(!1),t}function ax(e){let t=d.useContext(fh);return t||ue(!1),t}function ix(e){let t=d.useContext(Nt);return t||ue(!1),t}function jh(e){let t=ix(),n=t.matches[t.matches.length-1];return n.route.id||ue(!1),n.route.id}function lx(){var e;let t=d.useContext(xh),n=ax(),r=jh();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ox(){let{router:e}=rx(gh.UseNavigateStable),t=jh(yh.UseNavigateStable),n=d.useRef(!1);return vh(()=>{n.current=!0}),d.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Wn({fromRouteId:t},i)))},[e,t])}const Vc={};function cx(e,t,n){Vc[e]||(Vc[e]=!0)}function dx(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Nh(e){let{to:t,replace:n,state:r,relative:a}=e;en()||ue(!1);let{future:i,static:l}=d.useContext(Ft),{matches:c}=d.useContext(Nt),{pathname:o}=tn(),u=ns(),f=jo(t,yo(c,i.v7_relativeSplatPath),o,a==="path"),h=JSON.stringify(f);return d.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:a}),[u,h,a,n,r]),null}function ux(e){return Gf(e.context)}function be(e){ue(!1)}function hx(e){let{basename:t="/",children:n=null,location:r,navigationType:a=qt.Pop,navigator:i,static:l=!1,future:c}=e;en()&&ue(!1);let o=t.replace(/^\/*/,"/"),u=d.useMemo(()=>({basename:o,navigator:i,static:l,future:Wn({v7_relativeSplatPath:!1},c)}),[o,c,i,l]);typeof r=="string"&&(r=Zs(r));let{pathname:f="/",search:h="",hash:p="",state:v=null,key:N="default"}=r,j=d.useMemo(()=>{let k=Gs(f,o);return k==null?null:{location:{pathname:k,search:h,hash:p,state:v,key:N},navigationType:a}},[o,f,h,p,v,N,a]);return j==null?null:d.createElement(Ft.Provider,{value:u},d.createElement(Fa.Provider,{children:n,value:j}))}function mx(e){let{children:t,location:n}=e;return Xf(pl(t),n)}new Promise(()=>{});function pl(e,t){t===void 0&&(t=[]);let n=[];return d.Children.forEach(e,(r,a)=>{if(!d.isValidElement(r))return;let i=[...t,a];if(r.type===d.Fragment){n.push.apply(n,pl(r.props.children,i));return}r.type!==be&&ue(!1),!r.props.index||!r.props.children||ue(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=pl(r.props.children,i)),n.push(l)}),n}/**
+ * React Router DOM v6.30.3
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function ma(){return ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ma.apply(this,arguments)}function bh(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function px(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fx(e,t){return e.button===0&&(!t||t==="_self")&&!px(e)}const xx=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vx=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],gx="6";try{window.__reactRouterVersion=gx}catch{}const yx=d.createContext({isTransitioning:!1}),jx="startTransition",Hc=lm[jx];function Nx(e){let{basename:t,children:n,future:r,window:a}=e,i=d.useRef();i.current==null&&(i.current=jf({window:a,v5Compat:!0}));let l=i.current,[c,o]=d.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},f=d.useCallback(h=>{u&&Hc?Hc(()=>o(h)):o(h)},[o,u]);return d.useLayoutEffect(()=>l.listen(f),[l,f]),d.useEffect(()=>dx(r),[r]),d.createElement(hx,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:l,future:r})}const bx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,No=d.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:l,state:c,target:o,to:u,preventScrollReset:f,viewTransition:h}=t,p=bh(t,xx),{basename:v}=d.useContext(Ft),N,j=!1;if(typeof u=="string"&&wx.test(u)&&(N=u,bx))try{let g=new URL(window.location.href),y=u.startsWith("//")?new URL(g.protocol+u):new URL(u),S=Gs(y.pathname,v);y.origin===g.origin&&S!=null?u=S+y.search+y.hash:j=!0}catch{}let k=Wf(u,{relative:a}),m=Sx(u,{replace:l,state:c,target:o,preventScrollReset:f,relative:a,viewTransition:h});function x(g){r&&r(g),g.defaultPrevented||m(g)}return d.createElement("a",ma({},p,{href:N||k,onClick:j||i?r:x,ref:n,target:o}))}),qe=d.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:l=!1,style:c,to:o,viewTransition:u,children:f}=t,h=bh(t,vx),p=Ma(o,{relative:h.relative}),v=tn(),N=d.useContext(fh),{navigator:j,basename:k}=d.useContext(Ft),m=N!=null&&Cx(p)&&u===!0,x=j.encodeLocation?j.encodeLocation(p).pathname:p.pathname,g=v.pathname,y=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;a||(g=g.toLowerCase(),y=y?y.toLowerCase():null,x=x.toLowerCase()),y&&k&&(y=Gs(y,k)||y);const S=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let E=g===x||!l&&g.startsWith(x)&&g.charAt(S)==="/",T=y!=null&&(y===x||!l&&y.startsWith(x)&&y.charAt(x.length)==="/"),P={isActive:E,isPending:T,isTransitioning:m},O=E?r:void 0,w;typeof i=="function"?w=i(P):w=[i,E?"active":null,T?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let L=typeof c=="function"?c(P):c;return d.createElement(No,ma({},h,{"aria-current":O,className:w,ref:n,style:L,to:o,viewTransition:u}),typeof f=="function"?f(P):f)});var fl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(fl||(fl={}));var Wc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Wc||(Wc={}));function kx(e){let t=d.useContext(Da);return t||ue(!1),t}function Sx(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:l,viewTransition:c}=t===void 0?{}:t,o=ns(),u=tn(),f=Ma(e,{relative:l});return d.useCallback(h=>{if(fx(h,n)){h.preventDefault();let p=r!==void 0?r:ha(u)===ha(f);o(e,{replace:p,state:a,preventScrollReset:i,relative:l,viewTransition:c})}},[u,o,f,r,a,n,e,i,l,c])}function Cx(e,t){t===void 0&&(t={});let n=d.useContext(yx);n==null&&ue(!1);let{basename:r}=kx(fl.useViewTransitionState),a=Ma(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Gs(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Gs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ml(a.pathname,l)!=null||ml(a.pathname,i)!=null}const Px="/api/v1";class _x{constructor(){this.baseUrl=Px}getToken(){return localStorage.getItem("access_token")}setTokens(t,n){localStorage.setItem("access_token",t),localStorage.setItem("refresh_token",n)}clearTokens(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}async request(t,n={}){const r=`${this.baseUrl}${t}`,a=this.getToken(),i={headers:{"Content-Type":"application/json",...a&&{Authorization:`Bearer ${a}`},...n.headers},...n};n.body&&typeof n.body=="object"&&(i.body=JSON.stringify(n.body));try{const l=await fetch(r,i);if(l.status===401){if(await this.refreshToken()){i.headers.Authorization=`Bearer ${this.getToken()}`;const o=await fetch(r,i);return this.handleResponse(o)}throw this.clearTokens(),window.location.href="/login",new Error("Session expired")}return this.handleResponse(l)}catch(l){throw console.error("API Error:",l),l}}async handleResponse(t){const n=await t.json();if(!t.ok)throw new Error(n.error||"Request failed");return n}async refreshToken(){const t=localStorage.getItem("refresh_token");if(!t)return!1;try{const n=await fetch(`${this.baseUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(n.ok){const r=await n.json();return localStorage.setItem("access_token",r.access_token),!0}return!1}catch{return!1}}async login(t,n){const r=await this.request("/auth/login",{method:"POST",body:{email:t,password:n}});return this.setTokens(r.access_token,r.refresh_token),r}async register(t,n,r){const a=await this.request("/auth/register",{method:"POST",body:{email:t,username:n,password:r}});return this.setTokens(a.access_token,a.refresh_token),a}async logout(){this.clearTokens()}async getCurrentUser(){return this.request("/auth/me")}async updateCurrentUser(t){return this.request("/auth/me",{method:"PUT",body:t})}async getApps(){return this.request("/apps")}async getApp(t){return this.request(`/apps/${t}`)}async createApp(t){return this.request("/apps",{method:"POST",body:t})}async updateApp(t,n){return this.request(`/apps/${t}`,{method:"PUT",body:n})}async deleteApp(t){return this.request(`/apps/${t}`,{method:"DELETE"})}async startApp(t){return this.request(`/apps/${t}/start`,{method:"POST"})}async stopApp(t){return this.request(`/apps/${t}/stop`,{method:"POST"})}async restartApp(t){return this.request(`/apps/${t}/restart`,{method:"POST"})}async getDomains(){return this.request("/domains")}async getDomain(t){return this.request(`/domains/${t}`)}async createDomain(t){return this.request("/domains",{method:"POST",body:t})}async updateDomain(t,n){return this.request(`/domains/${t}`,{method:"PUT",body:n})}async deleteDomain(t){return this.request(`/domains/${t}`,{method:"DELETE"})}async enableSsl(t,n){return this.request(`/domains/${t}/ssl/enable`,{method:"POST",body:{email:n}})}async disableSsl(t){return this.request(`/domains/${t}/ssl/disable`,{method:"POST"})}async renewDomainSsl(t){return this.request(`/domains/${t}/ssl/renew`,{method:"POST"})}async verifyDomain(t){return this.request(`/domains/${t}/verify`)}async getDomainsNginxSites(){return this.request("/domains/nginx/sites")}async getDomainsSslStatus(){return this.request("/domains/ssl/status")}async getSystemMetrics(){return this.request("/system/metrics")}async getProcesses(){return this.request("/system/processes")}async getServices(){return this.request("/system/services")}async healthCheck(){return this.request("/system/health")}async getProcesses(t=50,n="cpu"){return this.request(`/processes?limit=${t}&sort=${n}`)}async getProcess(t){return this.request(`/processes/${t}`)}async killProcess(t,n=!1){return this.request(`/processes/${t}?force=${n}`,{method:"DELETE"})}async getServicesStatus(){return this.request("/processes/services")}async controlService(t,n){return this.request(`/processes/services/${t}`,{method:"POST",body:{action:n}})}async getNginxStatus(){return this.request("/nginx/status")}async testNginxConfig(){return this.request("/nginx/test",{method:"POST"})}async reloadNginx(){return this.request("/nginx/reload",{method:"POST"})}async getNginxSites(){return this.request("/nginx/sites")}async createNginxSite(t){return this.request("/nginx/sites",{method:"POST",body:t})}async enableNginxSite(t){return this.request(`/nginx/sites/${t}/enable`,{method:"POST"})}async disableNginxSite(t){return this.request(`/nginx/sites/${t}/disable`,{method:"POST"})}async deleteNginxSite(t){return this.request(`/nginx/sites/${t}`,{method:"DELETE"})}async getSSLStatus(){return this.request("/ssl/status")}async getCertificates(){return this.request("/ssl/certificates")}async obtainCertificate(t){return this.request("/ssl/certificates",{method:"POST",body:t})}async renewCertificate(t){return this.request(`/ssl/certificates/${t}/renew`,{method:"POST"})}async renewAllCertificates(){return this.request("/ssl/certificates/renew-all",{method:"POST"})}async revokeCertificate(t){return this.request(`/ssl/certificates/${t}`,{method:"DELETE"})}async getLogFiles(){return this.request("/logs")}async readLog(t,n=100){return this.request(`/logs/read?path=${encodeURIComponent(t)}&lines=${n}`)}async searchLog(t,n,r=100){return this.request(`/logs/search?path=${encodeURIComponent(t)}&pattern=${encodeURIComponent(n)}&lines=${r}`)}async getAppLogs(t,n="access",r=100){return this.request(`/logs/app/${t}?type=${n}&lines=${r}`)}async getJournalLogs(t,n=100){const r=new URLSearchParams({lines:n});return t&&r.append("unit",t),this.request(`/logs/journal?${r}`)}async clearLog(t){return this.request("/logs/clear",{method:"POST",body:{path:t}})}async getPHPVersions(){return this.request("/php/versions")}async installPHPVersion(t){return this.request(`/php/versions/${t}/install`,{method:"POST"})}async setDefaultPHPVersion(t){return this.request("/php/versions/default",{method:"POST",body:{version:t}})}async getPHPExtensions(t){return this.request(`/php/versions/${t}/extensions`)}async installPHPExtension(t,n){return this.request(`/php/versions/${t}/extensions`,{method:"POST",body:{extension:n}})}async getPHPPools(t){return this.request(`/php/versions/${t}/pools`)}async createPHPPool(t,n){return this.request(`/php/versions/${t}/pools`,{method:"POST",body:n})}async deletePHPPool(t,n){return this.request(`/php/versions/${t}/pools/${n}`,{method:"DELETE"})}async restartPHPFPM(t){return this.request(`/php/versions/${t}/fpm/restart`,{method:"POST"})}async getPHPFPMStatus(t){return this.request(`/php/versions/${t}/fpm/status`)}async installWordPress(t){return this.request("/wordpress/install",{method:"POST",body:t})}async getWordPressInfo(t){return this.request(`/wordpress/sites/${t}/info`)}async updateWordPress(t){return this.request(`/wordpress/sites/${t}/update`,{method:"POST"})}async getWordPressPlugins(t){return this.request(`/wordpress/sites/${t}/plugins`)}async installWordPressPlugin(t,n,r=!0){return this.request(`/wordpress/sites/${t}/plugins`,{method:"POST",body:{plugin:n,activate:r}})}async uninstallWordPressPlugin(t,n){return this.request(`/wordpress/sites/${t}/plugins/${n}`,{method:"DELETE"})}async activateWordPressPlugin(t,n){return this.request(`/wordpress/sites/${t}/plugins/${n}/activate`,{method:"POST"})}async deactivateWordPressPlugin(t,n){return this.request(`/wordpress/sites/${t}/plugins/${n}/deactivate`,{method:"POST"})}async updateWordPressPlugins(t,n=null){return this.request(`/wordpress/sites/${t}/plugins/update`,{method:"POST",body:n?{plugins:n}:{}})}async getWordPressThemes(t){return this.request(`/wordpress/sites/${t}/themes`)}async installWordPressTheme(t,n,r=!1){return this.request(`/wordpress/sites/${t}/themes`,{method:"POST",body:{theme:n,activate:r}})}async activateWordPressTheme(t,n){return this.request(`/wordpress/sites/${t}/themes/${n}/activate`,{method:"POST"})}async createWordPressBackup(t,n=!0){return this.request(`/wordpress/sites/${t}/backup`,{method:"POST",body:{include_db:n}})}async getWordPressBackups(t){return this.request(`/wordpress/sites/${t}/backups`)}async restoreWordPressBackup(t,n){return this.request(`/wordpress/sites/${t}/restore`,{method:"POST",body:{backup_name:n}})}async deleteWordPressBackup(t){return this.request(`/wordpress/backups/${t}`,{method:"DELETE"})}async hardenWordPress(t){return this.request(`/wordpress/sites/${t}/harden`,{method:"POST"})}async optimizeWordPressDatabase(t){return this.request(`/wordpress/sites/${t}/optimize`,{method:"POST"})}async flushWordPressCache(t){return this.request(`/wordpress/sites/${t}/flush-cache`,{method:"POST"})}async searchReplaceWordPress(t,n,r,a=!0){return this.request(`/wordpress/sites/${t}/search-replace`,{method:"POST",body:{search:n,replace:r,dry_run:a}})}async createWordPressUser(t,n){return this.request(`/wordpress/sites/${t}/users`,{method:"POST",body:n})}async resetWordPressPassword(t,n,r=null){return this.request(`/wordpress/sites/${t}/users/${n}/reset-password`,{method:"POST",body:r?{password:r}:{}})}async getPythonVersions(){return this.request("/python/versions")}async createFlaskApp(t){return this.request("/python/apps/flask",{method:"POST",body:t})}async createDjangoApp(t){return this.request("/python/apps/django",{method:"POST",body:t})}async createPythonVenv(t){return this.request(`/python/apps/${t}/venv`,{method:"POST"})}async getPythonPackages(t){return this.request(`/python/apps/${t}/packages`)}async installPythonPackages(t,n){return this.request(`/python/apps/${t}/packages`,{method:"POST",body:{packages:n}})}async freezePythonRequirements(t){return this.request(`/python/apps/${t}/requirements`,{method:"POST"})}async getPythonEnvVars(t){return this.request(`/python/apps/${t}/env`)}async setPythonEnvVars(t,n){return this.request(`/python/apps/${t}/env`,{method:"PUT",body:{env_vars:n}})}async deletePythonEnvVar(t,n){return this.request(`/python/apps/${t}/env/${n}`,{method:"DELETE"})}async startPythonApp(t){return this.request(`/python/apps/${t}/start`,{method:"POST"})}async stopPythonApp(t){return this.request(`/python/apps/${t}/stop`,{method:"POST"})}async restartPythonApp(t){return this.request(`/python/apps/${t}/restart`,{method:"POST"})}async getPythonAppStatus(t){return this.request(`/python/apps/${t}/status`)}async getGunicornConfig(t){return this.request(`/python/apps/${t}/gunicorn`)}async updateGunicornConfig(t,n){return this.request(`/python/apps/${t}/gunicorn`,{method:"PUT",body:{content:n}})}async runPythonMigrations(t){return this.request(`/python/apps/${t}/migrate`,{method:"POST"})}async collectPythonStatic(t){return this.request(`/python/apps/${t}/collectstatic`,{method:"POST"})}async runPythonCommand(t,n){return this.request(`/python/apps/${t}/run`,{method:"POST",body:{command:n}})}async deletePythonApp(t,n=!1){return this.request(`/python/apps/${t}`,{method:"DELETE",body:{remove_files:n}})}async getDockerStatus(){return this.request("/docker/status")}async getDockerInfo(){return this.request("/docker/info")}async getDockerDiskUsage(){return this.request("/docker/disk-usage")}async getContainers(t=!0){return this.request(`/docker/containers?all=${t}`)}async getContainer(t){return this.request(`/docker/containers/${t}`)}async createContainer(t){return this.request("/docker/containers",{method:"POST",body:t})}async runContainer(t){return this.request("/docker/containers/run",{method:"POST",body:t})}async startContainer(t){return this.request(`/docker/containers/${t}/start`,{method:"POST"})}async stopContainer(t,n=10){return this.request(`/docker/containers/${t}/stop`,{method:"POST",body:{timeout:n}})}async restartContainer(t,n=10){return this.request(`/docker/containers/${t}/restart`,{method:"POST",body:{timeout:n}})}async removeContainer(t,n=!1,r=!1){return this.request(`/docker/containers/${t}`,{method:"DELETE",body:{force:n,volumes:r}})}async getContainerLogs(t,n=100,r=null){const a=new URLSearchParams({tail:n});return r&&a.append("since",r),this.request(`/docker/containers/${t}/logs?${a}`)}async getContainerStats(t){return this.request(`/docker/containers/${t}/stats`)}async execContainer(t,n){return this.request(`/docker/containers/${t}/exec`,{method:"POST",body:{command:n}})}async getImages(){return this.request("/docker/images")}async pullImage(t,n="latest"){return this.request("/docker/images/pull",{method:"POST",body:{image:t,tag:n}})}async removeImage(t,n=!1){return this.request(`/docker/images/${t}`,{method:"DELETE",body:{force:n}})}async buildImage(t,n,r="Dockerfile",a=!1){return this.request("/docker/images/build",{method:"POST",body:{path:t,tag:n,dockerfile:r,no_cache:a}})}async getNetworks(){return this.request("/docker/networks")}async createNetwork(t,n="bridge"){return this.request("/docker/networks",{method:"POST",body:{name:t,driver:n}})}async removeNetwork(t){return this.request(`/docker/networks/${t}`,{method:"DELETE"})}async getVolumes(){return this.request("/docker/volumes")}async createVolume(t,n="local"){return this.request("/docker/volumes",{method:"POST",body:{name:t,driver:n}})}async removeVolume(t,n=!1){return this.request(`/docker/volumes/${t}`,{method:"DELETE",body:{force:n}})}async composeUp(t,n=!0,r=!1){return this.request("/docker/compose/up",{method:"POST",body:{path:t,detach:n,build:r}})}async composeDown(t,n=!1,r=!0){return this.request("/docker/compose/down",{method:"POST",body:{path:t,volumes:n,remove_orphans:r}})}async composePs(t){return this.request("/docker/compose/ps",{method:"POST",body:{path:t}})}async composeLogs(t,n=null,r=100){return this.request("/docker/compose/logs",{method:"POST",body:{path:t,service:n,tail:r}})}async composeRestart(t,n=null){return this.request("/docker/compose/restart",{method:"POST",body:{path:t,service:n}})}async composePull(t,n=null){return this.request("/docker/compose/pull",{method:"POST",body:{path:t,service:n}})}async createDockerApp(t){return this.request("/docker/apps",{method:"POST",body:t})}async pruneDocker(t=!1,n=!1){return this.request("/docker/prune",{method:"POST",body:{all:t,volumes:n}})}async getDatabaseStatus(){return this.request("/databases/status")}async getMySQLDatabases(t=null){const n=t?`?root_password=${encodeURIComponent(t)}`:"";return this.request(`/databases/mysql${n}`)}async createMySQLDatabase(t){return this.request("/databases/mysql",{method:"POST",body:t})}async dropMySQLDatabase(t,n=null){return this.request(`/databases/mysql/${t}`,{method:"DELETE",body:{root_password:n}})}async getMySQLTables(t,n=null){const r=n?`?root_password=${encodeURIComponent(n)}`:"";return this.request(`/databases/mysql/${t}/tables${r}`)}async backupMySQLDatabase(t,n=null){return this.request(`/databases/mysql/${t}/backup`,{method:"POST",body:{root_password:n}})}async restoreMySQLDatabase(t,n,r=null){return this.request(`/databases/mysql/${t}/restore`,{method:"POST",body:{backup_path:n,root_password:r}})}async getMySQLUsers(t=null){const n=t?`?root_password=${encodeURIComponent(t)}`:"";return this.request(`/databases/mysql/users${n}`)}async createMySQLUser(t){return this.request("/databases/mysql/users",{method:"POST",body:t})}async dropMySQLUser(t,n="localhost",r=null){return this.request(`/databases/mysql/users/${t}`,{method:"DELETE",body:{host:n,root_password:r}})}async grantMySQLPrivileges(t,n,r="ALL",a="localhost",i=null){return this.request(`/databases/mysql/users/${t}/grant`,{method:"POST",body:{database:n,privileges:r,host:a,root_password:i}})}async getPostgreSQLDatabases(){return this.request("/databases/postgresql")}async createPostgreSQLDatabase(t){return this.request("/databases/postgresql",{method:"POST",body:t})}async dropPostgreSQLDatabase(t){return this.request(`/databases/postgresql/${t}`,{method:"DELETE"})}async getPostgreSQLTables(t){return this.request(`/databases/postgresql/${t}/tables`)}async backupPostgreSQLDatabase(t){return this.request(`/databases/postgresql/${t}/backup`,{method:"POST"})}async restorePostgreSQLDatabase(t,n){return this.request(`/databases/postgresql/${t}/restore`,{method:"POST",body:{backup_path:n}})}async getPostgreSQLUsers(){return this.request("/databases/postgresql/users")}async createPostgreSQLUser(t){return this.request("/databases/postgresql/users",{method:"POST",body:t})}async dropPostgreSQLUser(t){return this.request(`/databases/postgresql/users/${t}`,{method:"DELETE"})}async grantPostgreSQLPrivileges(t,n,r="ALL"){return this.request(`/databases/postgresql/users/${t}/grant`,{method:"POST",body:{database:n,privileges:r}})}async getDatabaseBackups(t=null){const n=t?`?type=${t}`:"";return this.request(`/databases/backups${n}`)}async deleteDatabaseBackup(t){return this.request(`/databases/backups/${t}`,{method:"DELETE"})}async generateDatabasePassword(t=16){return this.request(`/databases/generate-password?length=${t}`)}async getMonitoringStatus(){return this.request("/monitoring/status")}async getMonitoringMetrics(){return this.request("/monitoring/metrics")}async checkAlerts(){return this.request("/monitoring/alerts/check")}async getAlertHistory(t=100){return this.request(`/monitoring/alerts/history?limit=${t}`)}async getMonitoringConfig(){return this.request("/monitoring/config")}async updateMonitoringConfig(t){return this.request("/monitoring/config",{method:"PUT",body:t})}async getMonitoringThresholds(){return this.request("/monitoring/thresholds")}async updateMonitoringThresholds(t){return this.request("/monitoring/thresholds",{method:"PUT",body:t})}async startMonitoring(){return this.request("/monitoring/start",{method:"POST"})}async stopMonitoring(){return this.request("/monitoring/stop",{method:"POST"})}async testEmailAlert(t){return this.request("/monitoring/test/email",{method:"POST",body:{email:t}})}async testWebhookAlert(t){return this.request("/monitoring/test/webhook",{method:"POST",body:{webhook_url:t}})}async getBackups(t=null){const n=t?`?type=${t}`:"";return this.request(`/backups${n}`)}async getBackupStats(){return this.request("/backups/stats")}async getBackupConfig(){return this.request("/backups/config")}async updateBackupConfig(t){return this.request("/backups/config",{method:"PUT",body:t})}async backupApplication(t,n=!1,r=null){return this.request("/backups/application",{method:"POST",body:{application_id:t,include_db:n,db_config:r}})}async backupDatabase(t,n,r=null,a=null,i="localhost"){return this.request("/backups/database",{method:"POST",body:{db_type:t,db_name:n,user:r,password:a,host:i}})}async restoreApplication(t,n=null){return this.request("/backups/restore/application",{method:"POST",body:{backup_path:t,restore_path:n}})}async restoreDatabase(t,n,r,a=null,i=null,l="localhost"){return this.request("/backups/restore/database",{method:"POST",body:{backup_path:t,db_type:n,db_name:r,user:a,password:i,host:l}})}async deleteBackup(t){return this.request(`/backups/${encodeURIComponent(t)}`,{method:"DELETE"})}async cleanupBackups(t=null){return this.request("/backups/cleanup",{method:"POST",body:t?{retention_days:t}:{}})}async getBackupSchedules(){return this.request("/backups/schedules")}async addBackupSchedule(t,n,r,a,i=null){return this.request("/backups/schedules",{method:"POST",body:{name:t,backup_type:n,target:r,schedule_time:a,days:i}})}async removeBackupSchedule(t){return this.request(`/backups/schedules/${t}`,{method:"DELETE"})}async getDeployConfig(t){return this.request(`/deploy/apps/${t}/config`)}async configureDeployment(t,n,r="main",a=!0,i=null,l=null){return this.request(`/deploy/apps/${t}/config`,{method:"POST",body:{repo_url:n,branch:r,auto_deploy:a,pre_deploy_script:i,post_deploy_script:l}})}async removeDeployment(t){return this.request(`/deploy/apps/${t}/config`,{method:"DELETE"})}async triggerDeploy(t,n=!1){return this.request(`/deploy/apps/${t}/deploy`,{method:"POST",body:{force:n}})}async pullChanges(t,n=null){return this.request(`/deploy/apps/${t}/pull`,{method:"POST",body:n?{branch:n}:{}})}async getGitStatus(t){return this.request(`/deploy/apps/${t}/git-status`)}async getCommitInfo(t){return this.request(`/deploy/apps/${t}/commit`)}async getDeploymentHistory(t=null,n=50){const r=new URLSearchParams({limit:n});return t&&r.append("app_id",t),this.request(`/deploy/history?${r}`)}async cloneRepository(t,n,r="main"){return this.request("/deploy/clone",{method:"POST",body:{app_path:t,repo_url:n,branch:r}})}async browseFiles(t="/home",n=!1){const r=new URLSearchParams({path:t,show_hidden:n});return this.request(`/files/browse?${r}`)}async getFileInfo(t){return this.request(`/files/info?path=${encodeURIComponent(t)}`)}async readFile(t){return this.request(`/files/read?path=${encodeURIComponent(t)}`)}async writeFile(t,n,r=!0){return this.request("/files/write",{method:"POST",body:{path:t,content:n,create_backup:r}})}async createFile(t,n=""){return this.request("/files/create",{method:"POST",body:{path:t,content:n}})}async createDirectory(t){return this.request("/files/mkdir",{method:"POST",body:{path:t}})}async deleteFile(t){return this.request(`/files/delete?path=${encodeURIComponent(t)}`,{method:"DELETE"})}async renameFile(t,n){return this.request("/files/rename",{method:"POST",body:{path:t,new_name:n}})}async copyFile(t,n){return this.request("/files/copy",{method:"POST",body:{src:t,dest:n}})}async moveFile(t,n){return this.request("/files/move",{method:"POST",body:{src:t,dest:n}})}async changeFilePermissions(t,n){return this.request("/files/chmod",{method:"POST",body:{path:t,mode:n}})}async searchFiles(t,n,r=100){const a=new URLSearchParams({directory:t,pattern:n,max_results:r});return this.request(`/files/search?${a}`)}async getDiskUsage(t="/"){return this.request(`/files/disk-usage?path=${encodeURIComponent(t)}`)}async downloadFile(t){const n=this.getToken(),r=`${this.baseUrl}/files/download?path=${encodeURIComponent(t)}`;window.open(`${r}&token=${n}`,"_blank")}async uploadFile(t,n,r=null){const a=this.getToken(),i=new FormData;return i.append("file",n),i.append("destination",t),new Promise((l,c)=>{const o=new XMLHttpRequest;o.open("POST",`${this.baseUrl}/files/upload`),o.setRequestHeader("Authorization",`Bearer ${a}`),r&&(o.upload.onprogress=u=>{u.lengthComputable&&r(u.loaded/u.total*100)}),o.onload=()=>{o.status>=200&&o.status<300?l(JSON.parse(o.responseText)):c(new Error(JSON.parse(o.responseText).error||"Upload failed"))},o.onerror=()=>c(new Error("Upload failed")),o.send(i)})}async getFTPStatus(){return this.request("/ftp/status")}async controlFTPService(t,n=null){return this.request(`/ftp/service/${t}`,{method:"POST",body:n?{service:n}:{}})}async getFTPConfig(t=null){const n=t?`?service=${t}`:"";return this.request(`/ftp/config${n}`)}async updateFTPConfig(t,n=null){return this.request("/ftp/config",{method:"POST",body:{config:t,service:n}})}async getFTPUsers(){return this.request("/ftp/users")}async createFTPUser(t,n=null,r=null){return this.request("/ftp/users",{method:"POST",body:{username:t,password:n,home_dir:r}})}async deleteFTPUser(t,n=!1){const r=n?"?delete_home=true":"";return this.request(`/ftp/users/${t}${r}`,{method:"DELETE"})}async changeFTPPassword(t,n=null){return this.request(`/ftp/users/${t}/password`,{method:"POST",body:n?{password:n}:{}})}async toggleFTPUser(t,n){return this.request(`/ftp/users/${t}/toggle`,{method:"POST",body:{enabled:n}})}async getFTPConnections(){return this.request("/ftp/connections")}async disconnectFTPSession(t){return this.request(`/ftp/connections/${t}`,{method:"DELETE"})}async getFTPLogs(t=100){return this.request(`/ftp/logs?lines=${t}`)}async installFTPServer(t="vsftpd"){return this.request("/ftp/install",{method:"POST",body:{service:t}})}async testFTPConnection(t="localhost",n=21,r=null,a=null){return this.request("/ftp/test",{method:"POST",body:{host:t,port:n,username:r,password:a}})}async getFirewallStatus(){return this.request("/firewall/status")}async enableFirewall(t=null){return this.request("/firewall/enable",{method:"POST",body:t?{firewall:t}:{}})}async disableFirewall(t=null){return this.request("/firewall/disable",{method:"POST",body:t?{firewall:t}:{}})}async getFirewallRules(t=null){const n=t?`?firewall=${t}`:"";return this.request(`/firewall/rules${n}`)}async addFirewallRule(t){return this.request("/firewall/rules",{method:"POST",body:t})}async removeFirewallRule(t){return this.request("/firewall/rules",{method:"DELETE",body:t})}async blockIP(t,n=!0){return this.request("/firewall/block-ip",{method:"POST",body:{ip:t,permanent:n}})}async unblockIP(t,n=!0){return this.request("/firewall/unblock-ip",{method:"POST",body:{ip:t,permanent:n}})}async getBlockedIPs(){return this.request("/firewall/blocked-ips")}async allowPort(t,n="tcp",r=!0){return this.request("/firewall/allow-port",{method:"POST",body:{port:t,protocol:n,permanent:r}})}async denyPort(t,n="tcp",r=!0){return this.request("/firewall/deny-port",{method:"POST",body:{port:t,protocol:n,permanent:r}})}async getFirewallZones(){return this.request("/firewall/zones")}async setDefaultZone(t){return this.request("/firewall/zones/default",{method:"POST",body:{zone:t}})}async installFirewall(t="ufw"){return this.request("/firewall/install",{method:"POST",body:{firewall:t}})}}const b=new _x,wh=d.createContext(null);function Ex({children:e}){const[t,n]=d.useState(null),[r,a]=d.useState(!0);d.useEffect(()=>{i()},[]);async function i(){if(localStorage.getItem("access_token"))try{const v=await b.getCurrentUser();n(v.user)}catch(v){console.error("Auth check failed:",v),b.clearTokens()}a(!1)}async function l(p,v){const N=await b.login(p,v);return n(N.user),N}async function c(p,v,N){const j=await b.register(p,v,N);return n(j.user),j}function o(){b.logout(),n(null)}async function u(p){const v=await b.updateCurrentUser(p);return n(v.user),v}async function f(){const p=await b.getCurrentUser();return n(p.user),p.user}const h={user:t,loading:r,login:l,register:c,logout:o,updateUser:u,refreshUser:f,isAuthenticated:!!t,isAdmin:(t==null?void 0:t.role)==="admin"};return s.jsx(wh.Provider,{value:h,children:e})}function rs(){const e=d.useContext(wh);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const kh=d.createContext(null);function Se(){const e=d.useContext(kh);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}let Tx=0;function Lx({children:e}){const[t,n]=d.useState([]),r=d.useCallback(f=>{n(h=>h.filter(p=>p.id!==f))},[]),a=d.useCallback((f,h="info",p=5e3)=>{const v=++Tx,N={id:v,message:f,type:h};return n(j=>[...j,N]),p>0&&setTimeout(()=>r(v),p),v},[r]),i=d.useCallback((f,h)=>a(f,"success",h),[a]),l=d.useCallback((f,h)=>a(f,"error",h),[a]),c=d.useCallback((f,h)=>a(f,"warning",h),[a]),o=d.useCallback((f,h)=>a(f,"info",h),[a]),u={toasts:t,addToast:a,removeToast:r,success:i,error:l,warning:c,info:o};return s.jsx(kh.Provider,{value:u,children:e})}/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */var Dx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Fx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const re=(e,t)=>{const n=d.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:c="",children:o,...u},f)=>d.createElement("svg",{ref:f,...Dx,width:a,height:a,stroke:r,strokeWidth:l?Number(i)*24/Number(a):i,className:["lucide",`lucide-${Fx(e)}`,c].join(" "),...u},[...t.map(([h,p])=>d.createElement(h,p)),...Array.isArray(o)?o:[o]]));return n.displayName=`${e}`,n};/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Mx=re("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ax=re("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const $x=re("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Sh=re("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Rx=re("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ox=re("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Bx=re("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Qc=re("Container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ix=re("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const qx=re("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ux=re("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Pn=re("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const zx=re("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const bo=re("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const pi=re("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Vx=re("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const fi=re("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Hx=re("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const pa=re("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const xl=re("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Wx=re("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Ch=re("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const br=re("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Qx=re("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Kx=re("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Aa=re("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
+ * @license lucide-react v0.363.0 - ISC
+ *
+ * This source code is licensed under the ISC license.
+ * See the LICENSE file in the root directory of this source tree.
+ */const Gx=re("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yx={success:Sh,error:Rx,warning:Aa,info:bo};function Xx({toast:e,onDismiss:t}){const n=Yx[e.type]||bo;return s.jsxs("div",{className:`toast toast-${e.type}`,children:[s.jsx("div",{className:"toast-icon",children:s.jsx(n,{size:18})}),s.jsx("div",{className:"toast-message",children:e.message}),s.jsx("button",{className:"toast-dismiss",onClick:()=>t(e.id),children:s.jsx(Gx,{size:14})})]})}function Jx(){const{toasts:e,removeToast:t}=Se();return e.length===0?null:s.jsx("div",{className:"toast-container",children:e.map(n=>s.jsx(Xx,{toast:n,onDismiss:t},n.id))})}const Zx=()=>{var n;const{user:e,logout:t}=rs();return s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"brand",children:[s.jsx("div",{className:"brand-logo",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",stroke:"currentColor",fill:"none",strokeWidth:"2",children:s.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),"ServerKit"]}),s.jsx("div",{className:"menu-label",children:"Overview"}),s.jsx("nav",{className:"nav",children:s.jsxs(qe,{to:"/",className:({isActive:r})=>`nav-item ${r?"active":""}`,end:!0,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),"Dashboard"]})}),s.jsx("div",{className:"menu-label",children:"Infrastructure"}),s.jsxs("nav",{className:"nav",children:[s.jsxs(qe,{to:"/domains",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),s.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),"Domains & Sites"]}),s.jsxs(qe,{to:"/apps",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),s.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),s.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Applications"]}),s.jsxs(qe,{to:"/databases",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),s.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]}),"Databases"]}),s.jsxs(qe,{to:"/ssl",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),s.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"SSL Certificates"]}),s.jsxs(qe,{to:"/docker",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("rect",{x:"2",y:"7",width:"6",height:"6",rx:"1"}),s.jsx("rect",{x:"9",y:"7",width:"6",height:"6",rx:"1"}),s.jsx("rect",{x:"16",y:"7",width:"6",height:"6",rx:"1"}),s.jsx("rect",{x:"2",y:"14",width:"6",height:"6",rx:"1"}),s.jsx("rect",{x:"9",y:"14",width:"6",height:"6",rx:"1"})]}),"Docker"]}),s.jsxs(qe,{to:"/php",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("ellipse",{cx:"12",cy:"12",rx:"10",ry:"6"}),s.jsx("text",{x:"12",y:"15",textAnchor:"middle",fontSize:"8",fill:"currentColor",stroke:"none",children:"php"})]}),"PHP"]}),s.jsxs(qe,{to:"/firewall",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsx("svg",{viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),"Firewall"]})]}),s.jsx("div",{className:"menu-label",children:"Operations"}),s.jsxs("nav",{className:"nav",children:[s.jsxs(qe,{to:"/files",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsx("svg",{viewBox:"0 0 24 24",children:s.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),"File Manager"]}),s.jsxs(qe,{to:"/ftp",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),s.jsx("polyline",{points:"17 8 12 3 7 8"}),s.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),"FTP Server"]}),s.jsxs(qe,{to:"/monitoring",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsx("svg",{viewBox:"0 0 24 24",children:s.jsx("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"})}),"Monitoring"]}),s.jsxs(qe,{to:"/backups",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),s.jsx("polyline",{points:"7 10 12 15 17 10"}),s.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Backups"]})]}),s.jsx("div",{className:"menu-label",children:"System"}),s.jsxs("nav",{className:"nav",children:[s.jsxs(qe,{to:"/terminal",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsx("svg",{viewBox:"0 0 24 24",children:s.jsx("path",{d:"M4 17l6-6-6-6M12 19h8"})}),"Terminal / Logs"]}),s.jsxs(qe,{to:"/settings",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[s.jsxs("svg",{viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),"Settings"]})]}),s.jsxs("div",{className:"user-profile",children:[s.jsx("div",{className:"avatar",children:((n=e==null?void 0:e.username)==null?void 0:n.charAt(0).toUpperCase())||"U"}),s.jsxs("div",{style:{flex:1,fontSize:"13px"},children:[s.jsx("div",{style:{fontWeight:600},children:(e==null?void 0:e.username)||"User"}),s.jsx("div",{style:{color:"var(--text-tertiary)"},children:(e==null?void 0:e.role)||"user"})]}),s.jsx("button",{onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:"4px"},title:"Logout",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),s.jsx("polyline",{points:"16 17 21 12 16 7"}),s.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})]})},ev=()=>s.jsxs("div",{className:"dashboard-layout",children:[s.jsx(Zx,{}),s.jsxs("main",{className:"main-content",children:[s.jsx("div",{className:"header",children:s.jsx("h2",{children:"Dashboard"})}),s.jsx(ux,{})]})]}),jt=Object.create(null);jt.open="0";jt.close="1";jt.ping="2";jt.pong="3";jt.message="4";jt.upgrade="5";jt.noop="6";const Rr=Object.create(null);Object.keys(jt).forEach(e=>{Rr[jt[e]]=e});const vl={type:"error",data:"parser error"},Ph=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",_h=typeof ArrayBuffer=="function",Eh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,wo=({type:e,data:t},n,r)=>Ph&&t instanceof Blob?n?r(t):Kc(t,r):_h&&(t instanceof ArrayBuffer||Eh(t))?n?r(t):Kc(new Blob([t]),r):r(jt[e]+(t||"")),Kc=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Gc(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xi;function tv(e,t){if(Ph&&e.data instanceof Blob)return e.data.arrayBuffer().then(Gc).then(t);if(_h&&(e.data instanceof ArrayBuffer||Eh(e.data)))return t(Gc(e.data));wo(e,!1,n=>{xi||(xi=new TextEncoder),t(xi.encode(n))})}const Yc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Yc.length;e++)vn[Yc.charCodeAt(e)]=e;const sv=e=>{let t=e.length*.75,n=e.length,r,a=0,i,l,c,o;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r<n;r+=4)i=vn[e.charCodeAt(r)],l=vn[e.charCodeAt(r+1)],c=vn[e.charCodeAt(r+2)],o=vn[e.charCodeAt(r+3)],f[a++]=i<<2|l>>4,f[a++]=(l&15)<<4|c>>2,f[a++]=(c&3)<<6|o&63;return u},nv=typeof ArrayBuffer=="function",ko=(e,t)=>{if(typeof e!="string")return{type:"message",data:Th(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:rv(e.substring(1),t)}:Rr[n]?e.length>1?{type:Rr[n],data:e.substring(1)}:{type:Rr[n]}:vl},rv=(e,t)=>{if(nv){const n=sv(e);return Th(n,t)}else return{base64:!0,data:e}},Th=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Lh="",av=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((i,l)=>{wo(i,!1,c=>{r[l]=c,++a===n&&t(r.join(Lh))})})},iv=(e,t)=>{const n=e.split(Lh),r=[];for(let a=0;a<n.length;a++){const i=ko(n[a],t);if(r.push(i),i.type==="error")break}return r};function lv(){return new TransformStream({transform(e,t){tv(e,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const i=new DataView(a.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{a=new Uint8Array(9);const i=new DataView(a.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let vi;function wr(e){return e.reduce((t,n)=>t+n.length,0)}function kr(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;a<t;a++)n[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function ov(e,t){vi||(vi=new TextDecoder);const n=[];let r=0,a=-1,i=!1;return new TransformStream({transform(l,c){for(n.push(l);;){if(r===0){if(wr(n)<1)break;const o=kr(n,1);i=(o[0]&128)===128,a=o[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(wr(n)<2)break;const o=kr(n,2);a=new DataView(o.buffer,o.byteOffset,o.length).getUint16(0),r=3}else if(r===2){if(wr(n)<8)break;const o=kr(n,8),u=new DataView(o.buffer,o.byteOffset,o.length),f=u.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(vl);break}a=f*Math.pow(2,32)+u.getUint32(4),r=3}else{if(wr(n)<a)break;const o=kr(n,a);c.enqueue(ko(i?o:vi.decode(o),t)),r=0}if(a===0||a>e){c.enqueue(vl);break}}}})}const Dh=4;function je(e){if(e)return cv(e)}function cv(e){for(var t in je.prototype)e[t]=je.prototype[t];return e}je.prototype.on=je.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};je.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};je.prototype.off=je.prototype.removeListener=je.prototype.removeAllListeners=je.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===t||r.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};je.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,t)}return this};je.prototype.emitReserved=je.prototype.emit;je.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};je.prototype.hasListeners=function(e){return!!this.listeners(e).length};const $a=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),tt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),dv="arraybuffer";function Fh(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const uv=tt.setTimeout,hv=tt.clearTimeout;function Ra(e,t){t.useNativeTimers?(e.setTimeoutFn=uv.bind(tt),e.clearTimeoutFn=hv.bind(tt)):(e.setTimeoutFn=tt.setTimeout.bind(tt),e.clearTimeoutFn=tt.clearTimeout.bind(tt))}const mv=1.33;function pv(e){return typeof e=="string"?fv(e):Math.ceil((e.byteLength||e.size)*mv)}function fv(e){let t=0,n=0;for(let r=0,a=e.length;r<a;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Mh(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function xv(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function vv(e){let t={},n=e.split("&");for(let r=0,a=n.length;r<a;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class gv extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class So extends je{constructor(t){super(),this.writable=!1,Ra(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new gv(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=ko(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=xv(t);return n.length?"?"+n:""}}class yv extends So{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};iv(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,av(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Mh()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Ah=!1;try{Ah=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jv=Ah;function Nv(){}class bv extends yv{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(a,i)=>{this.onError("xhr post error",a,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class yt extends je{constructor(t,n,r){super(),this.createRequest=t,Ra(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Fh(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=yt.requestsCount++,yt.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Nv,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete yt.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}yt.requestsCount=0;yt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Xc);else if(typeof addEventListener=="function"){const e="onpagehide"in tt?"pagehide":"unload";addEventListener(e,Xc,!1)}}function Xc(){for(let e in yt.requests)yt.requests.hasOwnProperty(e)&&yt.requests[e].abort()}const wv=function(){const e=$h({xdomain:!1});return e&&e.responseType!==null}();class kv extends bv{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=wv&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new yt($h,this.uri(),t)}}function $h(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||jv))return new XMLHttpRequest}catch{}if(!t)try{return new tt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Rh=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Sv extends So{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Rh?{}:Fh(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;wo(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}a&&$a(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Mh()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const gi=tt.WebSocket||tt.MozWebSocket;class Cv extends Sv{createSocket(t,n,r){return Rh?new gi(t,n,r):n?new gi(t,n):new gi(t)}doWrite(t,n){this.ws.send(n)}}class Pv extends So{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=ov(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=lv();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const i=()=>{r.read().then(({done:c,value:o})=>{c||(this.onPacket(o),i())}).catch(c=>{})};i();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;this._writer.write(r).then(()=>{a&&$a(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const _v={websocket:Cv,webtransport:Pv,polling:kv},Ev=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Tv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function gl(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let a=Ev.exec(e||""),i={},l=14;for(;l--;)i[Tv[l]]=a[l]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Lv(i,i.path),i.queryKey=Dv(i,i.query),i}function Lv(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Dv(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,i){a&&(n[a]=i)}),n}const yl=typeof addEventListener=="function"&&typeof removeEventListener=="function",Or=[];yl&&addEventListener("offline",()=>{Or.forEach(e=>e())},!1);class Xt extends je{constructor(t,n){if(super(),this.binaryType=dv,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=gl(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=gl(n.host).host);Ra(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=vv(this.opts.query)),yl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Or.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Dh,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Xt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Xt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const a=this.writeBuffer[r].data;if(a&&(n+=pv(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,$a(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Xt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),yl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Or.indexOf(this._offlineEventListener);r!==-1&&Or.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Xt.protocol=Dh;class Fv extends Xt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Xt.priorWebsocketSuccess=!1;const a=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function i(){r||(r=!0,f(),n.close(),n=null)}const l=h=>{const p=new Error("probe error: "+h);p.transport=n.name,i(),this.emitReserved("upgradeError",p)};function c(){l("transport closed")}function o(){l("socket closed")}function u(h){n&&h.name!==n.name&&i()}const f=()=>{n.removeListener("open",a),n.removeListener("error",l),n.removeListener("close",c),this.off("close",o),this.off("upgrading",u)};n.once("open",a),n.once("error",l),n.once("close",c),this.once("close",o),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Mv=class extends Fv{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(a=>_v[a]).filter(a=>!!a)),super(t,r)}};function Av(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=gl(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const $v=typeof ArrayBuffer=="function",Rv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Oh=Object.prototype.toString,Ov=typeof Blob=="function"||typeof Blob<"u"&&Oh.call(Blob)==="[object BlobConstructor]",Bv=typeof File=="function"||typeof File<"u"&&Oh.call(File)==="[object FileConstructor]";function Co(e){return $v&&(e instanceof ArrayBuffer||Rv(e))||Ov&&e instanceof Blob||Bv&&e instanceof File}function Br(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Br(e[n]))return!0;return!1}if(Co(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Br(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Br(e[n]))return!0;return!1}function Iv(e){const t=[],n=e.data,r=e;return r.data=jl(n,t),r.attachments=t.length,{packet:r,buffers:t}}function jl(e,t){if(!e)return e;if(Co(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=jl(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=jl(e[r],t));return n}return e}function qv(e,t){return e.data=Nl(e.data,t),delete e.attachments,e}function Nl(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Nl(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Nl(e[n],t));return e}const Bh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Uv=5;var X;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(X||(X={}));class zv{constructor(t){this.replacer=t}encode(t){return(t.type===X.EVENT||t.type===X.ACK)&&Br(t)?this.encodeAsBinary({type:t.type===X.EVENT?X.BINARY_EVENT:X.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===X.BINARY_EVENT||t.type===X.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=Iv(t),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}class Po extends je{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===X.BINARY_EVENT;r||n.type===X.BINARY_ACK?(n.type=r?X.EVENT:X.ACK,this.reconstructor=new Vv(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Co(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(X[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===X.BINARY_EVENT||r.type===X.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const l=t.substring(i,n);if(l!=Number(l)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(l)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const i=n+1;for(;++n;){const l=t.charAt(n);if(l==null||Number(l)!=l){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Po.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case X.CONNECT:return fa(n);case X.DISCONNECT:return n===void 0;case X.CONNECT_ERROR:return typeof n=="string"||fa(n);case X.EVENT:case X.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Bh.indexOf(n[0])===-1);case X.ACK:case X.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Vv{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=qv(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Hv(e){return typeof e=="string"}const Wv=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Qv(e){return e===void 0||Wv(e)}function fa(e){return Object.prototype.toString.call(e)==="[object Object]"}function Kv(e,t){switch(e){case X.CONNECT:return t===void 0||fa(t);case X.DISCONNECT:return t===void 0;case X.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Bh.indexOf(t[0])===-1);case X.ACK:return Array.isArray(t);case X.CONNECT_ERROR:return typeof t=="string"||fa(t);default:return!1}}function Gv(e){return Hv(e.nsp)&&Qv(e.id)&&Kv(e.type,e.data)}const Yv=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Po,Encoder:zv,get PacketType(){return X},isPacketValid:Gv,protocol:Uv},Symbol.toStringTag,{value:"Module"}));function ct(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Xv=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ih extends je{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ct(t,"open",this.onopen.bind(this)),ct(t,"packet",this.onpacket.bind(this)),ct(t,"error",this.onerror.bind(this)),ct(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,a,i;if(Xv.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const l={type:X.EVENT,data:n};if(l.options={},l.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const f=this.ids++,h=n.pop();this._registerAckCallback(f,h),l.id=f}const c=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,o=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!c||(o?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l)),this.flags={},this}_registerAckCallback(t,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},a),l=(...c)=>{this.io.clearTimeoutFn(i),n.apply(this,c)};l.withError=!0,this.acks[t]=l}emitWithAck(t,...n){return new Promise((r,a)=>{const i=(l,c)=>l?a(l):r(c);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...i)=>(this._queue[0],a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:X.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case X.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case X.EVENT:case X.BINARY_EVENT:this.onevent(t);break;case X.ACK:case X.BINARY_ACK:this.onack(t);break;case X.DISCONNECT:this.ondisconnect();break;case X.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:X.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:X.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function sn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}sn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};sn.prototype.reset=function(){this.attempts=0};sn.prototype.setMin=function(e){this.ms=e};sn.prototype.setMax=function(e){this.max=e};sn.prototype.setJitter=function(e){this.jitter=e};class bl extends je{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ra(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new sn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||Yv;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Mv(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=ct(n,"open",function(){r.onopen(),t&&t()}),i=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},l=ct(n,"error",i);if(this._timeout!==!1){const c=this._timeout,o=this.setTimeoutFn(()=>{a(),i(new Error("timeout")),n.close()},c);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}return this.subs.push(a),this.subs.push(l),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ct(t,"ping",this.onping.bind(this)),ct(t,"data",this.ondata.bind(this)),ct(t,"error",this.onerror.bind(this)),ct(t,"close",this.onclose.bind(this)),ct(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){$a(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Ih(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const hn={};function Ir(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Av(e,t.path||"/socket.io"),r=n.source,a=n.id,i=n.path,l=hn[a]&&i in hn[a].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let o;return c?o=new bl(r,t):(hn[a]||(hn[a]=new bl(r,t)),o=hn[a]),n.query&&!t.query&&(t.query=n.queryKey),o.socket(n.path,t)}Object.assign(Ir,{Manager:bl,Socket:Ih,io:Ir,connect:Ir});const Jv="http://localhost:5000";class Zv{constructor(){this.socket=null,this.listeners=new Map}connect(){var n;const t=localStorage.getItem("access_token");if(!t){console.warn("No token available for WebSocket connection");return}(n=this.socket)!=null&&n.connected||(this.socket=Ir(Jv,{query:{token:t},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3}),this.socket.on("connect",()=>{console.log("WebSocket connected"),this.emit("connected")}),this.socket.on("disconnect",r=>{console.log("WebSocket disconnected:",r),this.emit("disconnected",r)}),this.socket.on("error",r=>{console.error("WebSocket error:",r),this.emit("error",r)}),this.socket.on("metrics",r=>{this.emit("metrics",r)}),this.socket.on("log_line",r=>{this.emit("log_line",r)}),this.socket.on("log_error",r=>{this.emit("log_error",r)}))}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null)}subscribeMetrics(){var t;(t=this.socket)!=null&&t.connected&&this.socket.emit("subscribe_metrics")}unsubscribeMetrics(){var t;(t=this.socket)!=null&&t.connected&&this.socket.emit("unsubscribe_metrics")}subscribeLogs(t){var n;(n=this.socket)!=null&&n.connected&&this.socket.emit("subscribe_logs",{path:t})}unsubscribeLogs(){var t;(t=this.socket)!=null&&t.connected&&this.socket.emit("unsubscribe_logs")}on(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),()=>{var r;(r=this.listeners.get(t))==null||r.delete(n)}}off(t,n){var r;(r=this.listeners.get(t))==null||r.delete(n)}emit(t,n){var r;(r=this.listeners.get(t))==null||r.forEach(a=>{try{a(n)}catch(i){console.error("Socket listener error:",i)}})}}const is=new Zv;function eg(e=!0){const[t,n]=d.useState(null),[r,a]=d.useState(!0),[i,l]=d.useState(null),[c,o]=d.useState(!1),u=d.useCallback(async()=>{try{const f=await b.getSystemMetrics();n(f),l(null)}catch(f){l(f.message)}finally{a(!1)}},[]);return d.useEffect(()=>{if(u(),e){is.connect();const f=is.on("connected",()=>{o(!0),is.subscribeMetrics()}),h=is.on("disconnected",()=>{o(!1)}),p=is.on("metrics",N=>{n(N),a(!1)}),v=is.on("error",N=>{l(N.message||"WebSocket error")});return()=>{f(),h(),p(),v(),is.unsubscribeMetrics()}}else{const f=setInterval(u,5e3);return()=>clearInterval(f)}},[e,u]),{metrics:t,loading:r,error:i,connected:c,refresh:u}}const tg=()=>{var g,y,S,E,T,P,O,w,L,U,V,H,B,z,J,R,_,I,Q,Y,ve,ne,C,G,F,ee,ge,D,W,fe,Ce,bt,as,A,Ne,Ns,Jn,Zn,er,tr,sr,nr;const e=ns(),{metrics:t,loading:n,connected:r}=eg(!0),[a,i]=d.useState([]),[l,c]=d.useState([]),[o,u]=d.useState(null),[f,h]=d.useState(!0);d.useEffect(()=>{p()},[]);async function p(){try{const[K,De,Ia]=await Promise.all([b.getApps(),b.getServicesStatus().catch(()=>({services:[]})),b.getDatabasesStatus().catch(()=>null)]);i(K.apps||[]),c(De.services||[]),u(Ia)}catch(K){console.error("Failed to load data:",K)}finally{h(!1)}}function v(K){switch(K){case"running":return"status-active";case"stopped":return"status-stopped";case"error":return"status-error";default:return"status-warning"}}function N(K){switch(K){case"docker":return s.jsx(Qc,{size:20});case"wordpress":case"php":return s.jsx(Bx,{size:20});case"flask":case"django":return s.jsx(pi,{size:20});default:return s.jsx(Pn,{size:20})}}function j(K){return{php:"#777bb4",wordpress:"#21759b",flask:"#000000",django:"#092e20",docker:"#2496ed",static:"#60a5fa"}[K]||"#6366f1"}function k(K){if(!K)return{days:0,hours:0,minutes:0};const De=K.match(/(\d+)d\s*(\d+)h\s*(\d+)m|(\d+)h\s*(\d+)m|(\d+)m/);return De?De[1]?{days:parseInt(De[1]),hours:parseInt(De[2]),minutes:parseInt(De[3])}:De[4]?{days:0,hours:parseInt(De[4]),minutes:parseInt(De[5])}:{days:0,hours:0,minutes:parseInt(De[6])}:{days:0,hours:0,minutes:0}}const m=k((g=t==null?void 0:t.system)==null?void 0:g.uptime_human),x=a.filter(K=>K.status==="running").length;return l.filter(K=>K.status==="running").length,f&&n?s.jsx("div",{className:"loading",children:"Loading dashboard..."}):s.jsxs("div",{children:[s.jsxs("header",{className:"top-bar",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Dashboard"}),s.jsxs("div",{className:"subtitle",children:["Overview of your server status and applications",r&&s.jsx("span",{className:"live-indicator",children:" Live"})]})]}),s.jsxs("div",{className:"top-bar-actions",children:[s.jsxs("button",{className:"btn btn-secondary",onClick:p,children:[s.jsx(xl,{size:16}),"Refresh"]}),s.jsxs("button",{className:"btn btn-primary",onClick:()=>e("/apps"),children:[s.jsx(pa,{size:16}),"New Application"]})]})]}),(t==null?void 0:t.system)&&s.jsxs("div",{className:"uptime-display",children:[s.jsx(Ch,{size:24,style:{color:"var(--success)"}}),s.jsxs("div",{style:{flex:1},children:[s.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"Server Uptime"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[s.jsxs("div",{className:"uptime-item",children:[s.jsx("span",{className:"uptime-value",children:m.days}),s.jsx("span",{className:"uptime-label",children:"Days"})]}),s.jsx("span",{className:"uptime-separator",children:":"}),s.jsxs("div",{className:"uptime-item",children:[s.jsx("span",{className:"uptime-value",children:String(m.hours).padStart(2,"0")}),s.jsx("span",{className:"uptime-label",children:"Hours"})]}),s.jsx("span",{className:"uptime-separator",children:":"}),s.jsxs("div",{className:"uptime-item",children:[s.jsx("span",{className:"uptime-value",children:String(m.minutes).padStart(2,"0")}),s.jsx("span",{className:"uptime-label",children:"Minutes"})]})]})]}),s.jsxs("div",{style:{textAlign:"right"},children:[s.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:(y=t.system)==null?void 0:y.hostname}),s.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:(S=t.system)==null?void 0:S.platform})]})]}),t&&s.jsxs("div",{className:"system-metrics",children:[s.jsxs("div",{className:"metric-card",children:[s.jsxs("div",{className:"metric-header",children:[s.jsx("h4",{children:"CPU Usage"}),s.jsx(Ix,{size:18,className:"metric-icon"})]}),s.jsxs("div",{className:"metric-main",children:[s.jsx("span",{className:"metric-value",children:((E=t.cpu)==null?void 0:E.percent)||0}),s.jsx("span",{className:"metric-unit",children:"%"})]}),s.jsx("div",{className:"progress-bar",children:s.jsx("div",{className:"progress-fill",style:{width:`${((T=t.cpu)==null?void 0:T.percent)||0}%`,background:(((P=t.cpu)==null?void 0:P.percent)||0)>80?"var(--danger)":(((O=t.cpu)==null?void 0:O.percent)||0)>60?"var(--warning)":"var(--success)"}})}),s.jsxs("div",{className:"metric-sub",children:[(w=t.cpu)==null?void 0:w.cores," cores @ ",(L=t.cpu)==null?void 0:L.frequency_mhz," MHz"]})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("div",{className:"metric-header",children:[s.jsx("h4",{children:"Memory"}),s.jsx(Hx,{size:18,className:"metric-icon"})]}),s.jsxs("div",{className:"metric-main",children:[s.jsx("span",{className:"metric-value",children:((V=(U=t.memory)==null?void 0:U.ram)==null?void 0:V.percent)||0}),s.jsx("span",{className:"metric-unit",children:"%"})]}),s.jsx("div",{className:"progress-bar",children:s.jsx("div",{className:"progress-fill",style:{width:`${((B=(H=t.memory)==null?void 0:H.ram)==null?void 0:B.percent)||0}%`,background:"var(--accent-primary)"}})}),s.jsxs("div",{className:"metric-sub",children:[(J=(z=t.memory)==null?void 0:z.ram)==null?void 0:J.used_human," / ",(_=(R=t.memory)==null?void 0:R.ram)==null?void 0:_.total_human]})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("div",{className:"metric-header",children:[s.jsx("h4",{children:"Disk Space"}),s.jsx(zx,{size:18,className:"metric-icon"})]}),s.jsxs("div",{className:"metric-main",children:[s.jsx("span",{className:"metric-value",children:((Y=(Q=(I=t.disk)==null?void 0:I.partitions)==null?void 0:Q[0])==null?void 0:Y.percent)||0}),s.jsx("span",{className:"metric-unit",children:"%"})]}),s.jsx("div",{className:"progress-bar",children:s.jsx("div",{className:"progress-fill",style:{width:`${((C=(ne=(ve=t.disk)==null?void 0:ve.partitions)==null?void 0:ne[0])==null?void 0:C.percent)||0}%`,background:(((ee=(F=(G=t.disk)==null?void 0:G.partitions)==null?void 0:F[0])==null?void 0:ee.percent)||0)>90?"var(--danger)":"var(--accent-primary)"}})}),s.jsxs("div",{className:"metric-sub",children:[(W=(D=(ge=t.disk)==null?void 0:ge.partitions)==null?void 0:D[0])==null?void 0:W.used_human," / ",(bt=(Ce=(fe=t.disk)==null?void 0:fe.partitions)==null?void 0:Ce[0])==null?void 0:bt.total_human]})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("div",{className:"metric-header",children:[s.jsx("h4",{children:"Network I/O"}),s.jsx(Mx,{size:18,className:"metric-icon"})]}),s.jsxs("div",{className:"metric-main",children:[s.jsx("span",{className:"metric-value",style:{fontSize:"18px"},children:((A=(as=t.network)==null?void 0:as.io)==null?void 0:A.bytes_sent_human)||"0B"}),s.jsx("span",{className:"metric-unit",children:"sent"})]}),s.jsxs("div",{className:"metric-sub",children:["Received: ",((Ns=(Ne=t.network)==null?void 0:Ne.io)==null?void 0:Ns.bytes_recv_human)||"0B"]})]})]}),s.jsx("h2",{className:"section-title",children:"Quick Actions"}),s.jsxs("div",{className:"quick-actions",children:[s.jsxs("div",{className:"quick-action-card",onClick:()=>e("/apps"),children:[s.jsx("div",{className:"action-icon",children:s.jsx(pi,{size:24})}),s.jsx("h4",{children:"Applications"}),s.jsxs("p",{children:[x," of ",a.length," running"]})]}),s.jsxs("div",{className:"quick-action-card",onClick:()=>e("/docker"),children:[s.jsx("div",{className:"action-icon",children:s.jsx(Qc,{size:24})}),s.jsx("h4",{children:"Docker"}),s.jsx("p",{children:"Manage containers"})]}),s.jsxs("div",{className:"quick-action-card",onClick:()=>e("/databases"),children:[s.jsx("div",{className:"action-icon",children:s.jsx(qx,{size:24})}),s.jsx("h4",{children:"Databases"}),s.jsx("p",{children:"MySQL & PostgreSQL"})]}),s.jsxs("div",{className:"quick-action-card",onClick:()=>e("/domains"),children:[s.jsx("div",{className:"action-icon",children:s.jsx(Pn,{size:24})}),s.jsx("h4",{children:"Domains"}),s.jsx("p",{children:"Manage sites"})]})]}),l.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",children:"Services"}),s.jsx("div",{className:"services-grid",children:l.map(K=>s.jsxs("div",{className:"service-item",children:[s.jsx("span",{className:`service-dot ${K.status==="running"?"running":"stopped"}`}),s.jsx("span",{className:"service-name",children:K.name}),s.jsx("span",{className:"service-status",children:K.status})]},K.name))})]}),o&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:"32px"},children:"Database Servers"}),s.jsxs("div",{className:"db-status",children:[s.jsxs("div",{className:"db-status-item",children:[s.jsx("div",{className:"status-icon mysql",children:"M"}),s.jsxs("div",{className:"status-info",children:[s.jsx("h3",{children:"MySQL / MariaDB"}),s.jsxs("span",{className:(Jn=o.mysql)!=null&&Jn.running?"running":"stopped",children:[(Zn=o.mysql)!=null&&Zn.running?"Running":"Stopped",((er=o.mysql)==null?void 0:er.version)&&` - ${o.mysql.version}`]})]})]}),s.jsxs("div",{className:"db-status-item",children:[s.jsx("div",{className:"status-icon postgresql",children:"P"}),s.jsxs("div",{className:"status-info",children:[s.jsx("h3",{children:"PostgreSQL"}),s.jsxs("span",{className:(tr=o.postgresql)!=null&&tr.running?"running":"stopped",children:[(sr=o.postgresql)!=null&&sr.running?"Running":"Stopped",((nr=o.postgresql)==null?void 0:nr.version)&&` - ${o.postgresql.version}`]})]})]})]})]}),s.jsxs("div",{className:"section-header",style:{marginTop:"32px"},children:[s.jsx("h2",{className:"section-title",style:{marginBottom:0},children:"Active Projects"}),s.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>e("/apps"),children:["View All ",s.jsx(Ax,{size:14})]})]}),a.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx(pi,{size:48}),s.jsx("h3",{children:"No applications yet"}),s.jsx("p",{children:"Create your first application to get started."}),s.jsxs("button",{className:"btn btn-primary",onClick:()=>e("/apps"),children:[s.jsx(pa,{size:16}),"Create Application"]})]}):s.jsx("div",{className:"dashboard-grid",children:a.slice(0,6).map(K=>s.jsxs("div",{className:"card",onClick:()=>e(`/apps/${K.id}`),children:[s.jsxs("div",{className:"card-header",children:[s.jsx("div",{className:"app-icon",style:{background:j(K.app_type)},children:N(K.app_type)}),s.jsxs("div",{className:`status-badge ${v(K.status)}`,children:[s.jsx("div",{className:"status-dot"}),K.status.charAt(0).toUpperCase()+K.status.slice(1)]})]}),s.jsx("h3",{children:K.name}),K.domains&&K.domains[0]&&s.jsx("a",{href:`https://${K.domains[0].name}`,className:"card-link",target:"_blank",rel:"noopener noreferrer",onClick:De=>De.stopPropagation(),children:K.domains[0].name}),s.jsxs("div",{className:"metric-row",children:[s.jsxs("div",{className:"metric-item",children:[s.jsx("span",{children:"Stack"}),s.jsxs("span",{className:"metric-value",style:{color:j(K.app_type)},children:[K.app_type.toUpperCase(),K.php_version&&` / PHP ${K.php_version}`,K.python_version&&` / Py ${K.python_version}`]})]}),K.port&&s.jsxs("div",{className:"metric-item",children:[s.jsx("span",{children:"Port"}),s.jsx("span",{className:"metric-value",children:K.port})]})]})]},K.id))})]})},sg=()=>{const[e,t]=d.useState(""),[n,r]=d.useState(""),[a,i]=d.useState(""),[l,c]=d.useState(!1),{login:o}=rs(),u=ns();async function f(h){h.preventDefault(),i(""),c(!0);try{await o(e,n),u("/")}catch(p){i(p.message||"Failed to login")}finally{c(!1)}}return s.jsx("div",{className:"auth-container",children:s.jsxs("div",{className:"auth-card",children:[s.jsxs("div",{className:"auth-header",children:[s.jsx("div",{className:"brand-logo",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",stroke:"currentColor",fill:"none",strokeWidth:"2",children:s.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),s.jsx("h1",{children:"ServerKit"}),s.jsx("p",{children:"Sign in to your account"})]}),a&&s.jsx("div",{className:"error-message",children:a}),s.jsxs("form",{onSubmit:f,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{htmlFor:"email",children:"Email"}),s.jsx("input",{type:"email",id:"email",value:e,onChange:h=>t(h.target.value),placeholder:"[email protected]",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{htmlFor:"password",children:"Password"}),s.jsx("input",{type:"password",id:"password",value:n,onChange:h=>r(h.target.value),placeholder:"Enter your password",required:!0})]}),s.jsx("button",{type:"submit",className:"btn btn-primary btn-full",disabled:l,children:l?"Signing in...":"Sign In"})]}),s.jsxs("p",{className:"auth-footer",children:["Don't have an account? ",s.jsx(No,{to:"/register",children:"Create one"})]})]})})},ng=()=>{const[e,t]=d.useState(""),[n,r]=d.useState(""),[a,i]=d.useState(""),[l,c]=d.useState(""),[o,u]=d.useState(""),[f,h]=d.useState(!1),{register:p}=rs(),v=ns();async function N(j){if(j.preventDefault(),u(""),a!==l){u("Passwords do not match");return}if(a.length<8){u("Password must be at least 8 characters");return}h(!0);try{await p(e,n,a),v("/")}catch(k){u(k.message||"Failed to register")}finally{h(!1)}}return s.jsx("div",{className:"auth-container",children:s.jsxs("div",{className:"auth-card",children:[s.jsxs("div",{className:"auth-header",children:[s.jsx("div",{className:"brand-logo",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",stroke:"currentColor",fill:"none",strokeWidth:"2",children:s.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),s.jsx("h1",{children:"ServerKit"}),s.jsx("p",{children:"Create your account"})]}),o&&s.jsx("div",{className:"error-message",children:o}),s.jsxs("form",{onSubmit:N,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{htmlFor:"email",children:"Email"}),s.jsx("input",{type:"email",id:"email",value:e,onChange:j=>t(j.target.value),placeholder:"[email protected]",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{htmlFor:"username",children:"Username"}),s.jsx("input",{type:"text",id:"username",value:n,onChange:j=>r(j.target.value),placeholder:"Choose a username",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{htmlFor:"password",children:"Password"}),s.jsx("input",{type:"password",id:"password",value:a,onChange:j=>i(j.target.value),placeholder:"At least 8 characters",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{htmlFor:"confirmPassword",children:"Confirm Password"}),s.jsx("input",{type:"password",id:"confirmPassword",value:l,onChange:j=>c(j.target.value),placeholder:"Confirm your password",required:!0})]}),s.jsx("button",{type:"submit",className:"btn btn-primary btn-full",disabled:f,children:f?"Creating account...":"Create Account"})]}),s.jsxs("p",{className:"auth-footer",children:["Already have an account? ",s.jsx(No,{to:"/login",children:"Sign in"})]})]})})},rg=()=>{const[e,t]=d.useState([]),[n,r]=d.useState(!0),[a,i]=d.useState(!1),l=ns();d.useEffect(()=>{c()},[]);async function c(){try{const h=await b.getApps();t(h.apps||[])}catch(h){console.error("Failed to load apps:",h)}finally{r(!1)}}function o(h){return{php:"#a78bfa",wordpress:"#21759b",flask:"#fcd34d",django:"#34d399",docker:"#2496ed",static:"#60a5fa"}[h]||"#a1a1aa"}function u(h){switch(h){case"running":return"status-active";case"stopped":return"status-stopped";case"error":return"status-error";default:return"status-warning"}}async function f(h,p){try{p==="start"?await b.startApp(h):p==="stop"?await b.stopApp(h):p==="restart"&&await b.restartApp(h),c()}catch(v){console.error(`Failed to ${p} app:`,v)}}return n?s.jsx("div",{className:"loading",children:"Loading applications..."}):s.jsxs("div",{children:[s.jsxs("header",{className:"top-bar",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Applications"}),s.jsx("div",{className:"subtitle",children:"Manage your web applications"})]}),s.jsx("div",{className:"top-bar-actions",children:s.jsxs("button",{className:"btn btn-primary",onClick:()=>i(!0),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),s.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Application"]})})]}),e.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"48",height:"48",stroke:"currentColor",fill:"none",strokeWidth:"1.5",children:s.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),s.jsx("h3",{children:"No applications yet"}),s.jsx("p",{children:"Create your first application to get started."}),s.jsx("button",{className:"btn btn-primary",onClick:()=>i(!0),children:"Create Application"})]}):s.jsx("div",{className:"apps-list",children:e.map(h=>s.jsxs("div",{className:"app-row",children:[s.jsxs("div",{className:"app-info",children:[s.jsx("div",{className:"app-icon",style:{background:o(h.app_type)},children:h.app_type==="wordpress"?"W":h.app_type.charAt(0).toUpperCase()}),s.jsxs("div",{className:"app-details",children:[s.jsx("h3",{children:h.name}),s.jsxs("div",{className:"app-meta",children:[s.jsx("span",{className:"app-type",children:h.app_type.toUpperCase()}),h.php_version&&s.jsxs("span",{children:["PHP ",h.php_version]}),h.python_version&&s.jsxs("span",{children:["Python ",h.python_version]}),h.domains&&h.domains[0]&&s.jsx("a",{href:`https://${h.domains[0].name}`,target:"_blank",rel:"noopener noreferrer",children:h.domains[0].name})]})]})]}),s.jsx("div",{className:"app-status",children:s.jsxs("span",{className:`status-badge ${u(h.status)}`,children:[s.jsx("span",{className:"status-dot"}),h.status]})}),s.jsxs("div",{className:"app-actions",children:[h.status==="running"?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>f(h.id,"restart"),children:"Restart"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>f(h.id,"stop"),children:"Stop"})]}):s.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>f(h.id,"start"),children:"Start"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>l(`/apps/${h.id}`),children:"Manage"})]})]},h.id))}),a&&s.jsx(ag,{onClose:()=>i(!1),onCreated:c})]})},ag=({onClose:e,onCreated:t})=>{var k;const[n,r]=d.useState(1),[a,i]=d.useState(""),[l,c]=d.useState({name:"",app_type:"",php_version:"8.2",python_version:"3.11",port:8e3,root_path:"/var/www/",site_url:"",site_title:"",admin_user:"admin",admin_email:"",db_name:"",db_user:"",db_password:"",docker_image:"",docker_ports:"",docker_volumes:"",docker_env:""}),[o,u]=d.useState(!1),[f,h]=d.useState(""),p=[{id:"wordpress",name:"WordPress",icon:"W",color:"#21759b",description:"Full WordPress installation with WP-CLI"},{id:"php",name:"PHP",icon:"P",color:"#777bb4",description:"PHP application with FPM"},{id:"flask",name:"Flask",icon:"F",color:"#fcd34d",description:"Python Flask application"},{id:"django",name:"Django",icon:"D",color:"#34d399",description:"Python Django application"},{id:"docker",name:"Docker",icon:"D",color:"#2496ed",description:"Docker container application"},{id:"static",name:"Static",icon:"S",color:"#60a5fa",description:"Static HTML/CSS/JS site"}];function v(m){c({...l,[m.target.name]:m.target.value})}function N(m){i(m),c({...l,app_type:m,root_path:`/var/www/${l.name||"mysite"}`}),r(2)}async function j(m){m.preventDefault(),h(""),u(!0);try{if(a==="wordpress")await b.installWordPress({path:l.root_path,site_url:l.site_url,site_title:l.site_title||l.name,admin_user:l.admin_user,admin_email:l.admin_email,db_name:l.db_name,db_user:l.db_user,db_password:l.db_password,php_version:l.php_version});else if(a==="flask")await b.createFlaskApp({name:l.name,path:l.root_path,python_version:l.python_version,port:l.port,workers:l.workers||2});else if(a==="django")await b.createDjangoApp({name:l.name,path:l.root_path,python_version:l.python_version,port:l.port,workers:l.workers||2});else if(a==="docker"){const x=l.docker_ports?l.docker_ports.split(",").map(S=>S.trim()):[],g=l.docker_volumes?l.docker_volumes.split(",").map(S=>S.trim()):[],y=l.docker_env?Object.fromEntries(l.docker_env.split(`
+`).filter(S=>S.includes("=")).map(S=>{const[E,...T]=S.split("=");return[E.trim(),T.join("=").trim()]})):{};await b.createDockerApp({name:l.name,path:l.root_path,image:l.docker_image,ports:x,volumes:g,env:y})}else await b.createApp({name:l.name,app_type:a,php_version:a==="php"?l.php_version:null,root_path:l.root_path});t(),e()}catch(x){h(x.message||"Failed to create application")}finally{u(!1)}}return s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:m=>m.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:n===1?"Select Application Type":`Create ${(k=p.find(m=>m.id===a))==null?void 0:k.name} App`}),s.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),f&&s.jsx("div",{className:"error-message",children:f}),n===1?s.jsx("div",{className:"app-type-grid",children:p.map(m=>s.jsxs("button",{className:"app-type-card",onClick:()=>N(m.id),children:[s.jsx("div",{className:"app-type-icon",style:{background:m.color},children:m.icon}),s.jsx("h3",{children:m.name}),s.jsx("p",{children:m.description})]},m.id))}):s.jsxs("form",{onSubmit:j,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Site Name"}),s.jsx("input",{type:"text",name:"name",value:l.name,onChange:v,placeholder:"My Awesome Site",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Root Path"}),s.jsx("input",{type:"text",name:"root_path",value:l.root_path,onChange:v,placeholder:"/var/www/mysite",required:!0})]}),a==="wordpress"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Site URL"}),s.jsx("input",{type:"url",name:"site_url",value:l.site_url,onChange:v,placeholder:"https://example.com",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Admin Email"}),s.jsx("input",{type:"email",name:"admin_email",value:l.admin_email,onChange:v,placeholder:"[email protected]",required:!0})]}),s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Database Name"}),s.jsx("input",{type:"text",name:"db_name",value:l.db_name,onChange:v,required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Database User"}),s.jsx("input",{type:"text",name:"db_user",value:l.db_user,onChange:v,required:!0})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Database Password"}),s.jsx("input",{type:"password",name:"db_password",value:l.db_password,onChange:v,required:!0})]})]}),(a==="php"||a==="wordpress")&&s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"PHP Version"}),s.jsxs("select",{name:"php_version",value:l.php_version,onChange:v,children:[s.jsx("option",{value:"8.0",children:"PHP 8.0"}),s.jsx("option",{value:"8.1",children:"PHP 8.1"}),s.jsx("option",{value:"8.2",children:"PHP 8.2"}),s.jsx("option",{value:"8.3",children:"PHP 8.3"})]})]}),["flask","django"].includes(a)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Python Version"}),s.jsxs("select",{name:"python_version",value:l.python_version,onChange:v,children:[s.jsx("option",{value:"3.9",children:"Python 3.9"}),s.jsx("option",{value:"3.10",children:"Python 3.10"}),s.jsx("option",{value:"3.11",children:"Python 3.11"}),s.jsx("option",{value:"3.12",children:"Python 3.12"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Port"}),s.jsx("input",{type:"number",name:"port",value:l.port,onChange:v,min:"1024",max:"65535"})]})]}),a==="docker"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Docker Image *"}),s.jsx("input",{type:"text",name:"docker_image",value:l.docker_image,onChange:v,placeholder:"nginx:latest, mysql:8, redis:alpine",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Ports (comma-separated)"}),s.jsx("input",{type:"text",name:"docker_ports",value:l.docker_ports,onChange:v,placeholder:"8080:80, 3306:3306"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Volumes (comma-separated)"}),s.jsx("input",{type:"text",name:"docker_volumes",value:l.docker_volumes,onChange:v,placeholder:"/host/data:/container/data"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Environment Variables (one per line, KEY=value)"}),s.jsx("textarea",{name:"docker_env",value:l.docker_env,onChange:v,placeholder:`MYSQL_ROOT_PASSWORD=secret
+MYSQL_DATABASE=mydb`,rows:4})]})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>r(1),children:"Back"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:o,children:o?"Creating...":"Create Application"})]})]})]})})},ig=()=>{const{id:e}=Yf(),t=ns(),[n,r]=d.useState(null),[a,i]=d.useState(!0),[l,c]=d.useState("overview");d.useEffect(()=>{o()},[e]);async function o(){try{const N=await b.getApp(e);r(N.app)}catch(N){console.error("Failed to load app:",N)}finally{i(!1)}}async function u(N){try{N==="start"?await b.startApp(e):N==="stop"?await b.stopApp(e):N==="restart"&&await b.restartApp(e),o()}catch(j){console.error(`Failed to ${N} app:`,j)}}function f(N){return{php:"#777bb4",wordpress:"#21759b",flask:"#fcd34d",django:"#34d399",docker:"#2496ed",static:"#60a5fa"}[N]||"#a1a1aa"}function h(N){switch(N){case"running":return"status-active";case"stopped":return"status-stopped";case"error":return"status-error";default:return"status-warning"}}if(a)return s.jsx("div",{className:"loading",children:"Loading application..."});if(!n)return s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"Application not found"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>t("/apps"),children:"Back to Applications"})]});const p=["flask","django"].includes(n.app_type),v=n.app_type==="wordpress";return n.app_type,s.jsxs("div",{children:[s.jsxs("header",{className:"top-bar",children:[s.jsxs("div",{className:"app-header-info",children:[s.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>t("/apps"),children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",stroke:"currentColor",fill:"none",strokeWidth:"2",children:s.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),"Back"]}),s.jsxs("div",{className:"app-header-title",children:[s.jsx("div",{className:"app-icon",style:{background:f(n.app_type)},children:n.app_type.charAt(0).toUpperCase()}),s.jsxs("div",{children:[s.jsx("h1",{children:n.name}),s.jsxs("div",{className:"subtitle",children:[n.app_type.toUpperCase(),n.python_version&&` • Python ${n.python_version}`,n.php_version&&` • PHP ${n.php_version}`,n.port&&` • Port ${n.port}`]})]})]})]}),s.jsxs("div",{className:"top-bar-actions",children:[s.jsxs("span",{className:`status-badge ${h(n.status)}`,children:[s.jsx("span",{className:"status-dot"}),n.status]}),n.status==="running"?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>u("restart"),children:"Restart"}),s.jsx("button",{className:"btn btn-secondary",onClick:()=>u("stop"),children:"Stop"})]}):s.jsx("button",{className:"btn btn-primary",onClick:()=>u("start"),children:"Start"})]})]}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${l==="overview"?"active":""}`,onClick:()=>c("overview"),children:"Overview"}),p&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:`tab ${l==="packages"?"active":""}`,onClick:()=>c("packages"),children:"Packages"}),s.jsx("button",{className:`tab ${l==="environment"?"active":""}`,onClick:()=>c("environment"),children:"Environment"}),s.jsx("button",{className:`tab ${l==="gunicorn"?"active":""}`,onClick:()=>c("gunicorn"),children:"Gunicorn"}),s.jsx("button",{className:`tab ${l==="commands"?"active":""}`,onClick:()=>c("commands"),children:"Commands"})]}),v&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:`tab ${l==="plugins"?"active":""}`,onClick:()=>c("plugins"),children:"Plugins"}),s.jsx("button",{className:`tab ${l==="themes"?"active":""}`,onClick:()=>c("themes"),children:"Themes"}),s.jsx("button",{className:`tab ${l==="backups"?"active":""}`,onClick:()=>c("backups"),children:"Backups"})]}),s.jsx("button",{className:`tab ${l==="deploy"?"active":""}`,onClick:()=>c("deploy"),children:"Deploy"}),s.jsx("button",{className:`tab ${l==="logs"?"active":""}`,onClick:()=>c("logs"),children:"Logs"}),s.jsx("button",{className:`tab ${l==="settings"?"active":""}`,onClick:()=>c("settings"),children:"Settings"})]}),s.jsxs("div",{className:"tab-content",children:[l==="overview"&&s.jsx(lg,{app:n}),l==="packages"&&p&&s.jsx(og,{appId:n.id}),l==="environment"&&p&&s.jsx(cg,{appId:n.id}),l==="gunicorn"&&p&&s.jsx(dg,{appId:n.id}),l==="commands"&&p&&s.jsx(ug,{appId:n.id,appType:n.app_type}),l==="plugins"&&v&&s.jsx(hg,{appId:n.id}),l==="themes"&&v&&s.jsx(mg,{appId:n.id}),l==="backups"&&v&&s.jsx(pg,{appId:n.id}),l==="deploy"&&s.jsx(vg,{appId:n.id,appPath:n.path}),l==="logs"&&s.jsx(fg,{app:n}),l==="settings"&&s.jsx(xg,{app:n,onUpdate:o})]})]})},lg=({app:e})=>{const[t,n]=d.useState(null);d.useEffect(()=>{["flask","django"].includes(e.app_type)&&r()},[e]);async function r(){try{const a=await b.getPythonAppStatus(e.id);n(a)}catch(a){console.error("Failed to load status:",a)}}return s.jsxs("div",{className:"overview-grid",children:[s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Application Info"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Type"}),s.jsx("span",{className:"info-value",children:e.app_type.toUpperCase()})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Root Path"}),s.jsx("span",{className:"info-value mono",children:e.root_path})]}),e.python_version&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Python Version"}),s.jsx("span",{className:"info-value",children:e.python_version})]}),e.php_version&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"PHP Version"}),s.jsx("span",{className:"info-value",children:e.php_version})]}),e.port&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Port"}),s.jsx("span",{className:"info-value",children:e.port})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Created"}),s.jsx("span",{className:"info-value",children:new Date(e.created_at).toLocaleDateString()})]})]})]}),t&&s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Process Status"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Service"}),s.jsx("span",{className:"info-value mono",children:t.service_name})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"State"}),s.jsxs("span",{className:"info-value",children:[t.active_state," (",t.sub_state,")"]})]}),t.main_pid!=="0"&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"PID"}),s.jsx("span",{className:"info-value mono",children:t.main_pid})]}),t.memory&&t.memory!=="0"&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Memory"}),s.jsx("span",{className:"info-value",children:qh(parseInt(t.memory))})]})]})]}),e.domains&&e.domains.length>0&&s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Domains"}),s.jsx("div",{className:"domains-list",children:e.domains.map(a=>s.jsxs("div",{className:"domain-item",children:[s.jsx("a",{href:`https://${a.name}`,target:"_blank",rel:"noopener noreferrer",children:a.name}),a.ssl_enabled&&s.jsx("span",{className:"ssl-badge",children:"SSL"})]},a.id))})]})]})},og=({appId:e})=>{const t=Se(),[n,r]=d.useState([]),[a,i]=d.useState(!0),[l,c]=d.useState(!1),[o,u]=d.useState("");d.useEffect(()=>{f()},[e]);async function f(){try{const v=await b.getPythonPackages(e);r(v.packages||[])}catch(v){console.error("Failed to load packages:",v)}finally{i(!1)}}async function h(v){if(v.preventDefault(),!!o.trim()){c(!0);try{await b.installPythonPackages(e,[o.trim()]),u(""),f()}catch(N){console.error("Failed to install package:",N)}finally{c(!1)}}}async function p(){try{await b.freezePythonRequirements(e),t.success("requirements.txt updated")}catch(v){t.error("Failed to freeze requirements"),console.error("Failed to freeze requirements:",v)}}return a?s.jsx("div",{className:"loading",children:"Loading packages..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Installed Packages"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:p,children:"Freeze to requirements.txt"})]}),s.jsxs("form",{className:"install-form",onSubmit:h,children:[s.jsx("input",{type:"text",value:o,onChange:v=>u(v.target.value),placeholder:"Package name (e.g., requests, flask==2.0.0)"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:l,children:l?"Installing...":"Install"})]}),s.jsx("div",{className:"packages-list",children:n.map(v=>s.jsxs("div",{className:"package-item",children:[s.jsx("span",{className:"package-name",children:v.name}),s.jsx("span",{className:"package-version",children:v.version})]},v.name))})]})},cg=({appId:e})=>{const[t,n]=d.useState({}),[r,a]=d.useState(!0),[i,l]=d.useState(""),[c,o]=d.useState("");d.useEffect(()=>{u()},[e]);async function u(){try{const p=await b.getPythonEnvVars(e);n(p.env_vars||{})}catch(p){console.error("Failed to load env vars:",p)}finally{a(!1)}}async function f(p){if(p.preventDefault(),!!i.trim())try{await b.setPythonEnvVars(e,{[i]:c}),l(""),o(""),u()}catch(v){console.error("Failed to add env var:",v)}}async function h(p){if(confirm(`Delete ${p}?`))try{await b.deletePythonEnvVar(e,p),u()}catch(v){console.error("Failed to delete env var:",v)}}return r?s.jsx("div",{className:"loading",children:"Loading environment variables..."}):s.jsxs("div",{children:[s.jsx("h3",{children:"Environment Variables"}),s.jsx("p",{className:"hint",children:"Changes require app restart to take effect."}),s.jsxs("form",{className:"env-form",onSubmit:f,children:[s.jsx("input",{type:"text",value:i,onChange:p=>l(p.target.value),placeholder:"KEY"}),s.jsx("input",{type:"text",value:c,onChange:p=>o(p.target.value),placeholder:"value"}),s.jsx("button",{type:"submit",className:"btn btn-primary",children:"Add"})]}),s.jsx("div",{className:"env-list",children:Object.entries(t).map(([p,v])=>s.jsxs("div",{className:"env-item",children:[s.jsx("span",{className:"env-key",children:p}),s.jsx("span",{className:"env-value",children:v}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>h(p),children:"Delete"})]},p))})]})},dg=({appId:e})=>{const t=Se(),[n,r]=d.useState(""),[a,i]=d.useState(!0),[l,c]=d.useState(!1);d.useEffect(()=>{o()},[e]);async function o(){try{const f=await b.getGunicornConfig(e);r(f.content||"")}catch(f){console.error("Failed to load config:",f)}finally{i(!1)}}async function u(){c(!0);try{await b.updateGunicornConfig(e,n),t.success("Configuration saved. Restart the app to apply changes.")}catch(f){t.error("Failed to save configuration"),console.error("Failed to save config:",f)}finally{c(!1)}}return a?s.jsx("div",{className:"loading",children:"Loading Gunicorn configuration..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Gunicorn Configuration"}),s.jsx("button",{className:"btn btn-primary",onClick:u,disabled:l,children:l?"Saving...":"Save"})]}),s.jsx("textarea",{className:"code-editor",value:n,onChange:f=>r(f.target.value),spellCheck:!1})]})},ug=({appId:e,appType:t})=>{const[n,r]=d.useState(""),[a,i]=d.useState(null),[l,c]=d.useState(!1),o=t==="django"?[{label:"Run Migrations",cmd:"python manage.py migrate"},{label:"Collect Static",cmd:"python manage.py collectstatic --noinput"},{label:"Create Superuser",cmd:"python manage.py createsuperuser"},{label:"Shell",cmd:"python manage.py shell"},{label:"Check",cmd:"python manage.py check"}]:[{label:"Flask Routes",cmd:"flask routes"},{label:"Flask Shell",cmd:"flask shell"},{label:"DB Upgrade",cmd:"flask db upgrade"},{label:"DB Migrate",cmd:"flask db migrate"}];async function u(f){const h=f||n;if(h.trim()){c(!0),i(null);try{const p=await b.runPythonCommand(e,h);i(p)}catch(p){i({success:!1,stderr:p.message})}finally{c(!1)}}}return s.jsxs("div",{children:[s.jsx("h3",{children:"Run Commands"}),s.jsx("p",{className:"hint",children:"Commands run in the app's virtual environment context."}),s.jsx("div",{className:"quick-commands",children:o.map(({label:f,cmd:h})=>s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>u(h),disabled:l,children:f},h))}),s.jsxs("div",{className:"command-input",children:[s.jsx("input",{type:"text",value:n,onChange:f=>r(f.target.value),placeholder:"Enter command...",onKeyDown:f=>f.key==="Enter"&&u()}),s.jsx("button",{className:"btn btn-primary",onClick:()=>u(),disabled:l,children:l?"Running...":"Run"})]}),a&&s.jsxs("div",{className:`command-output ${a.success?"":"error"}`,children:[a.stdout&&s.jsx("pre",{children:a.stdout}),a.stderr&&s.jsx("pre",{className:"stderr",children:a.stderr}),!a.stdout&&!a.stderr&&s.jsx("pre",{children:a.success?"Command completed successfully":"Command failed"})]})]})},hg=({appId:e})=>{const[t,n]=d.useState([]),[r,a]=d.useState(!0);d.useEffect(()=>{i()},[e]);async function i(){try{const o=await b.getWordPressPlugins(e);n(o.plugins||[])}catch(o){console.error("Failed to load plugins:",o)}finally{a(!1)}}async function l(o){try{await b.activateWordPressPlugin(e,o),i()}catch(u){console.error("Failed to activate plugin:",u)}}async function c(o){try{await b.deactivateWordPressPlugin(e,o),i()}catch(u){console.error("Failed to deactivate plugin:",u)}}return r?s.jsx("div",{className:"loading",children:"Loading plugins..."}):s.jsxs("div",{children:[s.jsx("h3",{children:"WordPress Plugins"}),s.jsx("div",{className:"plugins-list",children:t.map(o=>s.jsxs("div",{className:"plugin-item",children:[s.jsxs("div",{className:"plugin-info",children:[s.jsx("span",{className:"plugin-name",children:o.title||o.name}),s.jsx("span",{className:"plugin-version",children:o.version})]}),s.jsx("div",{className:"plugin-actions",children:o.status==="active"?s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>c(o.name),children:"Deactivate"}):s.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>l(o.name),children:"Activate"})})]},o.name))})]})},mg=({appId:e})=>{const[t,n]=d.useState([]),[r,a]=d.useState(!0);d.useEffect(()=>{i()},[e]);async function i(){try{const c=await b.getWordPressThemes(e);n(c.themes||[])}catch(c){console.error("Failed to load themes:",c)}finally{a(!1)}}async function l(c){try{await b.activateWordPressTheme(e,c),i()}catch(o){console.error("Failed to activate theme:",o)}}return r?s.jsx("div",{className:"loading",children:"Loading themes..."}):s.jsxs("div",{children:[s.jsx("h3",{children:"WordPress Themes"}),s.jsx("div",{className:"themes-list",children:t.map(c=>s.jsxs("div",{className:`theme-item ${c.status==="active"?"active":""}`,children:[s.jsxs("div",{className:"theme-info",children:[s.jsx("span",{className:"theme-name",children:c.title||c.name}),s.jsx("span",{className:"theme-version",children:c.version})]}),c.status!=="active"&&s.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>l(c.name),children:"Activate"}),c.status==="active"&&s.jsx("span",{className:"active-badge",children:"Active"})]},c.name))})]})},pg=({appId:e})=>{const t=Se(),[n,r]=d.useState([]),[a,i]=d.useState(!0),[l,c]=d.useState(!1);d.useEffect(()=>{o()},[e]);async function o(){try{const h=await b.getWordPressBackups(e);r(h.backups||[])}catch(h){console.error("Failed to load backups:",h)}finally{i(!1)}}async function u(){c(!0);try{await b.createWordPressBackup(e),o()}catch(h){console.error("Failed to create backup:",h)}finally{c(!1)}}async function f(h){if(confirm(`Restore from ${h}? This will overwrite current data.`))try{await b.restoreWordPressBackup(e,h),t.success("Backup restored successfully")}catch(p){t.error("Failed to restore backup"),console.error("Failed to restore backup:",p)}}return a?s.jsx("div",{className:"loading",children:"Loading backups..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Backups"}),s.jsx("button",{className:"btn btn-primary",onClick:u,disabled:l,children:l?"Creating...":"Create Backup"})]}),n.length===0?s.jsx("p",{className:"hint",children:"No backups yet. Create your first backup."}):s.jsx("div",{className:"backups-list",children:n.map(h=>s.jsxs("div",{className:"backup-item",children:[s.jsxs("div",{className:"backup-info",children:[s.jsx("span",{className:"backup-name",children:h.name}),s.jsx("span",{className:"backup-size",children:qh(h.size)}),s.jsx("span",{className:"backup-date",children:new Date(h.created_at).toLocaleString()})]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>f(h.name),children:"Restore"})]},h.name))})]})},fg=({app:e})=>{const[t,n]=d.useState(""),[r,a]=d.useState(!0),[i,l]=d.useState("access");d.useEffect(()=>{c()},[e,i]);async function c(){a(!0);try{const o=await b.getAppLogs(e.name,i,200);n(o.content||"No logs available")}catch{n("Failed to load logs")}finally{a(!1)}}return s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Application Logs"}),s.jsxs("div",{className:"log-controls",children:[s.jsxs("select",{value:i,onChange:o=>l(o.target.value),children:[s.jsx("option",{value:"access",children:"Access Log"}),s.jsx("option",{value:"error",children:"Error Log"})]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:c,children:"Refresh"})]})]}),s.jsx("pre",{className:"log-viewer",children:r?"Loading...":t})]})},xg=({app:e,onUpdate:t})=>{const n=ns(),[r,a]=d.useState(!1);async function i(){if(confirm(`Delete ${e.name}? This action cannot be undone.`)&&confirm('Are you sure? Type "delete" to confirm.')){a(!0);try{await b.deleteApp(e.id),n("/apps")}catch(l){console.error("Failed to delete app:",l),a(!1)}}}return s.jsxs("div",{children:[s.jsx("h3",{children:"Application Settings"}),s.jsxs("div",{className:"card danger-zone",children:[s.jsx("h4",{children:"Danger Zone"}),s.jsx("p",{children:"Once you delete an application, there is no going back."}),s.jsx("button",{className:"btn btn-danger",onClick:i,disabled:r,children:r?"Deleting...":"Delete Application"})]})]})},vg=({appId:e,appPath:t})=>{const n=Se(),[r,a]=d.useState(null),[i,l]=d.useState(null),[c,o]=d.useState([]),[u,f]=d.useState(!0),[h,p]=d.useState(!1),[v,N]=d.useState(!1),[j,k]=d.useState(null),[m,x]=d.useState({repoUrl:"",branch:"main",autoDeploy:!0,preDeployScript:"",postDeployScript:""});d.useEffect(()=>{g()},[e]);async function g(){try{f(!0);const[w,L]=await Promise.all([b.getDeployConfig(e),b.getDeploymentHistory(e,20)]);if(w.configured){a(w.config),x({repoUrl:w.config.repo_url||"",branch:w.config.branch||"main",autoDeploy:w.config.auto_deploy!==!1,preDeployScript:w.config.pre_deploy_script||"",postDeployScript:w.config.post_deploy_script||""});try{const U=await b.getGitStatus(e);l(U)}catch{}}else a(null);o(L.deployments||[])}catch(w){k(w.message)}finally{f(!1)}}async function y(w){w.preventDefault();try{await b.configureDeployment(e,m.repoUrl,m.branch,m.autoDeploy,m.preDeployScript||null,m.postDeployScript||null),N(!1),g()}catch(L){k(L.message)}}async function S(){if(confirm("Remove deployment configuration? This will not delete the repository files."))try{await b.removeDeployment(e),a(null),l(null),g()}catch(w){k(w.message)}}async function E(w=!1){p(!0),k(null);try{const L=await b.triggerDeploy(e,w);L.success?n.success("Deployment completed successfully!"):k(L.error||"Deployment failed"),g()}catch(L){k(L.message)}finally{p(!1)}}async function T(){p(!0),k(null);try{const w=await b.pullChanges(e);w.success?n.success("Changes pulled successfully!"):k(w.error||"Pull failed"),g()}catch(w){k(w.message)}finally{p(!1)}}function P(w){return new Date(w).toLocaleString()}function O(w){switch(w){case"success":return"badge-success";case"failed":return"badge-danger";case"in_progress":return"badge-warning";default:return"badge-secondary"}}return u?s.jsx("div",{className:"loading",children:"Loading deployment configuration..."}):s.jsxs("div",{className:"deploy-tab",children:[j&&s.jsxs("div",{className:"alert alert-danger",children:[j,s.jsx("button",{onClick:()=>k(null),className:"alert-close",children:"×"})]}),r?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"deploy-header",children:s.jsxs("div",{className:"deploy-status-card",children:[s.jsxs("div",{className:"deploy-repo-info",children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",stroke:"currentColor",fill:"none",strokeWidth:"2",children:s.jsx("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})}),s.jsxs("div",{children:[s.jsx("span",{className:"repo-url",children:r.repo_url}),s.jsxs("span",{className:"repo-branch",children:["Branch: ",r.branch]})]})]}),s.jsxs("div",{className:"deploy-actions",children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:T,disabled:h,children:"Pull Only"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>E(!1),disabled:h,children:h?"Deploying...":"Deploy Now"})]})]})}),s.jsxs("div",{className:"deploy-grid",children:[s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Configuration"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Repository"}),s.jsx("span",{className:"info-value mono",children:r.repo_url})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Branch"}),s.jsx("span",{className:"info-value",children:r.branch})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Auto Deploy"}),s.jsx("span",{className:"info-value",children:r.auto_deploy?"Enabled":"Disabled"})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Deploy Count"}),s.jsx("span",{className:"info-value",children:r.deploy_count||0})]}),r.last_deploy&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Last Deploy"}),s.jsx("span",{className:"info-value",children:P(r.last_deploy)})]})]}),s.jsxs("div",{className:"card-actions",children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>N(!0),children:"Edit Configuration"}),s.jsx("button",{className:"btn btn-danger btn-sm",onClick:S,children:"Remove"})]})]}),i&&!i.error&&s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Git Status"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Current Branch"}),s.jsx("span",{className:"info-value",children:i.branch})]}),i.commit&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Commit"}),s.jsx("span",{className:"info-value mono",children:i.commit.short_hash})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Message"}),s.jsx("span",{className:"info-value",children:i.commit.message})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Author"}),s.jsx("span",{className:"info-value",children:i.commit.author})]})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Uncommitted Changes"}),s.jsx("span",{className:"info-value",children:i.has_uncommitted?`${i.changes} file(s)`:"None"})]}),(i.ahead>0||i.behind>0)&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Remote Status"}),s.jsxs("span",{className:"info-value",children:[i.ahead>0&&`${i.ahead} ahead`,i.ahead>0&&i.behind>0&&", ",i.behind>0&&`${i.behind} behind`]})]})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Webhook"}),s.jsx("p",{className:"hint",children:"Use this URL in your Git provider to trigger automatic deployments on push."}),s.jsxs("div",{className:"webhook-url",children:[s.jsxs("code",{children:[window.location.origin,"/api/v1/deploy/webhook/",e,"/",r.webhook_token]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>{navigator.clipboard.writeText(`${window.location.origin}/api/v1/deploy/webhook/${e}/${r.webhook_token}`),n.success("Webhook URL copied to clipboard")},children:"Copy"})]})]})]}),(r.pre_deploy_script||r.post_deploy_script)&&s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Deploy Scripts"}),s.jsxs("div",{className:"scripts-grid",children:[r.pre_deploy_script&&s.jsxs("div",{className:"script-section",children:[s.jsx("h4",{children:"Pre-Deploy Script"}),s.jsx("pre",{className:"script-code",children:r.pre_deploy_script})]}),r.post_deploy_script&&s.jsxs("div",{className:"script-section",children:[s.jsx("h4",{children:"Post-Deploy Script"}),s.jsx("pre",{className:"script-code",children:r.post_deploy_script})]})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Deployment History"}),c.length===0?s.jsx("p",{className:"hint",children:"No deployments yet."}):s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Started"}),s.jsx("th",{children:"Completed"}),s.jsx("th",{children:"Details"})]})}),s.jsx("tbody",{children:c.map((w,L)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("span",{className:`badge ${O(w.status)}`,children:w.status})}),s.jsx("td",{children:P(w.started_at)}),s.jsx("td",{children:w.completed_at?P(w.completed_at):"-"}),s.jsxs("td",{children:[w.error&&s.jsx("span",{className:"text-danger",children:w.error}),w.steps&&s.jsxs("span",{className:"text-muted",children:[w.steps.length," step(s)"]})]})]},L))})]})]})]}):s.jsx("div",{className:"deploy-setup",children:s.jsxs("div",{className:"empty-state",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"48",height:"48",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("line",{x1:"1.05",y1:"12",x2:"7",y2:"12"}),s.jsx("line",{x1:"17.01",y1:"12",x2:"22.96",y2:"12"})]}),s.jsx("h3",{children:"Git Deployment Not Configured"}),s.jsx("p",{children:"Connect a Git repository to enable automatic deployments via webhooks or manual triggers."}),s.jsx("button",{className:"btn btn-primary",onClick:()=>N(!0),children:"Configure Deployment"})]})}),v&&s.jsx("div",{className:"modal-overlay",onClick:()=>N(!1),children:s.jsxs("div",{className:"modal",onClick:w=>w.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:r?"Edit Deployment":"Configure Deployment"}),s.jsx("button",{className:"modal-close",onClick:()=>N(!1),children:"×"})]}),s.jsxs("form",{onSubmit:y,children:[s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Repository URL *"}),s.jsx("input",{type:"url",value:m.repoUrl,onChange:w=>x({...m,repoUrl:w.target.value}),placeholder:"https://github.com/user/repo.git",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Branch"}),s.jsx("input",{type:"text",value:m.branch,onChange:w=>x({...m,branch:w.target.value}),placeholder:"main"})]}),s.jsx("div",{className:"form-group",children:s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:m.autoDeploy,onChange:w=>x({...m,autoDeploy:w.target.checked})}),s.jsx("span",{children:"Enable Auto Deploy on Webhook"})]})}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Pre-Deploy Script (optional)"}),s.jsx("textarea",{value:m.preDeployScript,onChange:w=>x({...m,preDeployScript:w.target.value}),placeholder:`npm install
+npm run build`,rows:3}),s.jsx("span",{className:"form-help",children:"Commands to run before pulling changes"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Post-Deploy Script (optional)"}),s.jsx("textarea",{value:m.postDeployScript,onChange:w=>x({...m,postDeployScript:w.target.value}),placeholder:`npm install
+npm run build
+systemctl restart myapp`,rows:3}),s.jsx("span",{className:"form-help",children:"Commands to run after pulling changes"})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>N(!1),children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",children:r?"Update Configuration":"Configure Deployment"})]})]})]})})]})};function qh(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}const gg=()=>{const[e,t]=d.useState("containers"),[n,r]=d.useState(null),[a,i]=d.useState(!0);d.useEffect(()=>{l()},[]);async function l(){try{const c=await b.getDockerStatus();r(c)}catch(c){r({installed:!1,error:c.message})}finally{i(!1)}}return a?s.jsx("div",{className:"loading",children:"Checking Docker status..."}):n!=null&&n.installed?s.jsxs("div",{children:[s.jsx("header",{className:"top-bar",children:s.jsxs("div",{children:[s.jsx("h1",{children:"Docker"}),s.jsx("div",{className:"subtitle",children:"Container management"})]})}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${e==="containers"?"active":""}`,onClick:()=>t("containers"),children:"Containers"}),s.jsx("button",{className:`tab ${e==="images"?"active":""}`,onClick:()=>t("images"),children:"Images"}),s.jsx("button",{className:`tab ${e==="networks"?"active":""}`,onClick:()=>t("networks"),children:"Networks"}),s.jsx("button",{className:`tab ${e==="volumes"?"active":""}`,onClick:()=>t("volumes"),children:"Volumes"})]}),s.jsxs("div",{className:"tab-content",children:[e==="containers"&&s.jsx(yg,{}),e==="images"&&s.jsx(wg,{}),e==="networks"&&s.jsx(Sg,{}),e==="volumes"&&s.jsx(Pg,{})]})]}):s.jsxs("div",{children:[s.jsx("header",{className:"top-bar",children:s.jsxs("div",{children:[s.jsx("h1",{children:"Docker"}),s.jsx("div",{className:"subtitle",children:"Container management"})]})}),s.jsxs("div",{className:"empty-state",children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"48",height:"48",stroke:"currentColor",fill:"none",strokeWidth:"1.5",children:s.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),s.jsx("h3",{children:"Docker not available"}),s.jsx("p",{children:(n==null?void 0:n.error)||"Docker is not installed or running on this server."})]})]})},yg=()=>{const[e,t]=d.useState([]),[n,r]=d.useState(!0),[a,i]=d.useState(!0),[l,c]=d.useState(!1),[o,u]=d.useState(null),[f,h]=d.useState(null);d.useEffect(()=>{p()},[a]);async function p(){r(!0);try{const j=await b.getContainers(a);t(j.containers||[])}catch(j){console.error("Failed to load containers:",j)}finally{r(!1)}}async function v(j,k){try{if(k==="start")await b.startContainer(j);else if(k==="stop")await b.stopContainer(j);else if(k==="restart")await b.restartContainer(j);else if(k==="remove"){if(!confirm("Remove this container?"))return;await b.removeContainer(j,!0)}p()}catch(m){console.error(`Failed to ${k} container:`,m)}}function N(j){switch(j){case"running":return"status-active";case"exited":return"status-stopped";case"paused":return"status-warning";default:return"status-stopped"}}return n?s.jsx("div",{className:"loading",children:"Loading containers..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("div",{className:"filter-toggle",children:s.jsxs("label",{children:[s.jsx("input",{type:"checkbox",checked:a,onChange:j=>i(j.target.checked)}),"Show stopped containers"]})}),s.jsx("button",{className:"btn btn-primary",onClick:()=>c(!0),children:"Run Container"})]}),e.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No containers"}),s.jsx("p",{children:"Run your first container to get started."})]}):s.jsx("div",{className:"docker-list",children:e.map(j=>s.jsxs("div",{className:"docker-item",children:[s.jsxs("div",{className:"docker-item-info",children:[s.jsx("div",{className:"docker-item-icon",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:s.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"})})}),s.jsxs("div",{className:"docker-item-details",children:[s.jsx("h3",{children:j.name}),s.jsxs("div",{className:"docker-item-meta",children:[s.jsx("span",{className:"mono",children:j.id.substring(0,12)}),s.jsx("span",{children:j.image}),j.ports&&s.jsx("span",{children:j.ports})]})]})]}),s.jsx("div",{className:"docker-item-status",children:s.jsxs("span",{className:`status-badge ${N(j.state)}`,children:[s.jsx("span",{className:"status-dot"}),j.state]})}),s.jsx("div",{className:"docker-item-actions",children:j.state==="running"?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>u(j),children:"Logs"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>h(j),children:"Exec"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>v(j.id,"restart"),children:"Restart"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>v(j.id,"stop"),children:"Stop"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>v(j.id,"start"),children:"Start"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>v(j.id,"remove"),children:"Remove"})]})})]},j.id))}),l&&s.jsx(jg,{onClose:()=>c(!1),onCreated:p}),o&&s.jsx(Ng,{container:o,onClose:()=>u(null)}),f&&s.jsx(bg,{container:f,onClose:()=>h(null)})]})},jg=({onClose:e,onCreated:t})=>{const[n,r]=d.useState({image:"",name:"",ports:"",volumes:"",env:""}),[a,i]=d.useState(!1),[l,c]=d.useState("");function o(f){r({...n,[f.target.name]:f.target.value})}async function u(f){f.preventDefault(),c(""),i(!0);try{const h={image:n.image,name:n.name||void 0,ports:n.ports?n.ports.split(",").map(p=>p.trim()):[],volumes:n.volumes?n.volumes.split(",").map(p=>p.trim()):[],env:n.env?Object.fromEntries(n.env.split(`
+`).filter(p=>p.includes("=")).map(p=>{const[v,...N]=p.split("=");return[v.trim(),N.join("=").trim()]})):{}};await b.runContainer(h),t(),e()}catch(h){c(h.message||"Failed to run container")}finally{i(!1)}}return s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Run Container"}),s.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&s.jsx("div",{className:"error-message",children:l}),s.jsxs("form",{onSubmit:u,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Image *"}),s.jsx("input",{type:"text",name:"image",value:n.image,onChange:o,placeholder:"nginx:latest",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Container Name"}),s.jsx("input",{type:"text",name:"name",value:n.name,onChange:o,placeholder:"my-container"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Ports (comma-separated)"}),s.jsx("input",{type:"text",name:"ports",value:n.ports,onChange:o,placeholder:"8080:80, 443:443"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Volumes (comma-separated)"}),s.jsx("input",{type:"text",name:"volumes",value:n.volumes,onChange:o,placeholder:"/host/path:/container/path"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Environment Variables (one per line, KEY=value)"}),s.jsx("textarea",{name:"env",value:n.env,onChange:o,placeholder:`NODE_ENV=production
+API_KEY=xxx`,rows:4})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Running...":"Run Container"})]})]})]})})},Ng=({container:e,onClose:t})=>{const[n,r]=d.useState(""),[a,i]=d.useState(!0);d.useEffect(()=>{l()},[e]);async function l(){try{const c=await b.getContainerLogs(e.id,200);r(c.logs||"No logs available")}catch{r("Failed to load logs")}finally{i(!1)}}return s.jsx("div",{className:"modal-overlay",onClick:t,children:s.jsxs("div",{className:"modal modal-lg",onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h2",{children:["Logs: ",e.name]}),s.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),s.jsx("div",{className:"modal-body",children:s.jsx("pre",{className:"log-viewer",children:a?"Loading...":n})}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{className:"btn btn-secondary",onClick:l,children:"Refresh"}),s.jsx("button",{className:"btn btn-primary",onClick:t,children:"Close"})]})]})})},bg=({container:e,onClose:t})=>{const[n,r]=d.useState(""),[a,i]=d.useState([]),[l,c]=d.useState(!1),[o,u]=d.useState([]),[f,h]=d.useState(-1),p=qr.useRef(null),v=qr.useRef(null);d.useEffect(()=>{v.current&&v.current.focus()},[]),d.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[a]);async function N(m){if(m.preventDefault(),!n.trim()||l)return;const x=n.trim();i(g=>[...g,{type:"command",text:`$ ${x}`}]),u(g=>[x,...g.slice(0,49)]),h(-1),r(""),c(!0);try{const g=await b.execContainer(e.id,x);g.output&&i(y=>[...y,{type:"output",text:g.output}]),g.error&&i(y=>[...y,{type:"error",text:g.error}]),g.exit_code!==0&&i(y=>[...y,{type:"info",text:`Exit code: ${g.exit_code}`}])}catch(g){i(y=>[...y,{type:"error",text:g.message||"Failed to execute command"}])}finally{c(!1),v.current&&v.current.focus()}}function j(m){if(m.key==="ArrowUp"){if(m.preventDefault(),o.length>0&&f<o.length-1){const x=f+1;h(x),r(o[x])}}else if(m.key==="ArrowDown")if(m.preventDefault(),f>0){const x=f-1;h(x),r(o[x])}else f===0&&(h(-1),r(""))}function k(){i([])}return s.jsx("div",{className:"modal-overlay",onClick:t,children:s.jsxs("div",{className:"modal modal-lg",onClick:m=>m.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h2",{children:["Exec: ",e.name]}),s.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),s.jsxs("div",{className:"modal-body exec-modal-body",children:[s.jsxs("div",{className:"exec-output",ref:p,children:[a.length===0?s.jsxs("div",{className:"exec-welcome",children:[s.jsxs("p",{children:["Execute commands in container ",s.jsx("code",{children:e.name})]}),s.jsx("p",{className:"text-muted",children:"Type a command and press Enter"})]}):a.map((m,x)=>s.jsx("div",{className:`exec-line exec-${m.type}`,children:s.jsx("pre",{children:m.text})},x)),l&&s.jsxs("div",{className:"exec-line exec-loading",children:[s.jsx("span",{className:"spinner-inline"})," Running..."]})]}),s.jsxs("form",{onSubmit:N,className:"exec-input-form",children:[s.jsx("span",{className:"exec-prompt",children:"$"}),s.jsx("input",{ref:v,type:"text",value:n,onChange:m=>r(m.target.value),onKeyDown:j,placeholder:"Enter command...",className:"exec-input",disabled:l,autoComplete:"off",spellCheck:"false"}),s.jsx("button",{type:"submit",className:"btn btn-primary btn-sm",disabled:l||!n.trim(),children:"Run"})]})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{className:"btn btn-secondary",onClick:k,children:"Clear"}),s.jsx("button",{className:"btn btn-primary",onClick:t,children:"Close"})]})]})})},wg=()=>{const e=Se(),[t,n]=d.useState([]),[r,a]=d.useState(!0),[i,l]=d.useState(!1);d.useEffect(()=>{c()},[]);async function c(){a(!0);try{const u=await b.getImages();n(u.images||[])}catch(u){console.error("Failed to load images:",u)}finally{a(!1)}}async function o(u){if(confirm("Remove this image?"))try{await b.removeImage(u,!0),e.success("Image removed successfully"),c()}catch(f){console.error("Failed to remove image:",f),e.error("Failed to remove image. It may be in use by a container.")}}return r?s.jsx("div",{className:"loading",children:"Loading images..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Docker Images"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>l(!0),children:"Pull Image"})]}),t.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No images"}),s.jsx("p",{children:"Pull your first image to get started."})]}):s.jsx("div",{className:"docker-list",children:t.map(u=>s.jsxs("div",{className:"docker-item",children:[s.jsxs("div",{className:"docker-item-info",children:[s.jsx("div",{className:"docker-item-icon image-icon",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),s.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),s.jsx("path",{d:"M21 15l-5-5L5 21"})]})}),s.jsxs("div",{className:"docker-item-details",children:[s.jsxs("h3",{children:[u.repository,":",u.tag]}),s.jsxs("div",{className:"docker-item-meta",children:[s.jsx("span",{className:"mono",children:u.id.substring(0,12)}),s.jsx("span",{children:u.size}),s.jsx("span",{children:u.created})]})]})]}),s.jsx("div",{className:"docker-item-actions",children:s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>o(u.id),children:"Remove"})})]},u.id))}),i&&s.jsx(kg,{onClose:()=>l(!1),onPulled:c})]})},kg=({onClose:e,onPulled:t})=>{const[n,r]=d.useState(""),[a,i]=d.useState("latest"),[l,c]=d.useState(!1),[o,u]=d.useState("");async function f(h){h.preventDefault(),u(""),c(!0);try{await b.pullImage(n,a),t(),e()}catch(p){u(p.message||"Failed to pull image")}finally{c(!1)}}return s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Pull Image"}),s.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),o&&s.jsx("div",{className:"error-message",children:o}),s.jsxs("form",{onSubmit:f,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Image Name *"}),s.jsx("input",{type:"text",value:n,onChange:h=>r(h.target.value),placeholder:"nginx, mysql, redis",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Tag"}),s.jsx("input",{type:"text",value:a,onChange:h=>i(h.target.value),placeholder:"latest"})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:l,children:l?"Pulling...":"Pull Image"})]})]})]})})},Sg=()=>{const e=Se(),[t,n]=d.useState([]),[r,a]=d.useState(!0),[i,l]=d.useState(!1);d.useEffect(()=>{c()},[]);async function c(){a(!0);try{const f=await b.getNetworks();n(f.networks||[])}catch(f){console.error("Failed to load networks:",f)}finally{a(!1)}}async function o(f){if(confirm("Remove this network?"))try{await b.removeNetwork(f),e.success("Network removed successfully"),c()}catch(h){console.error("Failed to remove network:",h),e.error("Failed to remove network. It may be in use.")}}if(r)return s.jsx("div",{className:"loading",children:"Loading networks..."});const u=["bridge","host","none"];return s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Docker Networks"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>l(!0),children:"Create Network"})]}),s.jsx("div",{className:"docker-list",children:t.map(f=>s.jsxs("div",{className:"docker-item",children:[s.jsxs("div",{className:"docker-item-info",children:[s.jsx("div",{className:"docker-item-icon network-icon",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),s.jsx("path",{d:"M2 17l10 5 10-5"}),s.jsx("path",{d:"M2 12l10 5 10-5"})]})}),s.jsxs("div",{className:"docker-item-details",children:[s.jsx("h3",{children:f.name}),s.jsxs("div",{className:"docker-item-meta",children:[s.jsx("span",{className:"mono",children:f.id.substring(0,12)}),s.jsxs("span",{children:["Driver: ",f.driver]}),s.jsxs("span",{children:["Scope: ",f.scope]})]})]})]}),s.jsx("div",{className:"docker-item-actions",children:!u.includes(f.name)&&s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>o(f.id),children:"Remove"})})]},f.id))}),i&&s.jsx(Cg,{onClose:()=>l(!1),onCreated:c})]})},Cg=({onClose:e,onCreated:t})=>{const[n,r]=d.useState(""),[a,i]=d.useState("bridge"),[l,c]=d.useState(!1),[o,u]=d.useState("");async function f(h){h.preventDefault(),u(""),c(!0);try{await b.createNetwork(n,a),t(),e()}catch(p){u(p.message||"Failed to create network")}finally{c(!1)}}return s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create Network"}),s.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),o&&s.jsx("div",{className:"error-message",children:o}),s.jsxs("form",{onSubmit:f,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Network Name *"}),s.jsx("input",{type:"text",value:n,onChange:h=>r(h.target.value),placeholder:"my-network",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Driver"}),s.jsxs("select",{value:a,onChange:h=>i(h.target.value),children:[s.jsx("option",{value:"bridge",children:"bridge"}),s.jsx("option",{value:"overlay",children:"overlay"}),s.jsx("option",{value:"macvlan",children:"macvlan"})]})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:l,children:l?"Creating...":"Create Network"})]})]})]})})},Pg=()=>{const e=Se(),[t,n]=d.useState([]),[r,a]=d.useState(!0),[i,l]=d.useState(!1);d.useEffect(()=>{c()},[]);async function c(){a(!0);try{const u=await b.getVolumes();n(u.volumes||[])}catch(u){console.error("Failed to load volumes:",u)}finally{a(!1)}}async function o(u){if(confirm("Remove this volume? All data will be lost."))try{await b.removeVolume(u,!0),e.success("Volume removed successfully"),c()}catch(f){console.error("Failed to remove volume:",f),e.error("Failed to remove volume. It may be in use.")}}return r?s.jsx("div",{className:"loading",children:"Loading volumes..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Docker Volumes"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>l(!0),children:"Create Volume"})]}),t.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No volumes"}),s.jsx("p",{children:"Create a volume for persistent data storage."})]}):s.jsx("div",{className:"docker-list",children:t.map(u=>s.jsxs("div",{className:"docker-item",children:[s.jsxs("div",{className:"docker-item-info",children:[s.jsx("div",{className:"docker-item-icon volume-icon",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:s.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})})}),s.jsxs("div",{className:"docker-item-details",children:[s.jsx("h3",{children:u.name}),s.jsx("div",{className:"docker-item-meta",children:s.jsxs("span",{children:["Driver: ",u.driver]})})]})]}),s.jsx("div",{className:"docker-item-actions",children:s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>o(u.name),children:"Remove"})})]},u.name))}),i&&s.jsx(_g,{onClose:()=>l(!1),onCreated:c})]})},_g=({onClose:e,onCreated:t})=>{const[n,r]=d.useState(""),[a,i]=d.useState(!1),[l,c]=d.useState("");async function o(u){u.preventDefault(),c(""),i(!0);try{await b.createVolume(n),t(),e()}catch(f){c(f.message||"Failed to create volume")}finally{i(!1)}}return s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:u=>u.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create Volume"}),s.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&s.jsx("div",{className:"error-message",children:l}),s.jsxs("form",{onSubmit:o,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Volume Name *"}),s.jsx("input",{type:"text",value:n,onChange:u=>r(u.target.value),placeholder:"my-volume",required:!0})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Creating...":"Create Volume"})]})]})]})})},Eg=()=>{var c,o,u,f;const[e,t]=d.useState("mysql"),[n,r]=d.useState(null),[a,i]=d.useState(!0);d.useEffect(()=>{l()},[]);async function l(){try{const h=await b.getDatabaseStatus();r(h),!h.mysql.running&&h.postgresql.running&&t("postgresql")}catch(h){console.error("Failed to get database status:",h)}finally{i(!1)}}return a?s.jsx("div",{className:"loading",children:"Checking database servers..."}):s.jsxs("div",{children:[s.jsxs("header",{className:"top-bar",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Databases"}),s.jsx("div",{className:"subtitle",children:"Manage MySQL and PostgreSQL databases"})]}),s.jsx("div",{className:"top-bar-actions",children:s.jsxs("div",{className:"db-status-indicators",children:[s.jsxs("span",{className:`db-status-indicator ${(c=n==null?void 0:n.mysql)!=null&&c.running?"active":"inactive"}`,children:[s.jsx("span",{className:"status-dot"}),"MySQL"]}),s.jsxs("span",{className:`db-status-indicator ${(o=n==null?void 0:n.postgresql)!=null&&o.running?"active":"inactive"}`,children:[s.jsx("span",{className:"status-dot"}),"PostgreSQL"]})]})})]}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${e==="mysql"?"active":""}`,onClick:()=>t("mysql"),disabled:!((u=n==null?void 0:n.mysql)!=null&&u.installed),children:"MySQL / MariaDB"}),s.jsx("button",{className:`tab ${e==="postgresql"?"active":""}`,onClick:()=>t("postgresql"),disabled:!((f=n==null?void 0:n.postgresql)!=null&&f.installed),children:"PostgreSQL"}),s.jsx("button",{className:`tab ${e==="backups"?"active":""}`,onClick:()=>t("backups"),children:"Backups"})]}),s.jsxs("div",{className:"tab-content",children:[e==="mysql"&&s.jsx(Tg,{status:n==null?void 0:n.mysql}),e==="postgresql"&&s.jsx(Lg,{status:n==null?void 0:n.postgresql}),e==="backups"&&s.jsx(Dg,{})]})]})},Tg=({status:e})=>{const t=Se(),[n,r]=d.useState([]),[a,i]=d.useState([]),[l,c]=d.useState(!0),[o,u]=d.useState("databases"),[f,h]=d.useState(!1),[p,v]=d.useState(!1),[N,j]=d.useState(null);d.useEffect(()=>{e!=null&&e.running?k():c(!1)},[e]);async function k(){c(!0);try{const[y,S]=await Promise.all([b.getMySQLDatabases(),b.getMySQLUsers()]);r(y.databases||[]),i(S.users||[])}catch(y){console.error("Failed to load MySQL data:",y)}finally{c(!1)}}async function m(y){if(confirm(`Drop database "${y}"? This cannot be undone!`))try{await b.dropMySQLDatabase(y),t.success(`Database "${y}" dropped successfully`),k()}catch(S){console.error("Failed to drop database:",S),t.error("Failed to drop database")}}async function x(y){try{const S=await b.backupMySQLDatabase(y);S.success&&t.success(`Backup created: ${S.backup_path}`)}catch(S){console.error("Failed to backup database:",S),t.error("Failed to create backup")}}async function g(y,S){if(confirm(`Drop user "${y}"@"${S}"?`))try{await b.dropMySQLUser(y,S),t.success(`User "${y}" dropped successfully`),k()}catch(E){console.error("Failed to drop user:",E),t.error("Failed to drop user")}}return e!=null&&e.running?l?s.jsx("div",{className:"loading",children:"Loading MySQL data..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsxs("div",{className:"view-toggle",children:[s.jsxs("button",{className:`btn btn-sm ${o==="databases"?"btn-primary":"btn-secondary"}`,onClick:()=>u("databases"),children:["Databases (",n.length,")"]}),s.jsxs("button",{className:`btn btn-sm ${o==="users"?"btn-primary":"btn-secondary"}`,onClick:()=>u("users"),children:["Users (",a.length,")"]})]}),o==="databases"?s.jsx("button",{className:"btn btn-primary",onClick:()=>h(!0),children:"Create Database"}):s.jsx("button",{className:"btn btn-primary",onClick:()=>v(!0),children:"Create User"})]}),o==="databases"?n.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No databases"}),s.jsx("p",{children:"Create your first MySQL database."})]}):s.jsx("div",{className:"db-list",children:n.map(y=>s.jsxs("div",{className:"db-item",children:[s.jsxs("div",{className:"db-item-info",children:[s.jsx("div",{className:"db-item-icon mysql",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),s.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]})}),s.jsxs("div",{className:"db-item-details",children:[s.jsx("h3",{children:y.name}),s.jsxs("div",{className:"db-item-meta",children:[s.jsx("span",{children:_o(y.size)}),s.jsx("span",{children:"MySQL"})]})]})]}),s.jsxs("div",{className:"db-item-actions",children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>j(y),children:"Tables"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>x(y.name),children:"Backup"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>m(y.name),children:"Drop"})]})]},y.name))}):a.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No users"}),s.jsx("p",{children:"Create your first MySQL user."})]}):s.jsx("div",{className:"db-list",children:a.map(y=>s.jsxs("div",{className:"db-item",children:[s.jsxs("div",{className:"db-item-info",children:[s.jsx("div",{className:"db-item-icon user",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),s.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),s.jsxs("div",{className:"db-item-details",children:[s.jsx("h3",{children:y.user}),s.jsx("div",{className:"db-item-meta",children:s.jsxs("span",{children:["Host: ",y.host]})})]})]}),s.jsx("div",{className:"db-item-actions",children:s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>g(y.user,y.host),children:"Drop"})})]},`${y.user}@${y.host}`))}),f&&s.jsx(Fg,{onClose:()=>h(!1),onCreated:k}),p&&s.jsx(Mg,{databases:n,onClose:()=>v(!1),onCreated:k}),N&&s.jsx(Uh,{database:N,dbType:"mysql",onClose:()=>j(null)})]}):s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"MySQL is not running"}),s.jsx("p",{children:"Start the MySQL server to manage databases."})]})},Lg=({status:e})=>{const t=Se(),[n,r]=d.useState([]),[a,i]=d.useState([]),[l,c]=d.useState(!0),[o,u]=d.useState("databases"),[f,h]=d.useState(!1),[p,v]=d.useState(!1),[N,j]=d.useState(null);d.useEffect(()=>{e!=null&&e.running?k():c(!1)},[e]);async function k(){c(!0);try{const[y,S]=await Promise.all([b.getPostgreSQLDatabases(),b.getPostgreSQLUsers()]);r(y.databases||[]),i(S.users||[])}catch(y){console.error("Failed to load PostgreSQL data:",y)}finally{c(!1)}}async function m(y){if(confirm(`Drop database "${y}"? This cannot be undone!`))try{await b.dropPostgreSQLDatabase(y),t.success(`Database "${y}" dropped successfully`),k()}catch(S){console.error("Failed to drop database:",S),t.error("Failed to drop database")}}async function x(y){try{const S=await b.backupPostgreSQLDatabase(y);S.success&&t.success(`Backup created: ${S.backup_path}`)}catch(S){console.error("Failed to backup database:",S),t.error("Failed to create backup")}}async function g(y){if(confirm(`Drop user "${y}"?`))try{await b.dropPostgreSQLUser(y),t.success(`User "${y}" dropped successfully`),k()}catch(S){console.error("Failed to drop user:",S),t.error("Failed to drop user")}}return e!=null&&e.running?l?s.jsx("div",{className:"loading",children:"Loading PostgreSQL data..."}):s.jsxs("div",{children:[s.jsxs("div",{className:"section-header",children:[s.jsxs("div",{className:"view-toggle",children:[s.jsxs("button",{className:`btn btn-sm ${o==="databases"?"btn-primary":"btn-secondary"}`,onClick:()=>u("databases"),children:["Databases (",n.length,")"]}),s.jsxs("button",{className:`btn btn-sm ${o==="users"?"btn-primary":"btn-secondary"}`,onClick:()=>u("users"),children:["Users (",a.length,")"]})]}),o==="databases"?s.jsx("button",{className:"btn btn-primary",onClick:()=>h(!0),children:"Create Database"}):s.jsx("button",{className:"btn btn-primary",onClick:()=>v(!0),children:"Create User"})]}),o==="databases"?n.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No databases"}),s.jsx("p",{children:"Create your first PostgreSQL database."})]}):s.jsx("div",{className:"db-list",children:n.map(y=>s.jsxs("div",{className:"db-item",children:[s.jsxs("div",{className:"db-item-info",children:[s.jsx("div",{className:"db-item-icon postgresql",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),s.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]})}),s.jsxs("div",{className:"db-item-details",children:[s.jsx("h3",{children:y.name}),s.jsxs("div",{className:"db-item-meta",children:[s.jsx("span",{children:_o(y.size)}),s.jsx("span",{children:"PostgreSQL"})]})]})]}),s.jsxs("div",{className:"db-item-actions",children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>j(y),children:"Tables"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>x(y.name),children:"Backup"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>m(y.name),children:"Drop"})]})]},y.name))}):a.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No users"}),s.jsx("p",{children:"Create your first PostgreSQL user."})]}):s.jsx("div",{className:"db-list",children:a.map(y=>s.jsxs("div",{className:"db-item",children:[s.jsxs("div",{className:"db-item-info",children:[s.jsx("div",{className:"db-item-icon user",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),s.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),s.jsxs("div",{className:"db-item-details",children:[s.jsx("h3",{children:y.user}),s.jsx("div",{className:"db-item-meta",children:s.jsx("span",{children:"PostgreSQL User"})})]})]}),s.jsx("div",{className:"db-item-actions",children:s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>g(y.user),children:"Drop"})})]},y.user))}),f&&s.jsx(Ag,{onClose:()=>h(!1),onCreated:k}),p&&s.jsx($g,{databases:n,onClose:()=>v(!1),onCreated:k}),N&&s.jsx(Uh,{database:N,dbType:"postgresql",onClose:()=>j(null)})]}):s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"PostgreSQL is not running"}),s.jsx("p",{children:"Start the PostgreSQL server to manage databases."})]})},Dg=()=>{const[e,t]=d.useState([]),[n,r]=d.useState(!0),[a,i]=d.useState("all");d.useEffect(()=>{l()},[a]);async function l(){r(!0);try{const o=a==="all"?null:a,u=await b.getDatabaseBackups(o);t(u.backups||[])}catch(o){console.error("Failed to load backups:",o)}finally{r(!1)}}async function c(o){if(confirm("Delete this backup?"))try{await b.deleteDatabaseBackup(o),l()}catch(u){console.error("Failed to delete backup:",u)}}return n?s.jsx("div",{className:"loading",children:"Loading backups..."}):s.jsxs("div",{children:[s.jsx("div",{className:"section-header",children:s.jsxs("div",{className:"view-toggle",children:[s.jsx("button",{className:`btn btn-sm ${a==="all"?"btn-primary":"btn-secondary"}`,onClick:()=>i("all"),children:"All"}),s.jsx("button",{className:`btn btn-sm ${a==="mysql"?"btn-primary":"btn-secondary"}`,onClick:()=>i("mysql"),children:"MySQL"}),s.jsx("button",{className:`btn btn-sm ${a==="postgresql"?"btn-primary":"btn-secondary"}`,onClick:()=>i("postgresql"),children:"PostgreSQL"})]})}),e.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("h3",{children:"No backups"}),s.jsx("p",{children:"Database backups will appear here."})]}):s.jsx("div",{className:"db-list",children:e.map(o=>s.jsxs("div",{className:"db-item",children:[s.jsxs("div",{className:"db-item-info",children:[s.jsx("div",{className:`db-item-icon ${o.type}`,children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),s.jsx("polyline",{points:"7 10 12 15 17 10"}),s.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),s.jsxs("div",{className:"db-item-details",children:[s.jsx("h3",{children:o.database}),s.jsxs("div",{className:"db-item-meta",children:[s.jsx("span",{className:"mono",children:o.filename}),s.jsx("span",{children:_o(o.size)}),s.jsx("span",{children:new Date(o.created_at).toLocaleString()})]})]})]}),s.jsxs("div",{className:"db-item-actions",children:[s.jsx("span",{className:`db-type-badge ${o.type}`,children:o.type==="mysql"?"MySQL":"PostgreSQL"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>c(o.filename),children:"Delete"})]})]},o.filename))})]})},Fg=({onClose:e,onCreated:t})=>{const[n,r]=d.useState({name:"",charset:"utf8mb4",collation:"utf8mb4_unicode_ci",create_user:!0,user_password:""}),[a,i]=d.useState(!1),[l,c]=d.useState(""),[o,u]=d.useState(null);async function f(h){h.preventDefault(),c(""),i(!0);try{const p=await b.createMySQLDatabase(n);p.success&&(p.password?u({database:n.name,user:p.user,password:p.password}):(t(),e()))}catch(p){c(p.message||"Failed to create database")}finally{i(!1)}}return o?s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Database Created"}),s.jsx("button",{className:"modal-close",onClick:()=>{t(),e()},children:"×"})]}),s.jsx("div",{className:"modal-body",children:s.jsxs("div",{className:"credentials-box",children:[s.jsx("p",{children:"Save these credentials - the password won't be shown again!"}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Database:"}),s.jsx("code",{children:o.database})]}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Username:"}),s.jsx("code",{children:o.user})]}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Password:"}),s.jsx("code",{children:o.password})]})]})}),s.jsx("div",{className:"modal-actions",children:s.jsx("button",{className:"btn btn-primary",onClick:()=>{t(),e()},children:"Done"})})]})}):s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create MySQL Database"}),s.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&s.jsx("div",{className:"error-message",children:l}),s.jsxs("form",{onSubmit:f,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Database Name *"}),s.jsx("input",{type:"text",value:n.name,onChange:h=>r({...n,name:h.target.value}),placeholder:"my_database",required:!0,pattern:"[a-zA-Z0-9_]+"})]}),s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Character Set"}),s.jsxs("select",{value:n.charset,onChange:h=>r({...n,charset:h.target.value}),children:[s.jsx("option",{value:"utf8mb4",children:"utf8mb4"}),s.jsx("option",{value:"utf8",children:"utf8"}),s.jsx("option",{value:"latin1",children:"latin1"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Collation"}),s.jsxs("select",{value:n.collation,onChange:h=>r({...n,collation:h.target.value}),children:[s.jsx("option",{value:"utf8mb4_unicode_ci",children:"utf8mb4_unicode_ci"}),s.jsx("option",{value:"utf8mb4_general_ci",children:"utf8mb4_general_ci"}),s.jsx("option",{value:"utf8_general_ci",children:"utf8_general_ci"})]})]})]}),s.jsx("div",{className:"form-group",children:s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:n.create_user,onChange:h=>r({...n,create_user:h.target.checked})}),"Create user with same name and full privileges"]})}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Creating...":"Create Database"})]})]})]})})},Mg=({databases:e,onClose:t,onCreated:n})=>{const[r,a]=d.useState({username:"",password:"",host:"localhost",database:"",privileges:"ALL"}),[i,l]=d.useState(!1),[c,o]=d.useState(""),[u,f]=d.useState(null);async function h(){try{const v=await b.generateDatabasePassword();a({...r,password:v.password})}catch(v){console.error("Failed to generate password:",v)}}async function p(v){v.preventDefault(),o(""),l(!0);try{const N=await b.createMySQLUser(r);N.success&&f({username:r.username,password:N.password,host:r.host})}catch(N){o(N.message||"Failed to create user")}finally{l(!1)}}return u?s.jsx("div",{className:"modal-overlay",onClick:t,children:s.jsxs("div",{className:"modal",onClick:v=>v.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"User Created"}),s.jsx("button",{className:"modal-close",onClick:()=>{n(),t()},children:"×"})]}),s.jsx("div",{className:"modal-body",children:s.jsxs("div",{className:"credentials-box",children:[s.jsx("p",{children:"Save these credentials!"}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Username:"}),s.jsx("code",{children:u.username})]}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Password:"}),s.jsx("code",{children:u.password})]}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Host:"}),s.jsx("code",{children:u.host})]})]})}),s.jsx("div",{className:"modal-actions",children:s.jsx("button",{className:"btn btn-primary",onClick:()=>{n(),t()},children:"Done"})})]})}):s.jsx("div",{className:"modal-overlay",onClick:t,children:s.jsxs("div",{className:"modal",onClick:v=>v.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create MySQL User"}),s.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),c&&s.jsx("div",{className:"error-message",children:c}),s.jsxs("form",{onSubmit:p,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Username *"}),s.jsx("input",{type:"text",value:r.username,onChange:v=>a({...r,username:v.target.value}),placeholder:"db_user",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Password"}),s.jsxs("div",{className:"input-with-button",children:[s.jsx("input",{type:"text",value:r.password,onChange:v=>a({...r,password:v.target.value}),placeholder:"Leave empty to auto-generate"}),s.jsx("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:h,children:"Generate"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Host"}),s.jsxs("select",{value:r.host,onChange:v=>a({...r,host:v.target.value}),children:[s.jsx("option",{value:"localhost",children:"localhost"}),s.jsx("option",{value:"%",children:"% (any host)"}),s.jsx("option",{value:"127.0.0.1",children:"127.0.0.1"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Grant privileges on database"}),s.jsxs("select",{value:r.database,onChange:v=>a({...r,database:v.target.value}),children:[s.jsx("option",{value:"",children:"-- None --"}),e.map(v=>s.jsx("option",{value:v.name,children:v.name},v.name))]})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:i,children:i?"Creating...":"Create User"})]})]})]})})},Ag=({onClose:e,onCreated:t})=>{const[n,r]=d.useState({name:"",encoding:"UTF8",create_user:!0}),[a,i]=d.useState(!1),[l,c]=d.useState(""),[o,u]=d.useState(null);async function f(h){h.preventDefault(),c(""),i(!0);try{const p=await b.createPostgreSQLDatabase(n);p.success&&(p.password?u({database:n.name,user:p.user,password:p.password}):(t(),e()))}catch(p){c(p.message||"Failed to create database")}finally{i(!1)}}return o?s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Database Created"}),s.jsx("button",{className:"modal-close",onClick:()=>{t(),e()},children:"×"})]}),s.jsx("div",{className:"modal-body",children:s.jsxs("div",{className:"credentials-box",children:[s.jsx("p",{children:"Save these credentials!"}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Database:"}),s.jsx("code",{children:o.database})]}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Username:"}),s.jsx("code",{children:o.user})]}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Password:"}),s.jsx("code",{children:o.password})]})]})}),s.jsx("div",{className:"modal-actions",children:s.jsx("button",{className:"btn btn-primary",onClick:()=>{t(),e()},children:"Done"})})]})}):s.jsx("div",{className:"modal-overlay",onClick:e,children:s.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create PostgreSQL Database"}),s.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&s.jsx("div",{className:"error-message",children:l}),s.jsxs("form",{onSubmit:f,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Database Name *"}),s.jsx("input",{type:"text",value:n.name,onChange:h=>r({...n,name:h.target.value}),placeholder:"my_database",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Encoding"}),s.jsxs("select",{value:n.encoding,onChange:h=>r({...n,encoding:h.target.value}),children:[s.jsx("option",{value:"UTF8",children:"UTF8"}),s.jsx("option",{value:"LATIN1",children:"LATIN1"}),s.jsx("option",{value:"SQL_ASCII",children:"SQL_ASCII"})]})]}),s.jsx("div",{className:"form-group",children:s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:n.create_user,onChange:h=>r({...n,create_user:h.target.checked})}),"Create user with same name and full privileges"]})}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Creating...":"Create Database"})]})]})]})})},$g=({databases:e,onClose:t,onCreated:n})=>{const[r,a]=d.useState({username:"",password:"",database:""}),[i,l]=d.useState(!1),[c,o]=d.useState(""),[u,f]=d.useState(null);async function h(){try{const v=await b.generateDatabasePassword();a({...r,password:v.password})}catch(v){console.error("Failed to generate password:",v)}}async function p(v){v.preventDefault(),o(""),l(!0);try{const N=await b.createPostgreSQLUser(r);N.success&&f({username:r.username,password:N.password})}catch(N){o(N.message||"Failed to create user")}finally{l(!1)}}return u?s.jsx("div",{className:"modal-overlay",onClick:t,children:s.jsxs("div",{className:"modal",onClick:v=>v.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"User Created"}),s.jsx("button",{className:"modal-close",onClick:()=>{n(),t()},children:"×"})]}),s.jsx("div",{className:"modal-body",children:s.jsxs("div",{className:"credentials-box",children:[s.jsx("p",{children:"Save these credentials!"}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Username:"}),s.jsx("code",{children:u.username})]}),s.jsxs("div",{className:"credential-item",children:[s.jsx("label",{children:"Password:"}),s.jsx("code",{children:u.password})]})]})}),s.jsx("div",{className:"modal-actions",children:s.jsx("button",{className:"btn btn-primary",onClick:()=>{n(),t()},children:"Done"})})]})}):s.jsx("div",{className:"modal-overlay",onClick:t,children:s.jsxs("div",{className:"modal",onClick:v=>v.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create PostgreSQL User"}),s.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),c&&s.jsx("div",{className:"error-message",children:c}),s.jsxs("form",{onSubmit:p,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Username *"}),s.jsx("input",{type:"text",value:r.username,onChange:v=>a({...r,username:v.target.value}),placeholder:"db_user",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Password"}),s.jsxs("div",{className:"input-with-button",children:[s.jsx("input",{type:"text",value:r.password,onChange:v=>a({...r,password:v.target.value}),placeholder:"Leave empty to auto-generate"}),s.jsx("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:h,children:"Generate"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Grant privileges on database"}),s.jsxs("select",{value:r.database,onChange:v=>a({...r,database:v.target.value}),children:[s.jsx("option",{value:"",children:"-- None --"}),e.map(v=>s.jsx("option",{value:v.name,children:v.name},v.name))]})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:i,children:i?"Creating...":"Create User"})]})]})]})})},Uh=({database:e,dbType:t,onClose:n})=>{const[r,a]=d.useState([]),[i,l]=d.useState(!0);d.useEffect(()=>{c()},[e,t]);async function c(){try{let o;t==="mysql"?o=await b.getMySQLTables(e.name):o=await b.getPostgreSQLTables(e.name),a(o.tables||[])}catch(o){console.error("Failed to load tables:",o)}finally{l(!1)}}return s.jsx("div",{className:"modal-overlay",onClick:n,children:s.jsxs("div",{className:"modal",onClick:o=>o.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h2",{children:["Tables in ",e.name]}),s.jsx("button",{className:"modal-close",onClick:n,children:"×"})]}),s.jsx("div",{className:"modal-body",children:i?s.jsx("div",{className:"loading",children:"Loading tables..."}):r.length===0?s.jsx("p",{className:"hint",children:"No tables in this database."}):s.jsx("div",{className:"tables-list",children:r.map(o=>s.jsxs("div",{className:"table-item",children:[s.jsx("span",{className:"table-name",children:o.name}),s.jsxs("span",{className:"table-rows",children:[o.rows.toLocaleString()," rows"]})]},o.name))})}),s.jsx("div",{className:"modal-actions",children:s.jsx("button",{className:"btn btn-primary",onClick:n,children:"Close"})})]})})};function _o(e){if(!e||e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}const Rg=()=>{const e=Se(),[t,n]=d.useState([]),[r,a]=d.useState([]),[i,l]=d.useState(null),[c,o]=d.useState(!0),[u,f]=d.useState(""),[h,p]=d.useState(!1),[v,N]=d.useState(!1),[j,k]=d.useState(null),[m,x]=d.useState(""),[g,y]=d.useState(""),[S,E]=d.useState(!1),[T,P]=d.useState(""),[O,w]=d.useState(!1);d.useEffect(()=>{L()},[]);async function L(){try{o(!0);const[_,I,Q]=await Promise.all([b.getDomains(),b.getApps(),b.getDomainsSslStatus().catch(()=>null)]);n(_.domains||[]),a(I.apps||[]),l(Q)}catch(_){f("Failed to load data"),console.error(_)}finally{o(!1)}}async function U(_){if(_.preventDefault(),!(!m||!g))try{w(!0),await b.createDomain({name:m,application_id:parseInt(g),is_primary:S}),p(!1),x(""),y(""),E(!1),L()}catch(I){f(I.message)}finally{w(!1)}}async function V(_){if(confirm(`Are you sure you want to delete ${_.name}?`))try{await b.deleteDomain(_.id),L()}catch(I){f(I.message)}}async function H(_){if(_.preventDefault(),!(!j||!T))try{w(!0),await b.enableSsl(j.id,T),N(!1),P(""),k(null),L()}catch(I){f(I.message)}finally{w(!1)}}async function B(_){if(confirm(`Disable SSL for ${_.name}?`))try{await b.disableSsl(_.id),L()}catch(I){f(I.message)}}async function z(_){try{w(!0),await b.renewDomainSsl(_.id),L()}catch(I){f(I.message)}finally{w(!1)}}async function J(_){try{const I=await b.verifyDomain(_.id);I.verified?e.success(`Domain verified! IP: ${I.ip_address}`):e.error(`Domain verification failed: ${I.error}`)}catch(I){f(I.message)}}function R(_){const I=r.find(Q=>Q.id===_);return I?I.name:"Unknown"}return c?s.jsx("div",{className:"loading",children:"Loading domains..."}):s.jsxs("div",{children:[s.jsxs("header",{className:"top-bar",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Domains & SSL"}),s.jsx("p",{className:"subtitle",children:"Manage your domains and SSL certificates"})]}),s.jsxs("div",{className:"top-bar-actions",children:[s.jsxs("button",{className:"btn btn-secondary",onClick:L,children:[s.jsx(xl,{size:16}),"Refresh"]}),s.jsxs("button",{className:"btn btn-primary",onClick:()=>p(!0),children:[s.jsx(pa,{size:16}),"Add Domain"]})]})]}),u&&s.jsxs("div",{className:"error-banner",children:[u,s.jsx("button",{onClick:()=>f(""),style:{float:"right",background:"none",border:"none",cursor:"pointer"},children:"×"})]}),i&&s.jsxs("div",{className:"ssl-status-bar",children:[s.jsxs("div",{className:"ssl-status-item",children:[s.jsx("div",{className:`ssl-status-icon ${i.certbot_installed?"active":"inactive"}`,children:i.certbot_installed?s.jsx(br,{size:24}):s.jsx(Qx,{size:24})}),s.jsxs("div",{className:"ssl-status-info",children:[s.jsx("h4",{children:"Certbot"}),s.jsx("span",{children:i.certbot_installed?"Installed":"Not Installed"})]})]}),s.jsxs("div",{className:"ssl-status-item",children:[s.jsx("div",{className:"ssl-status-icon active",children:s.jsx(fi,{size:24})}),s.jsxs("div",{className:"ssl-status-info",children:[s.jsx("h4",{children:"Certificates"}),s.jsxs("span",{children:[i.total_certificates," active"]})]})]})]}),s.jsx("h2",{className:"section-title",children:"Domains"}),t.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx(Pn,{size:48}),s.jsx("h3",{children:"No domains configured"}),s.jsx("p",{children:"Add a domain to your application to get started."}),s.jsxs("button",{className:"btn btn-primary",onClick:()=>p(!0),children:[s.jsx(pa,{size:16}),"Add Domain"]})]}):s.jsx("div",{className:"domain-list",children:t.map(_=>s.jsxs("div",{className:"domain-item",children:[s.jsxs("div",{className:"domain-item-info",children:[s.jsx("div",{className:`domain-item-icon ${_.ssl_enabled?"ssl":""}`,children:_.ssl_enabled?s.jsx(br,{size:20}):s.jsx(Pn,{size:20})}),s.jsxs("div",{className:"domain-item-details",children:[s.jsxs("h3",{children:[_.name,_.is_primary&&s.jsx("span",{className:"primary-badge",children:"Primary"})]}),s.jsxs("div",{className:"domain-item-meta",children:[s.jsxs("span",{className:"app-link",children:[s.jsx(Ch,{size:12}),R(_.application_id)]}),_.ssl_enabled&&s.jsxs("span",{className:"ssl-badge",children:[s.jsx(fi,{size:12}),"SSL Active"]})]})]})]}),s.jsxs("div",{className:"domain-item-actions",children:[s.jsxs("a",{href:`${_.ssl_enabled?"https":"http"}://${_.name}`,target:"_blank",rel:"noopener noreferrer",className:"btn btn-secondary btn-sm",children:[s.jsx(Ux,{size:14}),"Visit"]}),s.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>J(_),children:[s.jsx(Wx,{size:14}),"Verify DNS"]}),_.ssl_enabled?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>z(_),disabled:O,children:[s.jsx(xl,{size:14}),"Renew SSL"]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>B(_),children:s.jsx(Vx,{size:14})})]}):s.jsxs("button",{className:"btn btn-primary btn-sm",onClick:()=>{k(_),N(!0)},children:[s.jsx(fi,{size:14}),"Enable SSL"]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>V(_),children:s.jsx(Kx,{size:14})})]})]},_.id))}),i&&i.certificates&&i.certificates.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"section-title",style:{marginTop:"40px"},children:"SSL Certificates"}),s.jsx("div",{className:"cert-list",children:i.certificates.map((_,I)=>{var Q;return s.jsxs("div",{className:"cert-item",children:[s.jsxs("div",{className:"cert-item-info",children:[s.jsx("div",{className:"cert-item-icon",children:s.jsx(br,{size:20})}),s.jsxs("div",{className:"cert-item-details",children:[s.jsx("h3",{children:_.name}),s.jsxs("div",{className:"cert-item-meta",children:[s.jsxs("span",{children:[s.jsx(Pn,{size:12}),(Q=_.domains)==null?void 0:Q.join(", ")]}),_.expiry&&s.jsxs("span",{className:_.expiry_valid?"valid":"expiring",children:[s.jsx(Ox,{size:12}),"Expires: ",_.expiry]})]})]})]}),s.jsx("div",{className:"cert-status",children:_.expiry_valid?s.jsxs("span",{className:"status-badge status-active",children:[s.jsx(Sh,{size:14}),"Valid"]}):s.jsxs("span",{className:"status-badge status-warning",children:[s.jsx(Aa,{size:14}),"Expiring Soon"]})})]},I)})})]}),h&&s.jsx("div",{className:"modal-overlay",onClick:()=>p(!1),children:s.jsxs("div",{className:"modal",onClick:_=>_.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Add Domain"}),s.jsx("button",{className:"modal-close",onClick:()=>p(!1),children:"×"})]}),s.jsxs("form",{onSubmit:U,children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Domain Name"}),s.jsx("input",{type:"text",placeholder:"example.com",value:m,onChange:_=>x(_.target.value),required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Application"}),s.jsxs("select",{value:g,onChange:_=>y(_.target.value),required:!0,children:[s.jsx("option",{value:"",children:"Select an application"}),r.map(_=>s.jsx("option",{value:_.id,children:_.name},_.id))]})]}),s.jsx("div",{className:"form-group",children:s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:S,onChange:_=>E(_.target.checked)}),"Set as primary domain"]})}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>p(!1),children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:O,children:O?"Adding...":"Add Domain"})]})]})]})}),v&&j&&s.jsx("div",{className:"modal-overlay",onClick:()=>N(!1),children:s.jsxs("div",{className:"modal",onClick:_=>_.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Enable SSL Certificate"}),s.jsx("button",{className:"modal-close",onClick:()=>N(!1),children:"×"})]}),s.jsxs("form",{onSubmit:H,children:[s.jsxs("div",{className:"ssl-info-box",children:[s.jsx(br,{size:32}),s.jsxs("div",{children:[s.jsx("h4",{children:"Free SSL from Let's Encrypt"}),s.jsxs("p",{children:["A free SSL certificate will be obtained for ",s.jsx("strong",{children:j.name})]})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Email Address"}),s.jsx("input",{type:"email",placeholder:"[email protected]",value:T,onChange:_=>P(_.target.value),required:!0}),s.jsx("p",{className:"hint",children:"Required for certificate expiration notifications"})]}),s.jsxs("div",{className:"modal-actions",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>N(!1),children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:O,children:O?"Obtaining Certificate...":"Enable SSL"})]})]})]})})]})},Og=()=>{const e=Se(),[t,n]=d.useState(null),[r,a]=d.useState(null),[i,l]=d.useState(null),[c,o]=d.useState([]),[u,f]=d.useState(!0),[h,p]=d.useState(null),[v,N]=d.useState("overview"),[j,k]=d.useState({enabled:!1,check_interval:60,alert_email:"",alert_webhook:""}),[m,x]=d.useState({cpu_percent:90,memory_percent:90,disk_percent:90,load_average:5}),[g,y]=d.useState(""),[S,E]=d.useState("");d.useEffect(()=>{T()},[]);const T=async()=>{try{f(!0);const[B,z,J,R]=await Promise.all([b.getMonitoringStatus(),b.getMonitoringConfig(),b.getMonitoringThresholds(),b.getAlertHistory(50)]);n(B),a(z),l(J.thresholds),o(R.alerts||[]),z&&k({enabled:z.enabled||!1,check_interval:z.check_interval||60,alert_email:z.alert_email||"",alert_webhook:z.alert_webhook||""}),J.thresholds&&x(J.thresholds)}catch(B){p(B.message)}finally{f(!1)}},P=async()=>{try{t!=null&&t.monitoring_active?await b.stopMonitoring():await b.startMonitoring(),T()}catch(B){p(B.message)}},O=async B=>{B.preventDefault();try{await b.updateMonitoringConfig(j),T()}catch(z){p(z.message)}},w=async B=>{B.preventDefault();try{await b.updateMonitoringThresholds(m),T()}catch(z){p(z.message)}},L=async()=>{try{await b.testEmailAlert(g||j.alert_email),e.success("Test email sent successfully")}catch(B){e.error(B.message)}},U=async()=>{try{await b.testWebhookAlert(S||j.alert_webhook),e.success("Test webhook sent successfully")}catch(B){e.error(B.message)}},V=B=>{switch(B){case"critical":return"badge-danger";case"warning":return"badge-warning";case"info":return"badge-info";default:return"badge-secondary"}},H=B=>new Date(B).toLocaleString();return u?s.jsx("div",{className:"page",children:s.jsx("div",{className:"loading",children:"Loading monitoring data..."})}):s.jsxs("div",{className:"page monitoring-page",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Monitoring & Alerts"}),s.jsx("p",{className:"page-subtitle",children:"System monitoring and alert configuration"})]}),s.jsx("div",{className:"page-actions",children:s.jsx("button",{className:`btn ${t!=null&&t.monitoring_active?"btn-danger":"btn-primary"}`,onClick:P,children:t!=null&&t.monitoring_active?s.jsxs(s.Fragment,{children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),s.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}),"Stop Monitoring"]}):s.jsxs(s.Fragment,{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),"Start Monitoring"]})})})]}),h&&s.jsxs("div",{className:"alert alert-danger",children:[h,s.jsx("button",{onClick:()=>p(null),className:"alert-close",children:"×"})]}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${v==="overview"?"active":""}`,onClick:()=>N("overview"),children:"Overview"}),s.jsx("button",{className:`tab ${v==="alerts"?"active":""}`,onClick:()=>N("alerts"),children:"Alert History"}),s.jsx("button",{className:`tab ${v==="config"?"active":""}`,onClick:()=>N("config"),children:"Configuration"}),s.jsx("button",{className:`tab ${v==="thresholds"?"active":""}`,onClick:()=>N("thresholds"),children:"Thresholds"})]}),v==="overview"&&s.jsxs("div",{className:"monitoring-overview",children:[s.jsxs("div",{className:"stats-grid",children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon status",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:s.jsx("circle",{cx:"12",cy:"12",r:"10"})})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Monitoring Status"}),s.jsx("span",{className:`stat-value ${t!=null&&t.monitoring_active?"text-success":"text-muted"}`,children:t!=null&&t.monitoring_active?"Active":"Inactive"})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon alerts",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:[s.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),s.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Recent Alerts"}),s.jsx("span",{className:"stat-value",children:c.length})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon interval",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Check Interval"}),s.jsxs("span",{className:"stat-value",children:[(r==null?void 0:r.check_interval)||60,"s"]})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon notifications",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:[s.jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),s.jsx("polyline",{points:"22,6 12,13 2,6"})]})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Notifications"}),s.jsxs("span",{className:"stat-value",children:[r!=null&&r.alert_email?"Email":"",r!=null&&r.alert_email&&(r!=null&&r.alert_webhook)?" + ":"",r!=null&&r.alert_webhook?"Webhook":"",!(r!=null&&r.alert_email)&&!(r!=null&&r.alert_webhook)?"None":""]})]})]})]}),s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-header",children:s.jsx("h3",{children:"Current Thresholds"})}),s.jsx("div",{className:"card-body",children:s.jsxs("div",{className:"threshold-grid",children:[s.jsxs("div",{className:"threshold-item",children:[s.jsx("span",{className:"threshold-label",children:"CPU Usage"}),s.jsxs("span",{className:"threshold-value",children:[(i==null?void 0:i.cpu_percent)||90,"%"]})]}),s.jsxs("div",{className:"threshold-item",children:[s.jsx("span",{className:"threshold-label",children:"Memory Usage"}),s.jsxs("span",{className:"threshold-value",children:[(i==null?void 0:i.memory_percent)||90,"%"]})]}),s.jsxs("div",{className:"threshold-item",children:[s.jsx("span",{className:"threshold-label",children:"Disk Usage"}),s.jsxs("span",{className:"threshold-value",children:[(i==null?void 0:i.disk_percent)||90,"%"]})]}),s.jsxs("div",{className:"threshold-item",children:[s.jsx("span",{className:"threshold-label",children:"Load Average"}),s.jsx("span",{className:"threshold-value",children:(i==null?void 0:i.load_average)||5})]})]})})]}),c.length>0&&s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-header",children:s.jsx("h3",{children:"Recent Alerts"})}),s.jsx("div",{className:"card-body",children:s.jsx("div",{className:"alert-list",children:c.slice(0,5).map((B,z)=>s.jsxs("div",{className:"alert-item",children:[s.jsx("span",{className:`badge ${V(B.severity)}`,children:B.severity}),s.jsx("span",{className:"alert-message",children:B.message}),s.jsx("span",{className:"alert-time",children:H(B.timestamp)})]},z))})})]})]}),v==="alerts"&&s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-header",children:[s.jsx("h3",{children:"Alert History"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:T,children:"Refresh"})]}),s.jsx("div",{className:"card-body",children:c.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"48",height:"48",children:[s.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),s.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),s.jsx("h3",{children:"No Alerts"}),s.jsx("p",{children:"No alerts have been triggered yet."})]}):s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Severity"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Message"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Threshold"}),s.jsx("th",{children:"Time"})]})}),s.jsx("tbody",{children:c.map((B,z)=>{var J;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("span",{className:`badge ${V(B.severity)}`,children:B.severity})}),s.jsx("td",{children:B.type}),s.jsx("td",{children:B.message}),s.jsx("td",{children:(J=B.value)==null?void 0:J.toFixed(1)}),s.jsx("td",{children:B.threshold}),s.jsx("td",{children:H(B.timestamp)})]},z)})})]})})]}),v==="config"&&s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-header",children:s.jsx("h3",{children:"Monitoring Configuration"})}),s.jsx("div",{className:"card-body",children:s.jsxs("form",{onSubmit:O,children:[s.jsx("div",{className:"form-group",children:s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:j.enabled,onChange:B=>k({...j,enabled:B.target.checked})}),s.jsx("span",{children:"Enable Monitoring"})]})}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Check Interval (seconds)"}),s.jsx("input",{type:"number",value:j.check_interval,onChange:B=>k({...j,check_interval:parseInt(B.target.value)}),min:"10",max:"3600"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Alert Email"}),s.jsxs("div",{className:"input-group",children:[s.jsx("input",{type:"email",value:j.alert_email,onChange:B=>k({...j,alert_email:B.target.value}),placeholder:"[email protected]"}),s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:L,disabled:!j.alert_email,children:"Test"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Webhook URL"}),s.jsxs("div",{className:"input-group",children:[s.jsx("input",{type:"url",value:j.alert_webhook,onChange:B=>k({...j,alert_webhook:B.target.value}),placeholder:"https://hooks.slack.com/..."}),s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:U,disabled:!j.alert_webhook,children:"Test"})]})]}),s.jsx("div",{className:"form-actions",children:s.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save Configuration"})})]})})]}),v==="thresholds"&&s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-header",children:s.jsx("h3",{children:"Alert Thresholds"})}),s.jsx("div",{className:"card-body",children:s.jsxs("form",{onSubmit:w,children:[s.jsxs("div",{className:"threshold-form-grid",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"CPU Usage (%)"}),s.jsx("input",{type:"number",value:m.cpu_percent,onChange:B=>x({...m,cpu_percent:parseInt(B.target.value)}),min:"1",max:"100"}),s.jsx("span",{className:"form-help",children:"Alert when CPU exceeds this percentage"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Memory Usage (%)"}),s.jsx("input",{type:"number",value:m.memory_percent,onChange:B=>x({...m,memory_percent:parseInt(B.target.value)}),min:"1",max:"100"}),s.jsx("span",{className:"form-help",children:"Alert when memory exceeds this percentage"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Disk Usage (%)"}),s.jsx("input",{type:"number",value:m.disk_percent,onChange:B=>x({...m,disk_percent:parseInt(B.target.value)}),min:"1",max:"100"}),s.jsx("span",{className:"form-help",children:"Alert when disk exceeds this percentage"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Load Average"}),s.jsx("input",{type:"number",step:"0.1",value:m.load_average,onChange:B=>x({...m,load_average:parseFloat(B.target.value)}),min:"0.1",max:"100"}),s.jsx("span",{className:"form-help",children:"Alert when load average exceeds this value"})]})]}),s.jsx("div",{className:"form-actions",children:s.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save Thresholds"})})]})})]})]})},Bg=()=>{const e=Se(),[t,n]=d.useState([]),[r,a]=d.useState(null),[i,l]=d.useState([]),[c,o]=d.useState(null),[u,f]=d.useState([]),[h,p]=d.useState(!0),[v,N]=d.useState(null),[j,k]=d.useState("backups"),[m,x]=d.useState("all"),[g,y]=d.useState(!1),[S,E]=d.useState(!1),[T,P]=d.useState(!1),[O,w]=d.useState(null),[L,U]=d.useState({type:"application",applicationId:"",includeDb:!1,dbType:"mysql",dbName:"",dbUser:"",dbPassword:"",dbHost:"localhost"}),[V,H]=d.useState({name:"",backupType:"application",target:"",scheduleTime:"02:00",days:["daily"]}),[B,z]=d.useState({enabled:!1,retention_days:30});d.useEffect(()=>{J()},[]);const J=async()=>{try{p(!0);const[D,W,fe,Ce,bt]=await Promise.all([b.getBackups(),b.getBackupStats(),b.getBackupSchedules(),b.getBackupConfig(),b.getApps()]);n(D.backups||[]),a(W),l(fe.schedules||[]),o(Ce),f(bt.applications||[]),Ce&&z({enabled:Ce.enabled||!1,retention_days:Ce.retention_days||30})}catch(D){N(D.message)}finally{p(!1)}},R=async D=>{D.preventDefault();try{if(L.type==="application"){const W=L.includeDb?{type:L.dbType,name:L.dbName,user:L.dbUser,password:L.dbPassword,host:L.dbHost}:null;await b.backupApplication(parseInt(L.applicationId),L.includeDb,W)}else await b.backupDatabase(L.dbType,L.dbName,L.dbUser,L.dbPassword,L.dbHost);y(!1),C(),J()}catch(W){N(W.message)}},_=async D=>{if(window.confirm("Are you sure you want to delete this backup?"))try{await b.deleteBackup(D),J()}catch(W){N(W.message)}},I=async()=>{if(O&&window.confirm("Are you sure you want to restore this backup? This may overwrite existing data."))try{O.type==="application"?await b.restoreApplication(O.path):await b.restoreDatabase(O.path,O.database_type,O.database_name),P(!1),w(null),e.success("Backup restored successfully")}catch(D){e.error(D.message)}},Q=async D=>{D.preventDefault();try{await b.addBackupSchedule(V.name,V.backupType,V.target,V.scheduleTime,V.days),E(!1),G(),J()}catch(W){N(W.message)}},Y=async D=>{if(window.confirm("Are you sure you want to remove this schedule?"))try{await b.removeBackupSchedule(D),J()}catch(W){N(W.message)}},ve=async D=>{D.preventDefault();try{await b.updateBackupConfig(B),J()}catch(W){N(W.message)}},ne=async()=>{if(window.confirm(`This will delete backups older than ${B.retention_days} days. Continue?`))try{const D=await b.cleanupBackups(B.retention_days);e.success(D.message),J()}catch(D){e.error(D.message)}},C=()=>{U({type:"application",applicationId:"",includeDb:!1,dbType:"mysql",dbName:"",dbUser:"",dbPassword:"",dbHost:"localhost"})},G=()=>{H({name:"",backupType:"application",target:"",scheduleTime:"02:00",days:["daily"]})},F=D=>{if(!D)return"0 B";const W=["B","KB","MB","GB","TB"];let fe=0,Ce=D;for(;Ce>=1024&&fe<W.length-1;)Ce/=1024,fe++;return`${Ce.toFixed(1)} ${W[fe]}`},ee=D=>new Date(D).toLocaleString(),ge=m==="all"?t:t.filter(D=>D.type===m);return h?s.jsx("div",{className:"page",children:s.jsx("div",{className:"loading",children:"Loading backup data..."})}):s.jsxs("div",{className:"page backups-page",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Backups"}),s.jsx("p",{className:"page-subtitle",children:"Manage application and database backups"})]}),s.jsxs("div",{className:"page-actions",children:[s.jsxs("button",{className:"btn btn-secondary",onClick:()=>E(!0),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Add Schedule"]}),s.jsxs("button",{className:"btn btn-primary",onClick:()=>y(!0),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),s.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create Backup"]})]})]}),v&&s.jsxs("div",{className:"alert alert-danger",children:[v,s.jsx("button",{onClick:()=>N(null),className:"alert-close",children:"×"})]}),s.jsxs("div",{className:"stats-grid",children:[s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon backups",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:[s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),s.jsx("polyline",{points:"7 10 12 15 17 10"}),s.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Total Backups"}),s.jsx("span",{className:"stat-value",children:(r==null?void 0:r.total_backups)||0})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon apps",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:s.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Application Backups"}),s.jsx("span",{className:"stat-value",children:(r==null?void 0:r.application_backups)||0})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon databases",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),s.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Database Backups"}),s.jsx("span",{className:"stat-value",children:(r==null?void 0:r.database_backups)||0})]})]}),s.jsxs("div",{className:"stat-card",children:[s.jsx("div",{className:"stat-icon size",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",children:[s.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2",ry:"2"}),s.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2",ry:"2"}),s.jsx("line",{x1:"6",y1:"6",x2:"6.01",y2:"6"}),s.jsx("line",{x1:"6",y1:"18",x2:"6.01",y2:"18"})]})}),s.jsxs("div",{className:"stat-content",children:[s.jsx("span",{className:"stat-label",children:"Total Size"}),s.jsx("span",{className:"stat-value",children:(r==null?void 0:r.total_size_human)||"0 B"})]})]})]}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${j==="backups"?"active":""}`,onClick:()=>k("backups"),children:"Backups"}),s.jsx("button",{className:`tab ${j==="schedules"?"active":""}`,onClick:()=>k("schedules"),children:"Schedules"}),s.jsx("button",{className:`tab ${j==="settings"?"active":""}`,onClick:()=>k("settings"),children:"Settings"})]}),j==="backups"&&s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-header",children:[s.jsx("h3",{children:"Backup List"}),s.jsxs("div",{className:"card-actions",children:[s.jsxs("select",{value:m,onChange:D=>x(D.target.value),className:"filter-select",children:[s.jsx("option",{value:"all",children:"All Types"}),s.jsx("option",{value:"application",children:"Applications"}),s.jsx("option",{value:"database",children:"Databases"})]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:J,children:"Refresh"})]})]}),s.jsx("div",{className:"card-body",children:ge.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"48",height:"48",children:[s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),s.jsx("polyline",{points:"7 10 12 15 17 10"}),s.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),s.jsx("h3",{children:"No Backups"}),s.jsx("p",{children:"No backups found. Create your first backup to get started."}),s.jsx("button",{className:"btn btn-primary",onClick:()=>y(!0),children:"Create Backup"})]}):s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Size"}),s.jsx("th",{children:"Created"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:ge.map((D,W)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"backup-name",children:[D.type==="application"?s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",className:"icon-app",children:s.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",className:"icon-db",children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),s.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]}),s.jsx("span",{children:D.name||D.app_name})]})}),s.jsx("td",{children:s.jsx("span",{className:`badge badge-${D.type==="application"?"primary":"info"}`,children:D.type})}),s.jsx("td",{children:F(D.size)}),s.jsx("td",{children:ee(D.timestamp)}),s.jsx("td",{children:s.jsxs("div",{className:"action-buttons",children:[s.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>{w(D),P(!0)},title:"Restore",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",children:[s.jsx("polyline",{points:"1 4 1 10 7 10"}),s.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})}),s.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>_(D.path),title:"Delete",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",children:[s.jsx("polyline",{points:"3 6 5 6 21 6"}),s.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})})]},W))})]})})]}),j==="schedules"&&s.jsxs("div",{className:"card",children:[s.jsxs("div",{className:"card-header",children:[s.jsx("h3",{children:"Backup Schedules"}),s.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>E(!0),children:"Add Schedule"})]}),s.jsx("div",{className:"card-body",children:i.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"48",height:"48",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]}),s.jsx("h3",{children:"No Schedules"}),s.jsx("p",{children:"No backup schedules configured. Add a schedule for automated backups."}),s.jsx("button",{className:"btn btn-primary",onClick:()=>E(!0),children:"Add Schedule"})]}):s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Time"}),s.jsx("th",{children:"Days"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:i.map(D=>{var W;return s.jsxs("tr",{children:[s.jsx("td",{children:D.name}),s.jsx("td",{children:s.jsx("span",{className:`badge badge-${D.backup_type==="application"?"primary":"info"}`,children:D.backup_type})}),s.jsx("td",{children:D.target}),s.jsx("td",{children:D.schedule_time}),s.jsx("td",{children:((W=D.days)==null?void 0:W.join(", "))||"daily"}),s.jsx("td",{children:s.jsx("span",{className:`badge badge-${D.enabled?"success":"secondary"}`,children:D.enabled?"Active":"Disabled"})}),s.jsx("td",{children:s.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>Y(D.id),title:"Remove",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",children:[s.jsx("polyline",{points:"3 6 5 6 21 6"}),s.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]},D.id)})})]})})]}),j==="settings"&&s.jsxs("div",{className:"card",children:[s.jsx("div",{className:"card-header",children:s.jsx("h3",{children:"Backup Settings"})}),s.jsx("div",{className:"card-body",children:s.jsxs("form",{onSubmit:ve,children:[s.jsx("div",{className:"form-group",children:s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:B.enabled,onChange:D=>z({...B,enabled:D.target.checked})}),s.jsx("span",{children:"Enable Scheduled Backups"})]})}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Retention Period (days)"}),s.jsx("input",{type:"number",value:B.retention_days,onChange:D=>z({...B,retention_days:parseInt(D.target.value)}),min:"1",max:"365"}),s.jsx("span",{className:"form-help",children:"Backups older than this will be deleted during cleanup"})]}),s.jsxs("div",{className:"form-actions",children:[s.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save Settings"}),s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:ne,children:"Run Cleanup Now"})]})]})})]}),g&&s.jsx("div",{className:"modal-overlay",onClick:()=>y(!1),children:s.jsxs("div",{className:"modal",onClick:D=>D.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create Backup"}),s.jsx("button",{className:"modal-close",onClick:()=>y(!1),children:"×"})]}),s.jsxs("form",{onSubmit:R,children:[s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Backup Type"}),s.jsxs("select",{value:L.type,onChange:D=>U({...L,type:D.target.value}),children:[s.jsx("option",{value:"application",children:"Application"}),s.jsx("option",{value:"database",children:"Database Only"})]})]}),L.type==="application"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Application"}),s.jsxs("select",{value:L.applicationId,onChange:D=>U({...L,applicationId:D.target.value}),required:!0,children:[s.jsx("option",{value:"",children:"Select Application"}),u.map(D=>s.jsx("option",{value:D.id,children:D.name},D.id))]})]}),s.jsx("div",{className:"form-group",children:s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:L.includeDb,onChange:D=>U({...L,includeDb:D.target.checked})}),s.jsx("span",{children:"Include Database"})]})})]}),(L.type==="database"||L.includeDb)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Database Type"}),s.jsxs("select",{value:L.dbType,onChange:D=>U({...L,dbType:D.target.value}),children:[s.jsx("option",{value:"mysql",children:"MySQL"}),s.jsx("option",{value:"postgresql",children:"PostgreSQL"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Database Name"}),s.jsx("input",{type:"text",value:L.dbName,onChange:D=>U({...L,dbName:D.target.value}),required:!0})]}),s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Username"}),s.jsx("input",{type:"text",value:L.dbUser,onChange:D=>U({...L,dbUser:D.target.value})})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Password"}),s.jsx("input",{type:"password",value:L.dbPassword,onChange:D=>U({...L,dbPassword:D.target.value})})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Host"}),s.jsx("input",{type:"text",value:L.dbHost,onChange:D=>U({...L,dbHost:D.target.value})})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>y(!1),children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",children:"Create Backup"})]})]})]})}),S&&s.jsx("div",{className:"modal-overlay",onClick:()=>E(!1),children:s.jsxs("div",{className:"modal",onClick:D=>D.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Add Backup Schedule"}),s.jsx("button",{className:"modal-close",onClick:()=>E(!1),children:"×"})]}),s.jsxs("form",{onSubmit:Q,children:[s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Schedule Name"}),s.jsx("input",{type:"text",value:V.name,onChange:D=>H({...V,name:D.target.value}),placeholder:"Daily App Backup",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Backup Type"}),s.jsxs("select",{value:V.backupType,onChange:D=>H({...V,backupType:D.target.value}),children:[s.jsx("option",{value:"application",children:"Application"}),s.jsx("option",{value:"database",children:"Database"})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Target"}),s.jsx("input",{type:"text",value:V.target,onChange:D=>H({...V,target:D.target.value}),placeholder:"App name or database name",required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Time"}),s.jsx("input",{type:"time",value:V.scheduleTime,onChange:D=>H({...V,scheduleTime:D.target.value}),required:!0})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>E(!1),children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn btn-primary",children:"Add Schedule"})]})]})]})}),T&&O&&s.jsx("div",{className:"modal-overlay",onClick:()=>P(!1),children:s.jsxs("div",{className:"modal",onClick:D=>D.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Restore Backup"}),s.jsx("button",{className:"modal-close",onClick:()=>P(!1),children:"×"})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"restore-warning",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"48",height:"48",children:[s.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),s.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),s.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),s.jsx("h3",{children:"Warning"}),s.jsx("p",{children:"Restoring this backup will overwrite existing data. This action cannot be undone."})]}),s.jsxs("div",{className:"restore-details",children:[s.jsxs("div",{className:"detail-row",children:[s.jsx("span",{className:"detail-label",children:"Backup Name:"}),s.jsx("span",{className:"detail-value",children:O.name||O.app_name})]}),s.jsxs("div",{className:"detail-row",children:[s.jsx("span",{className:"detail-label",children:"Type:"}),s.jsx("span",{className:"detail-value",children:O.type})]}),s.jsxs("div",{className:"detail-row",children:[s.jsx("span",{className:"detail-label",children:"Created:"}),s.jsx("span",{className:"detail-value",children:ee(O.timestamp)})]}),s.jsxs("div",{className:"detail-row",children:[s.jsx("span",{className:"detail-label",children:"Size:"}),s.jsx("span",{className:"detail-value",children:F(O.size)})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>P(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-danger",onClick:I,children:"Restore Backup"})]})]})})]})},Ig=()=>{const[e,t]=d.useState("logs");return s.jsxs("div",{className:"page terminal-page",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{children:[s.jsx("h1",{children:"Terminal & Logs"}),s.jsx("p",{className:"page-subtitle",children:"View logs, manage processes and services"})]})}),s.jsxs("div",{className:"tabs",children:[s.jsxs("button",{className:`tab ${e==="logs"?"active":""}`,onClick:()=>t("logs"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),s.jsx("polyline",{points:"14 2 14 8 20 8"}),s.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),s.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),"Log Files"]}),s.jsxs("button",{className:`tab ${e==="journal"?"active":""}`,onClick:()=>t("journal"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),s.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"9"}),s.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),s.jsx("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}),"System Journal"]}),s.jsxs("button",{className:`tab ${e==="processes"?"active":""}`,onClick:()=>t("processes"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),s.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),s.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),"Processes"]}),s.jsxs("button",{className:`tab ${e==="services"?"active":""}`,onClick:()=>t("services"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),"Services"]})]}),s.jsxs("div",{className:"tab-content",children:[e==="logs"&&s.jsx(qg,{}),e==="journal"&&s.jsx(Ug,{}),e==="processes"&&s.jsx(zg,{}),e==="services"&&s.jsx(Vg,{})]})]})},qg=()=>{const[e,t]=d.useState([]),[n,r]=d.useState(null),[a,i]=d.useState(""),[l,c]=d.useState(!0),[o,u]=d.useState(!1),[f,h]=d.useState(null),[p,v]=d.useState(100),[N,j]=d.useState(""),[k,m]=d.useState(!1),x=d.useRef(null),g=d.useRef(null);d.useEffect(()=>{y()},[]),d.useEffect(()=>(k&&n&&(g.current=setInterval(()=>{S(n,!1)},3e3)),()=>{g.current&&clearInterval(g.current)}),[k,n]);async function y(){try{const w=await b.getLogFiles();t(w.logs||[])}catch(w){h(w.message)}finally{c(!1)}}async function S(w,L=!0){var U;L&&u(!0);try{let V;N.trim()?V=await b.searchLog(w,N,p):V=await b.readLog(w,p),i(V.content||((U=V.lines)==null?void 0:U.join(`
+`))||"No content"),r(w),x.current&&(x.current.scrollTop=x.current.scrollHeight)}catch(V){i(`Error loading log: ${V.message}`)}finally{u(!1)}}async function E(){if(n&&confirm(`Clear ${n}? This cannot be undone.`))try{await b.clearLog(n),i("Log cleared.")}catch(w){h(w.message)}}function T(){if(!a)return;const w=new Blob([a],{type:"text/plain"}),L=URL.createObjectURL(w),U=document.createElement("a");U.href=L,U.download=n?n.split("/").pop():"log.txt",U.click(),URL.revokeObjectURL(L)}function P(w){return w.includes("error")?"error":w.includes("access")?"access":w.includes("nginx")?"nginx":w.includes("mysql")||w.includes("postgres")?"database":"default"}function O(w){if(!w)return"0 B";const L=["B","KB","MB","GB"];let U=0;for(;w>=1024&&U<L.length-1;)w/=1024,U++;return`${w.toFixed(1)} ${L[U]}`}return l?s.jsx("div",{className:"loading",children:"Loading log files..."}):s.jsxs("div",{className:"logs-container",children:[f&&s.jsxs("div",{className:"alert alert-danger",children:[f,s.jsx("button",{onClick:()=>h(null),className:"alert-close",children:"×"})]}),s.jsxs("div",{className:"logs-layout",children:[s.jsxs("div",{className:"logs-sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsx("h3",{children:"Log Files"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:y,children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",children:[s.jsx("polyline",{points:"23 4 23 10 17 10"}),s.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),s.jsx("div",{className:"log-files-list",children:e.length===0?s.jsx("div",{className:"empty-hint",children:"No log files found"}):e.map((w,L)=>s.jsxs("div",{className:`log-file-item ${n===w.path?"active":""}`,onClick:()=>S(w.path),children:[s.jsx("div",{className:`log-icon ${P(w.path)}`,children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),s.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),s.jsxs("div",{className:"log-file-info",children:[s.jsx("span",{className:"log-file-name",children:w.name}),s.jsx("span",{className:"log-file-path",children:w.path})]}),s.jsx("span",{className:"log-file-size",children:O(w.size)})]},L))})]}),s.jsxs("div",{className:"logs-viewer",children:[s.jsxs("div",{className:"viewer-toolbar",children:[s.jsxs("div",{className:"toolbar-left",children:[s.jsxs("div",{className:"search-input",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),s.jsx("input",{type:"text",value:N,onChange:w=>j(w.target.value),onKeyDown:w=>w.key==="Enter"&&n&&S(n),placeholder:"Search pattern..."})]}),s.jsxs("select",{value:p,onChange:w=>v(parseInt(w.target.value)),className:"lines-select",children:[s.jsx("option",{value:50,children:"50 lines"}),s.jsx("option",{value:100,children:"100 lines"}),s.jsx("option",{value:200,children:"200 lines"}),s.jsx("option",{value:500,children:"500 lines"}),s.jsx("option",{value:1e3,children:"1000 lines"})]})]}),s.jsxs("div",{className:"toolbar-right",children:[s.jsxs("label",{className:"auto-refresh-toggle",children:[s.jsx("input",{type:"checkbox",checked:k,onChange:w=>m(w.target.checked)}),s.jsx("span",{children:"Auto-refresh"})]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>n&&S(n),disabled:!n||o,children:"Refresh"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:T,disabled:!a,children:"Download"}),s.jsx("button",{className:"btn btn-danger btn-sm",onClick:E,disabled:!n,children:"Clear"})]})]}),s.jsx("div",{className:"log-content",ref:x,children:n?o?s.jsx("div",{className:"loading",children:"Loading log content..."}):s.jsx("pre",{children:a}):s.jsxs("div",{className:"empty-viewer",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"48",height:"48",children:[s.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),s.jsx("polyline",{points:"14 2 14 8 20 8"})]}),s.jsx("p",{children:"Select a log file to view its contents"})]})})]})]})]})},Ug=()=>{const[e,t]=d.useState(""),[n,r]=d.useState(!1),[a,i]=d.useState(""),[l,c]=d.useState(100),[o,u]=d.useState(""),[f]=d.useState(["nginx","apache2","mysql","mariadb","postgresql","php-fpm","docker","sshd","cron","systemd"]);async function h(){r(!0);try{const p=await b.getJournalLogs(a||null,l);t(p.content||p.logs||"No logs available")}catch(p){t(`Error: ${p.message}`)}finally{r(!1)}}return d.useEffect(()=>{h()},[]),s.jsxs("div",{className:"journal-container",children:[s.jsxs("div",{className:"journal-controls",children:[s.jsxs("div",{className:"control-group",children:[s.jsx("label",{children:"Service/Unit"}),s.jsxs("div",{className:"input-with-suggestions",children:[s.jsx("input",{type:"text",value:a,onChange:p=>i(p.target.value),placeholder:"All services"}),s.jsx("div",{className:"quick-units",children:f.map(p=>s.jsx("button",{className:`unit-chip ${a===p?"active":""}`,onClick:()=>i(a===p?"":p),children:p},p))})]})]}),s.jsxs("div",{className:"control-group",children:[s.jsx("label",{children:"Lines"}),s.jsxs("select",{value:l,onChange:p=>c(parseInt(p.target.value)),children:[s.jsx("option",{value:50,children:"50"}),s.jsx("option",{value:100,children:"100"}),s.jsx("option",{value:200,children:"200"}),s.jsx("option",{value:500,children:"500"})]})]}),s.jsxs("div",{className:"control-group",children:[s.jsx("label",{children:"Priority"}),s.jsxs("select",{value:o,onChange:p=>u(p.target.value),children:[s.jsx("option",{value:"",children:"All"}),s.jsx("option",{value:"0",children:"Emergency"}),s.jsx("option",{value:"1",children:"Alert"}),s.jsx("option",{value:"2",children:"Critical"}),s.jsx("option",{value:"3",children:"Error"}),s.jsx("option",{value:"4",children:"Warning"}),s.jsx("option",{value:"5",children:"Notice"}),s.jsx("option",{value:"6",children:"Info"}),s.jsx("option",{value:"7",children:"Debug"})]})]}),s.jsx("button",{className:"btn btn-primary",onClick:h,disabled:n,children:n?"Loading...":"Load Logs"})]}),s.jsx("div",{className:"journal-viewer",children:s.jsx("pre",{children:n?"Loading journal logs...":e})})]})},zg=()=>{var k;const e=Se(),[t,n]=d.useState([]),[r,a]=d.useState(!0),[i,l]=d.useState("cpu"),[c,o]=d.useState(50),[u,f]=d.useState(""),[h,p]=d.useState(null);d.useEffect(()=>{v()},[i,c]);async function v(){try{const m=await b.getProcesses(c,i);n(m.processes||[])}catch(m){console.error("Failed to load processes:",m)}finally{a(!1)}}async function N(m,x=!1){const g=x?`Force kill process ${m}? This may cause data loss.`:`Kill process ${m}?`;if(confirm(g))try{await b.killProcess(m,x),e.success(`Process ${m} killed successfully`),v(),p(null)}catch(y){e.error(`Failed to kill process: ${y.message}`)}}const j=t.filter(m=>{var x,g;return((x=m.name)==null?void 0:x.toLowerCase().includes(u.toLowerCase()))||((g=m.command)==null?void 0:g.toLowerCase().includes(u.toLowerCase()))||String(m.pid).includes(u)});return r?s.jsx("div",{className:"loading",children:"Loading processes..."}):s.jsxs("div",{className:"processes-container",children:[s.jsxs("div",{className:"processes-toolbar",children:[s.jsx("div",{className:"toolbar-left",children:s.jsxs("div",{className:"search-input",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),s.jsx("input",{type:"text",value:u,onChange:m=>f(m.target.value),placeholder:"Search processes..."})]})}),s.jsxs("div",{className:"toolbar-right",children:[s.jsxs("select",{value:i,onChange:m=>l(m.target.value),children:[s.jsx("option",{value:"cpu",children:"Sort by CPU"}),s.jsx("option",{value:"memory",children:"Sort by Memory"}),s.jsx("option",{value:"pid",children:"Sort by PID"}),s.jsx("option",{value:"name",children:"Sort by Name"})]}),s.jsxs("select",{value:c,onChange:m=>o(parseInt(m.target.value)),children:[s.jsx("option",{value:25,children:"25 processes"}),s.jsx("option",{value:50,children:"50 processes"}),s.jsx("option",{value:100,children:"100 processes"})]}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:v,children:"Refresh"})]})]}),s.jsx("div",{className:"processes-table-wrapper",children:s.jsxs("table",{className:"table processes-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"PID"}),s.jsx("th",{children:"Name"}),s.jsx("th",{children:"User"}),s.jsx("th",{children:"CPU %"}),s.jsx("th",{children:"Memory %"}),s.jsx("th",{children:"Memory"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:j.map(m=>{var x;return s.jsxs("tr",{className:(h==null?void 0:h.pid)===m.pid?"selected":"",onClick:()=>p(m),children:[s.jsx("td",{className:"mono",children:m.pid}),s.jsx("td",{children:s.jsx("div",{className:"process-name",children:s.jsx("span",{children:m.name})})}),s.jsx("td",{children:m.user}),s.jsx("td",{children:s.jsxs("div",{className:"usage-cell",children:[s.jsx("div",{className:"usage-bar cpu",style:{width:`${Math.min(m.cpu_percent||0,100)}%`}}),s.jsxs("span",{children:[(m.cpu_percent||0).toFixed(1),"%"]})]})}),s.jsx("td",{children:s.jsxs("div",{className:"usage-cell",children:[s.jsx("div",{className:"usage-bar memory",style:{width:`${Math.min(m.memory_percent||0,100)}%`}}),s.jsxs("span",{children:[(m.memory_percent||0).toFixed(1),"%"]})]})}),s.jsx("td",{children:Jc((x=m.memory_info)==null?void 0:x.rss)}),s.jsx("td",{children:s.jsx("span",{className:`badge badge-${Hg(m.status)}`,children:m.status})}),s.jsx("td",{children:s.jsxs("div",{className:"action-buttons",children:[s.jsx("button",{className:"btn btn-secondary btn-xs",onClick:g=>{g.stopPropagation(),N(m.pid)},title:"Kill",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"12",height:"12",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),s.jsx("button",{className:"btn btn-danger btn-xs",onClick:g=>{g.stopPropagation(),N(m.pid,!0)},title:"Force Kill",children:s.jsxs("svg",{viewBox:"0 0 24 24",width:"12",height:"12",children:[s.jsx("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"}),s.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),s.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})})]})})]},m.pid)})})]})}),h&&s.jsxs("div",{className:"process-details-panel",children:[s.jsxs("div",{className:"panel-header",children:[s.jsx("h3",{children:"Process Details"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>p(null),children:"Close"})]}),s.jsxs("div",{className:"panel-body",children:[s.jsxs("div",{className:"details-grid",children:[s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"PID"}),s.jsx("span",{className:"detail-value mono",children:h.pid})]}),s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"Name"}),s.jsx("span",{className:"detail-value",children:h.name})]}),s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"User"}),s.jsx("span",{className:"detail-value",children:h.user})]}),s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"Status"}),s.jsx("span",{className:"detail-value",children:h.status})]}),s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"CPU"}),s.jsxs("span",{className:"detail-value",children:[(h.cpu_percent||0).toFixed(2),"%"]})]}),s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"Memory"}),s.jsx("span",{className:"detail-value",children:Jc((k=h.memory_info)==null?void 0:k.rss)})]}),s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"Threads"}),s.jsx("span",{className:"detail-value",children:h.num_threads})]}),s.jsxs("div",{className:"detail-item",children:[s.jsx("span",{className:"detail-label",children:"Created"}),s.jsx("span",{className:"detail-value",children:h.create_time?new Date(h.create_time*1e3).toLocaleString():"-"})]})]}),h.command&&s.jsxs("div",{className:"command-line",children:[s.jsx("span",{className:"detail-label",children:"Command"}),s.jsx("code",{children:h.command})]})]})]})]})},Vg=()=>{const e=Se(),[t,n]=d.useState([]),[r,a]=d.useState(!0),[i,l]=d.useState(null),[c,o]=d.useState(null),[u,f]=d.useState(""),[h,p]=d.useState(!1);d.useEffect(()=>{v()},[]);async function v(){try{const m=await b.getServicesStatus();n(m.services||[])}catch(m){console.error("Failed to load services:",m)}finally{a(!1)}}async function N(m,x){l(`${m}-${x}`);try{await b.controlService(m,x),e.success(`Service ${m} ${x}ed successfully`),await v()}catch(g){e.error(`Failed to ${x} ${m}: ${g.message}`)}finally{l(null)}}async function j(m){o(m),p(!0);try{const x=await b.getJournalLogs(m,100);f(x.content||x.logs||"No logs available")}catch(x){f(`Error loading logs: ${x.message}`)}}function k(m){return m==="running"||m==="active"?"success":m==="stopped"||m==="inactive"?"secondary":m==="failed"?"danger":"warning"}return r?s.jsx("div",{className:"loading",children:"Loading services..."}):s.jsxs("div",{className:"services-container",children:[s.jsx("div",{className:"services-toolbar",children:s.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:v,children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",children:[s.jsx("polyline",{points:"23 4 23 10 17 10"}),s.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),"Refresh"]})}),s.jsx("div",{className:"services-grid",children:t.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("p",{children:"No services found"})}):t.map(m=>s.jsxs("div",{className:"service-card",children:[s.jsxs("div",{className:"service-header",children:[s.jsxs("div",{className:"service-info",children:[s.jsx("span",{className:`status-dot ${k(m.status)}`}),s.jsx("h4",{children:m.name})]}),s.jsx("span",{className:`badge badge-${k(m.status)}`,children:m.status})]}),m.description&&s.jsx("p",{className:"service-description",children:m.description}),s.jsxs("div",{className:"service-meta",children:[m.pid&&s.jsxs("span",{className:"meta-item",children:[s.jsx("span",{className:"meta-label",children:"PID:"})," ",m.pid]}),m.memory&&s.jsxs("span",{className:"meta-item",children:[s.jsx("span",{className:"meta-label",children:"Memory:"})," ",m.memory]})]}),s.jsxs("div",{className:"service-actions",children:[m.status==="running"||m.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>N(m.name,"restart"),disabled:i===`${m.name}-restart`,children:i===`${m.name}-restart`?"...":"Restart"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>N(m.name,"stop"),disabled:i===`${m.name}-stop`,children:i===`${m.name}-stop`?"...":"Stop"})]}):s.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>N(m.name,"start"),disabled:i===`${m.name}-start`,children:i===`${m.name}-start`?"...":"Start"}),s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>j(m.name),children:"Logs"})]})]},m.name))}),h&&s.jsx("div",{className:"modal-overlay",onClick:()=>p(!1),children:s.jsxs("div",{className:"modal modal-lg",onClick:m=>m.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h2",{children:["Logs: ",c]}),s.jsx("button",{className:"modal-close",onClick:()=>p(!1),children:"×"})]}),s.jsx("div",{className:"modal-body",children:s.jsx("div",{className:"modal-log-viewer",children:s.jsx("pre",{children:u})})}),s.jsx("div",{className:"modal-footer",children:s.jsx("button",{className:"btn btn-secondary",onClick:()=>p(!1),children:"Close"})})]})})]})};function Jc(e){if(!e)return"-";const t=["B","KB","MB","GB"];let n=0;for(;e>=1024&&n<t.length-1;)e/=1024,n++;return`${e.toFixed(1)} ${t[n]}`}function Hg(e){switch(e==null?void 0:e.toLowerCase()){case"running":case"sleeping":return"success";case"stopped":case"zombie":return"danger";case"idle":case"disk-sleep":return"warning";default:return"secondary"}}const Wg=()=>{const[e,t]=d.useState("profile");return s.jsxs("div",{className:"page settings-page",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{children:[s.jsx("h1",{children:"Settings"}),s.jsx("p",{className:"page-subtitle",children:"Manage your account and system preferences"})]})}),s.jsxs("div",{className:"settings-layout",children:[s.jsxs("nav",{className:"settings-nav",children:[s.jsxs("button",{className:`settings-nav-item ${e==="profile"?"active":""}`,onClick:()=>t("profile"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),s.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Profile"]}),s.jsxs("button",{className:`settings-nav-item ${e==="security"?"active":""}`,onClick:()=>t("security"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),s.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Security"]}),s.jsxs("button",{className:`settings-nav-item ${e==="appearance"?"active":""}`,onClick:()=>t("appearance"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("circle",{cx:"12",cy:"12",r:"5"}),s.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),s.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),s.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),s.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),s.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),s.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),s.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),s.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),"Appearance"]}),s.jsxs("button",{className:`settings-nav-item ${e==="notifications"?"active":""}`,onClick:()=>t("notifications"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),s.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),"Notifications"]}),s.jsxs("button",{className:`settings-nav-item ${e==="system"?"active":""}`,onClick:()=>t("system"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),s.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),s.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),"System Info"]}),s.jsxs("button",{className:`settings-nav-item ${e==="about"?"active":""}`,onClick:()=>t("about"),children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),s.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),"About"]})]}),s.jsxs("div",{className:"settings-content",children:[e==="profile"&&s.jsx(Qg,{}),e==="security"&&s.jsx(Kg,{}),e==="appearance"&&s.jsx(Gg,{}),e==="notifications"&&s.jsx(Yg,{}),e==="system"&&s.jsx(Xg,{}),e==="about"&&s.jsx(Jg,{})]})]})]})},Qg=()=>{const{user:e,updateUser:t}=rs(),[n,r]=d.useState({username:"",email:""}),[a,i]=d.useState(!1),[l,c]=d.useState(null);d.useEffect(()=>{e&&r({username:e.username||"",email:e.email||""})},[e]);async function o(u){u.preventDefault(),i(!0),c(null);try{await t(n),c({type:"success",text:"Profile updated successfully"})}catch(f){c({type:"error",text:f.message})}finally{i(!1)}}return s.jsxs("div",{className:"settings-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{children:"Profile Settings"}),s.jsx("p",{children:"Update your personal information"})]}),l&&s.jsx("div",{className:`alert alert-${l.type==="success"?"success":"danger"}`,children:l.text}),s.jsxs("form",{onSubmit:o,className:"settings-form",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Username"}),s.jsx("input",{type:"text",value:n.username,onChange:u=>r({...n,username:u.target.value}),required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Email Address"}),s.jsx("input",{type:"email",value:n.email,onChange:u=>r({...n,email:u.target.value}),required:!0})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Role"}),s.jsx("input",{type:"text",value:(e==null?void 0:e.role)||"user",disabled:!0,className:"input-disabled"}),s.jsx("span",{className:"form-help",children:"Contact an administrator to change your role"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Member Since"}),s.jsx("input",{type:"text",value:e!=null&&e.created_at?new Date(e.created_at).toLocaleDateString():"-",disabled:!0,className:"input-disabled"})]}),s.jsx("div",{className:"form-actions",children:s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Saving...":"Save Changes"})})]})]})},Kg=()=>{const{updateUser:e}=rs(),[t,n]=d.useState({currentPassword:"",newPassword:"",confirmPassword:""}),[r,a]=d.useState(!1),[i,l]=d.useState(null);async function c(o){if(o.preventDefault(),l(null),t.newPassword!==t.confirmPassword){l({type:"error",text:"Passwords do not match"});return}if(t.newPassword.length<8){l({type:"error",text:"Password must be at least 8 characters"});return}a(!0);try{await e({password:t.newPassword}),l({type:"success",text:"Password changed successfully"}),n({currentPassword:"",newPassword:"",confirmPassword:""})}catch(u){l({type:"error",text:u.message})}finally{a(!1)}}return s.jsxs("div",{className:"settings-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{children:"Security Settings"}),s.jsx("p",{children:"Manage your password and security preferences"})]}),i&&s.jsx("div",{className:`alert alert-${i.type==="success"?"success":"danger"}`,children:i.text}),s.jsxs("form",{onSubmit:c,className:"settings-form",children:[s.jsx("h3",{children:"Change Password"}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Current Password"}),s.jsx("input",{type:"password",value:t.currentPassword,onChange:o=>n({...t,currentPassword:o.target.value}),placeholder:"Enter current password"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"New Password"}),s.jsx("input",{type:"password",value:t.newPassword,onChange:o=>n({...t,newPassword:o.target.value}),placeholder:"Enter new password",required:!0}),s.jsx("span",{className:"form-help",children:"Minimum 8 characters"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Confirm New Password"}),s.jsx("input",{type:"password",value:t.confirmPassword,onChange:o=>n({...t,confirmPassword:o.target.value}),placeholder:"Confirm new password",required:!0})]}),s.jsx("div",{className:"form-actions",children:s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:r,children:r?"Changing...":"Change Password"})})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Sessions"}),s.jsx("p",{children:"Manage your active sessions"}),s.jsxs("div",{className:"session-item current",children:[s.jsxs("div",{className:"session-info",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",children:[s.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),s.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),s.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"session-device",children:"Current Session"}),s.jsx("span",{className:"session-details",children:"This device - Active now"})]})]}),s.jsx("span",{className:"badge badge-success",children:"Current"})]})]})]})},Gg=()=>{const[e,t]=d.useState(()=>localStorage.getItem("theme")||"dark");function n(r){t(r),localStorage.setItem("theme",r),document.documentElement.setAttribute("data-theme",r)}return s.jsxs("div",{className:"settings-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{children:"Appearance"}),s.jsx("p",{children:"Customize the look and feel of your dashboard"})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Theme"}),s.jsx("p",{children:"Select your preferred color scheme"}),s.jsxs("div",{className:"theme-options",children:[s.jsxs("button",{className:`theme-option ${e==="dark"?"active":""}`,onClick:()=>n("dark"),children:[s.jsxs("div",{className:"theme-preview dark",children:[s.jsx("div",{className:"preview-sidebar"}),s.jsxs("div",{className:"preview-content",children:[s.jsx("div",{className:"preview-card"}),s.jsx("div",{className:"preview-card"})]})]}),s.jsx("span",{children:"Dark"})]}),s.jsxs("button",{className:`theme-option ${e==="light"?"active":""}`,onClick:()=>n("light"),children:[s.jsxs("div",{className:"theme-preview light",children:[s.jsx("div",{className:"preview-sidebar"}),s.jsxs("div",{className:"preview-content",children:[s.jsx("div",{className:"preview-card"}),s.jsx("div",{className:"preview-card"})]})]}),s.jsx("span",{children:"Light"})]}),s.jsxs("button",{className:`theme-option ${e==="system"?"active":""}`,onClick:()=>n("system"),children:[s.jsxs("div",{className:"theme-preview system",children:[s.jsx("div",{className:"preview-sidebar"}),s.jsxs("div",{className:"preview-content",children:[s.jsx("div",{className:"preview-card"}),s.jsx("div",{className:"preview-card"})]})]}),s.jsx("span",{children:"System"})]})]})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Density"}),s.jsx("p",{children:"Adjust the spacing and size of elements"}),s.jsxs("div",{className:"density-options",children:[s.jsxs("label",{className:"radio-option",children:[s.jsx("input",{type:"radio",name:"density",value:"comfortable",defaultChecked:!0}),s.jsx("span",{children:"Comfortable"})]}),s.jsxs("label",{className:"radio-option",children:[s.jsx("input",{type:"radio",name:"density",value:"compact"}),s.jsx("span",{children:"Compact"})]})]})]})]})},Yg=()=>{const[e,t]=d.useState({emailAlerts:!0,serverAlerts:!0,securityAlerts:!0,backupAlerts:!1,deployAlerts:!0});function n(r){t({...e,[r]:!e[r]})}return s.jsxs("div",{className:"settings-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{children:"Notification Settings"}),s.jsx("p",{children:"Choose what notifications you want to receive"})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Email Notifications"}),s.jsxs("div",{className:"notification-options",children:[s.jsxs("div",{className:"notification-item",children:[s.jsxs("div",{className:"notification-info",children:[s.jsx("span",{className:"notification-title",children:"Server Alerts"}),s.jsx("span",{className:"notification-desc",children:"Get notified when server metrics exceed thresholds"})]}),s.jsxs("label",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:e.serverAlerts,onChange:()=>n("serverAlerts")}),s.jsx("span",{className:"toggle-slider"})]})]}),s.jsxs("div",{className:"notification-item",children:[s.jsxs("div",{className:"notification-info",children:[s.jsx("span",{className:"notification-title",children:"Security Alerts"}),s.jsx("span",{className:"notification-desc",children:"Get notified about security events and login attempts"})]}),s.jsxs("label",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:e.securityAlerts,onChange:()=>n("securityAlerts")}),s.jsx("span",{className:"toggle-slider"})]})]}),s.jsxs("div",{className:"notification-item",children:[s.jsxs("div",{className:"notification-info",children:[s.jsx("span",{className:"notification-title",children:"Backup Notifications"}),s.jsx("span",{className:"notification-desc",children:"Get notified when backups complete or fail"})]}),s.jsxs("label",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:e.backupAlerts,onChange:()=>n("backupAlerts")}),s.jsx("span",{className:"toggle-slider"})]})]}),s.jsxs("div",{className:"notification-item",children:[s.jsxs("div",{className:"notification-info",children:[s.jsx("span",{className:"notification-title",children:"Deployment Notifications"}),s.jsx("span",{className:"notification-desc",children:"Get notified when deployments complete or fail"})]}),s.jsxs("label",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:e.deployAlerts,onChange:()=>n("deployAlerts")}),s.jsx("span",{className:"toggle-slider"})]})]})]})]})]})},Xg=()=>{var l,c,o,u,f,h,p,v,N,j,k,m,x,g;const{isAdmin:e}=rs(),[t,n]=d.useState(null),[r,a]=d.useState(!0);d.useEffect(()=>{e&&i()},[e]);async function i(){try{const y=await b.getSystemMetrics();n(y)}catch(y){console.error("Failed to load metrics:",y)}finally{a(!1)}}return e?r?s.jsx("div",{className:"loading",children:"Loading system information..."}):s.jsxs("div",{className:"settings-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{children:"System Information"}),s.jsx("p",{children:"View system details and server information"})]}),s.jsxs("div",{className:"system-info-grid",children:[s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"CPU"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Usage"}),s.jsxs("span",{className:"info-value",children:[((c=(l=t==null?void 0:t.cpu)==null?void 0:l.percent)==null?void 0:c.toFixed(1))||0,"%"]})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Cores"}),s.jsx("span",{className:"info-value",children:((o=t==null?void 0:t.cpu)==null?void 0:o.count)||"-"})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Load Average"}),s.jsx("span",{className:"info-value",children:(u=t==null?void 0:t.cpu)!=null&&u.load_avg?t.cpu.load_avg.map(y=>y.toFixed(2)).join(", "):"-"})]})]})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Memory"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Usage"}),s.jsxs("span",{className:"info-value",children:[((h=(f=t==null?void 0:t.memory)==null?void 0:f.percent)==null?void 0:h.toFixed(1))||0,"%"]})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Used"}),s.jsx("span",{className:"info-value",children:ws((p=t==null?void 0:t.memory)==null?void 0:p.used)})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Total"}),s.jsx("span",{className:"info-value",children:ws((v=t==null?void 0:t.memory)==null?void 0:v.total)})]})]})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Disk"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Usage"}),s.jsxs("span",{className:"info-value",children:[((j=(N=t==null?void 0:t.disk)==null?void 0:N.percent)==null?void 0:j.toFixed(1))||0,"%"]})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Used"}),s.jsx("span",{className:"info-value",children:ws((k=t==null?void 0:t.disk)==null?void 0:k.used)})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Total"}),s.jsx("span",{className:"info-value",children:ws((m=t==null?void 0:t.disk)==null?void 0:m.total)})]})]})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Network"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Bytes Sent"}),s.jsx("span",{className:"info-value",children:ws((x=t==null?void 0:t.network)==null?void 0:x.bytes_sent)})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Bytes Received"}),s.jsx("span",{className:"info-value",children:ws((g=t==null?void 0:t.network)==null?void 0:g.bytes_recv)})]})]})]})]}),(t==null?void 0:t.system)&&s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"System Details"}),s.jsxs("div",{className:"info-list",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Hostname"}),s.jsx("span",{className:"info-value",children:t.system.hostname||"-"})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Platform"}),s.jsx("span",{className:"info-value",children:t.system.platform||"-"})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"OS Version"}),s.jsx("span",{className:"info-value",children:t.system.version||"-"})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Uptime"}),s.jsx("span",{className:"info-value",children:Zg(t.system.uptime)})]})]})]})]}):s.jsxs("div",{className:"settings-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{children:"System Information"}),s.jsx("p",{children:"View system details and server information"})]}),s.jsx("div",{className:"alert alert-warning",children:"Admin access required to view system information."})]})},Jg=()=>s.jsxs("div",{className:"settings-section",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h2",{children:"About ServerKit"}),s.jsx("p",{children:"Server management made simple"})]}),s.jsxs("div",{className:"about-card",children:[s.jsx("div",{className:"about-logo",children:s.jsx("svg",{viewBox:"0 0 24 24",width:"48",height:"48",stroke:"currentColor",fill:"none",strokeWidth:"1.5",children:s.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),s.jsx("h3",{children:"ServerKit"}),s.jsx("p",{className:"version",children:"Version 1.0.0"}),s.jsx("p",{className:"description",children:"A modern, lightweight server management panel for managing web applications, databases, domains, and more. Built with Flask and React."})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Features"}),s.jsxs("ul",{className:"feature-list",children:[s.jsxs("li",{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Application Management (PHP, Python, Node.js, Docker)"]}),s.jsxs("li",{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Domain & SSL Certificate Management"]}),s.jsxs("li",{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Database Management (MySQL, PostgreSQL)"]}),s.jsxs("li",{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Docker Container Management"]}),s.jsxs("li",{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),"System Monitoring & Alerts"]}),s.jsxs("li",{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Automated Backups"]}),s.jsxs("li",{children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Git Deployment with Webhooks"]})]})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"Links"}),s.jsxs("div",{className:"link-list",children:[s.jsxs("a",{href:"https://github.com/serverkit",target:"_blank",rel:"noopener noreferrer",className:"link-item",children:[s.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:s.jsx("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})}),"GitHub Repository"]}),s.jsxs("a",{href:"#",className:"link-item",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),s.jsx("polyline",{points:"14 2 14 8 20 8"})]}),"Documentation"]}),s.jsxs("a",{href:"#",className:"link-item",children:[s.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),s.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),"Support"]})]})]}),s.jsxs("div",{className:"settings-card",children:[s.jsx("h3",{children:"License"}),s.jsx("p",{className:"license-text",children:"ServerKit is open source software licensed under the MIT License."})]})]});function ws(e){if(!e)return"-";const t=["B","KB","MB","GB","TB"];let n=0;for(;e>=1024&&n<t.length-1;)e/=1024,n++;return`${e.toFixed(1)} ${t[n]}`}function Zg(e){if(!e)return"-";const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),a=[];return t>0&&a.push(`${t}d`),n>0&&a.push(`${n}h`),r>0&&a.push(`${r}m`),a.join(" ")||"< 1m"}function Oa({size:e="md",className:t=""}){const n={sm:"spinner-sm",md:"spinner-md",lg:"spinner-lg"};return s.jsx("div",{className:`spinner ${n[e]||"spinner-md"} ${t}`,children:s.jsx("div",{className:"spinner-ring"})})}const ey={danger:Aa,warning:$x,info:bo};function Ba({isOpen:e,title:t,message:n,confirmText:r="Confirm",cancelText:a="Cancel",variant:i="danger",onConfirm:l,onCancel:c}){if(!e)return null;const o=ey[i]||Aa;return s.jsx("div",{className:"modal-overlay",onClick:c,children:s.jsxs("div",{className:"modal confirm-dialog",onClick:u=>u.stopPropagation(),children:[s.jsxs("div",{className:"confirm-dialog-content",children:[s.jsx("div",{className:`confirm-dialog-icon confirm-dialog-icon-${i}`,children:s.jsx(o,{size:32})}),s.jsx("h2",{className:"confirm-dialog-title",children:t}),s.jsx("p",{className:"confirm-dialog-message",children:n})]}),s.jsxs("div",{className:"confirm-dialog-actions",children:[s.jsx("button",{className:"btn btn-secondary",onClick:c,children:a}),s.jsx("button",{className:`btn btn-${i==="danger"?"danger":"primary"}`,onClick:l,children:r})]})]})})}function ty(){const[e,t]=d.useState("/home"),[n,r]=d.useState([]),[a,i]=d.useState(null),[l,c]=d.useState(!0),[o,u]=d.useState(!1),[f,h]=d.useState(""),[p,v]=d.useState(null),[N,j]=d.useState(null),[k,m]=d.useState(null),[x,g]=d.useState(""),[y,S]=d.useState(null),[E,T]=d.useState(!1),[P,O]=d.useState(!1),[w,L]=d.useState(!1),[U,V]=d.useState(!1),[H,B]=d.useState(""),[z,J]=d.useState(""),[R,_]=d.useState(null),[I,Q]=d.useState(""),[Y,ve]=d.useState(null),[ne,C]=d.useState(""),[G,F]=d.useState(null),[ee,ge]=d.useState(null),D=d.useRef(null),W=Se();d.useEffect(()=>{fe(e),Ce()},[e,o]);const fe=async $=>{c(!0),v(null);try{const me=await b.browseFiles($,o);r(me.entries||[]),i(me.parent),t(me.path)}catch(me){W.error(`Failed to load directory: ${me.message}`)}finally{c(!1)}},Ce=async()=>{try{const $=await b.getDiskUsage(e);j($)}catch($){console.error("Failed to load disk usage:",$)}},bt=async()=>{if(!f.trim()){v(null);return}c(!0);try{const $=await b.searchFiles(e,f);v($.results||[])}catch($){W.error(`Search failed: ${$.message}`)}finally{c(!1)}},as=$=>{$.is_dir?(t($.path),m(null),S(null)):A($)},A=async $=>{if(m($),$.is_editable)try{const me=await b.readFile($.path);g(me.content)}catch(me){W.error(`Failed to read file: ${me.message}`)}},Ne=()=>{k&&k.is_editable&&S(k)},Ns=async()=>{if(y)try{await b.writeFile(y.path,x),W.success("File saved successfully"),S(null),fe(e)}catch($){W.error(`Failed to save file: ${$.message}`)}},Jn=async()=>{if(!H.trim())return;const $=`${e}/${H}`;try{await b.createFile($),W.success("File created successfully"),T(!1),B(""),fe(e)}catch(me){W.error(`Failed to create file: ${me.message}`)}},Zn=async()=>{if(!z.trim())return;const $=`${e}/${z}`;try{await b.createDirectory($),W.success("Folder created successfully"),O(!1),J(""),fe(e)}catch(me){W.error(`Failed to create folder: ${me.message}`)}},er=async $=>{ge({title:"Delete Confirmation",message:`Are you sure you want to delete "${$.name}"? ${$.is_dir?"This will delete all contents inside.":""}`,confirmText:"Delete",variant:"danger",onConfirm:async()=>{try{await b.deleteFile($.path),W.success(`${$.is_dir?"Folder":"File"} deleted successfully`),m(null),fe(e)}catch(me){W.error(`Failed to delete: ${me.message}`)}ge(null)},onCancel:()=>ge(null)})},tr=async()=>{if(!(!R||!I.trim()))try{await b.renameFile(R.path,I),W.success("Renamed successfully"),L(!1),_(null),Q(""),fe(e)}catch($){W.error(`Failed to rename: ${$.message}`)}},sr=async()=>{if(!(!Y||!ne.trim()))try{await b.changeFilePermissions(Y.path,ne),W.success("Permissions changed successfully"),V(!1),ve(null),C(""),fe(e)}catch($){W.error(`Failed to change permissions: ${$.message}`)}},nr=async $=>{const me=$.target.files[0];if(me)try{await b.uploadFile(e,me,rr=>{F(rr)}),W.success("File uploaded successfully"),fe(e)}catch(rr){W.error(`Upload failed: ${rr.message}`)}finally{F(null),D.current&&(D.current.value="")}},K=$=>{b.downloadFile($.path)},De=$=>{_($),Q($.name),L(!0)},Ia=$=>{ve($),C($.permissions_octal||"755"),V(!0)},zh=$=>{if($.is_dir)return"folder";const me=$.name.split(".").pop().toLowerCase();return{js:"javascript",jsx:"javascript",ts:"javascript",tsx:"javascript",py:"python",rb:"ruby",php:"php",java:"java",html:"html",css:"css",less:"css",scss:"css",json:"json",xml:"xml",yaml:"yaml",yml:"yaml",md:"markdown",txt:"text",log:"text",sh:"terminal",bash:"terminal",jpg:"image",jpeg:"image",png:"image",gif:"image",svg:"image",pdf:"pdf",doc:"document",docx:"document",zip:"archive",tar:"archive",gz:"archive",rar:"archive"}[me]||"file"},Eo=p||n;return s.jsxs("div",{className:"file-manager",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-content",children:[s.jsx("h1",{children:"File Manager"}),s.jsx("p",{className:"page-description",children:"Browse, edit, and manage your server files"})]}),s.jsxs("div",{className:"page-header-actions",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>{var $;return($=D.current)==null?void 0:$.click()},children:"Upload"}),s.jsx("button",{className:"btn btn-secondary",onClick:()=>O(!0),children:"New Folder"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>T(!0),children:"New File"}),s.jsx("input",{type:"file",ref:D,style:{display:"none"},onChange:nr})]})]}),G!==null&&s.jsxs("div",{className:"upload-progress",children:[s.jsx("div",{className:"progress-bar",children:s.jsx("div",{className:"progress-fill",style:{width:`${G}%`}})}),s.jsxs("span",{children:[Math.round(G),"%"]})]}),s.jsxs("div",{className:"file-manager-toolbar",children:[s.jsxs("div",{className:"path-breadcrumb",children:[s.jsx("button",{className:"btn btn-icon",onClick:()=>a&&t(a),disabled:!a,children:s.jsx("span",{className:"icon",children:"arrow_back"})}),s.jsx("span",{className:"current-path",children:e})]}),s.jsxs("div",{className:"toolbar-actions",children:[s.jsxs("div",{className:"search-box",children:[s.jsx("input",{type:"text",placeholder:"Search files...",value:f,onChange:$=>h($.target.value),onKeyDown:$=>$.key==="Enter"&&bt()}),s.jsx("button",{className:"btn btn-icon",onClick:bt,children:s.jsx("span",{className:"icon",children:"search"})}),p&&s.jsx("button",{className:"btn btn-icon",onClick:()=>v(null),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("label",{className:"checkbox-label",children:[s.jsx("input",{type:"checkbox",checked:o,onChange:$=>u($.target.checked)}),"Show hidden"]}),s.jsx("button",{className:"btn btn-icon",onClick:()=>fe(e),children:s.jsx("span",{className:"icon",children:"refresh"})})]})]}),N&&s.jsxs("div",{className:"disk-usage-bar",children:[s.jsxs("div",{className:"disk-usage-info",children:[s.jsxs("span",{children:["Disk Usage: ",N.used_human," / ",N.total_human]}),s.jsxs("span",{children:[N.percent,"% used"]})]}),s.jsx("div",{className:"disk-progress",children:s.jsx("div",{className:`disk-progress-fill ${N.percent>90?"critical":N.percent>75?"warning":""}`,style:{width:`${N.percent}%`}})})]}),s.jsxs("div",{className:"file-manager-content",children:[s.jsx("div",{className:"file-list-container",children:l?s.jsx("div",{className:"loading-state",children:s.jsx(Oa,{})}):Eo.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("span",{className:"icon",children:"folder_open"}),s.jsx("p",{children:p?"No files found matching your search":"This directory is empty"})]}):s.jsxs("div",{className:"file-list",children:[s.jsxs("div",{className:"file-list-header",children:[s.jsx("span",{className:"col-name",children:"Name"}),s.jsx("span",{className:"col-size",children:"Size"}),s.jsx("span",{className:"col-modified",children:"Modified"}),s.jsx("span",{className:"col-permissions",children:"Permissions"}),s.jsx("span",{className:"col-actions",children:"Actions"})]}),Eo.map($=>s.jsxs("div",{className:`file-item ${(k==null?void 0:k.path)===$.path?"selected":""}`,onClick:()=>as($),children:[s.jsxs("span",{className:"col-name",children:[s.jsx("span",{className:`file-icon ${zh($)}`}),$.name,$.is_link&&s.jsx("span",{className:"link-indicator",children:"→"})]}),s.jsx("span",{className:"col-size",children:$.is_dir?"-":$.size_human}),s.jsx("span",{className:"col-modified",children:new Date($.modified).toLocaleDateString()}),s.jsx("span",{className:"col-permissions",children:$.permissions}),s.jsxs("span",{className:"col-actions",onClick:me=>me.stopPropagation(),children:[!$.is_dir&&s.jsx("button",{className:"btn btn-icon btn-sm",onClick:()=>K($),title:"Download",children:s.jsx("span",{className:"icon",children:"download"})}),s.jsx("button",{className:"btn btn-icon btn-sm",onClick:()=>De($),title:"Rename",children:s.jsx("span",{className:"icon",children:"edit"})}),s.jsx("button",{className:"btn btn-icon btn-sm",onClick:()=>Ia($),title:"Permissions",children:s.jsx("span",{className:"icon",children:"lock"})}),s.jsx("button",{className:"btn btn-icon btn-sm btn-danger",onClick:()=>er($),title:"Delete",children:s.jsx("span",{className:"icon",children:"delete"})})]})]},$.path))]})}),k&&!k.is_dir&&s.jsxs("div",{className:"file-preview",children:[s.jsxs("div",{className:"preview-header",children:[s.jsx("h3",{children:k.name}),s.jsxs("div",{className:"preview-actions",children:[k.is_editable&&!y&&s.jsx("button",{className:"btn btn-primary btn-sm",onClick:Ne,children:"Edit"}),y&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>S(null),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary btn-sm",onClick:Ns,children:"Save"})]}),s.jsx("button",{className:"btn btn-icon btn-sm",onClick:()=>m(null),children:s.jsx("span",{className:"icon",children:"close"})})]})]}),s.jsxs("div",{className:"preview-info",children:[s.jsxs("span",{children:["Size: ",k.size_human]}),s.jsxs("span",{children:["Owner: ",k.owner]}),s.jsxs("span",{children:["Group: ",k.group]}),k.mime_type&&s.jsxs("span",{children:["Type: ",k.mime_type]})]}),k.is_editable?s.jsx("textarea",{className:"file-editor",value:x,onChange:$=>g($.target.value),readOnly:!y,spellCheck:!1}):s.jsxs("div",{className:"preview-unavailable",children:[s.jsx("span",{className:"icon",children:"visibility_off"}),s.jsx("p",{children:"Preview not available for this file type"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>K(k),children:"Download File"})]})]})]}),E&&s.jsx("div",{className:"modal-overlay",onClick:()=>T(!1),children:s.jsxs("div",{className:"modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create New File"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>T(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"File Name"}),s.jsx("input",{type:"text",value:H,onChange:$=>B($.target.value),placeholder:"example.txt",autoFocus:!0})]}),s.jsxs("p",{className:"text-muted",children:["File will be created in: ",e]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>T(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:Jn,children:"Create File"})]})]})}),P&&s.jsx("div",{className:"modal-overlay",onClick:()=>O(!1),children:s.jsxs("div",{className:"modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create New Folder"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>O(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Folder Name"}),s.jsx("input",{type:"text",value:z,onChange:$=>J($.target.value),placeholder:"new-folder",autoFocus:!0})]}),s.jsxs("p",{className:"text-muted",children:["Folder will be created in: ",e]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>O(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:Zn,children:"Create Folder"})]})]})}),w&&s.jsx("div",{className:"modal-overlay",onClick:()=>L(!1),children:s.jsxs("div",{className:"modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h2",{children:["Rename ",R!=null&&R.is_dir?"Folder":"File"]}),s.jsx("button",{className:"btn btn-icon",onClick:()=>L(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsx("div",{className:"modal-body",children:s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"New Name"}),s.jsx("input",{type:"text",value:I,onChange:$=>Q($.target.value),autoFocus:!0})]})}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>L(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:tr,children:"Rename"})]})]})}),U&&s.jsx("div",{className:"modal-overlay",onClick:()=>V(!1),children:s.jsxs("div",{className:"modal",onClick:$=>$.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Change Permissions"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>V(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Permissions (Octal)"}),s.jsx("input",{type:"text",value:ne,onChange:$=>C($.target.value),placeholder:"755",maxLength:4,autoFocus:!0})]}),s.jsxs("p",{className:"text-muted",children:["Current: ",Y==null?void 0:Y.permissions," (",Y==null?void 0:Y.permissions_octal,")"]}),s.jsxs("div",{className:"permissions-help",children:[s.jsx("p",{children:"Common permissions:"}),s.jsxs("ul",{children:[s.jsxs("li",{children:[s.jsx("code",{children:"755"})," - Owner: rwx, Group/Other: rx (directories)"]}),s.jsxs("li",{children:[s.jsx("code",{children:"644"})," - Owner: rw, Group/Other: r (files)"]}),s.jsxs("li",{children:[s.jsx("code",{children:"600"})," - Owner: rw only (private files)"]})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>V(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:sr,children:"Apply"})]})]})}),ee&&s.jsx(Ba,{title:ee.title,message:ee.message,confirmText:ee.confirmText,variant:ee.variant,onConfirm:ee.onConfirm,onCancel:ee.onCancel})]})}function sy(){var as;const[e,t]=d.useState(null),[n,r]=d.useState([]),[a,i]=d.useState([]),[l,c]=d.useState(null),[o,u]=d.useState(""),[f,h]=d.useState(!0),[p,v]=d.useState("overview"),[N,j]=d.useState(!1),[k,m]=d.useState(!1),[x,g]=d.useState(!1),[y,S]=d.useState({username:"",password:"",homeDir:""}),[E,T]=d.useState(null),[P,O]=d.useState(""),[w,L]=d.useState("vsftpd"),[U,V]=d.useState(null),[H,B]=d.useState(!1),z=Se();d.useEffect(()=>{J()},[]);const J=async()=>{h(!0);try{await Promise.all([R(),I(),Q()])}catch(A){console.error("Failed to load FTP data:",A)}finally{h(!1)}},R=async()=>{try{const A=await b.getFTPStatus();t(A),A.active_server&&_(A.active_server)}catch(A){console.error("Failed to load FTP status:",A)}},_=async A=>{try{const Ne=await b.getFTPConfig(A);c(Ne)}catch(Ne){console.error("Failed to load FTP config:",Ne)}},I=async()=>{try{const A=await b.getFTPUsers();r(A.users||[])}catch(A){console.error("Failed to load FTP users:",A)}},Q=async()=>{try{const A=await b.getFTPConnections();i(A.connections||[])}catch(A){console.error("Failed to load FTP connections:",A)}},Y=async()=>{try{const A=await b.getFTPLogs(200);u(A.content||"No logs available")}catch{u("Failed to load logs")}},ve=async A=>{if(e!=null&&e.active_server){B(!0);try{await b.controlFTPService(A,e.active_server),z.success(`FTP server ${A}ed successfully`),await R()}catch(Ne){z.error(`Failed to ${A} FTP server: ${Ne.message}`)}finally{B(!1)}}},ne=async()=>{B(!0);try{await b.installFTPServer(w),z.success(`${w} installed successfully`),g(!1),await J()}catch(A){z.error(`Failed to install: ${A.message}`)}finally{B(!1)}},C=async()=>{if(y.username.trim()){B(!0);try{const A=await b.createFTPUser(y.username,y.password||null,y.homeDir||null);z.success(`User created. Password: ${A.password}`),j(!1),S({username:"",password:"",homeDir:""}),await I()}catch(A){z.error(`Failed to create user: ${A.message}`)}finally{B(!1)}}},G=async A=>{V({title:"Delete FTP User",message:`Are you sure you want to delete user "${A}"?`,confirmText:"Delete",variant:"danger",onConfirm:async()=>{try{await b.deleteFTPUser(A,!1),z.success("User deleted successfully"),await I()}catch(Ne){z.error(`Failed to delete user: ${Ne.message}`)}V(null)},onCancel:()=>V(null)})},F=async(A,Ne)=>{try{await b.toggleFTPUser(A,!Ne),z.success(`User ${Ne?"disabled":"enabled"} successfully`),await I()}catch(Ns){z.error(`Failed to toggle user: ${Ns.message}`)}},ee=async()=>{if(E){B(!0);try{const A=await b.changeFTPPassword(E,P||null);z.success(`Password changed. New password: ${A.password}`),m(!1),T(null),O("")}catch(A){z.error(`Failed to change password: ${A.message}`)}finally{B(!1)}}},ge=async A=>{try{await b.disconnectFTPSession(A),z.success("Session disconnected"),await Q()}catch(Ne){z.error(`Failed to disconnect: ${Ne.message}`)}},D=async()=>{B(!0);try{const A=await b.testFTPConnection("localhost",21);A.success?z.success(A.message):z.error(A.error)}catch(A){z.error(`Connection test failed: ${A.message}`)}finally{B(!1)}},W=A=>{T(A),O(""),m(!0)};if(f)return s.jsx("div",{className:"page-loading",children:s.jsx(Oa,{size:"lg"})});const fe=e==null?void 0:e.any_installed,Ce=e==null?void 0:e.any_running,bt=e==null?void 0:e.active_server;return s.jsxs("div",{className:"ftp-server",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-content",children:[s.jsx("h1",{children:"FTP Server"}),s.jsx("p",{className:"page-description",children:"Manage FTP users and file transfer settings"})]}),s.jsx("div",{className:"page-header-actions",children:fe?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary",onClick:D,disabled:H,children:"Test Connection"}),Ce?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>ve("restart"),disabled:H,children:"Restart"}),s.jsx("button",{className:"btn btn-danger",onClick:()=>ve("stop"),disabled:H,children:"Stop"})]}):s.jsx("button",{className:"btn btn-primary",onClick:()=>ve("start"),disabled:H,children:"Start"})]}):s.jsx("button",{className:"btn btn-primary",onClick:()=>g(!0),children:"Install FTP Server"})})]}),fe?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"status-cards",children:[s.jsxs("div",{className:`status-card ${Ce?"success":"warning"}`,children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:Ce?"check_circle":"pause_circle"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Server Status"}),s.jsx("span",{className:"status-value",children:Ce?"Running":"Stopped"})]})]}),s.jsxs("div",{className:"status-card",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"dns"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Active Server"}),s.jsx("span",{className:"status-value",children:bt||"None"})]})]}),s.jsxs("div",{className:"status-card",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"people"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"FTP Users"}),s.jsx("span",{className:"status-value",children:n.length})]})]}),s.jsxs("div",{className:"status-card",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"lan"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Active Connections"}),s.jsx("span",{className:"status-value",children:a.length})]})]})]}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${p==="overview"?"active":""}`,onClick:()=>v("overview"),children:"Overview"}),s.jsx("button",{className:`tab ${p==="users"?"active":""}`,onClick:()=>v("users"),children:"Users"}),s.jsx("button",{className:`tab ${p==="connections"?"active":""}`,onClick:()=>{v("connections"),Q()},children:"Connections"}),s.jsx("button",{className:`tab ${p==="logs"?"active":""}`,onClick:()=>{v("logs"),Y()},children:"Logs"})]}),s.jsxs("div",{className:"tab-content",children:[p==="overview"&&s.jsxs("div",{className:"overview-tab",children:[s.jsxs("div",{className:"config-section",children:[s.jsx("h3",{children:"Server Configuration"}),l!=null&&l.settings?s.jsxs("div",{className:"config-grid",children:[s.jsxs("div",{className:"config-item",children:[s.jsx("span",{className:"config-label",children:"Port"}),s.jsx("span",{className:"config-value",children:l.settings.listen_port||l.settings.port||21})]}),s.jsxs("div",{className:"config-item",children:[s.jsx("span",{className:"config-label",children:"Anonymous Access"}),s.jsx("span",{className:`config-value ${l.settings.anonymous_enable?"warning":"success"}`,children:l.settings.anonymous_enable?"Enabled":"Disabled"})]}),s.jsxs("div",{className:"config-item",children:[s.jsx("span",{className:"config-label",children:"Local Users"}),s.jsx("span",{className:"config-value",children:l.settings.local_enable?"Enabled":"Disabled"})]}),s.jsxs("div",{className:"config-item",children:[s.jsx("span",{className:"config-label",children:"Write Permission"}),s.jsx("span",{className:"config-value",children:l.settings.write_enable?"Enabled":"Disabled"})]}),s.jsxs("div",{className:"config-item",children:[s.jsx("span",{className:"config-label",children:"Chroot Users"}),s.jsx("span",{className:"config-value",children:l.settings.chroot_local_user?"Yes":"No"})]}),s.jsxs("div",{className:"config-item",children:[s.jsx("span",{className:"config-label",children:"SSL/TLS"}),s.jsx("span",{className:`config-value ${l.settings.ssl_enable?"success":"warning"}`,children:l.settings.ssl_enable?"Enabled":"Disabled"})]})]}):s.jsx("p",{className:"text-muted",children:"Configuration not available"})]}),s.jsxs("div",{className:"info-section",children:[s.jsx("h3",{children:"Connection Information"}),s.jsxs("div",{className:"info-grid",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Host"}),s.jsx("code",{children:"Your server IP or domain"})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Port"}),s.jsx("code",{children:"21"})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Protocol"}),s.jsxs("code",{children:["FTP",(as=l==null?void 0:l.settings)!=null&&as.ssl_enable?"S":""]})]})]})]})]}),p==="users"&&s.jsxs("div",{className:"users-tab",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"FTP Users"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>j(!0),children:"Add User"})]}),n.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("span",{className:"icon",children:"person_add"}),s.jsx("p",{children:"No FTP users configured"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>j(!0),children:"Create First User"})]}):s.jsx("div",{className:"users-table",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Username"}),s.jsx("th",{children:"Home Directory"}),s.jsx("th",{children:"Usage"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:n.map(A=>s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx("span",{className:"user-name",children:A.username}),A.in_userlist&&s.jsx("span",{className:"badge badge-info",children:"FTP"})]}),s.jsxs("td",{children:[s.jsx("code",{children:A.home}),!A.home_exists&&s.jsx("span",{className:"badge badge-warning",children:"Missing"})]}),s.jsx("td",{children:A.home_size_human}),s.jsx("td",{children:s.jsx("span",{className:`status-badge ${A.is_active?"active":"inactive"}`,children:A.is_active?"Active":"Disabled"})}),s.jsxs("td",{className:"actions",children:[s.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>W(A.username),title:"Change Password",children:s.jsx("span",{className:"icon",children:"key"})}),s.jsx("button",{className:`btn btn-sm ${A.is_active?"btn-warning":"btn-success"}`,onClick:()=>F(A.username,A.is_active),title:A.is_active?"Disable":"Enable",children:s.jsx("span",{className:"icon",children:A.is_active?"block":"check"})}),s.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>G(A.username),title:"Delete",children:s.jsx("span",{className:"icon",children:"delete"})})]})]},A.username))})]})})]}),p==="connections"&&s.jsxs("div",{className:"connections-tab",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Active Connections"}),s.jsxs("button",{className:"btn btn-secondary",onClick:Q,children:[s.jsx("span",{className:"icon",children:"refresh"}),"Refresh"]})]}),a.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("span",{className:"icon",children:"lan"}),s.jsx("p",{children:"No active connections"})]}):s.jsx("div",{className:"connections-table",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Local Address"}),s.jsx("th",{children:"Remote Address"}),s.jsx("th",{children:"State"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:a.map((A,Ne)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("code",{children:A.local})}),s.jsx("td",{children:s.jsx("code",{children:A.remote})}),s.jsx("td",{children:s.jsx("span",{className:"status-badge active",children:A.state})}),s.jsx("td",{children:s.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>ge(A.pid),title:"Disconnect",children:s.jsx("span",{className:"icon",children:"close"})})})]},Ne))})]})})]}),p==="logs"&&s.jsxs("div",{className:"logs-tab",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Server Logs"}),s.jsxs("button",{className:"btn btn-secondary",onClick:Y,children:[s.jsx("span",{className:"icon",children:"refresh"}),"Refresh"]})]}),s.jsx("div",{className:"log-viewer",children:s.jsx("pre",{children:o})})]})]})]}):s.jsxs("div",{className:"empty-state-large",children:[s.jsx("span",{className:"icon",children:"cloud_upload"}),s.jsx("h2",{children:"No FTP Server Installed"}),s.jsx("p",{children:"Install an FTP server to enable file transfers on your server."}),s.jsx("button",{className:"btn btn-primary btn-lg",onClick:()=>g(!0),children:"Install FTP Server"})]}),x&&s.jsx("div",{className:"modal-overlay",onClick:()=>g(!1),children:s.jsxs("div",{className:"modal",onClick:A=>A.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Install FTP Server"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>g(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Select FTP Server"}),s.jsxs("select",{value:w,onChange:A=>L(A.target.value),children:[s.jsx("option",{value:"vsftpd",children:"vsftpd (Recommended)"}),s.jsx("option",{value:"proftpd",children:"ProFTPD"})]})]}),s.jsx("div",{className:"install-info",children:w==="vsftpd"?s.jsxs("p",{children:[s.jsx("strong",{children:"vsftpd"})," is a secure, fast, and stable FTP server. It's the default choice for most Ubuntu/Debian systems."]}):s.jsxs("p",{children:[s.jsx("strong",{children:"ProFTPD"})," is a highly configurable FTP server with advanced features and Apache-like configuration syntax."]})})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>g(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:ne,disabled:H,children:H?"Installing...":"Install"})]})]})}),N&&s.jsx("div",{className:"modal-overlay",onClick:()=>j(!1),children:s.jsxs("div",{className:"modal",onClick:A=>A.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create FTP User"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>j(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Username *"}),s.jsx("input",{type:"text",value:y.username,onChange:A=>S({...y,username:A.target.value}),placeholder:"ftpuser"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Password (leave empty to auto-generate)"}),s.jsx("input",{type:"password",value:y.password,onChange:A=>S({...y,password:A.target.value}),placeholder:"Auto-generated if empty"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Home Directory (optional)"}),s.jsx("input",{type:"text",value:y.homeDir,onChange:A=>S({...y,homeDir:A.target.value}),placeholder:"/home/ftp/username"})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>j(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:C,disabled:H||!y.username.trim(),children:H?"Creating...":"Create User"})]})]})}),k&&s.jsx("div",{className:"modal-overlay",onClick:()=>m(!1),children:s.jsxs("div",{className:"modal",onClick:A=>A.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Change Password"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>m(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("p",{children:["Changing password for user: ",s.jsx("strong",{children:E})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"New Password (leave empty to auto-generate)"}),s.jsx("input",{type:"password",value:P,onChange:A=>O(A.target.value),placeholder:"Auto-generated if empty"})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>m(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:ee,disabled:H,children:H?"Changing...":"Change Password"})]})]})}),U&&s.jsx(Ba,{title:U.title,message:U.message,confirmText:U.confirmText,variant:U.variant,onConfirm:U.onConfirm,onCancel:U.onCancel})]})}function ny(){const[e,t]=d.useState([]),[n,r]=d.useState(null),[a,i]=d.useState([]),[l,c]=d.useState([]),[o,u]=d.useState(null),[f,h]=d.useState(!0),[p,v]=d.useState("versions"),[N,j]=d.useState(!1),[k,m]=d.useState(!1),[x,g]=d.useState(!1),[y,S]=d.useState("8.2"),[E,T]=d.useState(""),[P,O]=d.useState({name:"",user:"www-data",group:"www-data",listen:"",pm:"dynamic",pm_max_children:5,pm_start_servers:2,pm_min_spare_servers:1,pm_max_spare_servers:3}),[w,L]=d.useState(!1),[U,V]=d.useState(null),H=Se(),B=["8.0","8.1","8.2","8.3"];d.useEffect(()=>{z()},[]),d.useEffect(()=>{n&&J(n)},[n]);const z=async()=>{var C;h(!0);try{const G=await b.getPHPVersions();if(t(G.versions||[]),((C=G.versions)==null?void 0:C.length)>0){const F=G.versions.find(ee=>ee.is_default)||G.versions[0];r(F.version)}}catch(G){H.error(`Failed to load PHP versions: ${G.message}`)}finally{h(!1)}},J=async C=>{try{const[G,F,ee]=await Promise.all([b.getPHPExtensions(C).catch(()=>({extensions:[]})),b.getPHPPools(C).catch(()=>({pools:[]})),b.getPHPFPMStatus(C).catch(()=>null)]);i(G.extensions||[]),c(F.pools||[]),u(ee)}catch(G){console.error("Failed to load version details:",G)}},R=async()=>{L(!0);try{await b.installPHPVersion(y),H.success(`PHP ${y} installation started`),j(!1),await z()}catch(C){H.error(`Failed to install PHP ${y}: ${C.message}`)}finally{L(!1)}},_=async C=>{L(!0);try{await b.setDefaultPHPVersion(C),H.success(`PHP ${C} is now the default version`),await z()}catch(G){H.error(`Failed to set default version: ${G.message}`)}finally{L(!1)}},I=async()=>{if(!(!E.trim()||!n)){L(!0);try{await b.installPHPExtension(n,E),H.success(`Extension ${E} installation started`),m(!1),T(""),await J(n)}catch(C){H.error(`Failed to install extension: ${C.message}`)}finally{L(!1)}}},Q=async()=>{if(!(!P.name.trim()||!n)){L(!0);try{const C={...P,listen:P.listen||`/run/php/php${n}-fpm-${P.name}.sock`};await b.createPHPPool(n,C),H.success(`Pool ${P.name} created successfully`),g(!1),O({name:"",user:"www-data",group:"www-data",listen:"",pm:"dynamic",pm_max_children:5,pm_start_servers:2,pm_min_spare_servers:1,pm_max_spare_servers:3}),await J(n)}catch(C){H.error(`Failed to create pool: ${C.message}`)}finally{L(!1)}}},Y=async C=>{V({title:"Delete Pool",message:`Are you sure you want to delete the pool "${C}"?`,confirmText:"Delete",variant:"danger",onConfirm:async()=>{try{await b.deletePHPPool(n,C),H.success(`Pool ${C} deleted`),await J(n)}catch(G){H.error(`Failed to delete pool: ${G.message}`)}V(null)},onCancel:()=>V(null)})},ve=async()=>{if(n){L(!0);try{await b.restartPHPFPM(n),H.success(`PHP-FPM ${n} restarted`),await J(n)}catch(C){H.error(`Failed to restart PHP-FPM: ${C.message}`)}finally{L(!1)}}},ne=e.find(C=>C.version===n);return f?s.jsx("div",{className:"page-loading",children:s.jsx(Oa,{size:"lg"})}):s.jsxs("div",{className:"php-management",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-content",children:[s.jsx("h1",{children:"PHP Management"}),s.jsx("p",{className:"page-description",children:"Manage PHP versions, extensions, and FPM pools"})]}),s.jsxs("div",{className:"page-header-actions",children:[s.jsx("button",{className:"btn btn-secondary",onClick:ve,disabled:!n||w,children:"Restart FPM"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>j(!0),children:"Install PHP Version"})]})]}),e.length===0?s.jsxs("div",{className:"empty-state-large",children:[s.jsx("span",{className:"icon",children:"code"}),s.jsx("h2",{children:"No PHP Versions Installed"}),s.jsx("p",{children:"Install a PHP version to get started with PHP development."}),s.jsx("button",{className:"btn btn-primary btn-lg",onClick:()=>j(!0),children:"Install PHP"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"version-selector",children:[s.jsx("label",{children:"Active Version:"}),s.jsx("select",{value:n||"",onChange:C=>r(C.target.value),children:e.map(C=>s.jsxs("option",{value:C.version,children:["PHP ",C.version," ",C.is_default?"(Default)":""]},C.version))}),ne&&!ne.is_default&&s.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>_(n),disabled:w,children:"Set as Default"})]}),o&&s.jsxs("div",{className:"status-cards",children:[s.jsxs("div",{className:`status-card ${o.active?"success":"warning"}`,children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:o.active?"check_circle":"error"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"FPM Status"}),s.jsx("span",{className:"status-value",children:o.active?"Running":"Stopped"})]})]}),s.jsxs("div",{className:"status-card",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"extension"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Extensions"}),s.jsx("span",{className:"status-value",children:a.length})]})]}),s.jsxs("div",{className:"status-card",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"layers"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"FPM Pools"}),s.jsx("span",{className:"status-value",children:l.length})]})]})]}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${p==="versions"?"active":""}`,onClick:()=>v("versions"),children:"Installed Versions"}),s.jsx("button",{className:`tab ${p==="extensions"?"active":""}`,onClick:()=>v("extensions"),children:"Extensions"}),s.jsx("button",{className:`tab ${p==="pools"?"active":""}`,onClick:()=>v("pools"),children:"FPM Pools"})]}),s.jsxs("div",{className:"tab-content",children:[p==="versions"&&s.jsx("div",{className:"versions-tab",children:s.jsx("div",{className:"versions-grid",children:e.map(C=>s.jsxs("div",{className:`version-card ${C.version===n?"selected":""}`,onClick:()=>r(C.version),children:[s.jsxs("div",{className:"version-header",children:[s.jsxs("span",{className:"version-number",children:["PHP ",C.version]}),C.is_default&&s.jsx("span",{className:"badge badge-primary",children:"Default"})]}),s.jsxs("div",{className:"version-details",children:[s.jsxs("div",{className:"detail-row",children:[s.jsx("span",{className:"label",children:"Binary:"}),s.jsx("code",{children:C.binary||`/usr/bin/php${C.version}`})]}),s.jsxs("div",{className:"detail-row",children:[s.jsx("span",{className:"label",children:"FPM:"}),s.jsx("span",{className:`status ${C.fpm_active?"active":"inactive"}`,children:C.fpm_active?"Running":"Stopped"})]})]}),s.jsx("div",{className:"version-actions",children:!C.is_default&&s.jsx("button",{className:"btn btn-sm btn-secondary",onClick:G=>{G.stopPropagation(),_(C.version)},children:"Set Default"})})]},C.version))})}),p==="extensions"&&s.jsxs("div",{className:"extensions-tab",children:[s.jsxs("div",{className:"section-header",children:[s.jsxs("h3",{children:["Installed Extensions (PHP ",n,")"]}),s.jsx("button",{className:"btn btn-primary",onClick:()=>m(!0),children:"Install Extension"})]}),a.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("span",{className:"icon",children:"extension"}),s.jsx("p",{children:"No extensions found"})]}):s.jsx("div",{className:"extensions-grid",children:a.map(C=>s.jsxs("div",{className:"extension-card",children:[s.jsx("span",{className:"extension-name",children:C.name||C}),C.version&&s.jsx("span",{className:"extension-version",children:C.version})]},C.name||C))})]}),p==="pools"&&s.jsxs("div",{className:"pools-tab",children:[s.jsxs("div",{className:"section-header",children:[s.jsxs("h3",{children:["FPM Pools (PHP ",n,")"]}),s.jsx("button",{className:"btn btn-primary",onClick:()=>g(!0),children:"Create Pool"})]}),l.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("span",{className:"icon",children:"layers"}),s.jsx("p",{children:"No FPM pools configured"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>g(!0),children:"Create Pool"})]}):s.jsx("div",{className:"pools-table",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Pool Name"}),s.jsx("th",{children:"User"}),s.jsx("th",{children:"Listen"}),s.jsx("th",{children:"Process Manager"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:l.map(C=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("strong",{children:C.name})}),s.jsxs("td",{children:[C.user,":",C.group]}),s.jsx("td",{children:s.jsx("code",{children:C.listen})}),s.jsx("td",{children:s.jsx("span",{className:"badge",children:C.pm||"dynamic"})}),s.jsx("td",{children:s.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>Y(C.name),disabled:C.name==="www",title:C.name==="www"?"Cannot delete default pool":"Delete pool",children:s.jsx("span",{className:"icon",children:"delete"})})})]},C.name))})]})})]})]})]}),N&&s.jsx("div",{className:"modal-overlay",onClick:()=>j(!1),children:s.jsxs("div",{className:"modal",onClick:C=>C.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Install PHP Version"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>j(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"PHP Version"}),s.jsx("select",{value:y,onChange:C=>S(C.target.value),children:B.map(C=>s.jsxs("option",{value:C,disabled:e.some(G=>G.version===C),children:["PHP ",C," ",e.some(G=>G.version===C)?"(Installed)":""]},C))})]}),s.jsxs("p",{className:"text-muted",children:["This will install PHP ",y," with common extensions including cli, fpm, mysql, pgsql, sqlite3, curl, gd, mbstring, xml, and zip."]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>j(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:R,disabled:w||e.some(C=>C.version===y),children:w?"Installing...":"Install"})]})]})}),k&&s.jsx("div",{className:"modal-overlay",onClick:()=>m(!1),children:s.jsxs("div",{className:"modal",onClick:C=>C.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Install PHP Extension"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>m(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Extension Name"}),s.jsx("input",{type:"text",value:E,onChange:C=>T(C.target.value),placeholder:"e.g., redis, imagick, xdebug"})]}),s.jsxs("div",{className:"common-extensions",children:[s.jsx("p",{className:"text-muted",children:"Common extensions:"}),s.jsx("div",{className:"extension-chips",children:["redis","imagick","xdebug","memcached","opcache","intl","soap","ldap"].map(C=>s.jsx("button",{className:"chip",onClick:()=>T(C),children:C},C))})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>m(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:I,disabled:w||!E.trim(),children:w?"Installing...":"Install"})]})]})}),x&&s.jsx("div",{className:"modal-overlay",onClick:()=>g(!1),children:s.jsxs("div",{className:"modal modal-lg",onClick:C=>C.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Create FPM Pool"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>g(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Pool Name *"}),s.jsx("input",{type:"text",value:P.name,onChange:C=>O({...P,name:C.target.value}),placeholder:"myapp"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Process Manager"}),s.jsxs("select",{value:P.pm,onChange:C=>O({...P,pm:C.target.value}),children:[s.jsx("option",{value:"dynamic",children:"Dynamic"}),s.jsx("option",{value:"static",children:"Static"}),s.jsx("option",{value:"ondemand",children:"On Demand"})]})]})]}),s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"User"}),s.jsx("input",{type:"text",value:P.user,onChange:C=>O({...P,user:C.target.value})})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Group"}),s.jsx("input",{type:"text",value:P.group,onChange:C=>O({...P,group:C.target.value})})]})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Listen Socket (leave empty for default)"}),s.jsx("input",{type:"text",value:P.listen,onChange:C=>O({...P,listen:C.target.value}),placeholder:`/run/php/php${n}-fpm-${P.name||"poolname"}.sock`})]}),P.pm==="dynamic"&&s.jsxs("div",{className:"form-row form-row-4",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Max Children"}),s.jsx("input",{type:"number",value:P.pm_max_children,onChange:C=>O({...P,pm_max_children:parseInt(C.target.value)}),min:"1"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Start Servers"}),s.jsx("input",{type:"number",value:P.pm_start_servers,onChange:C=>O({...P,pm_start_servers:parseInt(C.target.value)}),min:"1"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Min Spare"}),s.jsx("input",{type:"number",value:P.pm_min_spare_servers,onChange:C=>O({...P,pm_min_spare_servers:parseInt(C.target.value)}),min:"1"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Max Spare"}),s.jsx("input",{type:"number",value:P.pm_max_spare_servers,onChange:C=>O({...P,pm_max_spare_servers:parseInt(C.target.value)}),min:"1"})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>g(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:Q,disabled:w||!P.name.trim(),children:w?"Creating...":"Create Pool"})]})]})}),U&&s.jsx(Ba,{title:U.title,message:U.message,confirmText:U.confirmText,variant:U.variant,onConfirm:U.onConfirm,onCancel:U.onCancel})]})}function ry(){var G;const[e,t]=d.useState(null),[n,r]=d.useState([]),[a,i]=d.useState([]),[l,c]=d.useState(!0),[o,u]=d.useState("overview"),[f,h]=d.useState(!1),[p,v]=d.useState(!1),[N,j]=d.useState(!1),[k,m]=d.useState(""),[x,g]=d.useState({port:"",protocol:"tcp"}),[y,S]=d.useState("ufw"),[E,T]=d.useState(!1),[P,O]=d.useState(null),w=Se(),L=[{port:22,name:"SSH",protocol:"tcp"},{port:80,name:"HTTP",protocol:"tcp"},{port:443,name:"HTTPS",protocol:"tcp"},{port:21,name:"FTP",protocol:"tcp"},{port:25,name:"SMTP",protocol:"tcp"},{port:3306,name:"MySQL",protocol:"tcp"},{port:5432,name:"PostgreSQL",protocol:"tcp"},{port:6379,name:"Redis",protocol:"tcp"},{port:27017,name:"MongoDB",protocol:"tcp"}];d.useEffect(()=>{U()},[]);const U=async()=>{c(!0);try{await Promise.all([V(),H(),B()])}catch(F){console.error("Failed to load firewall data:",F)}finally{c(!1)}},V=async()=>{try{const F=await b.getFirewallStatus();t(F)}catch(F){console.error("Failed to load status:",F)}},H=async()=>{try{const F=await b.getFirewallRules();r(F.rules||[])}catch(F){console.error("Failed to load rules:",F)}},B=async()=>{try{const F=await b.getBlockedIPs();i(F.blocked_ips||[])}catch(F){console.error("Failed to load blocked IPs:",F)}},z=async()=>{T(!0);try{await b.enableFirewall(),w.success("Firewall enabled"),await V()}catch(F){w.error(`Failed to enable firewall: ${F.message}`)}finally{T(!1)}},J=async()=>{O({title:"Disable Firewall",message:"Are you sure you want to disable the firewall? This will leave your server unprotected.",confirmText:"Disable",variant:"danger",onConfirm:async()=>{T(!0);try{await b.disableFirewall(),w.success("Firewall disabled"),await V()}catch(F){w.error(`Failed to disable firewall: ${F.message}`)}finally{T(!1),O(null)}},onCancel:()=>O(null)})},R=async()=>{if(k.trim()){T(!0);try{await b.blockIP(k),w.success(`IP ${k} blocked`),h(!1),m(""),await B(),await H()}catch(F){w.error(`Failed to block IP: ${F.message}`)}finally{T(!1)}}},_=async F=>{O({title:"Unblock IP",message:`Are you sure you want to unblock ${F}?`,confirmText:"Unblock",variant:"warning",onConfirm:async()=>{try{await b.unblockIP(F),w.success(`IP ${F} unblocked`),await B(),await H()}catch(ee){w.error(`Failed to unblock IP: ${ee.message}`)}O(null)},onCancel:()=>O(null)})},I=async()=>{if(x.port){T(!0);try{await b.allowPort(parseInt(x.port),x.protocol),w.success(`Port ${x.port}/${x.protocol} allowed`),v(!1),g({port:"",protocol:"tcp"}),await H()}catch(F){w.error(`Failed to allow port: ${F.message}`)}finally{T(!1)}}},Q=async(F,ee)=>{T(!0);try{await b.allowPort(F,ee),w.success(`Port ${F}/${ee} allowed`),await H()}catch(ge){w.error(`Failed to allow port: ${ge.message}`)}finally{T(!1)}},Y=async(F,ee)=>{O({title:"Remove Port Rule",message:`Are you sure you want to remove the rule for port ${F}/${ee}?`,confirmText:"Remove",variant:"danger",onConfirm:async()=>{try{await b.denyPort(parseInt(F),ee),w.success(`Port ${F}/${ee} rule removed`),await H()}catch(ge){w.error(`Failed to remove port: ${ge.message}`)}O(null)},onCancel:()=>O(null)})},ve=async()=>{T(!0);try{await b.installFirewall(y),w.success(`${y.toUpperCase()} installed successfully`),j(!1),await U()}catch(F){w.error(`Failed to install firewall: ${F.message}`)}finally{T(!1)}},ne=e==null?void 0:e.any_active,C=e==null?void 0:e.active_firewall;return l?s.jsx("div",{className:"page-loading",children:s.jsx(Oa,{size:"lg"})}):s.jsxs("div",{className:"firewall-page",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-content",children:[s.jsx("h1",{children:"Firewall"}),s.jsx("p",{className:"page-description",children:"Manage firewall rules and IP blocking"})]}),s.jsx("div",{className:"page-header-actions",children:e!=null&&e.any_installed?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>h(!0),children:"Block IP"}),s.jsx("button",{className:"btn btn-secondary",onClick:()=>v(!0),children:"Allow Port"}),ne?s.jsx("button",{className:"btn btn-danger",onClick:J,disabled:E,children:"Disable Firewall"}):s.jsx("button",{className:"btn btn-primary",onClick:z,disabled:E,children:"Enable Firewall"})]}):s.jsx("button",{className:"btn btn-primary",onClick:()=>j(!0),children:"Install Firewall"})})]}),e!=null&&e.any_installed?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"status-cards",children:[s.jsxs("div",{className:`status-card ${ne?"success":"danger"}`,children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:ne?"shield":"shield_outlined"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Firewall Status"}),s.jsx("span",{className:"status-value",children:ne?"Active":"Inactive"})]})]}),s.jsxs("div",{className:"status-card",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"dns"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Firewall Type"}),s.jsx("span",{className:"status-value",children:(C==null?void 0:C.toUpperCase())||"None"})]})]}),s.jsxs("div",{className:"status-card",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"rule"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Active Rules"}),s.jsx("span",{className:"status-value",children:n.length})]})]}),s.jsxs("div",{className:"status-card warning",children:[s.jsx("div",{className:"status-icon",children:s.jsx("span",{className:"icon",children:"block"})}),s.jsxs("div",{className:"status-info",children:[s.jsx("span",{className:"status-label",children:"Blocked IPs"}),s.jsx("span",{className:"status-value",children:a.length})]})]})]}),s.jsxs("div",{className:"tabs",children:[s.jsx("button",{className:`tab ${o==="overview"?"active":""}`,onClick:()=>u("overview"),children:"Overview"}),s.jsx("button",{className:`tab ${o==="rules"?"active":""}`,onClick:()=>u("rules"),children:"Rules"}),s.jsx("button",{className:`tab ${o==="blocked"?"active":""}`,onClick:()=>u("blocked"),children:"Blocked IPs"}),s.jsx("button",{className:`tab ${o==="quick"?"active":""}`,onClick:()=>u("quick"),children:"Quick Actions"})]}),s.jsxs("div",{className:"tab-content",children:[o==="overview"&&s.jsxs("div",{className:"overview-tab",children:[s.jsxs("div",{className:"info-card",children:[s.jsx("h3",{children:"Firewall Information"}),s.jsxs("div",{className:"info-grid",children:[s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Type"}),s.jsx("span",{className:"info-value",children:C==null?void 0:C.toUpperCase()})]}),s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Status"}),s.jsx("span",{className:`info-value ${ne?"text-success":"text-danger"}`,children:ne?"Active":"Inactive"})]}),C==="firewalld"&&((G=e==null?void 0:e.firewalld)==null?void 0:G.default_zone)&&s.jsxs("div",{className:"info-item",children:[s.jsx("span",{className:"info-label",children:"Default Zone"}),s.jsx("span",{className:"info-value",children:e.firewalld.default_zone})]})]})]}),s.jsxs("div",{className:"protection-summary",children:[s.jsx("h3",{children:"Protection Summary"}),s.jsxs("div",{className:"summary-grid",children:[s.jsxs("div",{className:"summary-item",children:[s.jsx("span",{className:"summary-icon text-success",children:s.jsx("span",{className:"icon",children:"check_circle"})}),s.jsxs("span",{className:"summary-text",children:[n.filter(F=>F.type==="port"||F.port).length," ports allowed"]})]}),s.jsxs("div",{className:"summary-item",children:[s.jsx("span",{className:"summary-icon text-success",children:s.jsx("span",{className:"icon",children:"check_circle"})}),s.jsxs("span",{className:"summary-text",children:[n.filter(F=>F.type==="service"||F.service).length," services allowed"]})]}),s.jsxs("div",{className:"summary-item",children:[s.jsx("span",{className:"summary-icon text-danger",children:s.jsx("span",{className:"icon",children:"block"})}),s.jsxs("span",{className:"summary-text",children:[a.length," IPs blocked"]})]})]})]})]}),o==="rules"&&s.jsxs("div",{className:"rules-tab",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Firewall Rules"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>v(!0),children:"Add Rule"})]}),n.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("span",{className:"icon",children:"rule"}),s.jsx("p",{children:"No rules configured"})]}):s.jsx("div",{className:"rules-table",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Type"}),s.jsx("th",{children:"Target"}),s.jsx("th",{children:"Protocol"}),s.jsx("th",{children:"Actions"})]})}),s.jsx("tbody",{children:n.map((F,ee)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("span",{className:"badge badge-info",children:F.type})}),s.jsxs("td",{children:[F.type==="service"&&F.service,F.type==="port"&&F.port,F.type==="rich"&&s.jsx("code",{className:"rule-code",children:F.rule})]}),s.jsx("td",{children:F.protocol||"-"}),s.jsx("td",{children:F.type==="port"&&s.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>Y(F.port,F.protocol),children:s.jsx("span",{className:"icon",children:"delete"})})})]},ee))})]})})]}),o==="blocked"&&s.jsxs("div",{className:"blocked-tab",children:[s.jsxs("div",{className:"section-header",children:[s.jsx("h3",{children:"Blocked IP Addresses"}),s.jsx("button",{className:"btn btn-primary",onClick:()=>h(!0),children:"Block IP"})]}),a.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("span",{className:"icon",children:"verified_user"}),s.jsx("p",{children:"No blocked IPs"})]}):s.jsx("div",{className:"blocked-list",children:a.map((F,ee)=>s.jsxs("div",{className:"blocked-item",children:[s.jsxs("div",{className:"blocked-info",children:[s.jsx("span",{className:"blocked-ip",children:F.ip}),s.jsx("code",{className:"blocked-rule",children:F.rule})]}),s.jsx("button",{className:"btn btn-sm btn-warning",onClick:()=>_(F.ip),children:"Unblock"})]},ee))})]}),o==="quick"&&s.jsxs("div",{className:"quick-tab",children:[s.jsx("h3",{children:"Quick Port Access"}),s.jsx("p",{className:"text-muted",children:"One-click enable/disable common service ports"}),s.jsx("div",{className:"quick-ports",children:L.map(({port:F,name:ee,protocol:ge})=>{const D=n.some(W=>(W.port===String(F)||W.port===F)&&W.protocol===ge);return s.jsxs("div",{className:"quick-port-item",children:[s.jsxs("div",{className:"port-info",children:[s.jsx("span",{className:"port-name",children:ee}),s.jsxs("span",{className:"port-number",children:[F,"/",ge]})]}),s.jsx("div",{className:"port-status",children:D?s.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>Y(F,ge),disabled:E,children:"Block"}):s.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>Q(F,ge),disabled:E,children:"Allow"})})]},F)})})]})]})]}):s.jsxs("div",{className:"empty-state-large",children:[s.jsx("span",{className:"icon",children:"security"}),s.jsx("h2",{children:"No Firewall Installed"}),s.jsx("p",{children:"Install a firewall to protect your server from unauthorized access."}),s.jsx("button",{className:"btn btn-primary btn-lg",onClick:()=>j(!0),children:"Install Firewall"})]}),f&&s.jsx("div",{className:"modal-overlay",onClick:()=>h(!1),children:s.jsxs("div",{className:"modal",onClick:F=>F.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Block IP Address"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>h(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"IP Address"}),s.jsx("input",{type:"text",value:k,onChange:F=>m(F.target.value),placeholder:"192.168.1.100 or 10.0.0.0/24"})]}),s.jsx("p",{className:"text-muted",children:"You can block a single IP (192.168.1.100) or a range using CIDR notation (10.0.0.0/24)."})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>h(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-danger",onClick:R,disabled:E||!k.trim(),children:E?"Blocking...":"Block IP"})]})]})}),p&&s.jsx("div",{className:"modal-overlay",onClick:()=>v(!1),children:s.jsxs("div",{className:"modal",onClick:F=>F.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Allow Port"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>v(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsx("div",{className:"modal-body",children:s.jsxs("div",{className:"form-row",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Port Number"}),s.jsx("input",{type:"number",value:x.port,onChange:F=>g({...x,port:F.target.value}),placeholder:"8080",min:"1",max:"65535"})]}),s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Protocol"}),s.jsxs("select",{value:x.protocol,onChange:F=>g({...x,protocol:F.target.value}),children:[s.jsx("option",{value:"tcp",children:"TCP"}),s.jsx("option",{value:"udp",children:"UDP"})]})]})]})}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>v(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:I,disabled:E||!x.port,children:E?"Adding...":"Allow Port"})]})]})}),N&&s.jsx("div",{className:"modal-overlay",onClick:()=>j(!1),children:s.jsxs("div",{className:"modal",onClick:F=>F.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h2",{children:"Install Firewall"}),s.jsx("button",{className:"btn btn-icon",onClick:()=>j(!1),children:s.jsx("span",{className:"icon",children:"close"})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"form-group",children:[s.jsx("label",{children:"Select Firewall"}),s.jsxs("select",{value:y,onChange:F=>S(F.target.value),children:[s.jsx("option",{value:"ufw",children:"UFW (Recommended for Ubuntu)"}),s.jsx("option",{value:"firewalld",children:"firewalld (CentOS/RHEL)"})]})]}),s.jsx("div",{className:"install-info",children:y==="ufw"?s.jsxs("p",{children:[s.jsx("strong",{children:"UFW (Uncomplicated Firewall)"})," is a simple and easy-to-use firewall for Ubuntu and Debian systems. It provides a user-friendly interface for iptables."]}):s.jsxs("p",{children:[s.jsx("strong",{children:"firewalld"})," is a dynamically managed firewall with zone-based configuration. It's the default firewall on CentOS and RHEL systems."]})})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:()=>j(!1),children:"Cancel"}),s.jsx("button",{className:"btn btn-primary",onClick:ve,disabled:E,children:E?"Installing...":"Install"})]})]})}),P&&s.jsx(Ba,{title:P.title,message:P.message,confirmText:P.confirmText,variant:P.variant,onConfirm:P.onConfirm,onCancel:P.onCancel})]})}function ay({children:e}){const{isAuthenticated:t,loading:n}=rs();return n?s.jsx("div",{className:"loading",children:"Loading..."}):t?e:s.jsx(Nh,{to:"/login"})}function Zc({children:e}){const{isAuthenticated:t,loading:n}=rs();return n?s.jsx("div",{className:"loading",children:"Loading..."}):t?s.jsx(Nh,{to:"/"}):e}function iy(){return s.jsxs(mx,{children:[s.jsx(be,{path:"/login",element:s.jsx(Zc,{children:s.jsx(sg,{})})}),s.jsx(be,{path:"/register",element:s.jsx(Zc,{children:s.jsx(ng,{})})}),s.jsxs(be,{path:"/",element:s.jsx(ay,{children:s.jsx(ev,{})}),children:[s.jsx(be,{index:!0,element:s.jsx(tg,{})}),s.jsx(be,{path:"apps",element:s.jsx(rg,{})}),s.jsx(be,{path:"apps/:id",element:s.jsx(ig,{})}),s.jsx(be,{path:"domains",element:s.jsx(Rg,{})}),s.jsx(be,{path:"databases",element:s.jsx(Eg,{})}),s.jsx(be,{path:"ssl",element:s.jsx("div",{className:"page",children:"SSL Certificates"})}),s.jsx(be,{path:"docker",element:s.jsx(gg,{})}),s.jsx(be,{path:"php",element:s.jsx(ny,{})}),s.jsx(be,{path:"firewall",element:s.jsx(ry,{})}),s.jsx(be,{path:"files",element:s.jsx(ty,{})}),s.jsx(be,{path:"ftp",element:s.jsx(sy,{})}),s.jsx(be,{path:"monitoring",element:s.jsx(Og,{})}),s.jsx(be,{path:"backups",element:s.jsx(Bg,{})}),s.jsx(be,{path:"terminal",element:s.jsx(Ig,{})}),s.jsx(be,{path:"settings",element:s.jsx(Wg,{})})]})]})}function ly(){return s.jsx(Nx,{children:s.jsx(Ex,{children:s.jsxs(Lx,{children:[s.jsx(iy,{}),s.jsx(Jx,{})]})})})}yi.createRoot(document.getElementById("root")).render(s.jsx(qr.StrictMode,{children:s.jsx(ly,{})}));
diff --git a/frontend/dist/assets/index-CpeIL9J_.css b/frontend/dist/assets/index-CpeIL9J_.css
deleted file mode 100644
index b5d6f673..00000000
--- a/frontend/dist/assets/index-CpeIL9J_.css
+++ /dev/null
@@ -1 +0,0 @@
-*{margin:0;padding:0;box-sizing:border-box;outline:none}html{font-size:16px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background-color:#09090b;color:#f4f4f5;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;min-height:100vh}a{color:inherit;text-decoration:none}button{font-family:inherit}img{max-width:100%;height:auto}ul,ol{list-style:none}::selection{background:#6366f1;color:#fff}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#09090b}::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#71717a}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25;letter-spacing:-.5px}h1{font-size:24px}h2{font-size:18px}h3{font-size:16px}h4{font-size:14px}.text-primary{color:#f4f4f5}.text-secondary{color:#a1a1aa}.text-tertiary{color:#71717a}.text-success{color:#10b981}.text-warning{color:#f59e0b}.text-danger{color:#ef4444}.text-accent{color:#6366f1}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.subtitle{color:#71717a;margin-top:4px;font-size:14px}.section-title{font-size:18px;margin-bottom:20px;font-weight:600}.sidebar{width:280px;background-color:#0f0f11;border-right:1px solid #27272a;display:flex;flex-direction:column;position:fixed;height:100vh;z-index:30}@media (max-width: 768px){.sidebar{display:none}}.brand{padding:24px 32px;font-size:16px;font-weight:700;letter-spacing:-.5px;color:#f4f4f5;display:flex;align-items:center;justify-content:flex-start;gap:12px;border-bottom:1px solid #27272a}.brand-logo{width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:linear-gradient(135deg,#6366f1,#a9abf7);border-radius:8px;color:#fff}.menu-label{padding:24px 32px 8px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#71717a}.nav{display:flex;flex-direction:column;padding:0 16px;gap:4px}.nav-item{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:10px 16px;color:#a1a1aa;text-decoration:none;border-radius:6px;transition:all .2s ease;font-weight:500}.nav-item:hover{background-color:#27272a;color:#f4f4f5}.nav-item.active{background-color:#6366f126;color:#6366f1}.nav-item svg{width:20px;height:20px;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none}.user-profile{margin-top:auto;padding:20px;border-top:1px solid #27272a;display:flex;align-items:center;justify-content:flex-start;gap:12px}.avatar{width:36px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background-color:#27272a;border-radius:9999px;color:#a1a1aa;font-weight:600}.dashboard-layout{display:flex;min-height:100vh}.main-content{margin-left:280px;flex:1;padding:40px;overflow-y:auto}@media (max-width: 768px){.main-content{margin-left:0;padding:20px}}.top-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:40px}.top-bar h1{font-size:24px;font-weight:600;letter-spacing:-.5px}@media (max-width: 768px){.top-bar{flex-direction:column;align-items:flex-start;gap:16px}}.top-bar-actions{display:flex;gap:12px}.page{font-size:24px;color:#a1a1aa}.loading{display:flex;align-items:center;justify-content:center;min-height:100vh;color:#a1a1aa}.stats-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:24px;margin-bottom:32px}@media (max-width: 1280px){.stats-strip{grid-template-columns:repeat(2,1fr)}}@media (max-width: 640px){.stats-strip{grid-template-columns:1fr}}.dashboard-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:24px}.overview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:24px}@media (max-width: 768px){.overview-grid{grid-template-columns:1fr}}.btn{display:inline-flex;align-items:center;gap:8px;padding:8px 20px;border-radius:8px;border:1px solid transparent;font-size:13px;font-weight:500;cursor:pointer;transition:all .2s ease;background:none}.btn:disabled{opacity:.6;cursor:not-allowed}.btn svg{width:16px;height:16px}.btn-primary{background-color:#6366f1;color:#fff;box-shadow:0 4px 12px #6366f14d}.btn-primary:hover:not(:disabled){background-color:#4f46e5}.btn-secondary{background-color:transparent;border-color:#3f3f46;color:#f4f4f5}.btn-secondary:hover:not(:disabled){background-color:#27272a}.btn-danger{background:#ef4444;color:#fff}.btn-danger:hover:not(:disabled){background:#dc2626}.btn-ghost{background:transparent;color:#a1a1aa}.btn-ghost:hover:not(:disabled){background-color:#27272a;color:#f4f4f5}.btn-sm{padding:4px 8px;font-size:11px}.btn-lg{padding:12px 24px;font-size:14px}.btn-full{width:100%;justify-content:center}.btn-icon{padding:8px}.btn-icon svg{width:18px;height:18px}.btn-expand{background:none;border:none;color:#71717a;cursor:pointer;padding:4px 8px;font-size:12px;display:flex;align-items:center;justify-content:flex-start;gap:4px;transition:color .2s ease}.btn-expand:hover{color:#f4f4f5}.card{background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease;padding:24px;position:relative;overflow:hidden}.card:hover{border-color:#3f3f46}.card:hover{transform:translateY(-2px)}.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.card h3{font-size:16px;font-weight:600;color:#f4f4f5;margin-bottom:4px}.card-link{color:#a1a1aa;text-decoration:none;font-size:13px;transition:color .2s ease}.card-link:hover{color:#6366f1}.app-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:10px;font-size:18px;font-weight:700;color:#fff}.metric-row{margin-top:24px;padding-top:20px;border-top:1px solid #27272a;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#a1a1aa}.metric-item{display:flex;flex-direction:column;gap:4px}.metric-value{font-weight:600;color:#f4f4f5;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.stat-card{background:#18181b;padding:20px;border-radius:12px;border:1px solid #27272a;display:flex;flex-direction:column;gap:8px}.stat-label{font-size:12px;color:#71717a;text-transform:uppercase;font-weight:600}.stat-value{font-size:20px;font-weight:700;color:#f4f4f5}.stat-suffix{font-size:14px;color:#71717a;font-weight:400}.progress-bar{height:4px;background:#27272a;border-radius:2px;overflow:hidden;margin-top:4px}.progress-fill{height:100%;border-radius:2px;transition:width .2s ease}.empty-state{text-align:center;padding:64px 20px;background:#18181b;border-radius:12px;border:1px solid #27272a}.empty-state svg{color:#71717a;margin-bottom:16px}.empty-state h3{font-size:16px;font-weight:600;margin-bottom:8px}.empty-state p{color:#a1a1aa;margin-bottom:24px}.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.section-header h3{font-size:16px;font-weight:600}.danger-zone{border-color:#ef44444d;background:#ef44440d}.danger-zone h4{color:#ef4444;margin-bottom:8px}.danger-zone p{color:#a1a1aa;margin-bottom:16px}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:40;padding:20px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.modal{background:#18181b;border:1px solid #27272a;border-radius:16px;width:100%;max-width:560px;max-height:90vh;overflow-y:auto}.modal::-webkit-scrollbar{width:6px;height:6px}.modal::-webkit-scrollbar-track{background:#09090b}.modal::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.modal::-webkit-scrollbar-thumb:hover{background:#71717a}.modal-lg{max-width:800px}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid #27272a}.modal-header h2{font-size:18px;font-weight:600}.modal-close{background:none;border:none;color:#71717a;font-size:24px;cursor:pointer;line-height:1;padding:4px;transition:color .2s ease}.modal-close:hover{color:#f4f4f5}.modal-body{padding:24px;max-height:60vh;overflow-y:auto}.modal-body::-webkit-scrollbar{width:6px;height:6px}.modal-body::-webkit-scrollbar-track{background:#09090b}.modal-body::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.modal-body::-webkit-scrollbar-thumb:hover{background:#71717a}.modal form{padding:24px}.modal-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:24px;padding-top:24px;border-top:1px solid #27272a}.app-type-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px;padding:24px}.app-type-card{background:#09090b;border:1px solid #27272a;border-radius:12px;padding:24px;text-align:center;cursor:pointer;transition:all .2s ease}.app-type-card:hover{border-color:#6366f1;background:#27272a}.app-type-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:12px;font-size:20px;font-weight:700;color:#fff;margin:0 auto 16px}.app-type-card h3{font-size:14px;font-weight:600;margin-bottom:4px;color:#f4f4f5}.app-type-card p{font-size:12px;color:#71717a;line-height:1.5}.form-group{margin-bottom:20px}.form-group label{display:block;font-size:13px;font-weight:500;color:#a1a1aa;margin-bottom:8px}.form-group input,.form-group select,.form-group textarea{width:100%;padding:12px 16px;background:#09090b;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-size:14px;transition:border-color .2s ease}.form-group input:focus,.form-group select:focus,.form-group textarea:focus{border-color:#6366f1;outline:none}.form-group input::placeholder,.form-group select::placeholder,.form-group textarea::placeholder{color:#71717a}.form-group select{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 16px center;padding-right:40px}.form-group textarea{font-family:Fira Code,Monaco,Consolas,monospace;resize:vertical;min-height:120px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}@media (max-width: 768px){.form-row{grid-template-columns:1fr}}.install-form,.env-form,.command-input{display:flex;gap:12px;margin-bottom:24px}.install-form input,.env-form input,.command-input input{flex:1;width:100%;padding:12px 16px;background:#09090b;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-size:14px;transition:border-color .2s ease}.install-form input:focus,.env-form input:focus,.command-input input:focus{border-color:#6366f1;outline:none}.install-form input::placeholder,.env-form input::placeholder,.command-input input::placeholder{color:#71717a}.hint{color:#71717a;font-size:13px;margin-bottom:16px}.error-message{background:#ef44441a;border:1px solid rgba(239,68,68,.2);color:#ef4444;padding:12px 16px;border-radius:8px;margin-bottom:20px;font-size:13px}.error-banner{background:#ef44441a;border:1px solid rgba(239,68,68,.2);color:#ef4444;padding:12px 16px;border-radius:8px;margin-bottom:24px}.filter-toggle{display:flex;align-items:center;justify-content:flex-start;gap:8px}.filter-toggle label{display:flex;align-items:center;justify-content:flex-start;gap:8px;color:#a1a1aa;font-size:13px;cursor:pointer}.filter-toggle input[type=checkbox]{width:16px;height:16px;accent-color:#6366f1}.code-editor{width:100%;min-height:400px;padding:16px;background:#09090b;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-family:Fira Code,Monaco,Consolas,monospace;font-size:13px;line-height:1.6;resize:vertical;transition:border-color .2s ease}.code-editor:focus{border-color:#6366f1}.status-badge{display:flex;align-items:center;gap:6px;padding:4px 10px;border-radius:9999px;font-size:11px;font-weight:600;border:1px solid transparent}.status-dot{width:6px;height:6px;background:currentColor;border-radius:9999px}.status-active{background:#10b9811a;color:#10b981;border-color:#10b98133}.status-warning{background:#f59e0b1a;color:#f59e0b;border-color:#f59e0b33}.status-stopped{background:#71717a1a;color:#71717a;border-color:#71717a33}.status-error{background:#ef44441a;color:#ef4444;border-color:#ef444433}.app-type{background:#27272a;padding:2px 8px;border-radius:4px;font-weight:600;font-size:10px;letter-spacing:.5px;text-transform:uppercase}.ssl-badge{background:#10b9811a;color:#10b981;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600}.active-badge{background:#10b9811a;color:#10b981;padding:4px 12px;border-radius:9999px;font-size:12px;font-weight:600}.db-type-badge{display:inline-flex;align-items:center;gap:4px;background:#27272a;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.3px}.db-type-badge.mysql{color:#f29111}.db-type-badge.postgresql{color:#336791}.privilege-tag{background:#6366f126;color:#6366f1;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.3px}.table-tag{background:#27272a;border:1px solid #27272a;padding:6px 12px;border-radius:6px;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;color:#a1a1aa}.tabs{display:flex;gap:4px;border-bottom:1px solid #27272a;margin-bottom:24px;overflow-x:auto}.tabs::-webkit-scrollbar{width:6px;height:6px}.tabs::-webkit-scrollbar-track{background:#09090b}.tabs::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.tabs::-webkit-scrollbar-thumb:hover{background:#71717a}@media (max-width: 768px){.tabs{overflow-x:auto;-webkit-overflow-scrolling:touch}}.tab{background:none;border:none;padding:12px 20px;color:#a1a1aa;font-size:14px;font-weight:500;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;transition:all .2s ease;white-space:nowrap}.tab:hover{color:#f4f4f5}.tab.active{color:#6366f1;border-bottom-color:#6366f1}.tab-content{min-height:400px}.list-base{display:flex;flex-direction:column;gap:8px}.info-list{display:flex;flex-direction:column;gap:12px}.info-item{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid #27272a}.info-item:last-child{border-bottom:none}.info-label{color:#71717a;font-size:13px}.info-value{color:#f4f4f5;font-weight:500}.info-value.mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.packages-list{display:flex;flex-direction:column;gap:8px}.package-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.package-item:hover{border-color:#3f3f46}.package-name{font-weight:500}.package-version{color:#71717a;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.env-list{display:flex;flex-direction:column;gap:8px}.env-item{display:flex;align-items:center;gap:16px;padding:12px 16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.env-item:hover{border-color:#3f3f46}.env-key{font-weight:600;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;color:#6366f1;min-width:150px}.env-value{flex:1;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;color:#a1a1aa;word-break:break-all}.plugins-list,.themes-list{display:flex;flex-direction:column;gap:8px}.plugin-item,.theme-item{display:flex;align-items:center;justify-content:space-between;padding:16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.plugin-item:hover,.theme-item:hover{border-color:#3f3f46}.plugin-item.active,.theme-item.active{border-color:#10b981;background:#10b9810d}.plugin-info,.theme-info{display:flex;align-items:center;justify-content:flex-start;gap:12px}.plugin-name,.theme-name{font-weight:500}.plugin-version,.theme-version{color:#71717a;font-size:12px}.backups-list{display:flex;flex-direction:column;gap:8px}.backup-item{display:flex;align-items:center;justify-content:space-between;padding:16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.backup-item:hover{border-color:#3f3f46}.backup-info{display:flex;align-items:center;justify-content:flex-start;gap:20px}.backup-name{font-weight:500;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.backup-size,.backup-date{color:#71717a;font-size:13px}.domains-list{display:flex;flex-direction:column;gap:8px}.domain-item{display:flex;align-items:center;justify-content:flex-start;gap:8px}.domain-item a{color:#6366f1;transition:color .2s ease}.domain-item a:hover{text-decoration:underline}.tables-list{display:flex;flex-wrap:wrap;gap:8px}.privileges-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;padding-top:8px;border-top:1px solid #27272a}.services-grid{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:24px}.service-item{display:flex;align-items:center;justify-content:flex-start;gap:8px;padding:8px 16px;background:#18181b;border:1px solid #27272a;border-radius:8px;font-size:13px}.service-dot{width:8px;height:8px;border-radius:9999px}.service-dot.running{background:#10b981;box-shadow:0 0 8px #10b981}.service-dot.stopped{background:#71717a}.service-name{font-weight:500;color:#f4f4f5}.service-status{color:#71717a;font-size:12px}.live-indicator{color:#10b981;font-size:12px;font-weight:500}.live-indicator:before{content:"";display:inline-block;width:6px;height:6px;background:#10b981;border-radius:9999px;margin-right:4px;animation:pulse 2s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.log-viewer{background:#09090b;border:1px solid #27272a;border-radius:8px;padding:16px;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;max-height:500px;overflow-y:auto;line-height:1.5}.log-viewer::-webkit-scrollbar{width:6px;height:6px}.log-viewer::-webkit-scrollbar-track{background:#09090b}.log-viewer::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.log-viewer::-webkit-scrollbar-thumb:hover{background:#71717a}.log-controls{display:flex;align-items:center;justify-content:flex-start;gap:12px}.log-controls select{padding:8px 12px;background:#09090b;border:1px solid #27272a;border-radius:6px;color:#f4f4f5;font-size:13px}.command-output{background:#09090b;border:1px solid #27272a;border-radius:8px;padding:16px;margin-top:20px}.command-output pre{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;white-space:pre-wrap;word-break:break-all;color:#f4f4f5}.command-output.error{border-color:#ef4444}.command-output .stderr{color:#ef4444}.quick-commands{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}.credentials-box{background:#09090b;border:1px solid #27272a;border-radius:8px;padding:16px;margin:16px 0}.credentials-box h4{font-size:14px;font-weight:600;margin-bottom:12px;color:#10b981}.credentials-box .warning{font-size:12px;color:#f59e0b;margin-bottom:12px;display:flex;align-items:center;justify-content:flex-start;gap:6px}.credential-row{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:8px 0;border-bottom:1px solid #27272a}.credential-row:last-child{border-bottom:none}.credential-label{font-size:12px;color:#71717a;min-width:80px}.credential-value{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;font-size:13px;color:#f4f4f5;background:#27272a;padding:4px 8px;border-radius:4px;flex:1}.credential-copy{background:none;border:none;color:#71717a;cursor:pointer;padding:4px;transition:color .2s ease}.credential-copy:hover{color:#6366f1}.auth-container{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}.auth-card{width:100%;max-width:400px;background:#18181b;border:1px solid #27272a;border-radius:16px;padding:40px}.auth-header{text-align:center;margin-bottom:32px}.auth-header .brand-logo{width:48px;height:48px;margin:0 auto 16px}.auth-header h1{font-size:24px;font-weight:700;margin-bottom:8px}.auth-header p{color:#a1a1aa}.auth-footer{text-align:center;margin-top:24px;color:#a1a1aa}.auth-footer a{color:#6366f1;font-weight:500}.auth-footer a:hover{text-decoration:underline}.dashboard-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:24px;margin-bottom:32px}@media (max-width: 1280px){.dashboard-stats{grid-template-columns:repeat(2,1fr)}}@media (max-width: 640px){.dashboard-stats{grid-template-columns:1fr}}.system-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px;margin-bottom:32px}.metric-card{background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease;padding:20px}.metric-card:hover{border-color:#3f3f46}.metric-card .metric-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.metric-card .metric-header h4{font-size:12px;color:#71717a;text-transform:uppercase;font-weight:600}.metric-card .metric-header .metric-icon{color:#71717a}.metric-card .metric-main{display:flex;align-items:center;justify-content:flex-start;gap:12px;margin-bottom:12px}.metric-card .metric-main .metric-value{font-size:28px;font-weight:700;color:#f4f4f5;line-height:1}.metric-card .metric-main .metric-unit{font-size:14px;color:#71717a;align-self:flex-end;margin-bottom:4px}.metric-card .metric-sub{font-size:12px;color:#a1a1aa}.quick-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:32px}.quick-action-card{background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease;cursor:pointer;padding:20px;text-align:center}.quick-action-card:hover{border-color:#3f3f46}.quick-action-card:hover{transform:translateY(-2px)}.quick-action-card .action-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#6366f126;color:#6366f1;margin:0 auto 16px;border-radius:12px}.quick-action-card h4{font-size:14px;font-weight:600;margin-bottom:4px}.quick-action-card p{font-size:12px;color:#71717a}.activity-list{display:flex;flex-direction:column;gap:12px}.activity-item{display:flex;align-items:center;justify-content:flex-start;gap:16px;padding:12px 0;border-bottom:1px solid #27272a}.activity-item:last-child{border-bottom:none}.activity-icon{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:#27272a;border-radius:8px;color:#a1a1aa;flex-shrink:0}.activity-icon.success{background:#10b9811a;color:#10b981}.activity-icon.warning{background:#f59e0b1a;color:#f59e0b}.activity-icon.error{background:#ef44441a;color:#ef4444}.activity-content{flex:1;min-width:0}.activity-content p{font-size:13px;color:#f4f4f5;margin-bottom:4px}.activity-content span{font-size:12px;color:#71717a}.uptime-display{display:flex;align-items:center;justify-content:flex-start;gap:24px;padding:20px;background:#18181b;border:1px solid #27272a;border-radius:12px;margin-bottom:24px}.uptime-item{text-align:center}.uptime-item .uptime-value{font-size:24px;font-weight:700;color:#f4f4f5}.uptime-item .uptime-label{font-size:10px;color:#71717a;text-transform:uppercase;letter-spacing:.5px}.uptime-separator{color:#71717a;font-size:24px;font-weight:700}.apps-list{display:flex;flex-direction:column;gap:12px}.app-row{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.app-row:hover{border-color:#3f3f46}.app-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.app-details{min-width:0}.app-details h3{font-size:15px;font-weight:600;color:#f4f4f5;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-meta{display:flex;align-items:center;justify-content:flex-start;gap:12px;font-size:12px;color:#71717a}.app-meta a{color:#a1a1aa;transition:color .2s ease}.app-meta a:hover{color:#6366f1}.app-status{flex-shrink:0}.app-actions{display:flex;gap:8px;flex-shrink:0}.app-header-info{display:flex;align-items:center;justify-content:flex-start;gap:20px}@media (max-width: 768px){.app-header-info{flex-direction:column;align-items:flex-start}}.app-header-title{display:flex;align-items:center;justify-content:flex-start;gap:16px}.app-header-title h1{font-size:24px}.docker-list{display:flex;flex-direction:column;gap:12px}.docker-item{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.docker-item:hover{border-color:#3f3f46}.docker-item-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.docker-item-icon{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#27272a;border-radius:8px;color:#2496ed}.docker-item-icon.image-icon{color:#a78bfa}.docker-item-icon.network-icon{color:#34d399}.docker-item-icon.volume-icon{color:#fbbf24}.docker-item-details{min-width:0}.docker-item-details h3{font-size:14px;font-weight:600;color:#f4f4f5;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.docker-item-meta{display:flex;align-items:center;justify-content:flex-start;gap:12px;font-size:12px;color:#71717a;flex-wrap:wrap}.docker-item-meta .mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;background:#27272a;padding:2px 6px;border-radius:4px}.docker-item-status{flex-shrink:0}.docker-item-actions{display:flex;gap:8px;flex-shrink:0}.db-status{display:flex;gap:24px;margin-bottom:24px}@media (max-width: 768px){.db-status{flex-direction:column}}.db-status-item{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:16px 24px;background:#18181b;border:1px solid #27272a;border-radius:12px;flex:1}.status-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:10px;font-size:20px;font-weight:700}.status-icon.mysql{background:linear-gradient(135deg,#00758f,#f29111);color:#fff}.status-icon.postgresql{background:linear-gradient(135deg,#336791,#5f9ab8);color:#fff}.status-info h3{font-size:16px;font-weight:600;margin-bottom:4px}.status-info span{font-size:13px;color:#a1a1aa}.status-info span.running{color:#10b981}.status-info span.stopped{color:#ef4444}.db-list{display:flex;flex-direction:column;gap:12px}.db-item{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.db-item:hover{border-color:#3f3f46}.db-item-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.db-item-icon{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#27272a;border-radius:8px}.db-item-icon.mysql{color:#f29111}.db-item-icon.postgresql{color:#336791}.db-item-icon.user{color:#6366f1}.db-item-details{min-width:0}.db-item-details h3{font-size:14px;font-weight:600;color:#f4f4f5;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.db-item-meta{display:flex;align-items:center;justify-content:flex-start;gap:12px;font-size:12px;color:#71717a;flex-wrap:wrap}.db-item-meta .mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;background:#27272a;padding:2px 6px;border-radius:4px}.db-item-meta .host{color:#a1a1aa}.db-item-actions{display:flex;gap:8px;flex-shrink:0}.users-header{display:flex;align-items:center;justify-content:space-between;margin:32px 0 16px;padding-top:24px;border-top:1px solid #27272a}.users-header h3{font-size:16px;font-weight:600}
diff --git a/frontend/dist/assets/index-Ev8u7xXg.js b/frontend/dist/assets/index-Ev8u7xXg.js
deleted file mode 100644
index b510430f..00000000
--- a/frontend/dist/assets/index-Ev8u7xXg.js
+++ /dev/null
@@ -1,151 +0,0 @@
-function _h(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function bh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $c={exports:{}},Vs={},Fc={exports:{}},M={};/**
- * @license React
- * react.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Pr=Symbol.for("react.element"),Eh=Symbol.for("react.portal"),Ph=Symbol.for("react.fragment"),Th=Symbol.for("react.strict_mode"),Lh=Symbol.for("react.profiler"),Rh=Symbol.for("react.provider"),Dh=Symbol.for("react.context"),Oh=Symbol.for("react.forward_ref"),Ah=Symbol.for("react.suspense"),Mh=Symbol.for("react.memo"),zh=Symbol.for("react.lazy"),fo=Symbol.iterator;function $h(e){return e===null||typeof e!="object"?null:(e=fo&&e[fo]||e["@@iterator"],typeof e=="function"?e:null)}var Bc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qc=Object.assign,Ic={};function Dn(e,t,n){this.props=e,this.context=t,this.refs=Ic,this.updater=n||Bc}Dn.prototype.isReactComponent={};Dn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Uc(){}Uc.prototype=Dn.prototype;function Wa(e,t,n){this.props=e,this.context=t,this.refs=Ic,this.updater=n||Bc}var Qa=Wa.prototype=new Uc;Qa.constructor=Wa;qc(Qa,Dn.prototype);Qa.isPureReactComponent=!0;var po=Array.isArray,Vc=Object.prototype.hasOwnProperty,Ha={current:null},Wc={key:!0,ref:!0,__self:!0,__source:!0};function Qc(e,t,n){var r,s={},a=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)Vc.call(t,r)&&!Wc.hasOwnProperty(r)&&(s[r]=t[r]);var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){for(var o=Array(c),u=0;u<c;u++)o[u]=arguments[u+2];s.children=o}if(e&&e.defaultProps)for(r in c=e.defaultProps,c)s[r]===void 0&&(s[r]=c[r]);return{$$typeof:Pr,type:e,key:a,ref:l,props:s,_owner:Ha.current}}function Fh(e,t){return{$$typeof:Pr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ka(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pr}function Bh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var mo=/\/+/g;function di(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Bh(""+e.key):t.toString(36)}function ts(e,t,n,r,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Pr:case Eh:l=!0}}if(l)return l=e,s=s(l),e=r===""?"."+di(l,0):r,po(s)?(n="",e!=null&&(n=e.replace(mo,"$&/")+"/"),ts(s,t,n,"",function(u){return u})):s!=null&&(Ka(s)&&(s=Fh(s,n+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(mo,"$&/")+"/")+e)),t.push(s)),1;if(l=0,r=r===""?".":r+":",po(e))for(var c=0;c<e.length;c++){a=e[c];var o=r+di(a,c);l+=ts(a,t,n,o,s)}else if(o=$h(e),typeof o=="function")for(e=o.call(e),c=0;!(a=e.next()).done;)a=a.value,o=r+di(a,c++),l+=ts(a,t,n,o,s);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Mr(e,t,n){if(e==null)return e;var r=[],s=0;return ts(e,r,"","",function(a){return t.call(n,a,s++)}),r}function qh(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var pe={current:null},ns={transition:null},Ih={ReactCurrentDispatcher:pe,ReactCurrentBatchConfig:ns,ReactCurrentOwner:Ha};function Hc(){throw Error("act(...) is not supported in production builds of React.")}M.Children={map:Mr,forEach:function(e,t,n){Mr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Mr(e,function(){t++}),t},toArray:function(e){return Mr(e,function(t){return t})||[]},only:function(e){if(!Ka(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};M.Component=Dn;M.Fragment=Ph;M.Profiler=Lh;M.PureComponent=Wa;M.StrictMode=Th;M.Suspense=Ah;M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ih;M.act=Hc;M.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=qc({},e.props),s=e.key,a=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,l=Ha.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(o in t)Vc.call(t,o)&&!Wc.hasOwnProperty(o)&&(r[o]=t[o]===void 0&&c!==void 0?c[o]:t[o])}var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){c=Array(o);for(var u=0;u<o;u++)c[u]=arguments[u+2];r.children=c}return{$$typeof:Pr,type:e.type,key:s,ref:a,props:r,_owner:l}};M.createContext=function(e){return e={$$typeof:Dh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Rh,_context:e},e.Consumer=e};M.createElement=Qc;M.createFactory=function(e){var t=Qc.bind(null,e);return t.type=e,t};M.createRef=function(){return{current:null}};M.forwardRef=function(e){return{$$typeof:Oh,render:e}};M.isValidElement=Ka;M.lazy=function(e){return{$$typeof:zh,_payload:{_status:-1,_result:e},_init:qh}};M.memo=function(e,t){return{$$typeof:Mh,type:e,compare:t===void 0?null:t}};M.startTransition=function(e){var t=ns.transition;ns.transition={};try{e()}finally{ns.transition=t}};M.unstable_act=Hc;M.useCallback=function(e,t){return pe.current.useCallback(e,t)};M.useContext=function(e){return pe.current.useContext(e)};M.useDebugValue=function(){};M.useDeferredValue=function(e){return pe.current.useDeferredValue(e)};M.useEffect=function(e,t){return pe.current.useEffect(e,t)};M.useId=function(){return pe.current.useId()};M.useImperativeHandle=function(e,t,n){return pe.current.useImperativeHandle(e,t,n)};M.useInsertionEffect=function(e,t){return pe.current.useInsertionEffect(e,t)};M.useLayoutEffect=function(e,t){return pe.current.useLayoutEffect(e,t)};M.useMemo=function(e,t){return pe.current.useMemo(e,t)};M.useReducer=function(e,t,n){return pe.current.useReducer(e,t,n)};M.useRef=function(e){return pe.current.useRef(e)};M.useState=function(e){return pe.current.useState(e)};M.useSyncExternalStore=function(e,t,n){return pe.current.useSyncExternalStore(e,t,n)};M.useTransition=function(){return pe.current.useTransition()};M.version="18.3.1";Fc.exports=M;var m=Fc.exports;const Kc=bh(m),Uh=_h({__proto__:null,default:Kc},[m]);/**
- * @license React
- * react-jsx-runtime.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Vh=m,Wh=Symbol.for("react.element"),Qh=Symbol.for("react.fragment"),Hh=Object.prototype.hasOwnProperty,Kh=Vh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Yh={key:!0,ref:!0,__self:!0,__source:!0};function Yc(e,t,n){var r,s={},a=null,l=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)Hh.call(t,r)&&!Yh.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Wh,type:e,key:a,ref:l,props:s,_owner:Kh.current}}Vs.Fragment=Qh;Vs.jsx=Yc;Vs.jsxs=Yc;$c.exports=Vs;var i=$c.exports,Ii={},Gc={exports:{}},be={},Xc={exports:{}},Jc={};/**
- * @license React
- * scheduler.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */(function(e){function t(_,L){var O=_.length;_.push(L);e:for(;0<O;){var U=O-1>>>1,G=_[U];if(0<s(G,L))_[U]=L,_[O]=G,O=U;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var L=_[0],O=_.pop();if(O!==L){_[0]=O;e:for(var U=0,G=_.length,Ft=G>>>1;U<Ft;){var We=2*(U+1)-1,sn=_[We],Qe=We+1,Bt=_[Qe];if(0>s(sn,O))Qe<G&&0>s(Bt,sn)?(_[U]=Bt,_[Qe]=O,U=Qe):(_[U]=sn,_[We]=O,U=We);else if(Qe<G&&0>s(Bt,O))_[U]=Bt,_[Qe]=O,U=Qe;else break e}}return L}function s(_,L){var O=_.sortIndex-L.sortIndex;return O!==0?O:_.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var o=[],u=[],h=1,d=null,f=3,g=!1,x=!1,k=!1,N=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(_){for(var L=n(u);L!==null;){if(L.callback===null)r(u);else if(L.startTime<=_)r(u),L.sortIndex=L.expirationTime,t(o,L);else break;L=n(u)}}function j(_){if(k=!1,p(_),!x)if(n(o)!==null)x=!0,nn(S);else{var L=n(u);L!==null&&rn(j,L.startTime-_)}}function S(_,L){x=!1,k&&(k=!1,y(T),T=-1),g=!0;var O=f;try{for(p(L),d=n(o);d!==null&&(!(d.expirationTime>L)||_&&!le());){var U=d.callback;if(typeof U=="function"){d.callback=null,f=d.priorityLevel;var G=U(d.expirationTime<=L);L=e.unstable_now(),typeof G=="function"?d.callback=G:d===n(o)&&r(o),p(L)}else r(o);d=n(o)}if(d!==null)var Ft=!0;else{var We=n(u);We!==null&&rn(j,We.startTime-L),Ft=!1}return Ft}finally{d=null,f=O,g=!1}}var b=!1,P=null,T=-1,F=5,R=-1;function le(){return!(e.unstable_now()-R<F)}function ht(){if(P!==null){var _=e.unstable_now();R=_;var L=!0;try{L=P(!0,_)}finally{L?ft():(b=!1,P=null)}}else b=!1}var ft;if(typeof v=="function")ft=function(){v(ht)};else if(typeof MessageChannel<"u"){var Bn=new MessageChannel,Ar=Bn.port2;Bn.port1.onmessage=ht,ft=function(){Ar.postMessage(null)}}else ft=function(){N(ht,0)};function nn(_){P=_,b||(b=!0,ft())}function rn(_,L){T=N(function(){_(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,nn(S))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(o)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var L=3;break;default:L=f}var O=f;f=L;try{return _()}finally{f=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,L){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var O=f;f=_;try{return L()}finally{f=O}},e.unstable_scheduleCallback=function(_,L,O){var U=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?U+O:U):O=U,_){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=O+G,_={id:h++,callback:L,priorityLevel:_,startTime:O,expirationTime:G,sortIndex:-1},O>U?(_.sortIndex=O,t(u,_),n(o)===null&&_===n(u)&&(k?(y(T),T=-1):k=!0,rn(j,O-U))):(_.sortIndex=G,t(o,_),x||g||(x=!0,nn(S))),_},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(_){var L=f;return function(){var O=f;f=L;try{return _.apply(this,arguments)}finally{f=O}}}})(Jc);Xc.exports=Jc;var Gh=Xc.exports;/**
- * @license React
- * react-dom.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Xh=m,_e=Gh;function w(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Zc=new Set,ur={};function en(e,t){Cn(e,t),Cn(e+"Capture",t)}function Cn(e,t){for(ur[e]=t,e=0;e<t.length;e++)Zc.add(t[e])}var at=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=Object.prototype.hasOwnProperty,Jh=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,vo={},yo={};function Zh(e){return Ui.call(yo,e)?!0:Ui.call(vo,e)?!1:Jh.test(e)?yo[e]=!0:(vo[e]=!0,!1)}function ef(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tf(e,t,n,r){if(t===null||typeof t>"u"||ef(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function me(e,t,n,r,s,a,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ae[e]=new me(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ae[t]=new me(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ae[e]=new me(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ae[e]=new me(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ae[e]=new me(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ae[e]=new me(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ae[e]=new me(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ae[e]=new me(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ae[e]=new me(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ya=/[\-:]([a-z])/g;function Ga(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ya,Ga);ae[t]=new me(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ya,Ga);ae[t]=new me(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ya,Ga);ae[t]=new me(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ae[e]=new me(e,1,!1,e.toLowerCase(),null,!1,!1)});ae.xlinkHref=new me("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ae[e]=new me(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xa(e,t,n,r){var s=ae.hasOwnProperty(t)?ae[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(tf(t,n,s,r)&&(n=null),r||s===null?Zh(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ut=Xh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zr=Symbol.for("react.element"),ln=Symbol.for("react.portal"),on=Symbol.for("react.fragment"),Ja=Symbol.for("react.strict_mode"),Vi=Symbol.for("react.profiler"),eu=Symbol.for("react.provider"),tu=Symbol.for("react.context"),Za=Symbol.for("react.forward_ref"),Wi=Symbol.for("react.suspense"),Qi=Symbol.for("react.suspense_list"),el=Symbol.for("react.memo"),vt=Symbol.for("react.lazy"),nu=Symbol.for("react.offscreen"),go=Symbol.iterator;function qn(e){return e===null||typeof e!="object"?null:(e=go&&e[go]||e["@@iterator"],typeof e=="function"?e:null)}var K=Object.assign,hi;function Gn(e){if(hi===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);hi=t&&t[1]||""}return`
-`+hi+e}var fi=!1;function pi(e,t){if(!e||fi)return"";fi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
-`),a=r.stack.split(`
-`),l=s.length-1,c=a.length-1;1<=l&&0<=c&&s[l]!==a[c];)c--;for(;1<=l&&0<=c;l--,c--)if(s[l]!==a[c]){if(l!==1||c!==1)do if(l--,c--,0>c||s[l]!==a[c]){var o=`
-`+s[l].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=l&&0<=c);break}}}finally{fi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gn(e):""}function nf(e){switch(e.tag){case 5:return Gn(e.type);case 16:return Gn("Lazy");case 13:return Gn("Suspense");case 19:return Gn("SuspenseList");case 0:case 2:case 15:return e=pi(e.type,!1),e;case 11:return e=pi(e.type.render,!1),e;case 1:return e=pi(e.type,!0),e;default:return""}}function Hi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case on:return"Fragment";case ln:return"Portal";case Vi:return"Profiler";case Ja:return"StrictMode";case Wi:return"Suspense";case Qi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case tu:return(e.displayName||"Context")+".Consumer";case eu:return(e._context.displayName||"Context")+".Provider";case Za:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case el:return t=e.displayName||null,t!==null?t:Hi(e.type)||"Memo";case vt:t=e._payload,e=e._init;try{return Hi(e(t))}catch{}}return null}function rf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Hi(t);case 8:return t===Ja?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Dt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ru(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sf(e){var t=ru(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $r(e){e._valueTracker||(e._valueTracker=sf(e))}function su(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ru(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ys(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ki(e,t){var n=t.checked;return K({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Dt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function iu(e,t){t=t.checked,t!=null&&Xa(e,"checked",t,!1)}function Yi(e,t){iu(e,t);var n=Dt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Gi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gi(e,t.type,Dt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Gi(e,t,n){(t!=="number"||ys(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Xn=Array.isArray;function xn(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Dt(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Xi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(w(91));return K({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ko(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(w(92));if(Xn(n)){if(1<n.length)throw Error(w(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Dt(n)}}function au(e,t){var n=Dt(t.value),r=Dt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function wo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function lu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ji(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?lu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fr,ou=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fr=Fr||document.createElement("div"),Fr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var tr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},af=["Webkit","ms","Moz","O"];Object.keys(tr).forEach(function(e){af.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),tr[t]=tr[e]})});function cu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||tr.hasOwnProperty(e)&&tr[e]?(""+t).trim():t+"px"}function uu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=cu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var lf=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zi(e,t){if(t){if(lf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(w(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(w(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(w(61))}if(t.style!=null&&typeof t.style!="object")throw Error(w(62))}}function ea(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ta=null;function tl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var na=null,jn=null,kn=null;function So(e){if(e=Rr(e)){if(typeof na!="function")throw Error(w(280));var t=e.stateNode;t&&(t=Ys(t),na(e.stateNode,e.type,t))}}function du(e){jn?kn?kn.push(e):kn=[e]:jn=e}function hu(){if(jn){var e=jn,t=kn;if(kn=jn=null,So(e),t)for(e=0;e<t.length;e++)So(t[e])}}function fu(e,t){return e(t)}function pu(){}var mi=!1;function mu(e,t,n){if(mi)return e(t,n);mi=!0;try{return fu(e,t,n)}finally{mi=!1,(jn!==null||kn!==null)&&(pu(),hu())}}function hr(e,t){var n=e.stateNode;if(n===null)return null;var r=Ys(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(w(231,t,typeof n));return n}var ra=!1;if(at)try{var In={};Object.defineProperty(In,"passive",{get:function(){ra=!0}}),window.addEventListener("test",In,In),window.removeEventListener("test",In,In)}catch{ra=!1}function of(e,t,n,r,s,a,l,c,o){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(h){this.onError(h)}}var nr=!1,gs=null,xs=!1,sa=null,cf={onError:function(e){nr=!0,gs=e}};function uf(e,t,n,r,s,a,l,c,o){nr=!1,gs=null,of.apply(cf,arguments)}function df(e,t,n,r,s,a,l,c,o){if(uf.apply(this,arguments),nr){if(nr){var u=gs;nr=!1,gs=null}else throw Error(w(198));xs||(xs=!0,sa=u)}}function tn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function vu(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function No(e){if(tn(e)!==e)throw Error(w(188))}function hf(e){var t=e.alternate;if(!t){if(t=tn(e),t===null)throw Error(w(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var a=s.alternate;if(a===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===n)return No(s),e;if(a===r)return No(s),t;a=a.sibling}throw Error(w(188))}if(n.return!==r.return)n=s,r=a;else{for(var l=!1,c=s.child;c;){if(c===n){l=!0,n=s,r=a;break}if(c===r){l=!0,r=s,n=a;break}c=c.sibling}if(!l){for(c=a.child;c;){if(c===n){l=!0,n=a,r=s;break}if(c===r){l=!0,r=a,n=s;break}c=c.sibling}if(!l)throw Error(w(189))}}if(n.alternate!==r)throw Error(w(190))}if(n.tag!==3)throw Error(w(188));return n.stateNode.current===n?e:t}function yu(e){return e=hf(e),e!==null?gu(e):null}function gu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gu(e);if(t!==null)return t;e=e.sibling}return null}var xu=_e.unstable_scheduleCallback,Co=_e.unstable_cancelCallback,ff=_e.unstable_shouldYield,pf=_e.unstable_requestPaint,X=_e.unstable_now,mf=_e.unstable_getCurrentPriorityLevel,nl=_e.unstable_ImmediatePriority,ju=_e.unstable_UserBlockingPriority,js=_e.unstable_NormalPriority,vf=_e.unstable_LowPriority,ku=_e.unstable_IdlePriority,Ws=null,Ge=null;function yf(e){if(Ge&&typeof Ge.onCommitFiberRoot=="function")try{Ge.onCommitFiberRoot(Ws,e,void 0,(e.current.flags&128)===128)}catch{}}var Ie=Math.clz32?Math.clz32:jf,gf=Math.log,xf=Math.LN2;function jf(e){return e>>>=0,e===0?32:31-(gf(e)/xf|0)|0}var Br=64,qr=4194304;function Jn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ks(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes,l=n&268435455;if(l!==0){var c=l&~s;c!==0?r=Jn(c):(a&=l,a!==0&&(r=Jn(a)))}else l=n&~s,l!==0?r=Jn(l):a!==0&&(r=Jn(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ie(t),s=1<<n,r|=e[n],t&=~s;return r}function kf(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Ie(a),c=1<<l,o=s[l];o===-1?(!(c&n)||c&r)&&(s[l]=kf(c,t)):o<=t&&(e.expiredLanes|=c),a&=~c}}function ia(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function wu(){var e=Br;return Br<<=1,!(Br&4194240)&&(Br=64),e}function vi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ie(t),e[t]=n}function Sf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Ie(n),a=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~a}}function rl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var $=0;function Su(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Nu,sl,Cu,_u,bu,aa=!1,Ir=[],St=null,Nt=null,Ct=null,fr=new Map,pr=new Map,gt=[],Nf="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function _o(e,t){switch(e){case"focusin":case"focusout":St=null;break;case"dragenter":case"dragleave":Nt=null;break;case"mouseover":case"mouseout":Ct=null;break;case"pointerover":case"pointerout":fr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pr.delete(t.pointerId)}}function Un(e,t,n,r,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[s]},t!==null&&(t=Rr(t),t!==null&&sl(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Cf(e,t,n,r,s){switch(t){case"focusin":return St=Un(St,e,t,n,r,s),!0;case"dragenter":return Nt=Un(Nt,e,t,n,r,s),!0;case"mouseover":return Ct=Un(Ct,e,t,n,r,s),!0;case"pointerover":var a=s.pointerId;return fr.set(a,Un(fr.get(a)||null,e,t,n,r,s)),!0;case"gotpointercapture":return a=s.pointerId,pr.set(a,Un(pr.get(a)||null,e,t,n,r,s)),!0}return!1}function Eu(e){var t=Vt(e.target);if(t!==null){var n=tn(t);if(n!==null){if(t=n.tag,t===13){if(t=vu(n),t!==null){e.blockedOn=t,bu(e.priority,function(){Cu(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=la(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ta=r,n.target.dispatchEvent(r),ta=null}else return t=Rr(n),t!==null&&sl(t),e.blockedOn=n,!1;t.shift()}return!0}function bo(e,t,n){rs(e)&&n.delete(t)}function _f(){aa=!1,St!==null&&rs(St)&&(St=null),Nt!==null&&rs(Nt)&&(Nt=null),Ct!==null&&rs(Ct)&&(Ct=null),fr.forEach(bo),pr.forEach(bo)}function Vn(e,t){e.blockedOn===t&&(e.blockedOn=null,aa||(aa=!0,_e.unstable_scheduleCallback(_e.unstable_NormalPriority,_f)))}function mr(e){function t(s){return Vn(s,e)}if(0<Ir.length){Vn(Ir[0],e);for(var n=1;n<Ir.length;n++){var r=Ir[n];r.blockedOn===e&&(r.blockedOn=null)}}for(St!==null&&Vn(St,e),Nt!==null&&Vn(Nt,e),Ct!==null&&Vn(Ct,e),fr.forEach(t),pr.forEach(t),n=0;n<gt.length;n++)r=gt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<gt.length&&(n=gt[0],n.blockedOn===null);)Eu(n),n.blockedOn===null&&gt.shift()}var wn=ut.ReactCurrentBatchConfig,ws=!0;function bf(e,t,n,r){var s=$,a=wn.transition;wn.transition=null;try{$=1,il(e,t,n,r)}finally{$=s,wn.transition=a}}function Ef(e,t,n,r){var s=$,a=wn.transition;wn.transition=null;try{$=4,il(e,t,n,r)}finally{$=s,wn.transition=a}}function il(e,t,n,r){if(ws){var s=la(e,t,n,r);if(s===null)_i(e,t,r,Ss,n),_o(e,r);else if(Cf(s,e,t,n,r))r.stopPropagation();else if(_o(e,r),t&4&&-1<Nf.indexOf(e)){for(;s!==null;){var a=Rr(s);if(a!==null&&Nu(a),a=la(e,t,n,r),a===null&&_i(e,t,r,Ss,n),a===s)break;s=a}s!==null&&r.stopPropagation()}else _i(e,t,r,null,n)}}var Ss=null;function la(e,t,n,r){if(Ss=null,e=tl(r),e=Vt(e),e!==null)if(t=tn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=vu(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ss=e,null}function Pu(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mf()){case nl:return 1;case ju:return 4;case js:case vf:return 16;case ku:return 536870912;default:return 16}default:return 16}}var jt=null,al=null,ss=null;function Tu(){if(ss)return ss;var e,t=al,n=t.length,r,s="value"in jt?jt.value:jt.textContent,a=s.length;for(e=0;e<n&&t[e]===s[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===s[a-r];r++);return ss=s.slice(e,1<r?1-r:void 0)}function is(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ur(){return!0}function Eo(){return!1}function Ee(e){function t(n,r,s,a,l){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var c in e)e.hasOwnProperty(c)&&(n=e[c],this[c]=n?n(a):a[c]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ur:Eo,this.isPropagationStopped=Eo,this}return K(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ur)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ur)},persist:function(){},isPersistent:Ur}),t}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ll=Ee(On),Lr=K({},On,{view:0,detail:0}),Pf=Ee(Lr),yi,gi,Wn,Qs=K({},Lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ol,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Wn&&(Wn&&e.type==="mousemove"?(yi=e.screenX-Wn.screenX,gi=e.screenY-Wn.screenY):gi=yi=0,Wn=e),yi)},movementY:function(e){return"movementY"in e?e.movementY:gi}}),Po=Ee(Qs),Tf=K({},Qs,{dataTransfer:0}),Lf=Ee(Tf),Rf=K({},Lr,{relatedTarget:0}),xi=Ee(Rf),Df=K({},On,{animationName:0,elapsedTime:0,pseudoElement:0}),Of=Ee(Df),Af=K({},On,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mf=Ee(Af),zf=K({},On,{data:0}),To=Ee(zf),$f={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ff={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Bf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bf[e])?!!t[e]:!1}function ol(){return qf}var If=K({},Lr,{key:function(e){if(e.key){var t=$f[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=is(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ff[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ol,charCode:function(e){return e.type==="keypress"?is(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?is(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Uf=Ee(If),Vf=K({},Qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lo=Ee(Vf),Wf=K({},Lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ol}),Qf=Ee(Wf),Hf=K({},On,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kf=Ee(Hf),Yf=K({},Qs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Gf=Ee(Yf),Xf=[9,13,27,32],cl=at&&"CompositionEvent"in window,rr=null;at&&"documentMode"in document&&(rr=document.documentMode);var Jf=at&&"TextEvent"in window&&!rr,Lu=at&&(!cl||rr&&8<rr&&11>=rr),Ro=" ",Do=!1;function Ru(e,t){switch(e){case"keyup":return Xf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Du(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cn=!1;function Zf(e,t){switch(e){case"compositionend":return Du(t);case"keypress":return t.which!==32?null:(Do=!0,Ro);case"textInput":return e=t.data,e===Ro&&Do?null:e;default:return null}}function ep(e,t){if(cn)return e==="compositionend"||!cl&&Ru(e,t)?(e=Tu(),ss=al=jt=null,cn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Lu&&t.locale!=="ko"?null:t.data;default:return null}}var tp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Oo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tp[e.type]:t==="textarea"}function Ou(e,t,n,r){du(r),t=Ns(t,"onChange"),0<t.length&&(n=new ll("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var sr=null,vr=null;function np(e){Wu(e,0)}function Hs(e){var t=hn(e);if(su(t))return e}function rp(e,t){if(e==="change")return t}var Au=!1;if(at){var ji;if(at){var ki="oninput"in document;if(!ki){var Ao=document.createElement("div");Ao.setAttribute("oninput","return;"),ki=typeof Ao.oninput=="function"}ji=ki}else ji=!1;Au=ji&&(!document.documentMode||9<document.documentMode)}function Mo(){sr&&(sr.detachEvent("onpropertychange",Mu),vr=sr=null)}function Mu(e){if(e.propertyName==="value"&&Hs(vr)){var t=[];Ou(t,vr,e,tl(e)),mu(np,t)}}function sp(e,t,n){e==="focusin"?(Mo(),sr=t,vr=n,sr.attachEvent("onpropertychange",Mu)):e==="focusout"&&Mo()}function ip(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hs(vr)}function ap(e,t){if(e==="click")return Hs(t)}function lp(e,t){if(e==="input"||e==="change")return Hs(t)}function op(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ve=typeof Object.is=="function"?Object.is:op;function yr(e,t){if(Ve(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ui.call(t,s)||!Ve(e[s],t[s]))return!1}return!0}function zo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $o(e,t){var n=zo(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zo(n)}}function zu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $u(){for(var e=window,t=ys();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ys(e.document)}return t}function ul(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cp(e){var t=$u(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zu(n.ownerDocument.documentElement,n)){if(r!==null&&ul(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,a=Math.min(r.start,s);r=r.end===void 0?a:Math.min(r.end,s),!e.extend&&a>r&&(s=r,r=a,a=s),s=$o(n,a);var l=$o(n,r);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var up=at&&"documentMode"in document&&11>=document.documentMode,un=null,oa=null,ir=null,ca=!1;function Fo(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ca||un==null||un!==ys(r)||(r=un,"selectionStart"in r&&ul(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ir&&yr(ir,r)||(ir=r,r=Ns(oa,"onSelect"),0<r.length&&(t=new ll("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=un)))}function Vr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var dn={animationend:Vr("Animation","AnimationEnd"),animationiteration:Vr("Animation","AnimationIteration"),animationstart:Vr("Animation","AnimationStart"),transitionend:Vr("Transition","TransitionEnd")},wi={},Fu={};at&&(Fu=document.createElement("div").style,"AnimationEvent"in window||(delete dn.animationend.animation,delete dn.animationiteration.animation,delete dn.animationstart.animation),"TransitionEvent"in window||delete dn.transitionend.transition);function Ks(e){if(wi[e])return wi[e];if(!dn[e])return e;var t=dn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fu)return wi[e]=t[n];return e}var Bu=Ks("animationend"),qu=Ks("animationiteration"),Iu=Ks("animationstart"),Uu=Ks("transitionend"),Vu=new Map,Bo="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function At(e,t){Vu.set(e,t),en(t,[e])}for(var Si=0;Si<Bo.length;Si++){var Ni=Bo[Si],dp=Ni.toLowerCase(),hp=Ni[0].toUpperCase()+Ni.slice(1);At(dp,"on"+hp)}At(Bu,"onAnimationEnd");At(qu,"onAnimationIteration");At(Iu,"onAnimationStart");At("dblclick","onDoubleClick");At("focusin","onFocus");At("focusout","onBlur");At(Uu,"onTransitionEnd");Cn("onMouseEnter",["mouseout","mouseover"]);Cn("onMouseLeave",["mouseout","mouseover"]);Cn("onPointerEnter",["pointerout","pointerover"]);Cn("onPointerLeave",["pointerout","pointerover"]);en("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));en("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));en("onBeforeInput",["compositionend","keypress","textInput","paste"]);en("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));en("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));en("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),fp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zn));function qo(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,df(r,t,void 0,e),e.currentTarget=null}function Wu(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var l=r.length-1;0<=l;l--){var c=r[l],o=c.instance,u=c.currentTarget;if(c=c.listener,o!==a&&s.isPropagationStopped())break e;qo(s,c,u),a=o}else for(l=0;l<r.length;l++){if(c=r[l],o=c.instance,u=c.currentTarget,c=c.listener,o!==a&&s.isPropagationStopped())break e;qo(s,c,u),a=o}}}if(xs)throw e=sa,xs=!1,sa=null,e}function q(e,t){var n=t[pa];n===void 0&&(n=t[pa]=new Set);var r=e+"__bubble";n.has(r)||(Qu(t,e,2,!1),n.add(r))}function Ci(e,t,n){var r=0;t&&(r|=4),Qu(n,e,r,t)}var Wr="_reactListening"+Math.random().toString(36).slice(2);function gr(e){if(!e[Wr]){e[Wr]=!0,Zc.forEach(function(n){n!=="selectionchange"&&(fp.has(n)||Ci(n,!1,e),Ci(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wr]||(t[Wr]=!0,Ci("selectionchange",!1,t))}}function Qu(e,t,n,r){switch(Pu(t)){case 1:var s=bf;break;case 4:s=Ef;break;default:s=il}n=s.bind(null,t,n,e),s=void 0,!ra||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function _i(e,t,n,r,s){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var c=r.stateNode.containerInfo;if(c===s||c.nodeType===8&&c.parentNode===s)break;if(l===4)for(l=r.return;l!==null;){var o=l.tag;if((o===3||o===4)&&(o=l.stateNode.containerInfo,o===s||o.nodeType===8&&o.parentNode===s))return;l=l.return}for(;c!==null;){if(l=Vt(c),l===null)return;if(o=l.tag,o===5||o===6){r=a=l;continue e}c=c.parentNode}}r=r.return}mu(function(){var u=a,h=tl(n),d=[];e:{var f=Vu.get(e);if(f!==void 0){var g=ll,x=e;switch(e){case"keypress":if(is(n)===0)break e;case"keydown":case"keyup":g=Uf;break;case"focusin":x="focus",g=xi;break;case"focusout":x="blur",g=xi;break;case"beforeblur":case"afterblur":g=xi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Po;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Lf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Qf;break;case Bu:case qu:case Iu:g=Of;break;case Uu:g=Kf;break;case"scroll":g=Pf;break;case"wheel":g=Gf;break;case"copy":case"cut":case"paste":g=Mf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Lo}var k=(t&4)!==0,N=!k&&e==="scroll",y=k?f!==null?f+"Capture":null:f;k=[];for(var v=u,p;v!==null;){p=v;var j=p.stateNode;if(p.tag===5&&j!==null&&(p=j,y!==null&&(j=hr(v,y),j!=null&&k.push(xr(v,j,p)))),N)break;v=v.return}0<k.length&&(f=new g(f,x,null,n,h),d.push({event:f,listeners:k}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==ta&&(x=n.relatedTarget||n.fromElement)&&(Vt(x)||x[lt]))break e;if((g||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=u,x=x?Vt(x):null,x!==null&&(N=tn(x),x!==N||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=u),g!==x)){if(k=Po,j="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(k=Lo,j="onPointerLeave",y="onPointerEnter",v="pointer"),N=g==null?f:hn(g),p=x==null?f:hn(x),f=new k(j,v+"leave",g,n,h),f.target=N,f.relatedTarget=p,j=null,Vt(h)===u&&(k=new k(y,v+"enter",x,n,h),k.target=p,k.relatedTarget=N,j=k),N=j,g&&x)t:{for(k=g,y=x,v=0,p=k;p;p=an(p))v++;for(p=0,j=y;j;j=an(j))p++;for(;0<v-p;)k=an(k),v--;for(;0<p-v;)y=an(y),p--;for(;v--;){if(k===y||y!==null&&k===y.alternate)break t;k=an(k),y=an(y)}k=null}else k=null;g!==null&&Io(d,f,g,k,!1),x!==null&&N!==null&&Io(d,N,x,k,!0)}}e:{if(f=u?hn(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var S=rp;else if(Oo(f))if(Au)S=lp;else{S=ip;var b=sp}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=ap);if(S&&(S=S(e,u))){Ou(d,S,n,h);break e}b&&b(e,f,u),e==="focusout"&&(b=f._wrapperState)&&b.controlled&&f.type==="number"&&Gi(f,"number",f.value)}switch(b=u?hn(u):window,e){case"focusin":(Oo(b)||b.contentEditable==="true")&&(un=b,oa=u,ir=null);break;case"focusout":ir=oa=un=null;break;case"mousedown":ca=!0;break;case"contextmenu":case"mouseup":case"dragend":ca=!1,Fo(d,n,h);break;case"selectionchange":if(up)break;case"keydown":case"keyup":Fo(d,n,h)}var P;if(cl)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else cn?Ru(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Lu&&n.locale!=="ko"&&(cn||T!=="onCompositionStart"?T==="onCompositionEnd"&&cn&&(P=Tu()):(jt=h,al="value"in jt?jt.value:jt.textContent,cn=!0)),b=Ns(u,T),0<b.length&&(T=new To(T,e,null,n,h),d.push({event:T,listeners:b}),P?T.data=P:(P=Du(n),P!==null&&(T.data=P)))),(P=Jf?Zf(e,n):ep(e,n))&&(u=Ns(u,"onBeforeInput"),0<u.length&&(h=new To("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:u}),h.data=P))}Wu(d,t)})}function xr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ns(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=hr(e,n),a!=null&&r.unshift(xr(e,a,s)),a=hr(e,t),a!=null&&r.push(xr(e,a,s))),e=e.return}return r}function an(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Io(e,t,n,r,s){for(var a=t._reactName,l=[];n!==null&&n!==r;){var c=n,o=c.alternate,u=c.stateNode;if(o!==null&&o===r)break;c.tag===5&&u!==null&&(c=u,s?(o=hr(n,a),o!=null&&l.unshift(xr(n,o,c))):s||(o=hr(n,a),o!=null&&l.push(xr(n,o,c)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var pp=/\r\n?/g,mp=/\u0000|\uFFFD/g;function Uo(e){return(typeof e=="string"?e:""+e).replace(pp,`
-`).replace(mp,"")}function Qr(e,t,n){if(t=Uo(t),Uo(e)!==t&&n)throw Error(w(425))}function Cs(){}var ua=null,da=null;function ha(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var fa=typeof setTimeout=="function"?setTimeout:void 0,vp=typeof clearTimeout=="function"?clearTimeout:void 0,Vo=typeof Promise=="function"?Promise:void 0,yp=typeof queueMicrotask=="function"?queueMicrotask:typeof Vo<"u"?function(e){return Vo.resolve(null).then(e).catch(gp)}:fa;function gp(e){setTimeout(function(){throw e})}function bi(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),mr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);mr(t)}function _t(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Wo(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var An=Math.random().toString(36).slice(2),Ye="__reactFiber$"+An,jr="__reactProps$"+An,lt="__reactContainer$"+An,pa="__reactEvents$"+An,xp="__reactListeners$"+An,jp="__reactHandles$"+An;function Vt(e){var t=e[Ye];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[Ye]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Wo(e);e!==null;){if(n=e[Ye])return n;e=Wo(e)}return t}e=n,n=e.parentNode}return null}function Rr(e){return e=e[Ye]||e[lt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function hn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(w(33))}function Ys(e){return e[jr]||null}var ma=[],fn=-1;function Mt(e){return{current:e}}function I(e){0>fn||(e.current=ma[fn],ma[fn]=null,fn--)}function B(e,t){fn++,ma[fn]=e.current,e.current=t}var Ot={},de=Mt(Ot),xe=Mt(!1),Yt=Ot;function _n(e,t){var n=e.type.contextTypes;if(!n)return Ot;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in n)s[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function je(e){return e=e.childContextTypes,e!=null}function _s(){I(xe),I(de)}function Qo(e,t,n){if(de.current!==Ot)throw Error(w(168));B(de,t),B(xe,n)}function Hu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(w(108,rf(e)||"Unknown",s));return K({},n,r)}function bs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ot,Yt=de.current,B(de,e),B(xe,xe.current),!0}function Ho(e,t,n){var r=e.stateNode;if(!r)throw Error(w(169));n?(e=Hu(e,t,Yt),r.__reactInternalMemoizedMergedChildContext=e,I(xe),I(de),B(de,e)):I(xe),B(xe,n)}var nt=null,Gs=!1,Ei=!1;function Ku(e){nt===null?nt=[e]:nt.push(e)}function kp(e){Gs=!0,Ku(e)}function zt(){if(!Ei&&nt!==null){Ei=!0;var e=0,t=$;try{var n=nt;for($=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}nt=null,Gs=!1}catch(s){throw nt!==null&&(nt=nt.slice(e+1)),xu(nl,zt),s}finally{$=t,Ei=!1}}return null}var pn=[],mn=0,Es=null,Ps=0,Te=[],Le=0,Gt=null,rt=1,st="";function It(e,t){pn[mn++]=Ps,pn[mn++]=Es,Es=e,Ps=t}function Yu(e,t,n){Te[Le++]=rt,Te[Le++]=st,Te[Le++]=Gt,Gt=e;var r=rt;e=st;var s=32-Ie(r)-1;r&=~(1<<s),n+=1;var a=32-Ie(t)+s;if(30<a){var l=s-s%5;a=(r&(1<<l)-1).toString(32),r>>=l,s-=l,rt=1<<32-Ie(t)+s|n<<s|r,st=a+e}else rt=1<<a|n<<s|r,st=e}function dl(e){e.return!==null&&(It(e,1),Yu(e,1,0))}function hl(e){for(;e===Es;)Es=pn[--mn],pn[mn]=null,Ps=pn[--mn],pn[mn]=null;for(;e===Gt;)Gt=Te[--Le],Te[Le]=null,st=Te[--Le],Te[Le]=null,rt=Te[--Le],Te[Le]=null}var Ce=null,Ne=null,V=!1,qe=null;function Gu(e,t){var n=De(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ko(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ce=e,Ne=_t(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ce=e,Ne=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Gt!==null?{id:rt,overflow:st}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=De(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ce=e,Ne=null,!0):!1;default:return!1}}function va(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ya(e){if(V){var t=Ne;if(t){var n=t;if(!Ko(e,t)){if(va(e))throw Error(w(418));t=_t(n.nextSibling);var r=Ce;t&&Ko(e,t)?Gu(r,n):(e.flags=e.flags&-4097|2,V=!1,Ce=e)}}else{if(va(e))throw Error(w(418));e.flags=e.flags&-4097|2,V=!1,Ce=e}}}function Yo(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ce=e}function Hr(e){if(e!==Ce)return!1;if(!V)return Yo(e),V=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ha(e.type,e.memoizedProps)),t&&(t=Ne)){if(va(e))throw Xu(),Error(w(418));for(;t;)Gu(e,t),t=_t(t.nextSibling)}if(Yo(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(w(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ne=_t(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ne=null}}else Ne=Ce?_t(e.stateNode.nextSibling):null;return!0}function Xu(){for(var e=Ne;e;)e=_t(e.nextSibling)}function bn(){Ne=Ce=null,V=!1}function fl(e){qe===null?qe=[e]:qe.push(e)}var wp=ut.ReactCurrentBatchConfig;function Qn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(w(309));var r=n.stateNode}if(!r)throw Error(w(147,e));var s=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(l){var c=s.refs;l===null?delete c[a]:c[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(w(284));if(!n._owner)throw Error(w(290,e))}return e}function Kr(e,t){throw e=Object.prototype.toString.call(t),Error(w(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Go(e){var t=e._init;return t(e._payload)}function Ju(e){function t(y,v){if(e){var p=y.deletions;p===null?(y.deletions=[v],y.flags|=16):p.push(v)}}function n(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function r(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function s(y,v){return y=Tt(y,v),y.index=0,y.sibling=null,y}function a(y,v,p){return y.index=p,e?(p=y.alternate,p!==null?(p=p.index,p<v?(y.flags|=2,v):p):(y.flags|=2,v)):(y.flags|=1048576,v)}function l(y){return e&&y.alternate===null&&(y.flags|=2),y}function c(y,v,p,j){return v===null||v.tag!==6?(v=Ai(p,y.mode,j),v.return=y,v):(v=s(v,p),v.return=y,v)}function o(y,v,p,j){var S=p.type;return S===on?h(y,v,p.props.children,j,p.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===vt&&Go(S)===v.type)?(j=s(v,p.props),j.ref=Qn(y,v,p),j.return=y,j):(j=hs(p.type,p.key,p.props,null,y.mode,j),j.ref=Qn(y,v,p),j.return=y,j)}function u(y,v,p,j){return v===null||v.tag!==4||v.stateNode.containerInfo!==p.containerInfo||v.stateNode.implementation!==p.implementation?(v=Mi(p,y.mode,j),v.return=y,v):(v=s(v,p.children||[]),v.return=y,v)}function h(y,v,p,j,S){return v===null||v.tag!==7?(v=Kt(p,y.mode,j,S),v.return=y,v):(v=s(v,p),v.return=y,v)}function d(y,v,p){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Ai(""+v,y.mode,p),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case zr:return p=hs(v.type,v.key,v.props,null,y.mode,p),p.ref=Qn(y,null,v),p.return=y,p;case ln:return v=Mi(v,y.mode,p),v.return=y,v;case vt:var j=v._init;return d(y,j(v._payload),p)}if(Xn(v)||qn(v))return v=Kt(v,y.mode,p,null),v.return=y,v;Kr(y,v)}return null}function f(y,v,p,j){var S=v!==null?v.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return S!==null?null:c(y,v,""+p,j);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case zr:return p.key===S?o(y,v,p,j):null;case ln:return p.key===S?u(y,v,p,j):null;case vt:return S=p._init,f(y,v,S(p._payload),j)}if(Xn(p)||qn(p))return S!==null?null:h(y,v,p,j,null);Kr(y,p)}return null}function g(y,v,p,j,S){if(typeof j=="string"&&j!==""||typeof j=="number")return y=y.get(p)||null,c(v,y,""+j,S);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case zr:return y=y.get(j.key===null?p:j.key)||null,o(v,y,j,S);case ln:return y=y.get(j.key===null?p:j.key)||null,u(v,y,j,S);case vt:var b=j._init;return g(y,v,p,b(j._payload),S)}if(Xn(j)||qn(j))return y=y.get(p)||null,h(v,y,j,S,null);Kr(v,j)}return null}function x(y,v,p,j){for(var S=null,b=null,P=v,T=v=0,F=null;P!==null&&T<p.length;T++){P.index>T?(F=P,P=null):F=P.sibling;var R=f(y,P,p[T],j);if(R===null){P===null&&(P=F);break}e&&P&&R.alternate===null&&t(y,P),v=a(R,v,T),b===null?S=R:b.sibling=R,b=R,P=F}if(T===p.length)return n(y,P),V&&It(y,T),S;if(P===null){for(;T<p.length;T++)P=d(y,p[T],j),P!==null&&(v=a(P,v,T),b===null?S=P:b.sibling=P,b=P);return V&&It(y,T),S}for(P=r(y,P);T<p.length;T++)F=g(P,y,T,p[T],j),F!==null&&(e&&F.alternate!==null&&P.delete(F.key===null?T:F.key),v=a(F,v,T),b===null?S=F:b.sibling=F,b=F);return e&&P.forEach(function(le){return t(y,le)}),V&&It(y,T),S}function k(y,v,p,j){var S=qn(p);if(typeof S!="function")throw Error(w(150));if(p=S.call(p),p==null)throw Error(w(151));for(var b=S=null,P=v,T=v=0,F=null,R=p.next();P!==null&&!R.done;T++,R=p.next()){P.index>T?(F=P,P=null):F=P.sibling;var le=f(y,P,R.value,j);if(le===null){P===null&&(P=F);break}e&&P&&le.alternate===null&&t(y,P),v=a(le,v,T),b===null?S=le:b.sibling=le,b=le,P=F}if(R.done)return n(y,P),V&&It(y,T),S;if(P===null){for(;!R.done;T++,R=p.next())R=d(y,R.value,j),R!==null&&(v=a(R,v,T),b===null?S=R:b.sibling=R,b=R);return V&&It(y,T),S}for(P=r(y,P);!R.done;T++,R=p.next())R=g(P,y,T,R.value,j),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?T:R.key),v=a(R,v,T),b===null?S=R:b.sibling=R,b=R);return e&&P.forEach(function(ht){return t(y,ht)}),V&&It(y,T),S}function N(y,v,p,j){if(typeof p=="object"&&p!==null&&p.type===on&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case zr:e:{for(var S=p.key,b=v;b!==null;){if(b.key===S){if(S=p.type,S===on){if(b.tag===7){n(y,b.sibling),v=s(b,p.props.children),v.return=y,y=v;break e}}else if(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===vt&&Go(S)===b.type){n(y,b.sibling),v=s(b,p.props),v.ref=Qn(y,b,p),v.return=y,y=v;break e}n(y,b);break}else t(y,b);b=b.sibling}p.type===on?(v=Kt(p.props.children,y.mode,j,p.key),v.return=y,y=v):(j=hs(p.type,p.key,p.props,null,y.mode,j),j.ref=Qn(y,v,p),j.return=y,y=j)}return l(y);case ln:e:{for(b=p.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===p.containerInfo&&v.stateNode.implementation===p.implementation){n(y,v.sibling),v=s(v,p.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=Mi(p,y.mode,j),v.return=y,y=v}return l(y);case vt:return b=p._init,N(y,v,b(p._payload),j)}if(Xn(p))return x(y,v,p,j);if(qn(p))return k(y,v,p,j);Kr(y,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,v!==null&&v.tag===6?(n(y,v.sibling),v=s(v,p),v.return=y,y=v):(n(y,v),v=Ai(p,y.mode,j),v.return=y,y=v),l(y)):n(y,v)}return N}var En=Ju(!0),Zu=Ju(!1),Ts=Mt(null),Ls=null,vn=null,pl=null;function ml(){pl=vn=Ls=null}function vl(e){var t=Ts.current;I(Ts),e._currentValue=t}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Sn(e,t){Ls=e,pl=vn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ge=!0),e.firstContext=null)}function Ae(e){var t=e._currentValue;if(pl!==e)if(e={context:e,memoizedValue:t,next:null},vn===null){if(Ls===null)throw Error(w(308));vn=e,Ls.dependencies={lanes:0,firstContext:e}}else vn=vn.next=e;return t}var Wt=null;function yl(e){Wt===null?Wt=[e]:Wt.push(e)}function ed(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,yl(t)):(n.next=s.next,s.next=n),t.interleaved=n,ot(e,r)}function ot(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var yt=!1;function gl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function td(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function it(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function bt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,z&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,ot(e,n)}return s=r.interleaved,s===null?(t.next=t,yl(r)):(t.next=s.next,s.next=t),r.interleaved=t,ot(e,n)}function as(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rl(e,n)}}function Xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?s=a=l:a=a.next=l,n=n.next}while(n!==null);a===null?s=a=t:a=a.next=t}else s=a=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Rs(e,t,n,r){var s=e.updateQueue;yt=!1;var a=s.firstBaseUpdate,l=s.lastBaseUpdate,c=s.shared.pending;if(c!==null){s.shared.pending=null;var o=c,u=o.next;o.next=null,l===null?a=u:l.next=u,l=o;var h=e.alternate;h!==null&&(h=h.updateQueue,c=h.lastBaseUpdate,c!==l&&(c===null?h.firstBaseUpdate=u:c.next=u,h.lastBaseUpdate=o))}if(a!==null){var d=s.baseState;l=0,h=u=o=null,c=a;do{var f=c.lane,g=c.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:g,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var x=e,k=c;switch(f=t,g=n,k.tag){case 1:if(x=k.payload,typeof x=="function"){d=x.call(g,d,f);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=k.payload,f=typeof x=="function"?x.call(g,d,f):x,f==null)break e;d=K({},d,f);break e;case 2:yt=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[c]:f.push(c))}else g={eventTime:g,lane:f,tag:c.tag,payload:c.payload,callback:c.callback,next:null},h===null?(u=h=g,o=d):h=h.next=g,l|=f;if(c=c.next,c===null){if(c=s.shared.pending,c===null)break;f=c,c=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(h===null&&(o=d),s.baseState=o,s.firstBaseUpdate=u,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);Jt|=l,e.lanes=l,e.memoizedState=d}}function Jo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(w(191,s));s.call(r)}}}var Dr={},Xe=Mt(Dr),kr=Mt(Dr),wr=Mt(Dr);function Qt(e){if(e===Dr)throw Error(w(174));return e}function xl(e,t){switch(B(wr,t),B(kr,e),B(Xe,Dr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ji(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ji(t,e)}I(Xe),B(Xe,t)}function Pn(){I(Xe),I(kr),I(wr)}function nd(e){Qt(wr.current);var t=Qt(Xe.current),n=Ji(t,e.type);t!==n&&(B(kr,e),B(Xe,n))}function jl(e){kr.current===e&&(I(Xe),I(kr))}var W=Mt(0);function Ds(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pi=[];function kl(){for(var e=0;e<Pi.length;e++)Pi[e]._workInProgressVersionPrimary=null;Pi.length=0}var ls=ut.ReactCurrentDispatcher,Ti=ut.ReactCurrentBatchConfig,Xt=0,Q=null,ee=null,ne=null,Os=!1,ar=!1,Sr=0,Sp=0;function oe(){throw Error(w(321))}function wl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ve(e[n],t[n]))return!1;return!0}function Sl(e,t,n,r,s,a){if(Xt=a,Q=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ls.current=e===null||e.memoizedState===null?bp:Ep,e=n(r,s),ar){a=0;do{if(ar=!1,Sr=0,25<=a)throw Error(w(301));a+=1,ne=ee=null,t.updateQueue=null,ls.current=Pp,e=n(r,s)}while(ar)}if(ls.current=As,t=ee!==null&&ee.next!==null,Xt=0,ne=ee=Q=null,Os=!1,t)throw Error(w(300));return e}function Nl(){var e=Sr!==0;return Sr=0,e}function Ke(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ne===null?Q.memoizedState=ne=e:ne=ne.next=e,ne}function Me(){if(ee===null){var e=Q.alternate;e=e!==null?e.memoizedState:null}else e=ee.next;var t=ne===null?Q.memoizedState:ne.next;if(t!==null)ne=t,ee=e;else{if(e===null)throw Error(w(310));ee=e,e={memoizedState:ee.memoizedState,baseState:ee.baseState,baseQueue:ee.baseQueue,queue:ee.queue,next:null},ne===null?Q.memoizedState=ne=e:ne=ne.next=e}return ne}function Nr(e,t){return typeof t=="function"?t(e):t}function Li(e){var t=Me(),n=t.queue;if(n===null)throw Error(w(311));n.lastRenderedReducer=e;var r=ee,s=r.baseQueue,a=n.pending;if(a!==null){if(s!==null){var l=s.next;s.next=a.next,a.next=l}r.baseQueue=s=a,n.pending=null}if(s!==null){a=s.next,r=r.baseState;var c=l=null,o=null,u=a;do{var h=u.lane;if((Xt&h)===h)o!==null&&(o=o.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};o===null?(c=o=d,l=r):o=o.next=d,Q.lanes|=h,Jt|=h}u=u.next}while(u!==null&&u!==a);o===null?l=r:o.next=c,Ve(r,t.memoizedState)||(ge=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=o,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do a=s.lane,Q.lanes|=a,Jt|=a,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ri(e){var t=Me(),n=t.queue;if(n===null)throw Error(w(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,a=t.memoizedState;if(s!==null){n.pending=null;var l=s=s.next;do a=e(a,l.action),l=l.next;while(l!==s);Ve(a,t.memoizedState)||(ge=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function rd(){}function sd(e,t){var n=Q,r=Me(),s=t(),a=!Ve(r.memoizedState,s);if(a&&(r.memoizedState=s,ge=!0),r=r.queue,Cl(ld.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||ne!==null&&ne.memoizedState.tag&1){if(n.flags|=2048,Cr(9,ad.bind(null,n,r,s,t),void 0,null),re===null)throw Error(w(349));Xt&30||id(n,t,s)}return s}function id(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Q.updateQueue,t===null?(t={lastEffect:null,stores:null},Q.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ad(e,t,n,r){t.value=n,t.getSnapshot=r,od(t)&&cd(e)}function ld(e,t,n){return n(function(){od(t)&&cd(e)})}function od(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ve(e,n)}catch{return!0}}function cd(e){var t=ot(e,1);t!==null&&Ue(t,e,1,-1)}function Zo(e){var t=Ke();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nr,lastRenderedState:e},t.queue=e,e=e.dispatch=_p.bind(null,Q,e),[t.memoizedState,e]}function Cr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Q.updateQueue,t===null?(t={lastEffect:null,stores:null},Q.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ud(){return Me().memoizedState}function os(e,t,n,r){var s=Ke();Q.flags|=e,s.memoizedState=Cr(1|t,n,void 0,r===void 0?null:r)}function Xs(e,t,n,r){var s=Me();r=r===void 0?null:r;var a=void 0;if(ee!==null){var l=ee.memoizedState;if(a=l.destroy,r!==null&&wl(r,l.deps)){s.memoizedState=Cr(t,n,a,r);return}}Q.flags|=e,s.memoizedState=Cr(1|t,n,a,r)}function ec(e,t){return os(8390656,8,e,t)}function Cl(e,t){return Xs(2048,8,e,t)}function dd(e,t){return Xs(4,2,e,t)}function hd(e,t){return Xs(4,4,e,t)}function fd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function pd(e,t,n){return n=n!=null?n.concat([e]):null,Xs(4,4,fd.bind(null,t,e),n)}function _l(){}function md(e,t){var n=Me();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vd(e,t){var n=Me();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wl(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yd(e,t,n){return Xt&21?(Ve(n,t)||(n=wu(),Q.lanes|=n,Jt|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ge=!0),e.memoizedState=n)}function Np(e,t){var n=$;$=n!==0&&4>n?n:4,e(!0);var r=Ti.transition;Ti.transition={};try{e(!1),t()}finally{$=n,Ti.transition=r}}function gd(){return Me().memoizedState}function Cp(e,t,n){var r=Pt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xd(e))jd(t,n);else if(n=ed(e,t,n,r),n!==null){var s=fe();Ue(n,e,r,s),kd(n,t,r)}}function _p(e,t,n){var r=Pt(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xd(e))jd(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,c=a(l,n);if(s.hasEagerState=!0,s.eagerState=c,Ve(c,l)){var o=t.interleaved;o===null?(s.next=s,yl(t)):(s.next=o.next,o.next=s),t.interleaved=s;return}}catch{}finally{}n=ed(e,t,s,r),n!==null&&(s=fe(),Ue(n,e,r,s),kd(n,t,r))}}function xd(e){var t=e.alternate;return e===Q||t!==null&&t===Q}function jd(e,t){ar=Os=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rl(e,n)}}var As={readContext:Ae,useCallback:oe,useContext:oe,useEffect:oe,useImperativeHandle:oe,useInsertionEffect:oe,useLayoutEffect:oe,useMemo:oe,useReducer:oe,useRef:oe,useState:oe,useDebugValue:oe,useDeferredValue:oe,useTransition:oe,useMutableSource:oe,useSyncExternalStore:oe,useId:oe,unstable_isNewReconciler:!1},bp={readContext:Ae,useCallback:function(e,t){return Ke().memoizedState=[e,t===void 0?null:t],e},useContext:Ae,useEffect:ec,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,os(4194308,4,fd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){return os(4,2,e,t)},useMemo:function(e,t){var n=Ke();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ke();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Cp.bind(null,Q,e),[r.memoizedState,e]},useRef:function(e){var t=Ke();return e={current:e},t.memoizedState=e},useState:Zo,useDebugValue:_l,useDeferredValue:function(e){return Ke().memoizedState=e},useTransition:function(){var e=Zo(!1),t=e[0];return e=Np.bind(null,e[1]),Ke().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Q,s=Ke();if(V){if(n===void 0)throw Error(w(407));n=n()}else{if(n=t(),re===null)throw Error(w(349));Xt&30||id(r,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,ec(ld.bind(null,r,a,e),[e]),r.flags|=2048,Cr(9,ad.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Ke(),t=re.identifierPrefix;if(V){var n=st,r=rt;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Sr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Sp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ep={readContext:Ae,useCallback:md,useContext:Ae,useEffect:Cl,useImperativeHandle:pd,useInsertionEffect:dd,useLayoutEffect:hd,useMemo:vd,useReducer:Li,useRef:ud,useState:function(){return Li(Nr)},useDebugValue:_l,useDeferredValue:function(e){var t=Me();return yd(t,ee.memoizedState,e)},useTransition:function(){var e=Li(Nr)[0],t=Me().memoizedState;return[e,t]},useMutableSource:rd,useSyncExternalStore:sd,useId:gd,unstable_isNewReconciler:!1},Pp={readContext:Ae,useCallback:md,useContext:Ae,useEffect:Cl,useImperativeHandle:pd,useInsertionEffect:dd,useLayoutEffect:hd,useMemo:vd,useReducer:Ri,useRef:ud,useState:function(){return Ri(Nr)},useDebugValue:_l,useDeferredValue:function(e){var t=Me();return ee===null?t.memoizedState=e:yd(t,ee.memoizedState,e)},useTransition:function(){var e=Ri(Nr)[0],t=Me().memoizedState;return[e,t]},useMutableSource:rd,useSyncExternalStore:sd,useId:gd,unstable_isNewReconciler:!1};function $e(e,t){if(e&&e.defaultProps){t=K({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function xa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:K({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Js={isMounted:function(e){return(e=e._reactInternals)?tn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fe(),s=Pt(e),a=it(r,s);a.payload=t,n!=null&&(a.callback=n),t=bt(e,a,s),t!==null&&(Ue(t,e,s,r),as(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fe(),s=Pt(e),a=it(r,s);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=bt(e,a,s),t!==null&&(Ue(t,e,s,r),as(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fe(),r=Pt(e),s=it(n,r);s.tag=2,t!=null&&(s.callback=t),t=bt(e,s,r),t!==null&&(Ue(t,e,r,n),as(t,e,r))}};function tc(e,t,n,r,s,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,l):t.prototype&&t.prototype.isPureReactComponent?!yr(n,r)||!yr(s,a):!0}function wd(e,t,n){var r=!1,s=Ot,a=t.contextType;return typeof a=="object"&&a!==null?a=Ae(a):(s=je(t)?Yt:de.current,r=t.contextTypes,a=(r=r!=null)?_n(e,s):Ot),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Js,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function nc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Js.enqueueReplaceState(t,t.state,null)}function ja(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},gl(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=Ae(a):(a=je(t)?Yt:de.current,s.context=_n(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(xa(e,t,a,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Js.enqueueReplaceState(s,s.state,null),Rs(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Tn(e,t){try{var n="",r=t;do n+=nf(r),r=r.return;while(r);var s=n}catch(a){s=`
-Error generating stack: `+a.message+`
-`+a.stack}return{value:e,source:t,stack:s,digest:null}}function Di(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ka(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Tp=typeof WeakMap=="function"?WeakMap:Map;function Sd(e,t,n){n=it(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){zs||(zs=!0,La=r),ka(e,t)},n}function Nd(e,t,n){n=it(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){ka(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ka(e,t),typeof r!="function"&&(Et===null?Et=new Set([this]):Et.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function rc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Tp;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Vp.bind(null,e,t,n),t.then(e,e))}function sc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ic(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=it(-1,1),t.tag=2,bt(n,t,1))),n.lanes|=1),e)}var Lp=ut.ReactCurrentOwner,ge=!1;function he(e,t,n,r){t.child=e===null?Zu(t,null,n,r):En(t,e.child,n,r)}function ac(e,t,n,r,s){n=n.render;var a=t.ref;return Sn(t,s),r=Sl(e,t,n,r,a,s),n=Nl(),e!==null&&!ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ct(e,t,s)):(V&&n&&dl(t),t.flags|=1,he(e,t,r,s),t.child)}function lc(e,t,n,r,s){if(e===null){var a=n.type;return typeof a=="function"&&!Ol(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Cd(e,t,a,r,s)):(e=hs(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var l=a.memoizedProps;if(n=n.compare,n=n!==null?n:yr,n(l,r)&&e.ref===t.ref)return ct(e,t,s)}return t.flags|=1,e=Tt(a,r),e.ref=t.ref,e.return=t,t.child=e}function Cd(e,t,n,r,s){if(e!==null){var a=e.memoizedProps;if(yr(a,r)&&e.ref===t.ref)if(ge=!1,t.pendingProps=r=a,(e.lanes&s)!==0)e.flags&131072&&(ge=!0);else return t.lanes=e.lanes,ct(e,t,s)}return wa(e,t,n,r,s)}function _d(e,t,n){var r=t.pendingProps,s=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},B(gn,Se),Se|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,B(gn,Se),Se|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,B(gn,Se),Se|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,B(gn,Se),Se|=r;return he(e,t,s,n),t.child}function bd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function wa(e,t,n,r,s){var a=je(n)?Yt:de.current;return a=_n(t,a),Sn(t,s),n=Sl(e,t,n,r,a,s),r=Nl(),e!==null&&!ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ct(e,t,s)):(V&&r&&dl(t),t.flags|=1,he(e,t,n,s),t.child)}function oc(e,t,n,r,s){if(je(n)){var a=!0;bs(t)}else a=!1;if(Sn(t,s),t.stateNode===null)cs(e,t),wd(t,n,r),ja(t,n,r,s),r=!0;else if(e===null){var l=t.stateNode,c=t.memoizedProps;l.props=c;var o=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=Ae(u):(u=je(n)?Yt:de.current,u=_n(t,u));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==r||o!==u)&&nc(t,l,r,u),yt=!1;var f=t.memoizedState;l.state=f,Rs(t,r,l,s),o=t.memoizedState,c!==r||f!==o||xe.current||yt?(typeof h=="function"&&(xa(t,n,h,r),o=t.memoizedState),(c=yt||tc(t,n,c,r,f,o,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=o),l.props=r,l.state=o,l.context=u,r=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,td(e,t),c=t.memoizedProps,u=t.type===t.elementType?c:$e(t.type,c),l.props=u,d=t.pendingProps,f=l.context,o=n.contextType,typeof o=="object"&&o!==null?o=Ae(o):(o=je(n)?Yt:de.current,o=_n(t,o));var g=n.getDerivedStateFromProps;(h=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(c!==d||f!==o)&&nc(t,l,r,o),yt=!1,f=t.memoizedState,l.state=f,Rs(t,r,l,s);var x=t.memoizedState;c!==d||f!==x||xe.current||yt?(typeof g=="function"&&(xa(t,n,g,r),x=t.memoizedState),(u=yt||tc(t,n,u,r,f,x,o)||!1)?(h||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,x,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,x,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),l.props=r,l.state=x,l.context=o,r=u):(typeof l.componentDidUpdate!="function"||c===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Sa(e,t,n,r,a,s)}function Sa(e,t,n,r,s,a){bd(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return s&&Ho(t,n,!1),ct(e,t,a);r=t.stateNode,Lp.current=t;var c=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=En(t,e.child,null,a),t.child=En(t,null,c,a)):he(e,t,c,a),t.memoizedState=r.state,s&&Ho(t,n,!0),t.child}function Ed(e){var t=e.stateNode;t.pendingContext?Qo(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Qo(e,t.context,!1),xl(e,t.containerInfo)}function cc(e,t,n,r,s){return bn(),fl(s),t.flags|=256,he(e,t,n,r),t.child}var Na={dehydrated:null,treeContext:null,retryLane:0};function Ca(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pd(e,t,n){var r=t.pendingProps,s=W.current,a=!1,l=(t.flags&128)!==0,c;if((c=l)||(c=e!==null&&e.memoizedState===null?!1:(s&2)!==0),c?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),B(W,s&1),e===null)return ya(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,a?(r=t.mode,a=t.child,l={mode:"hidden",children:l},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=ti(l,r,0,null),e=Kt(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ca(n),t.memoizedState=Na,e):bl(t,l));if(s=e.memoizedState,s!==null&&(c=s.dehydrated,c!==null))return Rp(e,t,l,r,c,s,n);if(a){a=r.fallback,l=t.mode,s=e.child,c=s.sibling;var o={mode:"hidden",children:r.children};return!(l&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=o,t.deletions=null):(r=Tt(s,o),r.subtreeFlags=s.subtreeFlags&14680064),c!==null?a=Tt(c,a):(a=Kt(a,l,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,l=e.child.memoizedState,l=l===null?Ca(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~n,t.memoizedState=Na,r}return a=e.child,e=a.sibling,r=Tt(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function bl(e,t){return t=ti({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Yr(e,t,n,r){return r!==null&&fl(r),En(t,e.child,null,n),e=bl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rp(e,t,n,r,s,a,l){if(n)return t.flags&256?(t.flags&=-257,r=Di(Error(w(422))),Yr(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,s=t.mode,r=ti({mode:"visible",children:r.children},s,0,null),a=Kt(a,s,l,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&En(t,e.child,null,l),t.child.memoizedState=Ca(l),t.memoizedState=Na,a);if(!(t.mode&1))return Yr(e,t,l,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var c=r.dgst;return r=c,a=Error(w(419)),r=Di(a,r,void 0),Yr(e,t,l,r)}if(c=(l&e.childLanes)!==0,ge||c){if(r=re,r!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|l)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,ot(e,s),Ue(r,e,s,-1))}return Dl(),r=Di(Error(w(421))),Yr(e,t,l,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Wp.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,Ne=_t(s.nextSibling),Ce=t,V=!0,qe=null,e!==null&&(Te[Le++]=rt,Te[Le++]=st,Te[Le++]=Gt,rt=e.id,st=e.overflow,Gt=t),t=bl(t,r.children),t.flags|=4096,t)}function uc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function Oi(e,t,n,r,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=s)}function Td(e,t,n){var r=t.pendingProps,s=r.revealOrder,a=r.tail;if(he(e,t,r.children,n),r=W.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uc(e,n,t);else if(e.tag===19)uc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(B(W,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ds(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Oi(t,!1,s,n,a);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ds(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Oi(t,!0,n,null,a);break;case"together":Oi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ct(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(w(153));if(t.child!==null){for(e=t.child,n=Tt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Tt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dp(e,t,n){switch(t.tag){case 3:Ed(t),bn();break;case 5:nd(t);break;case 1:je(t.type)&&bs(t);break;case 4:xl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;B(Ts,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(B(W,W.current&1),t.flags|=128,null):n&t.child.childLanes?Pd(e,t,n):(B(W,W.current&1),e=ct(e,t,n),e!==null?e.sibling:null);B(W,W.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Td(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),B(W,W.current),r)break;return null;case 22:case 23:return t.lanes=0,_d(e,t,n)}return ct(e,t,n)}var Ld,_a,Rd,Dd;Ld=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};_a=function(){};Rd=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Qt(Xe.current);var a=null;switch(n){case"input":s=Ki(e,s),r=Ki(e,r),a=[];break;case"select":s=K({},s,{value:void 0}),r=K({},r,{value:void 0}),a=[];break;case"textarea":s=Xi(e,s),r=Xi(e,r),a=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Cs)}Zi(n,r);var l;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var c=s[u];for(l in c)c.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ur.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var o=r[u];if(c=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&o!==c&&(o!=null||c!=null))if(u==="style")if(c){for(l in c)!c.hasOwnProperty(l)||o&&o.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in o)o.hasOwnProperty(l)&&c[l]!==o[l]&&(n||(n={}),n[l]=o[l])}else n||(a||(a=[]),a.push(u,n)),n=o;else u==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,c=c?c.__html:void 0,o!=null&&c!==o&&(a=a||[]).push(u,o)):u==="children"?typeof o!="string"&&typeof o!="number"||(a=a||[]).push(u,""+o):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ur.hasOwnProperty(u)?(o!=null&&u==="onScroll"&&q("scroll",e),a||c===o||(a=[])):(a=a||[]).push(u,o))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Dd=function(e,t,n,r){n!==r&&(t.flags|=4)};function Hn(e,t){if(!V)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ce(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Op(e,t,n){var r=t.pendingProps;switch(hl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ce(t),null;case 1:return je(t.type)&&_s(),ce(t),null;case 3:return r=t.stateNode,Pn(),I(xe),I(de),kl(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Hr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,qe!==null&&(Oa(qe),qe=null))),_a(e,t),ce(t),null;case 5:jl(t);var s=Qt(wr.current);if(n=t.type,e!==null&&t.stateNode!=null)Rd(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(w(166));return ce(t),null}if(e=Qt(Xe.current),Hr(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Ye]=t,r[jr]=a,e=(t.mode&1)!==0,n){case"dialog":q("cancel",r),q("close",r);break;case"iframe":case"object":case"embed":q("load",r);break;case"video":case"audio":for(s=0;s<Zn.length;s++)q(Zn[s],r);break;case"source":q("error",r);break;case"img":case"image":case"link":q("error",r),q("load",r);break;case"details":q("toggle",r);break;case"input":xo(r,a),q("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},q("invalid",r);break;case"textarea":ko(r,a),q("invalid",r)}Zi(n,a),s=null;for(var l in a)if(a.hasOwnProperty(l)){var c=a[l];l==="children"?typeof c=="string"?r.textContent!==c&&(a.suppressHydrationWarning!==!0&&Qr(r.textContent,c,e),s=["children",c]):typeof c=="number"&&r.textContent!==""+c&&(a.suppressHydrationWarning!==!0&&Qr(r.textContent,c,e),s=["children",""+c]):ur.hasOwnProperty(l)&&c!=null&&l==="onScroll"&&q("scroll",r)}switch(n){case"input":$r(r),jo(r,a,!0);break;case"textarea":$r(r),wo(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Cs)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=lu(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Ye]=t,e[jr]=r,Ld(e,t,!1,!1),t.stateNode=e;e:{switch(l=ea(n,r),n){case"dialog":q("cancel",e),q("close",e),s=r;break;case"iframe":case"object":case"embed":q("load",e),s=r;break;case"video":case"audio":for(s=0;s<Zn.length;s++)q(Zn[s],e);s=r;break;case"source":q("error",e),s=r;break;case"img":case"image":case"link":q("error",e),q("load",e),s=r;break;case"details":q("toggle",e),s=r;break;case"input":xo(e,r),s=Ki(e,r),q("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=K({},r,{value:void 0}),q("invalid",e);break;case"textarea":ko(e,r),s=Xi(e,r),q("invalid",e);break;default:s=r}Zi(n,s),c=s;for(a in c)if(c.hasOwnProperty(a)){var o=c[a];a==="style"?uu(e,o):a==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&ou(e,o)):a==="children"?typeof o=="string"?(n!=="textarea"||o!=="")&&dr(e,o):typeof o=="number"&&dr(e,""+o):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(ur.hasOwnProperty(a)?o!=null&&a==="onScroll"&&q("scroll",e):o!=null&&Xa(e,a,o,l))}switch(n){case"input":$r(e),jo(e,r,!1);break;case"textarea":$r(e),wo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Dt(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?xn(e,!!r.multiple,a,!1):r.defaultValue!=null&&xn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Cs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ce(t),null;case 6:if(e&&t.stateNode!=null)Dd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(w(166));if(n=Qt(wr.current),Qt(Xe.current),Hr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ye]=t,(a=r.nodeValue!==n)&&(e=Ce,e!==null))switch(e.tag){case 3:Qr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qr(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ye]=t,t.stateNode=r}return ce(t),null;case 13:if(I(W),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(V&&Ne!==null&&t.mode&1&&!(t.flags&128))Xu(),bn(),t.flags|=98560,a=!1;else if(a=Hr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(w(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(w(317));a[Ye]=t}else bn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ce(t),a=!1}else qe!==null&&(Oa(qe),qe=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||W.current&1?te===0&&(te=3):Dl())),t.updateQueue!==null&&(t.flags|=4),ce(t),null);case 4:return Pn(),_a(e,t),e===null&&gr(t.stateNode.containerInfo),ce(t),null;case 10:return vl(t.type._context),ce(t),null;case 17:return je(t.type)&&_s(),ce(t),null;case 19:if(I(W),a=t.memoizedState,a===null)return ce(t),null;if(r=(t.flags&128)!==0,l=a.rendering,l===null)if(r)Hn(a,!1);else{if(te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ds(e),l!==null){for(t.flags|=128,Hn(a,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return B(W,W.current&1|2),t.child}e=e.sibling}a.tail!==null&&X()>Ln&&(t.flags|=128,r=!0,Hn(a,!1),t.lanes=4194304)}else{if(!r)if(e=Ds(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!V)return ce(t),null}else 2*X()-a.renderingStartTime>Ln&&n!==1073741824&&(t.flags|=128,r=!0,Hn(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(n=a.last,n!==null?n.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=X(),t.sibling=null,n=W.current,B(W,r?n&1|2:n&1),t):(ce(t),null);case 22:case 23:return Rl(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Se&1073741824&&(ce(t),t.subtreeFlags&6&&(t.flags|=8192)):ce(t),null;case 24:return null;case 25:return null}throw Error(w(156,t.tag))}function Ap(e,t){switch(hl(t),t.tag){case 1:return je(t.type)&&_s(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pn(),I(xe),I(de),kl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return jl(t),null;case 13:if(I(W),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(w(340));bn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(W),null;case 4:return Pn(),null;case 10:return vl(t.type._context),null;case 22:case 23:return Rl(),null;case 24:return null;default:return null}}var Gr=!1,ue=!1,Mp=typeof WeakSet=="function"?WeakSet:Set,E=null;function yn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Y(e,t,r)}else n.current=null}function ba(e,t,n){try{n()}catch(r){Y(e,t,r)}}var dc=!1;function zp(e,t){if(ua=ws,e=$u(),ul(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var l=0,c=-1,o=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var g;d!==n||s!==0&&d.nodeType!==3||(c=l+s),d!==a||r!==0&&d.nodeType!==3||(o=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++u===s&&(c=l),f===a&&++h===r&&(o=l),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=c===-1||o===-1?null:{start:c,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(da={focusedElem:e,selectionRange:n},ws=!1,E=t;E!==null;)if(t=E,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,E=e;else for(;E!==null;){t=E;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var k=x.memoizedProps,N=x.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?k:$e(t.type,k),N);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(j){Y(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,E=e;break}E=t.return}return x=dc,dc=!1,x}function lr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&ba(t,n,a)}s=s.next}while(s!==r)}}function Zs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ea(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Od(e){var t=e.alternate;t!==null&&(e.alternate=null,Od(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ye],delete t[jr],delete t[pa],delete t[xp],delete t[jp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ad(e){return e.tag===5||e.tag===3||e.tag===4}function hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ad(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Cs));else if(r!==4&&(e=e.child,e!==null))for(Pa(e,t,n),e=e.sibling;e!==null;)Pa(e,t,n),e=e.sibling}function Ta(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ta(e,t,n),e=e.sibling;e!==null;)Ta(e,t,n),e=e.sibling}var se=null,Fe=!1;function pt(e,t,n){for(n=n.child;n!==null;)Md(e,t,n),n=n.sibling}function Md(e,t,n){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(Ws,n)}catch{}switch(n.tag){case 5:ue||yn(n,t);case 6:var r=se,s=Fe;se=null,pt(e,t,n),se=r,Fe=s,se!==null&&(Fe?(e=se,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):se.removeChild(n.stateNode));break;case 18:se!==null&&(Fe?(e=se,n=n.stateNode,e.nodeType===8?bi(e.parentNode,n):e.nodeType===1&&bi(e,n),mr(e)):bi(se,n.stateNode));break;case 4:r=se,s=Fe,se=n.stateNode.containerInfo,Fe=!0,pt(e,t,n),se=r,Fe=s;break;case 0:case 11:case 14:case 15:if(!ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var a=s,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&ba(n,t,l),s=s.next}while(s!==r)}pt(e,t,n);break;case 1:if(!ue&&(yn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Y(n,t,c)}pt(e,t,n);break;case 21:pt(e,t,n);break;case 22:n.mode&1?(ue=(r=ue)||n.memoizedState!==null,pt(e,t,n),ue=r):pt(e,t,n);break;default:pt(e,t,n)}}function fc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mp),t.forEach(function(r){var s=Qp.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ze(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var a=e,l=t,c=l;e:for(;c!==null;){switch(c.tag){case 5:se=c.stateNode,Fe=!1;break e;case 3:se=c.stateNode.containerInfo,Fe=!0;break e;case 4:se=c.stateNode.containerInfo,Fe=!0;break e}c=c.return}if(se===null)throw Error(w(160));Md(a,l,s),se=null,Fe=!1;var o=s.alternate;o!==null&&(o.return=null),s.return=null}catch(u){Y(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zd(t,e),t=t.sibling}function zd(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ze(t,e),He(e),r&4){try{lr(3,e,e.return),Zs(3,e)}catch(k){Y(e,e.return,k)}try{lr(5,e,e.return)}catch(k){Y(e,e.return,k)}}break;case 1:ze(t,e),He(e),r&512&&n!==null&&yn(n,n.return);break;case 5:if(ze(t,e),He(e),r&512&&n!==null&&yn(n,n.return),e.flags&32){var s=e.stateNode;try{dr(s,"")}catch(k){Y(e,e.return,k)}}if(r&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,l=n!==null?n.memoizedProps:a,c=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{c==="input"&&a.type==="radio"&&a.name!=null&&iu(s,a),ea(c,l);var u=ea(c,a);for(l=0;l<o.length;l+=2){var h=o[l],d=o[l+1];h==="style"?uu(s,d):h==="dangerouslySetInnerHTML"?ou(s,d):h==="children"?dr(s,d):Xa(s,h,d,u)}switch(c){case"input":Yi(s,a);break;case"textarea":au(s,a);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var g=a.value;g!=null?xn(s,!!a.multiple,g,!1):f!==!!a.multiple&&(a.defaultValue!=null?xn(s,!!a.multiple,a.defaultValue,!0):xn(s,!!a.multiple,a.multiple?[]:"",!1))}s[jr]=a}catch(k){Y(e,e.return,k)}}break;case 6:if(ze(t,e),He(e),r&4){if(e.stateNode===null)throw Error(w(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(k){Y(e,e.return,k)}}break;case 3:if(ze(t,e),He(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{mr(t.containerInfo)}catch(k){Y(e,e.return,k)}break;case 4:ze(t,e),He(e);break;case 13:ze(t,e),He(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(Tl=X())),r&4&&fc(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(ue=(u=ue)||h,ze(t,e),ue=u):ze(t,e),He(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(E=e,h=e.child;h!==null;){for(d=E=h;E!==null;){switch(f=E,g=f.child,f.tag){case 0:case 11:case 14:case 15:lr(4,f,f.return);break;case 1:yn(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(k){Y(r,n,k)}}break;case 5:yn(f,f.return);break;case 22:if(f.memoizedState!==null){mc(d);continue}}g!==null?(g.return=f,E=g):mc(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{s=d.stateNode,u?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(c=d.stateNode,o=d.memoizedProps.style,l=o!=null&&o.hasOwnProperty("display")?o.display:null,c.style.display=cu("display",l))}catch(k){Y(e,e.return,k)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(k){Y(e,e.return,k)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ze(t,e),He(e),r&4&&fc(e);break;case 21:break;default:ze(t,e),He(e)}}function He(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ad(n)){var r=n;break e}n=n.return}throw Error(w(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(dr(s,""),r.flags&=-33);var a=hc(e);Ta(e,a,s);break;case 3:case 4:var l=r.stateNode.containerInfo,c=hc(e);Pa(e,c,l);break;default:throw Error(w(161))}}catch(o){Y(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $p(e,t,n){E=e,$d(e)}function $d(e,t,n){for(var r=(e.mode&1)!==0;E!==null;){var s=E,a=s.child;if(s.tag===22&&r){var l=s.memoizedState!==null||Gr;if(!l){var c=s.alternate,o=c!==null&&c.memoizedState!==null||ue;c=Gr;var u=ue;if(Gr=l,(ue=o)&&!u)for(E=s;E!==null;)l=E,o=l.child,l.tag===22&&l.memoizedState!==null?vc(s):o!==null?(o.return=l,E=o):vc(s);for(;a!==null;)E=a,$d(a),a=a.sibling;E=s,Gr=c,ue=u}pc(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,E=a):pc(e)}}function pc(e){for(;E!==null;){var t=E;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ue||Zs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ue)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:$e(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Jo(t,a,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Jo(t,l,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&n.focus();break;case"img":o.src&&(n.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var h=u.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&mr(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(w(163))}ue||t.flags&512&&Ea(t)}catch(f){Y(t,t.return,f)}}if(t===e){E=null;break}if(n=t.sibling,n!==null){n.return=t.return,E=n;break}E=t.return}}function mc(e){for(;E!==null;){var t=E;if(t===e){E=null;break}var n=t.sibling;if(n!==null){n.return=t.return,E=n;break}E=t.return}}function vc(e){for(;E!==null;){var t=E;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zs(4,t)}catch(o){Y(t,n,o)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(o){Y(t,s,o)}}var a=t.return;try{Ea(t)}catch(o){Y(t,a,o)}break;case 5:var l=t.return;try{Ea(t)}catch(o){Y(t,l,o)}}}catch(o){Y(t,t.return,o)}if(t===e){E=null;break}var c=t.sibling;if(c!==null){c.return=t.return,E=c;break}E=t.return}}var Fp=Math.ceil,Ms=ut.ReactCurrentDispatcher,El=ut.ReactCurrentOwner,Oe=ut.ReactCurrentBatchConfig,z=0,re=null,J=null,ie=0,Se=0,gn=Mt(0),te=0,_r=null,Jt=0,ei=0,Pl=0,or=null,ye=null,Tl=0,Ln=1/0,tt=null,zs=!1,La=null,Et=null,Xr=!1,kt=null,$s=0,cr=0,Ra=null,us=-1,ds=0;function fe(){return z&6?X():us!==-1?us:us=X()}function Pt(e){return e.mode&1?z&2&&ie!==0?ie&-ie:wp.transition!==null?(ds===0&&(ds=wu()),ds):(e=$,e!==0||(e=window.event,e=e===void 0?16:Pu(e.type)),e):1}function Ue(e,t,n,r){if(50<cr)throw cr=0,Ra=null,Error(w(185));Tr(e,n,r),(!(z&2)||e!==re)&&(e===re&&(!(z&2)&&(ei|=n),te===4&&xt(e,ie)),ke(e,r),n===1&&z===0&&!(t.mode&1)&&(Ln=X()+500,Gs&&zt()))}function ke(e,t){var n=e.callbackNode;wf(e,t);var r=ks(e,e===re?ie:0);if(r===0)n!==null&&Co(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Co(n),t===1)e.tag===0?kp(yc.bind(null,e)):Ku(yc.bind(null,e)),yp(function(){!(z&6)&&zt()}),n=null;else{switch(Su(r)){case 1:n=nl;break;case 4:n=ju;break;case 16:n=js;break;case 536870912:n=ku;break;default:n=js}n=Qd(n,Fd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Fd(e,t){if(us=-1,ds=0,z&6)throw Error(w(327));var n=e.callbackNode;if(Nn()&&e.callbackNode!==n)return null;var r=ks(e,e===re?ie:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Fs(e,r);else{t=r;var s=z;z|=2;var a=qd();(re!==e||ie!==t)&&(tt=null,Ln=X()+500,Ht(e,t));do try{Ip();break}catch(c){Bd(e,c)}while(!0);ml(),Ms.current=a,z=s,J!==null?t=0:(re=null,ie=0,t=te)}if(t!==0){if(t===2&&(s=ia(e),s!==0&&(r=s,t=Da(e,s))),t===1)throw n=_r,Ht(e,0),xt(e,r),ke(e,X()),n;if(t===6)xt(e,r);else{if(s=e.current.alternate,!(r&30)&&!Bp(s)&&(t=Fs(e,r),t===2&&(a=ia(e),a!==0&&(r=a,t=Da(e,a))),t===1))throw n=_r,Ht(e,0),xt(e,r),ke(e,X()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(w(345));case 2:Ut(e,ye,tt);break;case 3:if(xt(e,r),(r&130023424)===r&&(t=Tl+500-X(),10<t)){if(ks(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){fe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=fa(Ut.bind(null,e,ye,tt),t);break}Ut(e,ye,tt);break;case 4:if(xt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var l=31-Ie(r);a=1<<l,l=t[l],l>s&&(s=l),r&=~a}if(r=s,r=X()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Fp(r/1960))-r,10<r){e.timeoutHandle=fa(Ut.bind(null,e,ye,tt),r);break}Ut(e,ye,tt);break;case 5:Ut(e,ye,tt);break;default:throw Error(w(329))}}}return ke(e,X()),e.callbackNode===n?Fd.bind(null,e):null}function Da(e,t){var n=or;return e.current.memoizedState.isDehydrated&&(Ht(e,t).flags|=256),e=Fs(e,t),e!==2&&(t=ye,ye=n,t!==null&&Oa(t)),e}function Oa(e){ye===null?ye=e:ye.push.apply(ye,e)}function Bp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],a=s.getSnapshot;s=s.value;try{if(!Ve(a(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xt(e,t){for(t&=~Pl,t&=~ei,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ie(t),r=1<<n;e[n]=-1,t&=~r}}function yc(e){if(z&6)throw Error(w(327));Nn();var t=ks(e,0);if(!(t&1))return ke(e,X()),null;var n=Fs(e,t);if(e.tag!==0&&n===2){var r=ia(e);r!==0&&(t=r,n=Da(e,r))}if(n===1)throw n=_r,Ht(e,0),xt(e,t),ke(e,X()),n;if(n===6)throw Error(w(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ut(e,ye,tt),ke(e,X()),null}function Ll(e,t){var n=z;z|=1;try{return e(t)}finally{z=n,z===0&&(Ln=X()+500,Gs&&zt())}}function Zt(e){kt!==null&&kt.tag===0&&!(z&6)&&Nn();var t=z;z|=1;var n=Oe.transition,r=$;try{if(Oe.transition=null,$=1,e)return e()}finally{$=r,Oe.transition=n,z=t,!(z&6)&&zt()}}function Rl(){Se=gn.current,I(gn)}function Ht(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,vp(n)),J!==null)for(n=J.return;n!==null;){var r=n;switch(hl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_s();break;case 3:Pn(),I(xe),I(de),kl();break;case 5:jl(r);break;case 4:Pn();break;case 13:I(W);break;case 19:I(W);break;case 10:vl(r.type._context);break;case 22:case 23:Rl()}n=n.return}if(re=e,J=e=Tt(e.current,null),ie=Se=t,te=0,_r=null,Pl=ei=Jt=0,ye=or=null,Wt!==null){for(t=0;t<Wt.length;t++)if(n=Wt[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,a=n.pending;if(a!==null){var l=a.next;a.next=s,r.next=l}n.pending=r}Wt=null}return e}function Bd(e,t){do{var n=J;try{if(ml(),ls.current=As,Os){for(var r=Q.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Os=!1}if(Xt=0,ne=ee=Q=null,ar=!1,Sr=0,El.current=null,n===null||n.return===null){te=1,_r=t,J=null;break}e:{var a=e,l=n.return,c=n,o=t;if(t=ie,c.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var u=o,h=c,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var g=sc(l);if(g!==null){g.flags&=-257,ic(g,l,c,a,t),g.mode&1&&rc(a,u,t),t=g,o=u;var x=t.updateQueue;if(x===null){var k=new Set;k.add(o),t.updateQueue=k}else x.add(o);break e}else{if(!(t&1)){rc(a,u,t),Dl();break e}o=Error(w(426))}}else if(V&&c.mode&1){var N=sc(l);if(N!==null){!(N.flags&65536)&&(N.flags|=256),ic(N,l,c,a,t),fl(Tn(o,c));break e}}a=o=Tn(o,c),te!==4&&(te=2),or===null?or=[a]:or.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=Sd(a,o,t);Xo(a,y);break e;case 1:c=o;var v=a.type,p=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Et===null||!Et.has(p)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=Nd(a,c,t);Xo(a,j);break e}}a=a.return}while(a!==null)}Ud(n)}catch(S){t=S,J===n&&n!==null&&(J=n=n.return);continue}break}while(!0)}function qd(){var e=Ms.current;return Ms.current=As,e===null?As:e}function Dl(){(te===0||te===3||te===2)&&(te=4),re===null||!(Jt&268435455)&&!(ei&268435455)||xt(re,ie)}function Fs(e,t){var n=z;z|=2;var r=qd();(re!==e||ie!==t)&&(tt=null,Ht(e,t));do try{qp();break}catch(s){Bd(e,s)}while(!0);if(ml(),z=n,Ms.current=r,J!==null)throw Error(w(261));return re=null,ie=0,te}function qp(){for(;J!==null;)Id(J)}function Ip(){for(;J!==null&&!ff();)Id(J)}function Id(e){var t=Wd(e.alternate,e,Se);e.memoizedProps=e.pendingProps,t===null?Ud(e):J=t,El.current=null}function Ud(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Ap(n,t),n!==null){n.flags&=32767,J=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{te=6,J=null;return}}else if(n=Op(n,t,Se),n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);te===0&&(te=5)}function Ut(e,t,n){var r=$,s=Oe.transition;try{Oe.transition=null,$=1,Up(e,t,n,r)}finally{Oe.transition=s,$=r}return null}function Up(e,t,n,r){do Nn();while(kt!==null);if(z&6)throw Error(w(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(w(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(Sf(e,a),e===re&&(J=re=null,ie=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xr||(Xr=!0,Qd(js,function(){return Nn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Oe.transition,Oe.transition=null;var l=$;$=1;var c=z;z|=4,El.current=null,zp(e,n),zd(n,e),cp(da),ws=!!ua,da=ua=null,e.current=n,$p(n),pf(),z=c,$=l,Oe.transition=a}else e.current=n;if(Xr&&(Xr=!1,kt=e,$s=s),a=e.pendingLanes,a===0&&(Et=null),yf(n.stateNode),ke(e,X()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(zs)throw zs=!1,e=La,La=null,e;return $s&1&&e.tag!==0&&Nn(),a=e.pendingLanes,a&1?e===Ra?cr++:(cr=0,Ra=e):cr=0,zt(),null}function Nn(){if(kt!==null){var e=Su($s),t=Oe.transition,n=$;try{if(Oe.transition=null,$=16>e?16:e,kt===null)var r=!1;else{if(e=kt,kt=null,$s=0,z&6)throw Error(w(331));var s=z;for(z|=4,E=e.current;E!==null;){var a=E,l=a.child;if(E.flags&16){var c=a.deletions;if(c!==null){for(var o=0;o<c.length;o++){var u=c[o];for(E=u;E!==null;){var h=E;switch(h.tag){case 0:case 11:case 15:lr(8,h,a)}var d=h.child;if(d!==null)d.return=h,E=d;else for(;E!==null;){h=E;var f=h.sibling,g=h.return;if(Od(h),h===u){E=null;break}if(f!==null){f.return=g,E=f;break}E=g}}}var x=a.alternate;if(x!==null){var k=x.child;if(k!==null){x.child=null;do{var N=k.sibling;k.sibling=null,k=N}while(k!==null)}}E=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,E=l;else e:for(;E!==null;){if(a=E,a.flags&2048)switch(a.tag){case 0:case 11:case 15:lr(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,E=y;break e}E=a.return}}var v=e.current;for(E=v;E!==null;){l=E;var p=l.child;if(l.subtreeFlags&2064&&p!==null)p.return=l,E=p;else e:for(l=v;E!==null;){if(c=E,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Zs(9,c)}}catch(S){Y(c,c.return,S)}if(c===l){E=null;break e}var j=c.sibling;if(j!==null){j.return=c.return,E=j;break e}E=c.return}}if(z=s,zt(),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(Ws,e)}catch{}r=!0}return r}finally{$=n,Oe.transition=t}}return!1}function gc(e,t,n){t=Tn(n,t),t=Sd(e,t,1),e=bt(e,t,1),t=fe(),e!==null&&(Tr(e,1,t),ke(e,t))}function Y(e,t,n){if(e.tag===3)gc(e,e,n);else for(;t!==null;){if(t.tag===3){gc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Et===null||!Et.has(r))){e=Tn(n,e),e=Nd(t,e,1),t=bt(t,e,1),e=fe(),t!==null&&(Tr(t,1,e),ke(t,e));break}}t=t.return}}function Vp(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=fe(),e.pingedLanes|=e.suspendedLanes&n,re===e&&(ie&n)===n&&(te===4||te===3&&(ie&130023424)===ie&&500>X()-Tl?Ht(e,0):Pl|=n),ke(e,t)}function Vd(e,t){t===0&&(e.mode&1?(t=qr,qr<<=1,!(qr&130023424)&&(qr=4194304)):t=1);var n=fe();e=ot(e,t),e!==null&&(Tr(e,t,n),ke(e,n))}function Wp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Vd(e,n)}function Qp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(w(314))}r!==null&&r.delete(t),Vd(e,n)}var Wd;Wd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||xe.current)ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ge=!1,Dp(e,t,n);ge=!!(e.flags&131072)}else ge=!1,V&&t.flags&1048576&&Yu(t,Ps,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cs(e,t),e=t.pendingProps;var s=_n(t,de.current);Sn(t,n),s=Sl(null,t,r,e,s,n);var a=Nl();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,je(r)?(a=!0,bs(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,gl(t),s.updater=Js,t.stateNode=s,s._reactInternals=t,ja(t,r,e,n),t=Sa(null,t,r,!0,a,n)):(t.tag=0,V&&a&&dl(t),he(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cs(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Kp(r),e=$e(r,e),s){case 0:t=wa(null,t,r,e,n);break e;case 1:t=oc(null,t,r,e,n);break e;case 11:t=ac(null,t,r,e,n);break e;case 14:t=lc(null,t,r,$e(r.type,e),n);break e}throw Error(w(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$e(r,s),wa(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$e(r,s),oc(e,t,r,s,n);case 3:e:{if(Ed(t),e===null)throw Error(w(387));r=t.pendingProps,a=t.memoizedState,s=a.element,td(e,t),Rs(t,r,null,n);var l=t.memoizedState;if(r=l.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=Tn(Error(w(423)),t),t=cc(e,t,r,n,s);break e}else if(r!==s){s=Tn(Error(w(424)),t),t=cc(e,t,r,n,s);break e}else for(Ne=_t(t.stateNode.containerInfo.firstChild),Ce=t,V=!0,qe=null,n=Zu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bn(),r===s){t=ct(e,t,n);break e}he(e,t,r,n)}t=t.child}return t;case 5:return nd(t),e===null&&ya(t),r=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,l=s.children,ha(r,s)?l=null:a!==null&&ha(r,a)&&(t.flags|=32),bd(e,t),he(e,t,l,n),t.child;case 6:return e===null&&ya(t),null;case 13:return Pd(e,t,n);case 4:return xl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=En(t,null,r,n):he(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$e(r,s),ac(e,t,r,s,n);case 7:return he(e,t,t.pendingProps,n),t.child;case 8:return he(e,t,t.pendingProps.children,n),t.child;case 12:return he(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,a=t.memoizedProps,l=s.value,B(Ts,r._currentValue),r._currentValue=l,a!==null)if(Ve(a.value,l)){if(a.children===s.children&&!xe.current){t=ct(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var c=a.dependencies;if(c!==null){l=a.child;for(var o=c.firstContext;o!==null;){if(o.context===r){if(a.tag===1){o=it(-1,n&-n),o.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?o.next=o:(o.next=h.next,h.next=o),u.pending=o}}a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),ga(a.return,n,t),c.lanes|=n;break}o=o.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(w(341));l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),ga(l,n,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}he(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Sn(t,n),s=Ae(s),r=r(s),t.flags|=1,he(e,t,r,n),t.child;case 14:return r=t.type,s=$e(r,t.pendingProps),s=$e(r.type,s),lc(e,t,r,s,n);case 15:return Cd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:$e(r,s),cs(e,t),t.tag=1,je(r)?(e=!0,bs(t)):e=!1,Sn(t,n),wd(t,r,s),ja(t,r,s,n),Sa(null,t,r,!0,e,n);case 19:return Td(e,t,n);case 22:return _d(e,t,n)}throw Error(w(156,t.tag))};function Qd(e,t){return xu(e,t)}function Hp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function De(e,t,n,r){return new Hp(e,t,n,r)}function Ol(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kp(e){if(typeof e=="function")return Ol(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Za)return 11;if(e===el)return 14}return 2}function Tt(e,t){var n=e.alternate;return n===null?(n=De(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function hs(e,t,n,r,s,a){var l=2;if(r=e,typeof e=="function")Ol(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case on:return Kt(n.children,s,a,t);case Ja:l=8,s|=8;break;case Vi:return e=De(12,n,t,s|2),e.elementType=Vi,e.lanes=a,e;case Wi:return e=De(13,n,t,s),e.elementType=Wi,e.lanes=a,e;case Qi:return e=De(19,n,t,s),e.elementType=Qi,e.lanes=a,e;case nu:return ti(n,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case eu:l=10;break e;case tu:l=9;break e;case Za:l=11;break e;case el:l=14;break e;case vt:l=16,r=null;break e}throw Error(w(130,e==null?e:typeof e,""))}return t=De(l,n,t,s),t.elementType=e,t.type=r,t.lanes=a,t}function Kt(e,t,n,r){return e=De(7,e,r,t),e.lanes=n,e}function ti(e,t,n,r){return e=De(22,e,r,t),e.elementType=nu,e.lanes=n,e.stateNode={isHidden:!1},e}function Ai(e,t,n){return e=De(6,e,null,t),e.lanes=n,e}function Mi(e,t,n){return t=De(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Yp(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vi(0),this.expirationTimes=vi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vi(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Al(e,t,n,r,s,a,l,c,o){return e=new Yp(e,t,n,c,o),t===1?(t=1,a===!0&&(t|=8)):t=0,a=De(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gl(a),e}function Gp(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ln,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Hd(e){if(!e)return Ot;e=e._reactInternals;e:{if(tn(e)!==e||e.tag!==1)throw Error(w(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(w(171))}if(e.tag===1){var n=e.type;if(je(n))return Hu(e,n,t)}return t}function Kd(e,t,n,r,s,a,l,c,o){return e=Al(n,r,!0,e,s,a,l,c,o),e.context=Hd(null),n=e.current,r=fe(),s=Pt(n),a=it(r,s),a.callback=t??null,bt(n,a,s),e.current.lanes=s,Tr(e,s,r),ke(e,r),e}function ni(e,t,n,r){var s=t.current,a=fe(),l=Pt(s);return n=Hd(n),t.context===null?t.context=n:t.pendingContext=n,t=it(a,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=bt(s,t,l),e!==null&&(Ue(e,s,l,a),as(e,s,l)),l}function Bs(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ml(e,t){xc(e,t),(e=e.alternate)&&xc(e,t)}function Xp(){return null}var Yd=typeof reportError=="function"?reportError:function(e){console.error(e)};function zl(e){this._internalRoot=e}ri.prototype.render=zl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(w(409));ni(e,t,null,null)};ri.prototype.unmount=zl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zt(function(){ni(null,e,null,null)}),t[lt]=null}};function ri(e){this._internalRoot=e}ri.prototype.unstable_scheduleHydration=function(e){if(e){var t=_u();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gt.length&&t!==0&&t<gt[n].priority;n++);gt.splice(n,0,e),n===0&&Eu(e)}};function $l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function si(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function jc(){}function Jp(e,t,n,r,s){if(s){if(typeof r=="function"){var a=r;r=function(){var u=Bs(l);a.call(u)}}var l=Kd(t,r,e,0,null,!1,!1,"",jc);return e._reactRootContainer=l,e[lt]=l.current,gr(e.nodeType===8?e.parentNode:e),Zt(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var c=r;r=function(){var u=Bs(o);c.call(u)}}var o=Al(e,0,!1,null,null,!1,!1,"",jc);return e._reactRootContainer=o,e[lt]=o.current,gr(e.nodeType===8?e.parentNode:e),Zt(function(){ni(t,o,n,r)}),o}function ii(e,t,n,r,s){var a=n._reactRootContainer;if(a){var l=a;if(typeof s=="function"){var c=s;s=function(){var o=Bs(l);c.call(o)}}ni(t,l,e,s)}else l=Jp(n,t,e,s,r);return Bs(l)}Nu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Jn(t.pendingLanes);n!==0&&(rl(t,n|1),ke(t,X()),!(z&6)&&(Ln=X()+500,zt()))}break;case 13:Zt(function(){var r=ot(e,1);if(r!==null){var s=fe();Ue(r,e,1,s)}}),Ml(e,1)}};sl=function(e){if(e.tag===13){var t=ot(e,134217728);if(t!==null){var n=fe();Ue(t,e,134217728,n)}Ml(e,134217728)}};Cu=function(e){if(e.tag===13){var t=Pt(e),n=ot(e,t);if(n!==null){var r=fe();Ue(n,e,t,r)}Ml(e,t)}};_u=function(){return $};bu=function(e,t){var n=$;try{return $=e,t()}finally{$=n}};na=function(e,t,n){switch(t){case"input":if(Yi(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Ys(r);if(!s)throw Error(w(90));su(r),Yi(r,s)}}}break;case"textarea":au(e,n);break;case"select":t=n.value,t!=null&&xn(e,!!n.multiple,t,!1)}};fu=Ll;pu=Zt;var Zp={usingClientEntryPoint:!1,Events:[Rr,hn,Ys,du,hu,Ll]},Kn={findFiberByHostInstance:Vt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},em={bundleType:Kn.bundleType,version:Kn.version,rendererPackageName:Kn.rendererPackageName,rendererConfig:Kn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ut.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yu(e),e===null?null:e.stateNode},findFiberByHostInstance:Kn.findFiberByHostInstance||Xp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jr.isDisabled&&Jr.supportsFiber)try{Ws=Jr.inject(em),Ge=Jr}catch{}}be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zp;be.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$l(t))throw Error(w(200));return Gp(e,t,null,n)};be.createRoot=function(e,t){if(!$l(e))throw Error(w(299));var n=!1,r="",s=Yd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Al(e,1,!1,null,null,n,!1,r,s),e[lt]=t.current,gr(e.nodeType===8?e.parentNode:e),new zl(t)};be.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(w(188)):(e=Object.keys(e).join(","),Error(w(268,e)));return e=yu(t),e=e===null?null:e.stateNode,e};be.flushSync=function(e){return Zt(e)};be.hydrate=function(e,t,n){if(!si(t))throw Error(w(200));return ii(null,e,t,!0,n)};be.hydrateRoot=function(e,t,n){if(!$l(e))throw Error(w(405));var r=n!=null&&n.hydratedSources||null,s=!1,a="",l=Yd;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=Kd(t,null,e,1,n??null,s,!1,a,l),e[lt]=t.current,gr(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new ri(t)};be.render=function(e,t,n){if(!si(t))throw Error(w(200));return ii(null,e,t,!1,n)};be.unmountComponentAtNode=function(e){if(!si(e))throw Error(w(40));return e._reactRootContainer?(Zt(function(){ii(null,null,e,!1,function(){e._reactRootContainer=null,e[lt]=null})}),!0):!1};be.unstable_batchedUpdates=Ll;be.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!si(n))throw Error(w(200));if(e==null||e._reactInternals===void 0)throw Error(w(38));return ii(e,t,n,!1,r)};be.version="18.3.1-next-f1338f8080-20240426";function Gd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gd)}catch(e){console.error(e)}}Gd(),Gc.exports=be;var tm=Gc.exports,kc=tm;Ii.createRoot=kc.createRoot,Ii.hydrateRoot=kc.hydrateRoot;/**
- * @remix-run/router v1.23.2
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},br.apply(this,arguments)}var wt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(wt||(wt={}));const wc="popstate";function nm(e){e===void 0&&(e={});function t(r,s){let{pathname:a,search:l,hash:c}=r.location;return Aa("",{pathname:a,search:l,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:qs(s)}return sm(t,n,null,e)}function H(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fl(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rm(){return Math.random().toString(36).substr(2,8)}function Sc(e,t){return{usr:e.state,key:e.key,idx:t}}function Aa(e,t,n,r){return n===void 0&&(n=null),br({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Mn(t):t,{state:n,key:t&&t.key||r||rm()})}function qs(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Mn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function sm(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,l=s.history,c=wt.Pop,o=null,u=h();u==null&&(u=0,l.replaceState(br({},l.state,{idx:u}),""));function h(){return(l.state||{idx:null}).idx}function d(){c=wt.Pop;let N=h(),y=N==null?null:N-u;u=N,o&&o({action:c,location:k.location,delta:y})}function f(N,y){c=wt.Push;let v=Aa(k.location,N,y);u=h()+1;let p=Sc(v,u),j=k.createHref(v);try{l.pushState(p,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(j)}a&&o&&o({action:c,location:k.location,delta:1})}function g(N,y){c=wt.Replace;let v=Aa(k.location,N,y);u=h();let p=Sc(v,u),j=k.createHref(v);l.replaceState(p,"",j),a&&o&&o({action:c,location:k.location,delta:0})}function x(N){let y=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof N=="string"?N:qs(N);return v=v.replace(/ $/,"%20"),H(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let k={get action(){return c},get location(){return e(s,l)},listen(N){if(o)throw new Error("A history only accepts one active listener");return s.addEventListener(wc,d),o=N,()=>{s.removeEventListener(wc,d),o=null}},createHref(N){return t(s,N)},createURL:x,encodeLocation(N){let y=x(N);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:g,go(N){return l.go(N)}};return k}var Nc;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Nc||(Nc={}));function im(e,t,n){return n===void 0&&(n="/"),am(e,t,n)}function am(e,t,n,r){let s=typeof t=="string"?Mn(t):t,a=Rn(s.pathname||"/",n);if(a==null)return null;let l=Xd(e);lm(l);let c=null;for(let o=0;c==null&&o<l.length;++o){let u=gm(a);c=vm(l[o],u)}return c}function Xd(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(a,l,c)=>{let o={relativePath:c===void 0?a.path||"":c,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};o.relativePath.startsWith("/")&&(H(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),o.relativePath=o.relativePath.slice(r.length));let u=Lt([r,o.relativePath]),h=n.concat(o);a.children&&a.children.length>0&&(H(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Xd(a.children,t,h,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:pm(u,a.index),routesMeta:h})};return e.forEach((a,l)=>{var c;if(a.path===""||!((c=a.path)!=null&&c.includes("?")))s(a,l);else for(let o of Jd(a.path))s(a,l,o)}),t}function Jd(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let l=Jd(r.join("/")),c=[];return c.push(...l.map(o=>o===""?a:[a,o].join("/"))),s&&c.push(...l),c.map(o=>e.startsWith("/")&&o===""?"/":o)}function lm(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mm(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const om=/^:[\w-]+$/,cm=3,um=2,dm=1,hm=10,fm=-2,Cc=e=>e==="*";function pm(e,t){let n=e.split("/"),r=n.length;return n.some(Cc)&&(r+=fm),t&&(r+=um),n.filter(s=>!Cc(s)).reduce((s,a)=>s+(om.test(a)?cm:a===""?dm:hm),r)}function mm(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function vm(e,t,n){let{routesMeta:r}=e,s={},a="/",l=[];for(let c=0;c<r.length;++c){let o=r[c],u=c===r.length-1,h=a==="/"?t:t.slice(a.length)||"/",d=Ma({path:o.relativePath,caseSensitive:o.caseSensitive,end:u},h),f=o.route;if(!d)return null;Object.assign(s,d.params),l.push({params:s,pathname:Lt([a,d.pathname]),pathnameBase:Sm(Lt([a,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(a=Lt([a,d.pathnameBase]))}return l}function Ma(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ym(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],l=a.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:r.reduce((u,h,d)=>{let{paramName:f,isOptional:g}=h;if(f==="*"){let k=c[d]||"";l=a.slice(0,a.length-k.length).replace(/(.)\/+$/,"$1")}const x=c[d];return g&&!x?u[f]=void 0:u[f]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:l,pattern:e}}function ym(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Fl(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,o)=>(r.push({paramName:c,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function gm(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fl(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Rn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const xm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jm=e=>xm.test(e);function km(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Mn(e):e,a;if(n)if(jm(n))a=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),Fl(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?a=_c(n.substring(1),"/"):a=_c(n,t)}else a=t;return{pathname:a,search:Nm(r),hash:Cm(s)}}function _c(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function zi(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function wm(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Bl(e,t){let n=wm(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ql(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Mn(e):(s=br({},e),H(!s.pathname||!s.pathname.includes("?"),zi("?","pathname","search",s)),H(!s.pathname||!s.pathname.includes("#"),zi("#","pathname","hash",s)),H(!s.search||!s.search.includes("#"),zi("#","search","hash",s)));let a=e===""||s.pathname==="",l=a?"/":s.pathname,c;if(l==null)c=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}c=d>=0?t[d]:"/"}let o=km(s,c),u=l&&l!=="/"&&l.endsWith("/"),h=(a||l===".")&&n.endsWith("/");return!o.pathname.endsWith("/")&&(u||h)&&(o.pathname+="/"),o}const Lt=e=>e.join("/").replace(/\/\/+/g,"/"),Sm=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Nm=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Cm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _m(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Zd=["post","put","patch","delete"];new Set(Zd);const bm=["get",...Zd];new Set(bm);/**
- * React Router v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function Er(){return Er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er.apply(this,arguments)}const ai=m.createContext(null),eh=m.createContext(null),dt=m.createContext(null),li=m.createContext(null),et=m.createContext({outlet:null,matches:[],isDataRoute:!1}),th=m.createContext(null);function Em(e,t){let{relative:n}=t===void 0?{}:t;zn()||H(!1);let{basename:r,navigator:s}=m.useContext(dt),{hash:a,pathname:l,search:c}=oi(e,{relative:n}),o=l;return r!=="/"&&(o=l==="/"?r:Lt([r,l])),s.createHref({pathname:o,search:c,hash:a})}function zn(){return m.useContext(li)!=null}function $n(){return zn()||H(!1),m.useContext(li).location}function nh(e){m.useContext(dt).static||m.useLayoutEffect(e)}function $t(){let{isDataRoute:e}=m.useContext(et);return e?Vm():Pm()}function Pm(){zn()||H(!1);let e=m.useContext(ai),{basename:t,future:n,navigator:r}=m.useContext(dt),{matches:s}=m.useContext(et),{pathname:a}=$n(),l=JSON.stringify(Bl(s,n.v7_relativeSplatPath)),c=m.useRef(!1);return nh(()=>{c.current=!0}),m.useCallback(function(u,h){if(h===void 0&&(h={}),!c.current)return;if(typeof u=="number"){r.go(u);return}let d=ql(u,JSON.parse(l),a,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Lt([t,d.pathname])),(h.replace?r.replace:r.push)(d,h.state,h)},[t,r,l,a,e])}const Tm=m.createContext(null);function Lm(e){let t=m.useContext(et).outlet;return t&&m.createElement(Tm.Provider,{value:e},t)}function Rm(){let{matches:e}=m.useContext(et),t=e[e.length-1];return t?t.params:{}}function oi(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(dt),{matches:s}=m.useContext(et),{pathname:a}=$n(),l=JSON.stringify(Bl(s,r.v7_relativeSplatPath));return m.useMemo(()=>ql(e,JSON.parse(l),a,n==="path"),[e,l,a,n])}function Dm(e,t){return Om(e,t)}function Om(e,t,n,r){zn()||H(!1);let{navigator:s}=m.useContext(dt),{matches:a}=m.useContext(et),l=a[a.length-1],c=l?l.params:{};l&&l.pathname;let o=l?l.pathnameBase:"/";l&&l.route;let u=$n(),h;if(t){var d;let N=typeof t=="string"?Mn(t):t;o==="/"||(d=N.pathname)!=null&&d.startsWith(o)||H(!1),h=N}else h=u;let f=h.pathname||"/",g=f;if(o!=="/"){let N=o.replace(/^\//,"").split("/");g="/"+f.replace(/^\//,"").split("/").slice(N.length).join("/")}let x=im(e,{pathname:g}),k=Fm(x&&x.map(N=>Object.assign({},N,{params:Object.assign({},c,N.params),pathname:Lt([o,s.encodeLocation?s.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?o:Lt([o,s.encodeLocation?s.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),a,n,r);return t&&k?m.createElement(li.Provider,{value:{location:Er({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:wt.Pop}},k):k}function Am(){let e=Um(),t=_m(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const Mm=m.createElement(Am,null);class zm extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(et.Provider,{value:this.props.routeContext},m.createElement(th.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $m(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(ai);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(et.Provider,{value:t},r)}function Fm(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,c=(s=n)==null?void 0:s.errors;if(c!=null){let h=l.findIndex(d=>d.route.id&&(c==null?void 0:c[d.route.id])!==void 0);h>=0||H(!1),l=l.slice(0,Math.min(l.length,h+1))}let o=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<l.length;h++){let d=l[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=h),d.route.id){let{loaderData:f,errors:g}=n,x=d.route.loader&&f[d.route.id]===void 0&&(!g||g[d.route.id]===void 0);if(d.route.lazy||x){o=!0,u>=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((h,d,f)=>{let g,x=!1,k=null,N=null;n&&(g=c&&d.route.id?c[d.route.id]:void 0,k=d.route.errorElement||Mm,o&&(u<0&&f===0?(Wm("route-fallback"),x=!0,N=null):u===f&&(x=!0,N=d.route.hydrateFallbackElement||null)));let y=t.concat(l.slice(0,f+1)),v=()=>{let p;return g?p=k:x?p=N:d.route.Component?p=m.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=h,m.createElement($m,{match:d,routeContext:{outlet:h,matches:y,isDataRoute:n!=null},children:p})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?m.createElement(zm,{location:n.location,revalidation:n.revalidation,component:k,error:g,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var rh=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rh||{}),sh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(sh||{});function Bm(e){let t=m.useContext(ai);return t||H(!1),t}function qm(e){let t=m.useContext(eh);return t||H(!1),t}function Im(e){let t=m.useContext(et);return t||H(!1),t}function ih(e){let t=Im(),n=t.matches[t.matches.length-1];return n.route.id||H(!1),n.route.id}function Um(){var e;let t=m.useContext(th),n=qm(),r=ih();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Vm(){let{router:e}=Bm(rh.UseNavigateStable),t=ih(sh.UseNavigateStable),n=m.useRef(!1);return nh(()=>{n.current=!0}),m.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Er({fromRouteId:t},a)))},[e,t])}const bc={};function Wm(e,t,n){bc[e]||(bc[e]=!0)}function Qm(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ah(e){let{to:t,replace:n,state:r,relative:s}=e;zn()||H(!1);let{future:a,static:l}=m.useContext(dt),{matches:c}=m.useContext(et),{pathname:o}=$n(),u=$t(),h=ql(t,Bl(c,a.v7_relativeSplatPath),o,s==="path"),d=JSON.stringify(h);return m.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:s}),[u,d,s,n,r]),null}function Hm(e){return Lm(e.context)}function we(e){H(!1)}function Km(e){let{basename:t="/",children:n=null,location:r,navigationType:s=wt.Pop,navigator:a,static:l=!1,future:c}=e;zn()&&H(!1);let o=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:o,navigator:a,static:l,future:Er({v7_relativeSplatPath:!1},c)}),[o,c,a,l]);typeof r=="string"&&(r=Mn(r));let{pathname:h="/",search:d="",hash:f="",state:g=null,key:x="default"}=r,k=m.useMemo(()=>{let N=Rn(h,o);return N==null?null:{location:{pathname:N,search:d,hash:f,state:g,key:x},navigationType:s}},[o,h,d,f,g,x,s]);return k==null?null:m.createElement(dt.Provider,{value:u},m.createElement(li.Provider,{children:n,value:k}))}function Ym(e){let{children:t,location:n}=e;return Dm(za(t),n)}new Promise(()=>{});function za(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let a=[...t,s];if(r.type===m.Fragment){n.push.apply(n,za(r.props.children,a));return}r.type!==we&&H(!1),!r.props.index||!r.props.children||H(!1);let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=za(r.props.children,a)),n.push(l)}),n}/**
- * React Router DOM v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function Is(){return Is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Is.apply(this,arguments)}function lh(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Gm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xm(e,t){return e.button===0&&(!t||t==="_self")&&!Gm(e)}const Jm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Zm=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ev="6";try{window.__reactRouterVersion=ev}catch{}const tv=m.createContext({isTransitioning:!1}),nv="startTransition",Ec=Uh[nv];function rv(e){let{basename:t,children:n,future:r,window:s}=e,a=m.useRef();a.current==null&&(a.current=nm({window:s,v5Compat:!0}));let l=a.current,[c,o]=m.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},h=m.useCallback(d=>{u&&Ec?Ec(()=>o(d)):o(d)},[o,u]);return m.useLayoutEffect(()=>l.listen(h),[l,h]),m.useEffect(()=>Qm(r),[r]),m.createElement(Km,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:l,future:r})}const sv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",iv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Il=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:l,state:c,target:o,to:u,preventScrollReset:h,viewTransition:d}=t,f=lh(t,Jm),{basename:g}=m.useContext(dt),x,k=!1;if(typeof u=="string"&&iv.test(u)&&(x=u,sv))try{let p=new URL(window.location.href),j=u.startsWith("//")?new URL(p.protocol+u):new URL(u),S=Rn(j.pathname,g);j.origin===p.origin&&S!=null?u=S+j.search+j.hash:k=!0}catch{}let N=Em(u,{relative:s}),y=lv(u,{replace:l,state:c,target:o,preventScrollReset:h,relative:s,viewTransition:d});function v(p){r&&r(p),p.defaultPrevented||y(p)}return m.createElement("a",Is({},f,{href:x||N,onClick:k||a?r:v,ref:n,target:o}))}),mt=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:a="",end:l=!1,style:c,to:o,viewTransition:u,children:h}=t,d=lh(t,Zm),f=oi(o,{relative:d.relative}),g=$n(),x=m.useContext(eh),{navigator:k,basename:N}=m.useContext(dt),y=x!=null&&ov(f)&&u===!0,v=k.encodeLocation?k.encodeLocation(f).pathname:f.pathname,p=g.pathname,j=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;s||(p=p.toLowerCase(),j=j?j.toLowerCase():null,v=v.toLowerCase()),j&&N&&(j=Rn(j,N)||j);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let b=p===v||!l&&p.startsWith(v)&&p.charAt(S)==="/",P=j!=null&&(j===v||!l&&j.startsWith(v)&&j.charAt(v.length)==="/"),T={isActive:b,isPending:P,isTransitioning:y},F=b?r:void 0,R;typeof a=="function"?R=a(T):R=[a,b?"active":null,P?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let le=typeof c=="function"?c(T):c;return m.createElement(Il,Is({},d,{"aria-current":F,className:R,ref:n,style:le,to:o,viewTransition:u}),typeof h=="function"?h(T):h)});var $a;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})($a||($a={}));var Pc;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pc||(Pc={}));function av(e){let t=m.useContext(ai);return t||H(!1),t}function lv(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:l,viewTransition:c}=t===void 0?{}:t,o=$t(),u=$n(),h=oi(e,{relative:l});return m.useCallback(d=>{if(Xm(d,n)){d.preventDefault();let f=r!==void 0?r:qs(u)===qs(h);o(e,{replace:f,state:s,preventScrollReset:a,relative:l,viewTransition:c})}},[u,o,h,r,s,n,e,a,l,c])}function ov(e,t){t===void 0&&(t={});let n=m.useContext(tv);n==null&&H(!1);let{basename:r}=av($a.useViewTransitionState),s=oi(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Rn(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Rn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ma(s.pathname,l)!=null||Ma(s.pathname,a)!=null}const cv="http://localhost:5000/api/v1";class uv{constructor(){this.baseUrl=cv}getToken(){return localStorage.getItem("access_token")}setTokens(t,n){localStorage.setItem("access_token",t),localStorage.setItem("refresh_token",n)}clearTokens(){localStorage.removeItem("access_token"),localStorage.removeItem("refresh_token")}async request(t,n={}){const r=`${this.baseUrl}${t}`,s=this.getToken(),a={headers:{"Content-Type":"application/json",...s&&{Authorization:`Bearer ${s}`},...n.headers},...n};n.body&&typeof n.body=="object"&&(a.body=JSON.stringify(n.body));try{const l=await fetch(r,a);if(l.status===401){if(await this.refreshToken()){a.headers.Authorization=`Bearer ${this.getToken()}`;const o=await fetch(r,a);return this.handleResponse(o)}throw this.clearTokens(),window.location.href="/login",new Error("Session expired")}return this.handleResponse(l)}catch(l){throw console.error("API Error:",l),l}}async handleResponse(t){const n=await t.json();if(!t.ok)throw new Error(n.error||"Request failed");return n}async refreshToken(){const t=localStorage.getItem("refresh_token");if(!t)return!1;try{const n=await fetch(`${this.baseUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(n.ok){const r=await n.json();return localStorage.setItem("access_token",r.access_token),!0}return!1}catch{return!1}}async login(t,n){const r=await this.request("/auth/login",{method:"POST",body:{email:t,password:n}});return this.setTokens(r.access_token,r.refresh_token),r}async register(t,n,r){const s=await this.request("/auth/register",{method:"POST",body:{email:t,username:n,password:r}});return this.setTokens(s.access_token,s.refresh_token),s}async logout(){this.clearTokens()}async getCurrentUser(){return this.request("/auth/me")}async getApps(){return this.request("/apps")}async getApp(t){return this.request(`/apps/${t}`)}async createApp(t){return this.request("/apps",{method:"POST",body:t})}async updateApp(t,n){return this.request(`/apps/${t}`,{method:"PUT",body:n})}async deleteApp(t){return this.request(`/apps/${t}`,{method:"DELETE"})}async startApp(t){return this.request(`/apps/${t}/start`,{method:"POST"})}async stopApp(t){return this.request(`/apps/${t}/stop`,{method:"POST"})}async restartApp(t){return this.request(`/apps/${t}/restart`,{method:"POST"})}async getDomains(){return this.request("/domains")}async getDomain(t){return this.request(`/domains/${t}`)}async createDomain(t){return this.request("/domains",{method:"POST",body:t})}async updateDomain(t,n){return this.request(`/domains/${t}`,{method:"PUT",body:n})}async deleteDomain(t){return this.request(`/domains/${t}`,{method:"DELETE"})}async enableSsl(t){return this.request(`/domains/${t}/ssl/enable`,{method:"POST"})}async getSystemMetrics(){return this.request("/system/metrics")}async getProcesses(){return this.request("/system/processes")}async getServices(){return this.request("/system/services")}async healthCheck(){return this.request("/system/health")}async getProcesses(t=50,n="cpu"){return this.request(`/processes?limit=${t}&sort=${n}`)}async getProcess(t){return this.request(`/processes/${t}`)}async killProcess(t,n=!1){return this.request(`/processes/${t}?force=${n}`,{method:"DELETE"})}async getServicesStatus(){return this.request("/processes/services")}async controlService(t,n){return this.request(`/processes/services/${t}`,{method:"POST",body:{action:n}})}async getNginxStatus(){return this.request("/nginx/status")}async testNginxConfig(){return this.request("/nginx/test",{method:"POST"})}async reloadNginx(){return this.request("/nginx/reload",{method:"POST"})}async getNginxSites(){return this.request("/nginx/sites")}async createNginxSite(t){return this.request("/nginx/sites",{method:"POST",body:t})}async enableNginxSite(t){return this.request(`/nginx/sites/${t}/enable`,{method:"POST"})}async disableNginxSite(t){return this.request(`/nginx/sites/${t}/disable`,{method:"POST"})}async deleteNginxSite(t){return this.request(`/nginx/sites/${t}`,{method:"DELETE"})}async getSSLStatus(){return this.request("/ssl/status")}async getCertificates(){return this.request("/ssl/certificates")}async obtainCertificate(t){return this.request("/ssl/certificates",{method:"POST",body:t})}async renewCertificate(t){return this.request(`/ssl/certificates/${t}/renew`,{method:"POST"})}async renewAllCertificates(){return this.request("/ssl/certificates/renew-all",{method:"POST"})}async revokeCertificate(t){return this.request(`/ssl/certificates/${t}`,{method:"DELETE"})}async getLogFiles(){return this.request("/logs")}async readLog(t,n=100){return this.request(`/logs/read?path=${encodeURIComponent(t)}&lines=${n}`)}async searchLog(t,n,r=100){return this.request(`/logs/search?path=${encodeURIComponent(t)}&pattern=${encodeURIComponent(n)}&lines=${r}`)}async getAppLogs(t,n="access",r=100){return this.request(`/logs/app/${t}?type=${n}&lines=${r}`)}async getJournalLogs(t,n=100){const r=new URLSearchParams({lines:n});return t&&r.append("unit",t),this.request(`/logs/journal?${r}`)}async clearLog(t){return this.request("/logs/clear",{method:"POST",body:{path:t}})}async getPHPVersions(){return this.request("/php/versions")}async installPHPVersion(t){return this.request(`/php/versions/${t}/install`,{method:"POST"})}async setDefaultPHPVersion(t){return this.request("/php/versions/default",{method:"POST",body:{version:t}})}async getPHPExtensions(t){return this.request(`/php/versions/${t}/extensions`)}async installPHPExtension(t,n){return this.request(`/php/versions/${t}/extensions`,{method:"POST",body:{extension:n}})}async getPHPPools(t){return this.request(`/php/versions/${t}/pools`)}async createPHPPool(t,n){return this.request(`/php/versions/${t}/pools`,{method:"POST",body:n})}async deletePHPPool(t,n){return this.request(`/php/versions/${t}/pools/${n}`,{method:"DELETE"})}async restartPHPFPM(t){return this.request(`/php/versions/${t}/fpm/restart`,{method:"POST"})}async getPHPFPMStatus(t){return this.request(`/php/versions/${t}/fpm/status`)}async installWordPress(t){return this.request("/wordpress/install",{method:"POST",body:t})}async getWordPressInfo(t){return this.request(`/wordpress/sites/${t}/info`)}async updateWordPress(t){return this.request(`/wordpress/sites/${t}/update`,{method:"POST"})}async getWordPressPlugins(t){return this.request(`/wordpress/sites/${t}/plugins`)}async installWordPressPlugin(t,n,r=!0){return this.request(`/wordpress/sites/${t}/plugins`,{method:"POST",body:{plugin:n,activate:r}})}async uninstallWordPressPlugin(t,n){return this.request(`/wordpress/sites/${t}/plugins/${n}`,{method:"DELETE"})}async activateWordPressPlugin(t,n){return this.request(`/wordpress/sites/${t}/plugins/${n}/activate`,{method:"POST"})}async deactivateWordPressPlugin(t,n){return this.request(`/wordpress/sites/${t}/plugins/${n}/deactivate`,{method:"POST"})}async updateWordPressPlugins(t,n=null){return this.request(`/wordpress/sites/${t}/plugins/update`,{method:"POST",body:n?{plugins:n}:{}})}async getWordPressThemes(t){return this.request(`/wordpress/sites/${t}/themes`)}async installWordPressTheme(t,n,r=!1){return this.request(`/wordpress/sites/${t}/themes`,{method:"POST",body:{theme:n,activate:r}})}async activateWordPressTheme(t,n){return this.request(`/wordpress/sites/${t}/themes/${n}/activate`,{method:"POST"})}async createWordPressBackup(t,n=!0){return this.request(`/wordpress/sites/${t}/backup`,{method:"POST",body:{include_db:n}})}async getWordPressBackups(t){return this.request(`/wordpress/sites/${t}/backups`)}async restoreWordPressBackup(t,n){return this.request(`/wordpress/sites/${t}/restore`,{method:"POST",body:{backup_name:n}})}async deleteWordPressBackup(t){return this.request(`/wordpress/backups/${t}`,{method:"DELETE"})}async hardenWordPress(t){return this.request(`/wordpress/sites/${t}/harden`,{method:"POST"})}async optimizeWordPressDatabase(t){return this.request(`/wordpress/sites/${t}/optimize`,{method:"POST"})}async flushWordPressCache(t){return this.request(`/wordpress/sites/${t}/flush-cache`,{method:"POST"})}async searchReplaceWordPress(t,n,r,s=!0){return this.request(`/wordpress/sites/${t}/search-replace`,{method:"POST",body:{search:n,replace:r,dry_run:s}})}async createWordPressUser(t,n){return this.request(`/wordpress/sites/${t}/users`,{method:"POST",body:n})}async resetWordPressPassword(t,n,r=null){return this.request(`/wordpress/sites/${t}/users/${n}/reset-password`,{method:"POST",body:r?{password:r}:{}})}async getPythonVersions(){return this.request("/python/versions")}async createFlaskApp(t){return this.request("/python/apps/flask",{method:"POST",body:t})}async createDjangoApp(t){return this.request("/python/apps/django",{method:"POST",body:t})}async createPythonVenv(t){return this.request(`/python/apps/${t}/venv`,{method:"POST"})}async getPythonPackages(t){return this.request(`/python/apps/${t}/packages`)}async installPythonPackages(t,n){return this.request(`/python/apps/${t}/packages`,{method:"POST",body:{packages:n}})}async freezePythonRequirements(t){return this.request(`/python/apps/${t}/requirements`,{method:"POST"})}async getPythonEnvVars(t){return this.request(`/python/apps/${t}/env`)}async setPythonEnvVars(t,n){return this.request(`/python/apps/${t}/env`,{method:"PUT",body:{env_vars:n}})}async deletePythonEnvVar(t,n){return this.request(`/python/apps/${t}/env/${n}`,{method:"DELETE"})}async startPythonApp(t){return this.request(`/python/apps/${t}/start`,{method:"POST"})}async stopPythonApp(t){return this.request(`/python/apps/${t}/stop`,{method:"POST"})}async restartPythonApp(t){return this.request(`/python/apps/${t}/restart`,{method:"POST"})}async getPythonAppStatus(t){return this.request(`/python/apps/${t}/status`)}async getGunicornConfig(t){return this.request(`/python/apps/${t}/gunicorn`)}async updateGunicornConfig(t,n){return this.request(`/python/apps/${t}/gunicorn`,{method:"PUT",body:{content:n}})}async runPythonMigrations(t){return this.request(`/python/apps/${t}/migrate`,{method:"POST"})}async collectPythonStatic(t){return this.request(`/python/apps/${t}/collectstatic`,{method:"POST"})}async runPythonCommand(t,n){return this.request(`/python/apps/${t}/run`,{method:"POST",body:{command:n}})}async deletePythonApp(t,n=!1){return this.request(`/python/apps/${t}`,{method:"DELETE",body:{remove_files:n}})}async getDockerStatus(){return this.request("/docker/status")}async getDockerInfo(){return this.request("/docker/info")}async getDockerDiskUsage(){return this.request("/docker/disk-usage")}async getContainers(t=!0){return this.request(`/docker/containers?all=${t}`)}async getContainer(t){return this.request(`/docker/containers/${t}`)}async createContainer(t){return this.request("/docker/containers",{method:"POST",body:t})}async runContainer(t){return this.request("/docker/containers/run",{method:"POST",body:t})}async startContainer(t){return this.request(`/docker/containers/${t}/start`,{method:"POST"})}async stopContainer(t,n=10){return this.request(`/docker/containers/${t}/stop`,{method:"POST",body:{timeout:n}})}async restartContainer(t,n=10){return this.request(`/docker/containers/${t}/restart`,{method:"POST",body:{timeout:n}})}async removeContainer(t,n=!1,r=!1){return this.request(`/docker/containers/${t}`,{method:"DELETE",body:{force:n,volumes:r}})}async getContainerLogs(t,n=100,r=null){const s=new URLSearchParams({tail:n});return r&&s.append("since",r),this.request(`/docker/containers/${t}/logs?${s}`)}async getContainerStats(t){return this.request(`/docker/containers/${t}/stats`)}async execContainer(t,n){return this.request(`/docker/containers/${t}/exec`,{method:"POST",body:{command:n}})}async getImages(){return this.request("/docker/images")}async pullImage(t,n="latest"){return this.request("/docker/images/pull",{method:"POST",body:{image:t,tag:n}})}async removeImage(t,n=!1){return this.request(`/docker/images/${t}`,{method:"DELETE",body:{force:n}})}async buildImage(t,n,r="Dockerfile",s=!1){return this.request("/docker/images/build",{method:"POST",body:{path:t,tag:n,dockerfile:r,no_cache:s}})}async getNetworks(){return this.request("/docker/networks")}async createNetwork(t,n="bridge"){return this.request("/docker/networks",{method:"POST",body:{name:t,driver:n}})}async removeNetwork(t){return this.request(`/docker/networks/${t}`,{method:"DELETE"})}async getVolumes(){return this.request("/docker/volumes")}async createVolume(t,n="local"){return this.request("/docker/volumes",{method:"POST",body:{name:t,driver:n}})}async removeVolume(t,n=!1){return this.request(`/docker/volumes/${t}`,{method:"DELETE",body:{force:n}})}async composeUp(t,n=!0,r=!1){return this.request("/docker/compose/up",{method:"POST",body:{path:t,detach:n,build:r}})}async composeDown(t,n=!1,r=!0){return this.request("/docker/compose/down",{method:"POST",body:{path:t,volumes:n,remove_orphans:r}})}async composePs(t){return this.request("/docker/compose/ps",{method:"POST",body:{path:t}})}async composeLogs(t,n=null,r=100){return this.request("/docker/compose/logs",{method:"POST",body:{path:t,service:n,tail:r}})}async composeRestart(t,n=null){return this.request("/docker/compose/restart",{method:"POST",body:{path:t,service:n}})}async composePull(t,n=null){return this.request("/docker/compose/pull",{method:"POST",body:{path:t,service:n}})}async createDockerApp(t){return this.request("/docker/apps",{method:"POST",body:t})}async pruneDocker(t=!1,n=!1){return this.request("/docker/prune",{method:"POST",body:{all:t,volumes:n}})}async getDatabaseStatus(){return this.request("/databases/status")}async getMySQLDatabases(t=null){const n=t?`?root_password=${encodeURIComponent(t)}`:"";return this.request(`/databases/mysql${n}`)}async createMySQLDatabase(t){return this.request("/databases/mysql",{method:"POST",body:t})}async dropMySQLDatabase(t,n=null){return this.request(`/databases/mysql/${t}`,{method:"DELETE",body:{root_password:n}})}async getMySQLTables(t,n=null){const r=n?`?root_password=${encodeURIComponent(n)}`:"";return this.request(`/databases/mysql/${t}/tables${r}`)}async backupMySQLDatabase(t,n=null){return this.request(`/databases/mysql/${t}/backup`,{method:"POST",body:{root_password:n}})}async restoreMySQLDatabase(t,n,r=null){return this.request(`/databases/mysql/${t}/restore`,{method:"POST",body:{backup_path:n,root_password:r}})}async getMySQLUsers(t=null){const n=t?`?root_password=${encodeURIComponent(t)}`:"";return this.request(`/databases/mysql/users${n}`)}async createMySQLUser(t){return this.request("/databases/mysql/users",{method:"POST",body:t})}async dropMySQLUser(t,n="localhost",r=null){return this.request(`/databases/mysql/users/${t}`,{method:"DELETE",body:{host:n,root_password:r}})}async grantMySQLPrivileges(t,n,r="ALL",s="localhost",a=null){return this.request(`/databases/mysql/users/${t}/grant`,{method:"POST",body:{database:n,privileges:r,host:s,root_password:a}})}async getPostgreSQLDatabases(){return this.request("/databases/postgresql")}async createPostgreSQLDatabase(t){return this.request("/databases/postgresql",{method:"POST",body:t})}async dropPostgreSQLDatabase(t){return this.request(`/databases/postgresql/${t}`,{method:"DELETE"})}async getPostgreSQLTables(t){return this.request(`/databases/postgresql/${t}/tables`)}async backupPostgreSQLDatabase(t){return this.request(`/databases/postgresql/${t}/backup`,{method:"POST"})}async restorePostgreSQLDatabase(t,n){return this.request(`/databases/postgresql/${t}/restore`,{method:"POST",body:{backup_path:n}})}async getPostgreSQLUsers(){return this.request("/databases/postgresql/users")}async createPostgreSQLUser(t){return this.request("/databases/postgresql/users",{method:"POST",body:t})}async dropPostgreSQLUser(t){return this.request(`/databases/postgresql/users/${t}`,{method:"DELETE"})}async grantPostgreSQLPrivileges(t,n,r="ALL"){return this.request(`/databases/postgresql/users/${t}/grant`,{method:"POST",body:{database:n,privileges:r}})}async getDatabaseBackups(t=null){const n=t?`?type=${t}`:"";return this.request(`/databases/backups${n}`)}async deleteDatabaseBackup(t){return this.request(`/databases/backups/${t}`,{method:"DELETE"})}async generateDatabasePassword(t=16){return this.request(`/databases/generate-password?length=${t}`)}}const C=new uv,oh=m.createContext(null);function dv({children:e}){const[t,n]=m.useState(null),[r,s]=m.useState(!0);m.useEffect(()=>{a()},[]);async function a(){if(localStorage.getItem("access_token"))try{const d=await C.getCurrentUser();n(d.user)}catch(d){console.error("Auth check failed:",d),C.clearTokens()}s(!1)}async function l(h,d){const f=await C.login(h,d);return n(f.user),f}async function c(h,d,f){const g=await C.register(h,d,f);return n(g.user),g}function o(){C.logout(),n(null)}const u={user:t,loading:r,login:l,register:c,logout:o,isAuthenticated:!!t,isAdmin:(t==null?void 0:t.role)==="admin"};return i.jsx(oh.Provider,{value:u,children:e})}function Or(){const e=m.useContext(oh);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const hv=()=>{var n;const{user:e,logout:t}=Or();return i.jsxs("aside",{className:"sidebar",children:[i.jsxs("div",{className:"brand",children:[i.jsx("div",{className:"brand-logo",children:i.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",stroke:"currentColor",fill:"none",strokeWidth:"2",children:i.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),"ServerKit"]}),i.jsx("div",{className:"menu-label",children:"Overview"}),i.jsx("nav",{className:"nav",children:i.jsxs(mt,{to:"/",className:({isActive:r})=>`nav-item ${r?"active":""}`,end:!0,children:[i.jsxs("svg",{viewBox:"0 0 24 24",children:[i.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),i.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),i.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),i.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),"Dashboard"]})}),i.jsx("div",{className:"menu-label",children:"Infrastructure"}),i.jsxs("nav",{className:"nav",children:[i.jsxs(mt,{to:"/domains",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[i.jsxs("svg",{viewBox:"0 0 24 24",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),i.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),"Domains & Sites"]}),i.jsxs(mt,{to:"/apps",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[i.jsxs("svg",{viewBox:"0 0 24 24",children:[i.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),i.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),i.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),"Applications"]}),i.jsxs(mt,{to:"/databases",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[i.jsxs("svg",{viewBox:"0 0 24 24",children:[i.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),i.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),i.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]}),"Databases"]}),i.jsxs(mt,{to:"/ssl",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[i.jsxs("svg",{viewBox:"0 0 24 24",children:[i.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),i.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"SSL Certificates"]}),i.jsxs(mt,{to:"/docker",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[i.jsxs("svg",{viewBox:"0 0 24 24",children:[i.jsx("rect",{x:"2",y:"7",width:"6",height:"6",rx:"1"}),i.jsx("rect",{x:"9",y:"7",width:"6",height:"6",rx:"1"}),i.jsx("rect",{x:"16",y:"7",width:"6",height:"6",rx:"1"}),i.jsx("rect",{x:"2",y:"14",width:"6",height:"6",rx:"1"}),i.jsx("rect",{x:"9",y:"14",width:"6",height:"6",rx:"1"})]}),"Docker"]})]}),i.jsx("div",{className:"menu-label",children:"System"}),i.jsxs("nav",{className:"nav",children:[i.jsxs(mt,{to:"/terminal",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[i.jsx("svg",{viewBox:"0 0 24 24",children:i.jsx("path",{d:"M4 17l6-6-6-6M12 19h8"})}),"Terminal / Logs"]}),i.jsxs(mt,{to:"/settings",className:({isActive:r})=>`nav-item ${r?"active":""}`,children:[i.jsxs("svg",{viewBox:"0 0 24 24",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),"Settings"]})]}),i.jsxs("div",{className:"user-profile",children:[i.jsx("div",{className:"avatar",children:((n=e==null?void 0:e.username)==null?void 0:n.charAt(0).toUpperCase())||"U"}),i.jsxs("div",{style:{flex:1,fontSize:"13px"},children:[i.jsx("div",{style:{fontWeight:600},children:(e==null?void 0:e.username)||"User"}),i.jsx("div",{style:{color:"var(--text-tertiary)"},children:(e==null?void 0:e.role)||"user"})]}),i.jsx("button",{onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:"4px"},title:"Logout",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),i.jsx("polyline",{points:"16 17 21 12 16 7"}),i.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})})]})]})},fv=()=>i.jsxs("div",{className:"dashboard-layout",children:[i.jsx(hv,{}),i.jsxs("main",{className:"main-content",children:[i.jsx("div",{className:"header",children:i.jsx("h2",{children:"Dashboard"})}),i.jsx(Hm,{})]})]});/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */var pv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const mv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Pe=(e,t)=>{const n=m.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:c="",children:o,...u},h)=>m.createElement("svg",{ref:h,...pv,width:s,height:s,stroke:r,strokeWidth:l?Number(a)*24/Number(s):a,className:["lucide",`lucide-${mv(e)}`,c].join(" "),...u},[...t.map(([d,f])=>m.createElement(d,f)),...Array.isArray(o)?o:[o]]));return n.displayName=`${e}`,n};/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const vv=Pe("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const yv=Pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const gv=Pe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Tc=Pe("Container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const xv=Pe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const jv=Pe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Lc=Pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const kv=Pe("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const $i=Pe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const wv=Pe("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Rc=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Sv=Pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
- * @license lucide-react v0.363.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */const Nv=Pe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),Ze=Object.create(null);Ze.open="0";Ze.close="1";Ze.ping="2";Ze.pong="3";Ze.message="4";Ze.upgrade="5";Ze.noop="6";const fs=Object.create(null);Object.keys(Ze).forEach(e=>{fs[Ze[e]]=e});const Fa={type:"error",data:"parser error"},ch=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",uh=typeof ArrayBuffer=="function",dh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ul=({type:e,data:t},n,r)=>ch&&t instanceof Blob?n?r(t):Dc(t,r):uh&&(t instanceof ArrayBuffer||dh(t))?n?r(t):Dc(new Blob([t]),r):r(Ze[e]+(t||"")),Dc=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Oc(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Fi;function Cv(e,t){if(ch&&e.data instanceof Blob)return e.data.arrayBuffer().then(Oc).then(t);if(uh&&(e.data instanceof ArrayBuffer||dh(e.data)))return t(Oc(e.data));Ul(e,!1,n=>{Fi||(Fi=new TextEncoder),t(Fi.encode(n))})}const Ac="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",er=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Ac.length;e++)er[Ac.charCodeAt(e)]=e;const _v=e=>{let t=e.length*.75,n=e.length,r,s=0,a,l,c,o;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),h=new Uint8Array(u);for(r=0;r<n;r+=4)a=er[e.charCodeAt(r)],l=er[e.charCodeAt(r+1)],c=er[e.charCodeAt(r+2)],o=er[e.charCodeAt(r+3)],h[s++]=a<<2|l>>4,h[s++]=(l&15)<<4|c>>2,h[s++]=(c&3)<<6|o&63;return u},bv=typeof ArrayBuffer=="function",Vl=(e,t)=>{if(typeof e!="string")return{type:"message",data:hh(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Ev(e.substring(1),t)}:fs[n]?e.length>1?{type:fs[n],data:e.substring(1)}:{type:fs[n]}:Fa},Ev=(e,t)=>{if(bv){const n=_v(e);return hh(n,t)}else return{base64:!0,data:e}},hh=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},fh="",Pv=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,l)=>{Ul(a,!1,c=>{r[l]=c,++s===n&&t(r.join(fh))})})},Tv=(e,t)=>{const n=e.split(fh),r=[];for(let s=0;s<n.length;s++){const a=Vl(n[s],t);if(r.push(a),a.type==="error")break}return r};function Lv(){return new TransformStream({transform(e,t){Cv(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let Bi;function Zr(e){return e.reduce((t,n)=>t+n.length,0)}function es(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function Rv(e,t){Bi||(Bi=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(l,c){for(n.push(l);;){if(r===0){if(Zr(n)<1)break;const o=es(n,1);a=(o[0]&128)===128,s=o[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Zr(n)<2)break;const o=es(n,2);s=new DataView(o.buffer,o.byteOffset,o.length).getUint16(0),r=3}else if(r===2){if(Zr(n)<8)break;const o=es(n,8),u=new DataView(o.buffer,o.byteOffset,o.length),h=u.getUint32(0);if(h>Math.pow(2,21)-1){c.enqueue(Fa);break}s=h*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Zr(n)<s)break;const o=es(n,s);c.enqueue(Vl(a?o:Bi.decode(o),t)),r=0}if(s===0||s>e){c.enqueue(Fa);break}}}})}const ph=4;function Z(e){if(e)return Dv(e)}function Dv(e){for(var t in Z.prototype)e[t]=Z.prototype[t];return e}Z.prototype.on=Z.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Z.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Z.prototype.off=Z.prototype.removeListener=Z.prototype.removeAllListeners=Z.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Z.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Z.prototype.emitReserved=Z.prototype.emit;Z.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Z.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ci=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Re=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ov="arraybuffer";function mh(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Av=Re.setTimeout,Mv=Re.clearTimeout;function ui(e,t){t.useNativeTimers?(e.setTimeoutFn=Av.bind(Re),e.clearTimeoutFn=Mv.bind(Re)):(e.setTimeoutFn=Re.setTimeout.bind(Re),e.clearTimeoutFn=Re.clearTimeout.bind(Re))}const zv=1.33;function $v(e){return typeof e=="string"?Fv(e):Math.ceil((e.byteLength||e.size)*zv)}function Fv(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function vh(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Bv(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function qv(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class Iv extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Wl extends Z{constructor(t){super(),this.writable=!1,ui(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Iv(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Vl(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=Bv(t);return n.length?"?"+n:""}}class Uv extends Wl{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Tv(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Pv(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=vh()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let yh=!1;try{yh=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Vv=yh;function Wv(){}class Qv extends Uv{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Je extends Z{constructor(t,n,r){super(),this.createRequest=t,ui(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=mh(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Je.requestsCount++,Je.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Wv,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Je.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Je.requestsCount=0;Je.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Mc);else if(typeof addEventListener=="function"){const e="onpagehide"in Re?"pagehide":"unload";addEventListener(e,Mc,!1)}}function Mc(){for(let e in Je.requests)Je.requests.hasOwnProperty(e)&&Je.requests[e].abort()}const Hv=function(){const e=gh({xdomain:!1});return e&&e.responseType!==null}();class Kv extends Qv{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Hv&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Je(gh,this.uri(),t)}}function gh(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Vv))return new XMLHttpRequest}catch{}if(!t)try{return new Re[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const xh=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Yv extends Wl{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=xh?{}:mh(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Ul(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}s&&ci(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=vh()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const qi=Re.WebSocket||Re.MozWebSocket;class Gv extends Yv{createSocket(t,n,r){return xh?new qi(t,n,r):n?new qi(t,n):new qi(t)}doWrite(t,n){this.ws.send(n)}}class Xv extends Wl{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Rv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=Lv();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:c,value:o})=>{c||(this.onPacket(o),a())}).catch(c=>{})};a();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&ci(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Jv={websocket:Gv,webtransport:Xv,polling:Kv},Zv=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ey=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ba(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=Zv.exec(e||""),a={},l=14;for(;l--;)a[ey[l]]=s[l]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=ty(a,a.path),a.queryKey=ny(a,a.query),a}function ty(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function ny(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const qa=typeof addEventListener=="function"&&typeof removeEventListener=="function",ps=[];qa&&addEventListener("offline",()=>{ps.forEach(e=>e())},!1);class Rt extends Z{constructor(t,n){if(super(),this.binaryType=Ov,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Ba(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Ba(n.host).host);ui(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=qv(this.opts.query)),qa&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ps.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ph,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Rt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Rt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=$v(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ci(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Rt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),qa&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=ps.indexOf(this._offlineEventListener);r!==-1&&ps.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Rt.protocol=ph;class ry extends Rt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Rt.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Rt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function a(){r||(r=!0,h(),n.close(),n=null)}const l=d=>{const f=new Error("probe error: "+d);f.transport=n.name,a(),this.emitReserved("upgradeError",f)};function c(){l("transport closed")}function o(){l("socket closed")}function u(d){n&&d.name!==n.name&&a()}const h=()=>{n.removeListener("open",s),n.removeListener("error",l),n.removeListener("close",c),this.off("close",o),this.off("upgrading",u)};n.once("open",s),n.once("error",l),n.once("close",c),this.once("close",o),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let sy=class extends ry{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>Jv[s]).filter(s=>!!s)),super(t,r)}};function iy(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Ba(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const ay=typeof ArrayBuffer=="function",ly=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,jh=Object.prototype.toString,oy=typeof Blob=="function"||typeof Blob<"u"&&jh.call(Blob)==="[object BlobConstructor]",cy=typeof File=="function"||typeof File<"u"&&jh.call(File)==="[object FileConstructor]";function Ql(e){return ay&&(e instanceof ArrayBuffer||ly(e))||oy&&e instanceof Blob||cy&&e instanceof File}function ms(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ms(e[n]))return!0;return!1}if(Ql(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ms(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ms(e[n]))return!0;return!1}function uy(e){const t=[],n=e.data,r=e;return r.data=Ia(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ia(e,t){if(!e)return e;if(Ql(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ia(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ia(e[r],t));return n}return e}function dy(e,t){return e.data=Ua(e.data,t),delete e.attachments,e}function Ua(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Ua(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ua(e[n],t));return e}const kh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],hy=5;var A;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(A||(A={}));class fy{constructor(t){this.replacer=t}encode(t){return(t.type===A.EVENT||t.type===A.ACK)&&ms(t)?this.encodeAsBinary({type:t.type===A.EVENT?A.BINARY_EVENT:A.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===A.BINARY_EVENT||t.type===A.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=uy(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}class Hl extends Z{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===A.BINARY_EVENT;r||n.type===A.BINARY_ACK?(n.type=r?A.EVENT:A.ACK,this.reconstructor=new py(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ql(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(A[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===A.BINARY_EVENT||r.type===A.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const l=t.substring(a,n);if(l!=Number(l)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(l)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const a=n+1;for(;++n;){const l=t.charAt(n);if(l==null||Number(l)!=l){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(Hl.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case A.CONNECT:return Us(n);case A.DISCONNECT:return n===void 0;case A.CONNECT_ERROR:return typeof n=="string"||Us(n);case A.EVENT:case A.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&kh.indexOf(n[0])===-1);case A.ACK:case A.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class py{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=dy(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function my(e){return typeof e=="string"}const vy=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function yy(e){return e===void 0||vy(e)}function Us(e){return Object.prototype.toString.call(e)==="[object Object]"}function gy(e,t){switch(e){case A.CONNECT:return t===void 0||Us(t);case A.DISCONNECT:return t===void 0;case A.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&kh.indexOf(t[0])===-1);case A.ACK:return Array.isArray(t);case A.CONNECT_ERROR:return typeof t=="string"||Us(t);default:return!1}}function xy(e){return my(e.nsp)&&yy(e.id)&&gy(e.type,e.data)}const jy=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Hl,Encoder:fy,get PacketType(){return A},isPacketValid:xy,protocol:hy},Symbol.toStringTag,{value:"Module"}));function Be(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const ky=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wh extends Z{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Be(t,"open",this.onopen.bind(this)),Be(t,"packet",this.onpacket.bind(this)),Be(t,"error",this.onerror.bind(this)),Be(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,a;if(ky.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const l={type:A.EVENT,data:n};if(l.options={},l.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,d=n.pop();this._registerAckCallback(h,d),l.id=h}const c=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,o=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!c||(o?(this.notifyOutgoingListeners(l),this.packet(l)):this.sendBuffer.push(l)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);n.call(this,new Error("operation has timed out"))},s),l=(...c)=>{this.io.clearTimeoutFn(a),n.apply(this,c)};l.withError=!0,this.acks[t]=l}emitWithAck(t,...n){return new Promise((r,s)=>{const a=(l,c)=>l?s(l):r(c);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...a)=>(this._queue[0],s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:A.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case A.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case A.EVENT:case A.BINARY_EVENT:this.onevent(t);break;case A.ACK:case A.BINARY_ACK:this.onack(t);break;case A.DISCONNECT:this.ondisconnect();break;case A.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:A.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:A.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Fn(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Fn.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Fn.prototype.reset=function(){this.attempts=0};Fn.prototype.setMin=function(e){this.ms=e};Fn.prototype.setMax=function(e){this.max=e};Fn.prototype.setJitter=function(e){this.jitter=e};class Va extends Z{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ui(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Fn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||jy;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new sy(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Be(n,"open",function(){r.onopen(),t&&t()}),a=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},l=Be(n,"error",a);if(this._timeout!==!1){const c=this._timeout,o=this.setTimeoutFn(()=>{s(),a(new Error("timeout")),n.close()},c);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}return this.subs.push(s),this.subs.push(l),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Be(t,"ping",this.onping.bind(this)),Be(t,"data",this.ondata.bind(this)),Be(t,"error",this.onerror.bind(this)),Be(t,"close",this.onclose.bind(this)),Be(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){ci(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new wh(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Yn={};function vs(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=iy(e,t.path||"/socket.io"),r=n.source,s=n.id,a=n.path,l=Yn[s]&&a in Yn[s].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let o;return c?o=new Va(r,t):(Yn[s]||(Yn[s]=new Va(r,t)),o=Yn[s]),n.query&&!t.query&&(t.query=n.queryKey),o.socket(n.path,t)}Object.assign(vs,{Manager:Va,Socket:wh,io:vs,connect:vs});const wy="http://localhost:5000";class Sy{constructor(){this.socket=null,this.listeners=new Map}connect(){var n;const t=localStorage.getItem("access_token");if(!t){console.warn("No token available for WebSocket connection");return}(n=this.socket)!=null&&n.connected||(this.socket=vs(wy,{query:{token:t},transports:["websocket","polling"],reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3}),this.socket.on("connect",()=>{console.log("WebSocket connected"),this.emit("connected")}),this.socket.on("disconnect",r=>{console.log("WebSocket disconnected:",r),this.emit("disconnected",r)}),this.socket.on("error",r=>{console.error("WebSocket error:",r),this.emit("error",r)}),this.socket.on("metrics",r=>{this.emit("metrics",r)}),this.socket.on("log_line",r=>{this.emit("log_line",r)}),this.socket.on("log_error",r=>{this.emit("log_error",r)}))}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null)}subscribeMetrics(){var t;(t=this.socket)!=null&&t.connected&&this.socket.emit("subscribe_metrics")}unsubscribeMetrics(){var t;(t=this.socket)!=null&&t.connected&&this.socket.emit("unsubscribe_metrics")}subscribeLogs(t){var n;(n=this.socket)!=null&&n.connected&&this.socket.emit("subscribe_logs",{path:t})}unsubscribeLogs(){var t;(t=this.socket)!=null&&t.connected&&this.socket.emit("unsubscribe_logs")}on(t,n){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n),()=>{var r;(r=this.listeners.get(t))==null||r.delete(n)}}off(t,n){var r;(r=this.listeners.get(t))==null||r.delete(n)}emit(t,n){var r;(r=this.listeners.get(t))==null||r.forEach(s=>{try{s(n)}catch(a){console.error("Socket listener error:",a)}})}}const qt=new Sy;function Ny(e=!0){const[t,n]=m.useState(null),[r,s]=m.useState(!0),[a,l]=m.useState(null),[c,o]=m.useState(!1),u=m.useCallback(async()=>{try{const h=await C.getSystemMetrics();n(h),l(null)}catch(h){l(h.message)}finally{s(!1)}},[]);return m.useEffect(()=>{if(u(),e){qt.connect();const h=qt.on("connected",()=>{o(!0),qt.subscribeMetrics()}),d=qt.on("disconnected",()=>{o(!1)}),f=qt.on("metrics",x=>{n(x),s(!1)}),g=qt.on("error",x=>{l(x.message||"WebSocket error")});return()=>{h(),d(),f(),g(),qt.unsubscribeMetrics()}}else{const h=setInterval(u,5e3);return()=>clearInterval(h)}},[e,u]),{metrics:t,loading:r,error:a,connected:c,refresh:u}}const Cy=()=>{var p,j,S,b,P,T,F,R,le,ht,ft,Bn,Ar,nn,rn,_,L,O,U,G,Ft,We,sn,Qe,Bt,Yl,Gl,Xl,Jl,Zl,eo,to,no,ro,so,io,ao,lo,oo,co,uo,ho;const e=$t(),{metrics:t,loading:n,connected:r}=Ny(!0),[s,a]=m.useState([]),[l,c]=m.useState([]),[o,u]=m.useState(null),[h,d]=m.useState(!0);m.useEffect(()=>{f()},[]);async function f(){try{const[D,ve,Ch]=await Promise.all([C.getApps(),C.getServicesStatus().catch(()=>({services:[]})),C.getDatabasesStatus().catch(()=>null)]);a(D.apps||[]),c(ve.services||[]),u(Ch)}catch(D){console.error("Failed to load data:",D)}finally{d(!1)}}function g(D){switch(D){case"running":return"status-active";case"stopped":return"status-stopped";case"error":return"status-error";default:return"status-warning"}}function x(D){switch(D){case"docker":return i.jsx(Tc,{size:20});case"wordpress":case"php":return i.jsx(gv,{size:20});case"flask":case"django":return i.jsx($i,{size:20});default:return i.jsx(Lc,{size:20})}}function k(D){return{php:"#777bb4",wordpress:"#21759b",flask:"#000000",django:"#092e20",docker:"#2496ed",static:"#60a5fa"}[D]||"#6366f1"}function N(D){if(!D)return{days:0,hours:0,minutes:0};const ve=D.match(/(\d+)d\s*(\d+)h\s*(\d+)m|(\d+)h\s*(\d+)m|(\d+)m/);return ve?ve[1]?{days:parseInt(ve[1]),hours:parseInt(ve[2]),minutes:parseInt(ve[3])}:ve[4]?{days:0,hours:parseInt(ve[4]),minutes:parseInt(ve[5])}:{days:0,hours:0,minutes:parseInt(ve[6])}:{days:0,hours:0,minutes:0}}const y=N((p=t==null?void 0:t.system)==null?void 0:p.uptime_human),v=s.filter(D=>D.status==="running").length;return l.filter(D=>D.status==="running").length,h&&n?i.jsx("div",{className:"loading",children:"Loading dashboard..."}):i.jsxs("div",{children:[i.jsxs("header",{className:"top-bar",children:[i.jsxs("div",{children:[i.jsx("h1",{children:"Dashboard"}),i.jsxs("div",{className:"subtitle",children:["Overview of your server status and applications",r&&i.jsx("span",{className:"live-indicator",children:" Live"})]})]}),i.jsxs("div",{className:"top-bar-actions",children:[i.jsxs("button",{className:"btn btn-secondary",onClick:f,children:[i.jsx(Sv,{size:16}),"Refresh"]}),i.jsxs("button",{className:"btn btn-primary",onClick:()=>e("/apps"),children:[i.jsx(Rc,{size:16}),"New Application"]})]})]}),(t==null?void 0:t.system)&&i.jsxs("div",{className:"uptime-display",children:[i.jsx(Nv,{size:24,style:{color:"var(--success)"}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"Server Uptime"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[i.jsxs("div",{className:"uptime-item",children:[i.jsx("span",{className:"uptime-value",children:y.days}),i.jsx("span",{className:"uptime-label",children:"Days"})]}),i.jsx("span",{className:"uptime-separator",children:":"}),i.jsxs("div",{className:"uptime-item",children:[i.jsx("span",{className:"uptime-value",children:String(y.hours).padStart(2,"0")}),i.jsx("span",{className:"uptime-label",children:"Hours"})]}),i.jsx("span",{className:"uptime-separator",children:":"}),i.jsxs("div",{className:"uptime-item",children:[i.jsx("span",{className:"uptime-value",children:String(y.minutes).padStart(2,"0")}),i.jsx("span",{className:"uptime-label",children:"Minutes"})]})]})]}),i.jsxs("div",{style:{textAlign:"right"},children:[i.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:(j=t.system)==null?void 0:j.hostname}),i.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:(S=t.system)==null?void 0:S.platform})]})]}),t&&i.jsxs("div",{className:"system-metrics",children:[i.jsxs("div",{className:"metric-card",children:[i.jsxs("div",{className:"metric-header",children:[i.jsx("h4",{children:"CPU Usage"}),i.jsx(xv,{size:18,className:"metric-icon"})]}),i.jsxs("div",{className:"metric-main",children:[i.jsx("span",{className:"metric-value",children:((b=t.cpu)==null?void 0:b.percent)||0}),i.jsx("span",{className:"metric-unit",children:"%"})]}),i.jsx("div",{className:"progress-bar",children:i.jsx("div",{className:"progress-fill",style:{width:`${((P=t.cpu)==null?void 0:P.percent)||0}%`,background:(((T=t.cpu)==null?void 0:T.percent)||0)>80?"var(--danger)":(((F=t.cpu)==null?void 0:F.percent)||0)>60?"var(--warning)":"var(--success)"}})}),i.jsxs("div",{className:"metric-sub",children:[(R=t.cpu)==null?void 0:R.cores," cores @ ",(le=t.cpu)==null?void 0:le.frequency_mhz," MHz"]})]}),i.jsxs("div",{className:"metric-card",children:[i.jsxs("div",{className:"metric-header",children:[i.jsx("h4",{children:"Memory"}),i.jsx(wv,{size:18,className:"metric-icon"})]}),i.jsxs("div",{className:"metric-main",children:[i.jsx("span",{className:"metric-value",children:((ft=(ht=t.memory)==null?void 0:ht.ram)==null?void 0:ft.percent)||0}),i.jsx("span",{className:"metric-unit",children:"%"})]}),i.jsx("div",{className:"progress-bar",children:i.jsx("div",{className:"progress-fill",style:{width:`${((Ar=(Bn=t.memory)==null?void 0:Bn.ram)==null?void 0:Ar.percent)||0}%`,background:"var(--accent-primary)"}})}),i.jsxs("div",{className:"metric-sub",children:[(rn=(nn=t.memory)==null?void 0:nn.ram)==null?void 0:rn.used_human," / ",(L=(_=t.memory)==null?void 0:_.ram)==null?void 0:L.total_human]})]}),i.jsxs("div",{className:"metric-card",children:[i.jsxs("div",{className:"metric-header",children:[i.jsx("h4",{children:"Disk Space"}),i.jsx(kv,{size:18,className:"metric-icon"})]}),i.jsxs("div",{className:"metric-main",children:[i.jsx("span",{className:"metric-value",children:((G=(U=(O=t.disk)==null?void 0:O.partitions)==null?void 0:U[0])==null?void 0:G.percent)||0}),i.jsx("span",{className:"metric-unit",children:"%"})]}),i.jsx("div",{className:"progress-bar",children:i.jsx("div",{className:"progress-fill",style:{width:`${((sn=(We=(Ft=t.disk)==null?void 0:Ft.partitions)==null?void 0:We[0])==null?void 0:sn.percent)||0}%`,background:(((Yl=(Bt=(Qe=t.disk)==null?void 0:Qe.partitions)==null?void 0:Bt[0])==null?void 0:Yl.percent)||0)>90?"var(--danger)":"var(--accent-primary)"}})}),i.jsxs("div",{className:"metric-sub",children:[(Jl=(Xl=(Gl=t.disk)==null?void 0:Gl.partitions)==null?void 0:Xl[0])==null?void 0:Jl.used_human," / ",(to=(eo=(Zl=t.disk)==null?void 0:Zl.partitions)==null?void 0:eo[0])==null?void 0:to.total_human]})]}),i.jsxs("div",{className:"metric-card",children:[i.jsxs("div",{className:"metric-header",children:[i.jsx("h4",{children:"Network I/O"}),i.jsx(vv,{size:18,className:"metric-icon"})]}),i.jsxs("div",{className:"metric-main",children:[i.jsx("span",{className:"metric-value",style:{fontSize:"18px"},children:((ro=(no=t.network)==null?void 0:no.io)==null?void 0:ro.bytes_sent_human)||"0B"}),i.jsx("span",{className:"metric-unit",children:"sent"})]}),i.jsxs("div",{className:"metric-sub",children:["Received: ",((io=(so=t.network)==null?void 0:so.io)==null?void 0:io.bytes_recv_human)||"0B"]})]})]}),i.jsx("h2",{className:"section-title",children:"Quick Actions"}),i.jsxs("div",{className:"quick-actions",children:[i.jsxs("div",{className:"quick-action-card",onClick:()=>e("/apps"),children:[i.jsx("div",{className:"action-icon",children:i.jsx($i,{size:24})}),i.jsx("h4",{children:"Applications"}),i.jsxs("p",{children:[v," of ",s.length," running"]})]}),i.jsxs("div",{className:"quick-action-card",onClick:()=>e("/docker"),children:[i.jsx("div",{className:"action-icon",children:i.jsx(Tc,{size:24})}),i.jsx("h4",{children:"Docker"}),i.jsx("p",{children:"Manage containers"})]}),i.jsxs("div",{className:"quick-action-card",onClick:()=>e("/databases"),children:[i.jsx("div",{className:"action-icon",children:i.jsx(jv,{size:24})}),i.jsx("h4",{children:"Databases"}),i.jsx("p",{children:"MySQL & PostgreSQL"})]}),i.jsxs("div",{className:"quick-action-card",onClick:()=>e("/domains"),children:[i.jsx("div",{className:"action-icon",children:i.jsx(Lc,{size:24})}),i.jsx("h4",{children:"Domains"}),i.jsx("p",{children:"Manage sites"})]})]}),l.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-title",children:"Services"}),i.jsx("div",{className:"services-grid",children:l.map(D=>i.jsxs("div",{className:"service-item",children:[i.jsx("span",{className:`service-dot ${D.status==="running"?"running":"stopped"}`}),i.jsx("span",{className:"service-name",children:D.name}),i.jsx("span",{className:"service-status",children:D.status})]},D.name))})]}),o&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"section-title",style:{marginTop:"32px"},children:"Database Servers"}),i.jsxs("div",{className:"db-status",children:[i.jsxs("div",{className:"db-status-item",children:[i.jsx("div",{className:"status-icon mysql",children:"M"}),i.jsxs("div",{className:"status-info",children:[i.jsx("h3",{children:"MySQL / MariaDB"}),i.jsxs("span",{className:(ao=o.mysql)!=null&&ao.running?"running":"stopped",children:[(lo=o.mysql)!=null&&lo.running?"Running":"Stopped",((oo=o.mysql)==null?void 0:oo.version)&&` - ${o.mysql.version}`]})]})]}),i.jsxs("div",{className:"db-status-item",children:[i.jsx("div",{className:"status-icon postgresql",children:"P"}),i.jsxs("div",{className:"status-info",children:[i.jsx("h3",{children:"PostgreSQL"}),i.jsxs("span",{className:(co=o.postgresql)!=null&&co.running?"running":"stopped",children:[(uo=o.postgresql)!=null&&uo.running?"Running":"Stopped",((ho=o.postgresql)==null?void 0:ho.version)&&` - ${o.postgresql.version}`]})]})]})]})]}),i.jsxs("div",{className:"section-header",style:{marginTop:"32px"},children:[i.jsx("h2",{className:"section-title",style:{marginBottom:0},children:"Active Projects"}),i.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>e("/apps"),children:["View All ",i.jsx(yv,{size:14})]})]}),s.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx($i,{size:48}),i.jsx("h3",{children:"No applications yet"}),i.jsx("p",{children:"Create your first application to get started."}),i.jsxs("button",{className:"btn btn-primary",onClick:()=>e("/apps"),children:[i.jsx(Rc,{size:16}),"Create Application"]})]}):i.jsx("div",{className:"dashboard-grid",children:s.slice(0,6).map(D=>i.jsxs("div",{className:"card",onClick:()=>e(`/apps/${D.id}`),children:[i.jsxs("div",{className:"card-header",children:[i.jsx("div",{className:"app-icon",style:{background:k(D.app_type)},children:x(D.app_type)}),i.jsxs("div",{className:`status-badge ${g(D.status)}`,children:[i.jsx("div",{className:"status-dot"}),D.status.charAt(0).toUpperCase()+D.status.slice(1)]})]}),i.jsx("h3",{children:D.name}),D.domains&&D.domains[0]&&i.jsx("a",{href:`https://${D.domains[0].name}`,className:"card-link",target:"_blank",rel:"noopener noreferrer",onClick:ve=>ve.stopPropagation(),children:D.domains[0].name}),i.jsxs("div",{className:"metric-row",children:[i.jsxs("div",{className:"metric-item",children:[i.jsx("span",{children:"Stack"}),i.jsxs("span",{className:"metric-value",style:{color:k(D.app_type)},children:[D.app_type.toUpperCase(),D.php_version&&` / PHP ${D.php_version}`,D.python_version&&` / Py ${D.python_version}`]})]}),D.port&&i.jsxs("div",{className:"metric-item",children:[i.jsx("span",{children:"Port"}),i.jsx("span",{className:"metric-value",children:D.port})]})]})]},D.id))})]})},_y=()=>{const[e,t]=m.useState(""),[n,r]=m.useState(""),[s,a]=m.useState(""),[l,c]=m.useState(!1),{login:o}=Or(),u=$t();async function h(d){d.preventDefault(),a(""),c(!0);try{await o(e,n),u("/")}catch(f){a(f.message||"Failed to login")}finally{c(!1)}}return i.jsx("div",{className:"auth-container",children:i.jsxs("div",{className:"auth-card",children:[i.jsxs("div",{className:"auth-header",children:[i.jsx("div",{className:"brand-logo",children:i.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",stroke:"currentColor",fill:"none",strokeWidth:"2",children:i.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),i.jsx("h1",{children:"ServerKit"}),i.jsx("p",{children:"Sign in to your account"})]}),s&&i.jsx("div",{className:"error-message",children:s}),i.jsxs("form",{onSubmit:h,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"email",children:"Email"}),i.jsx("input",{type:"email",id:"email",value:e,onChange:d=>t(d.target.value),placeholder:"[email protected]",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"password",children:"Password"}),i.jsx("input",{type:"password",id:"password",value:n,onChange:d=>r(d.target.value),placeholder:"Enter your password",required:!0})]}),i.jsx("button",{type:"submit",className:"btn btn-primary btn-full",disabled:l,children:l?"Signing in...":"Sign In"})]}),i.jsxs("p",{className:"auth-footer",children:["Don't have an account? ",i.jsx(Il,{to:"/register",children:"Create one"})]})]})})},by=()=>{const[e,t]=m.useState(""),[n,r]=m.useState(""),[s,a]=m.useState(""),[l,c]=m.useState(""),[o,u]=m.useState(""),[h,d]=m.useState(!1),{register:f}=Or(),g=$t();async function x(k){if(k.preventDefault(),u(""),s!==l){u("Passwords do not match");return}if(s.length<8){u("Password must be at least 8 characters");return}d(!0);try{await f(e,n,s),g("/")}catch(N){u(N.message||"Failed to register")}finally{d(!1)}}return i.jsx("div",{className:"auth-container",children:i.jsxs("div",{className:"auth-card",children:[i.jsxs("div",{className:"auth-header",children:[i.jsx("div",{className:"brand-logo",children:i.jsx("svg",{viewBox:"0 0 24 24",width:"32",height:"32",stroke:"currentColor",fill:"none",strokeWidth:"2",children:i.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})})}),i.jsx("h1",{children:"ServerKit"}),i.jsx("p",{children:"Create your account"})]}),o&&i.jsx("div",{className:"error-message",children:o}),i.jsxs("form",{onSubmit:x,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"email",children:"Email"}),i.jsx("input",{type:"email",id:"email",value:e,onChange:k=>t(k.target.value),placeholder:"[email protected]",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"username",children:"Username"}),i.jsx("input",{type:"text",id:"username",value:n,onChange:k=>r(k.target.value),placeholder:"Choose a username",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"password",children:"Password"}),i.jsx("input",{type:"password",id:"password",value:s,onChange:k=>a(k.target.value),placeholder:"At least 8 characters",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"confirmPassword",children:"Confirm Password"}),i.jsx("input",{type:"password",id:"confirmPassword",value:l,onChange:k=>c(k.target.value),placeholder:"Confirm your password",required:!0})]}),i.jsx("button",{type:"submit",className:"btn btn-primary btn-full",disabled:h,children:h?"Creating account...":"Create Account"})]}),i.jsxs("p",{className:"auth-footer",children:["Already have an account? ",i.jsx(Il,{to:"/login",children:"Sign in"})]})]})})},Ey=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!1),l=$t();m.useEffect(()=>{c()},[]);async function c(){try{const d=await C.getApps();t(d.apps||[])}catch(d){console.error("Failed to load apps:",d)}finally{r(!1)}}function o(d){return{php:"#a78bfa",wordpress:"#21759b",flask:"#fcd34d",django:"#34d399",docker:"#2496ed",static:"#60a5fa"}[d]||"#a1a1aa"}function u(d){switch(d){case"running":return"status-active";case"stopped":return"status-stopped";case"error":return"status-error";default:return"status-warning"}}async function h(d,f){try{f==="start"?await C.startApp(d):f==="stop"?await C.stopApp(d):f==="restart"&&await C.restartApp(d),c()}catch(g){console.error(`Failed to ${f} app:`,g)}}return n?i.jsx("div",{className:"loading",children:"Loading applications..."}):i.jsxs("div",{children:[i.jsxs("header",{className:"top-bar",children:[i.jsxs("div",{children:[i.jsx("h1",{children:"Applications"}),i.jsx("div",{className:"subtitle",children:"Manage your web applications"})]}),i.jsx("div",{className:"top-bar-actions",children:i.jsxs("button",{className:"btn btn-primary",onClick:()=>a(!0),children:[i.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),i.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Application"]})})]}),e.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("svg",{viewBox:"0 0 24 24",width:"48",height:"48",stroke:"currentColor",fill:"none",strokeWidth:"1.5",children:i.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),i.jsx("h3",{children:"No applications yet"}),i.jsx("p",{children:"Create your first application to get started."}),i.jsx("button",{className:"btn btn-primary",onClick:()=>a(!0),children:"Create Application"})]}):i.jsx("div",{className:"apps-list",children:e.map(d=>i.jsxs("div",{className:"app-row",children:[i.jsxs("div",{className:"app-info",children:[i.jsx("div",{className:"app-icon",style:{background:o(d.app_type)},children:d.app_type==="wordpress"?"W":d.app_type.charAt(0).toUpperCase()}),i.jsxs("div",{className:"app-details",children:[i.jsx("h3",{children:d.name}),i.jsxs("div",{className:"app-meta",children:[i.jsx("span",{className:"app-type",children:d.app_type.toUpperCase()}),d.php_version&&i.jsxs("span",{children:["PHP ",d.php_version]}),d.python_version&&i.jsxs("span",{children:["Python ",d.python_version]}),d.domains&&d.domains[0]&&i.jsx("a",{href:`https://${d.domains[0].name}`,target:"_blank",rel:"noopener noreferrer",children:d.domains[0].name})]})]})]}),i.jsx("div",{className:"app-status",children:i.jsxs("span",{className:`status-badge ${u(d.status)}`,children:[i.jsx("span",{className:"status-dot"}),d.status]})}),i.jsxs("div",{className:"app-actions",children:[d.status==="running"?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>h(d.id,"restart"),children:"Restart"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>h(d.id,"stop"),children:"Stop"})]}):i.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>h(d.id,"start"),children:"Start"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>l(`/apps/${d.id}`),children:"Manage"})]})]},d.id))}),s&&i.jsx(Py,{onClose:()=>a(!1),onCreated:c})]})},Py=({onClose:e,onCreated:t})=>{var N;const[n,r]=m.useState(1),[s,a]=m.useState(""),[l,c]=m.useState({name:"",app_type:"",php_version:"8.2",python_version:"3.11",port:8e3,root_path:"/var/www/",site_url:"",site_title:"",admin_user:"admin",admin_email:"",db_name:"",db_user:"",db_password:"",docker_image:"",docker_ports:"",docker_volumes:"",docker_env:""}),[o,u]=m.useState(!1),[h,d]=m.useState(""),f=[{id:"wordpress",name:"WordPress",icon:"W",color:"#21759b",description:"Full WordPress installation with WP-CLI"},{id:"php",name:"PHP",icon:"P",color:"#777bb4",description:"PHP application with FPM"},{id:"flask",name:"Flask",icon:"F",color:"#fcd34d",description:"Python Flask application"},{id:"django",name:"Django",icon:"D",color:"#34d399",description:"Python Django application"},{id:"docker",name:"Docker",icon:"D",color:"#2496ed",description:"Docker container application"},{id:"static",name:"Static",icon:"S",color:"#60a5fa",description:"Static HTML/CSS/JS site"}];function g(y){c({...l,[y.target.name]:y.target.value})}function x(y){a(y),c({...l,app_type:y,root_path:`/var/www/${l.name||"mysite"}`}),r(2)}async function k(y){y.preventDefault(),d(""),u(!0);try{if(s==="wordpress")await C.installWordPress({path:l.root_path,site_url:l.site_url,site_title:l.site_title||l.name,admin_user:l.admin_user,admin_email:l.admin_email,db_name:l.db_name,db_user:l.db_user,db_password:l.db_password,php_version:l.php_version});else if(s==="flask")await C.createFlaskApp({name:l.name,path:l.root_path,python_version:l.python_version,port:l.port,workers:l.workers||2});else if(s==="django")await C.createDjangoApp({name:l.name,path:l.root_path,python_version:l.python_version,port:l.port,workers:l.workers||2});else if(s==="docker"){const v=l.docker_ports?l.docker_ports.split(",").map(S=>S.trim()):[],p=l.docker_volumes?l.docker_volumes.split(",").map(S=>S.trim()):[],j=l.docker_env?Object.fromEntries(l.docker_env.split(`
-`).filter(S=>S.includes("=")).map(S=>{const[b,...P]=S.split("=");return[b.trim(),P.join("=").trim()]})):{};await C.createDockerApp({name:l.name,path:l.root_path,image:l.docker_image,ports:v,volumes:p,env:j})}else await C.createApp({name:l.name,app_type:s,php_version:s==="php"?l.php_version:null,root_path:l.root_path});t(),e()}catch(v){d(v.message||"Failed to create application")}finally{u(!1)}}return i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:y=>y.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:n===1?"Select Application Type":`Create ${(N=f.find(y=>y.id===s))==null?void 0:N.name} App`}),i.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),h&&i.jsx("div",{className:"error-message",children:h}),n===1?i.jsx("div",{className:"app-type-grid",children:f.map(y=>i.jsxs("button",{className:"app-type-card",onClick:()=>x(y.id),children:[i.jsx("div",{className:"app-type-icon",style:{background:y.color},children:y.icon}),i.jsx("h3",{children:y.name}),i.jsx("p",{children:y.description})]},y.id))}):i.jsxs("form",{onSubmit:k,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Site Name"}),i.jsx("input",{type:"text",name:"name",value:l.name,onChange:g,placeholder:"My Awesome Site",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Root Path"}),i.jsx("input",{type:"text",name:"root_path",value:l.root_path,onChange:g,placeholder:"/var/www/mysite",required:!0})]}),s==="wordpress"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Site URL"}),i.jsx("input",{type:"url",name:"site_url",value:l.site_url,onChange:g,placeholder:"https://example.com",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Admin Email"}),i.jsx("input",{type:"email",name:"admin_email",value:l.admin_email,onChange:g,placeholder:"[email protected]",required:!0})]}),i.jsxs("div",{className:"form-row",children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Database Name"}),i.jsx("input",{type:"text",name:"db_name",value:l.db_name,onChange:g,required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Database User"}),i.jsx("input",{type:"text",name:"db_user",value:l.db_user,onChange:g,required:!0})]})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Database Password"}),i.jsx("input",{type:"password",name:"db_password",value:l.db_password,onChange:g,required:!0})]})]}),(s==="php"||s==="wordpress")&&i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"PHP Version"}),i.jsxs("select",{name:"php_version",value:l.php_version,onChange:g,children:[i.jsx("option",{value:"8.0",children:"PHP 8.0"}),i.jsx("option",{value:"8.1",children:"PHP 8.1"}),i.jsx("option",{value:"8.2",children:"PHP 8.2"}),i.jsx("option",{value:"8.3",children:"PHP 8.3"})]})]}),["flask","django"].includes(s)&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Python Version"}),i.jsxs("select",{name:"python_version",value:l.python_version,onChange:g,children:[i.jsx("option",{value:"3.9",children:"Python 3.9"}),i.jsx("option",{value:"3.10",children:"Python 3.10"}),i.jsx("option",{value:"3.11",children:"Python 3.11"}),i.jsx("option",{value:"3.12",children:"Python 3.12"})]})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Port"}),i.jsx("input",{type:"number",name:"port",value:l.port,onChange:g,min:"1024",max:"65535"})]})]}),s==="docker"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Docker Image *"}),i.jsx("input",{type:"text",name:"docker_image",value:l.docker_image,onChange:g,placeholder:"nginx:latest, mysql:8, redis:alpine",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Ports (comma-separated)"}),i.jsx("input",{type:"text",name:"docker_ports",value:l.docker_ports,onChange:g,placeholder:"8080:80, 3306:3306"})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Volumes (comma-separated)"}),i.jsx("input",{type:"text",name:"docker_volumes",value:l.docker_volumes,onChange:g,placeholder:"/host/data:/container/data"})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Environment Variables (one per line, KEY=value)"}),i.jsx("textarea",{name:"docker_env",value:l.docker_env,onChange:g,placeholder:`MYSQL_ROOT_PASSWORD=secret
-MYSQL_DATABASE=mydb`,rows:4})]})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>r(1),children:"Back"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:o,children:o?"Creating...":"Create Application"})]})]})]})})},Ty=()=>{const{id:e}=Rm(),t=$t(),[n,r]=m.useState(null),[s,a]=m.useState(!0),[l,c]=m.useState("overview");m.useEffect(()=>{o()},[e]);async function o(){try{const x=await C.getApp(e);r(x.app)}catch(x){console.error("Failed to load app:",x)}finally{a(!1)}}async function u(x){try{x==="start"?await C.startApp(e):x==="stop"?await C.stopApp(e):x==="restart"&&await C.restartApp(e),o()}catch(k){console.error(`Failed to ${x} app:`,k)}}function h(x){return{php:"#777bb4",wordpress:"#21759b",flask:"#fcd34d",django:"#34d399",docker:"#2496ed",static:"#60a5fa"}[x]||"#a1a1aa"}function d(x){switch(x){case"running":return"status-active";case"stopped":return"status-stopped";case"error":return"status-error";default:return"status-warning"}}if(s)return i.jsx("div",{className:"loading",children:"Loading application..."});if(!n)return i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"Application not found"}),i.jsx("button",{className:"btn btn-primary",onClick:()=>t("/apps"),children:"Back to Applications"})]});const f=["flask","django"].includes(n.app_type),g=n.app_type==="wordpress";return n.app_type,i.jsxs("div",{children:[i.jsxs("header",{className:"top-bar",children:[i.jsxs("div",{className:"app-header-info",children:[i.jsxs("button",{className:"btn btn-secondary btn-sm",onClick:()=>t("/apps"),children:[i.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",stroke:"currentColor",fill:"none",strokeWidth:"2",children:i.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),"Back"]}),i.jsxs("div",{className:"app-header-title",children:[i.jsx("div",{className:"app-icon",style:{background:h(n.app_type)},children:n.app_type.charAt(0).toUpperCase()}),i.jsxs("div",{children:[i.jsx("h1",{children:n.name}),i.jsxs("div",{className:"subtitle",children:[n.app_type.toUpperCase(),n.python_version&&` • Python ${n.python_version}`,n.php_version&&` • PHP ${n.php_version}`,n.port&&` • Port ${n.port}`]})]})]})]}),i.jsxs("div",{className:"top-bar-actions",children:[i.jsxs("span",{className:`status-badge ${d(n.status)}`,children:[i.jsx("span",{className:"status-dot"}),n.status]}),n.status==="running"?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn btn-secondary",onClick:()=>u("restart"),children:"Restart"}),i.jsx("button",{className:"btn btn-secondary",onClick:()=>u("stop"),children:"Stop"})]}):i.jsx("button",{className:"btn btn-primary",onClick:()=>u("start"),children:"Start"})]})]}),i.jsxs("div",{className:"tabs",children:[i.jsx("button",{className:`tab ${l==="overview"?"active":""}`,onClick:()=>c("overview"),children:"Overview"}),f&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:`tab ${l==="packages"?"active":""}`,onClick:()=>c("packages"),children:"Packages"}),i.jsx("button",{className:`tab ${l==="environment"?"active":""}`,onClick:()=>c("environment"),children:"Environment"}),i.jsx("button",{className:`tab ${l==="gunicorn"?"active":""}`,onClick:()=>c("gunicorn"),children:"Gunicorn"}),i.jsx("button",{className:`tab ${l==="commands"?"active":""}`,onClick:()=>c("commands"),children:"Commands"})]}),g&&i.jsxs(i.Fragment,{children:[i.jsx("button",{className:`tab ${l==="plugins"?"active":""}`,onClick:()=>c("plugins"),children:"Plugins"}),i.jsx("button",{className:`tab ${l==="themes"?"active":""}`,onClick:()=>c("themes"),children:"Themes"}),i.jsx("button",{className:`tab ${l==="backups"?"active":""}`,onClick:()=>c("backups"),children:"Backups"})]}),i.jsx("button",{className:`tab ${l==="logs"?"active":""}`,onClick:()=>c("logs"),children:"Logs"}),i.jsx("button",{className:`tab ${l==="settings"?"active":""}`,onClick:()=>c("settings"),children:"Settings"})]}),i.jsxs("div",{className:"tab-content",children:[l==="overview"&&i.jsx(Ly,{app:n}),l==="packages"&&f&&i.jsx(Ry,{appId:n.id}),l==="environment"&&f&&i.jsx(Dy,{appId:n.id}),l==="gunicorn"&&f&&i.jsx(Oy,{appId:n.id}),l==="commands"&&f&&i.jsx(Ay,{appId:n.id,appType:n.app_type}),l==="plugins"&&g&&i.jsx(My,{appId:n.id}),l==="themes"&&g&&i.jsx(zy,{appId:n.id}),l==="backups"&&g&&i.jsx($y,{appId:n.id}),l==="logs"&&i.jsx(Fy,{app:n}),l==="settings"&&i.jsx(By,{app:n,onUpdate:o})]})]})},Ly=({app:e})=>{const[t,n]=m.useState(null);m.useEffect(()=>{["flask","django"].includes(e.app_type)&&r()},[e]);async function r(){try{const s=await C.getPythonAppStatus(e.id);n(s)}catch(s){console.error("Failed to load status:",s)}}return i.jsxs("div",{className:"overview-grid",children:[i.jsxs("div",{className:"card",children:[i.jsx("h3",{children:"Application Info"}),i.jsxs("div",{className:"info-list",children:[i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"Type"}),i.jsx("span",{className:"info-value",children:e.app_type.toUpperCase()})]}),i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"Root Path"}),i.jsx("span",{className:"info-value mono",children:e.root_path})]}),e.python_version&&i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"Python Version"}),i.jsx("span",{className:"info-value",children:e.python_version})]}),e.php_version&&i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"PHP Version"}),i.jsx("span",{className:"info-value",children:e.php_version})]}),e.port&&i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"Port"}),i.jsx("span",{className:"info-value",children:e.port})]}),i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"Created"}),i.jsx("span",{className:"info-value",children:new Date(e.created_at).toLocaleDateString()})]})]})]}),t&&i.jsxs("div",{className:"card",children:[i.jsx("h3",{children:"Process Status"}),i.jsxs("div",{className:"info-list",children:[i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"Service"}),i.jsx("span",{className:"info-value mono",children:t.service_name})]}),i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"State"}),i.jsxs("span",{className:"info-value",children:[t.active_state," (",t.sub_state,")"]})]}),t.main_pid!=="0"&&i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"PID"}),i.jsx("span",{className:"info-value mono",children:t.main_pid})]}),t.memory&&t.memory!=="0"&&i.jsxs("div",{className:"info-item",children:[i.jsx("span",{className:"info-label",children:"Memory"}),i.jsx("span",{className:"info-value",children:Sh(parseInt(t.memory))})]})]})]}),e.domains&&e.domains.length>0&&i.jsxs("div",{className:"card",children:[i.jsx("h3",{children:"Domains"}),i.jsx("div",{className:"domains-list",children:e.domains.map(s=>i.jsxs("div",{className:"domain-item",children:[i.jsx("a",{href:`https://${s.name}`,target:"_blank",rel:"noopener noreferrer",children:s.name}),s.ssl_enabled&&i.jsx("span",{className:"ssl-badge",children:"SSL"})]},s.id))})]})]})},Ry=({appId:e})=>{const[t,n]=m.useState([]),[r,s]=m.useState(!0),[a,l]=m.useState(!1),[c,o]=m.useState("");m.useEffect(()=>{u()},[e]);async function u(){try{const f=await C.getPythonPackages(e);n(f.packages||[])}catch(f){console.error("Failed to load packages:",f)}finally{s(!1)}}async function h(f){if(f.preventDefault(),!!c.trim()){l(!0);try{await C.installPythonPackages(e,[c.trim()]),o(""),u()}catch(g){console.error("Failed to install package:",g)}finally{l(!1)}}}async function d(){try{await C.freezePythonRequirements(e),alert("requirements.txt updated")}catch(f){console.error("Failed to freeze requirements:",f)}}return r?i.jsx("div",{className:"loading",children:"Loading packages..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Installed Packages"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:d,children:"Freeze to requirements.txt"})]}),i.jsxs("form",{className:"install-form",onSubmit:h,children:[i.jsx("input",{type:"text",value:c,onChange:f=>o(f.target.value),placeholder:"Package name (e.g., requests, flask==2.0.0)"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Installing...":"Install"})]}),i.jsx("div",{className:"packages-list",children:t.map(f=>i.jsxs("div",{className:"package-item",children:[i.jsx("span",{className:"package-name",children:f.name}),i.jsx("span",{className:"package-version",children:f.version})]},f.name))})]})},Dy=({appId:e})=>{const[t,n]=m.useState({}),[r,s]=m.useState(!0),[a,l]=m.useState(""),[c,o]=m.useState("");m.useEffect(()=>{u()},[e]);async function u(){try{const f=await C.getPythonEnvVars(e);n(f.env_vars||{})}catch(f){console.error("Failed to load env vars:",f)}finally{s(!1)}}async function h(f){if(f.preventDefault(),!!a.trim())try{await C.setPythonEnvVars(e,{[a]:c}),l(""),o(""),u()}catch(g){console.error("Failed to add env var:",g)}}async function d(f){if(confirm(`Delete ${f}?`))try{await C.deletePythonEnvVar(e,f),u()}catch(g){console.error("Failed to delete env var:",g)}}return r?i.jsx("div",{className:"loading",children:"Loading environment variables..."}):i.jsxs("div",{children:[i.jsx("h3",{children:"Environment Variables"}),i.jsx("p",{className:"hint",children:"Changes require app restart to take effect."}),i.jsxs("form",{className:"env-form",onSubmit:h,children:[i.jsx("input",{type:"text",value:a,onChange:f=>l(f.target.value),placeholder:"KEY"}),i.jsx("input",{type:"text",value:c,onChange:f=>o(f.target.value),placeholder:"value"}),i.jsx("button",{type:"submit",className:"btn btn-primary",children:"Add"})]}),i.jsx("div",{className:"env-list",children:Object.entries(t).map(([f,g])=>i.jsxs("div",{className:"env-item",children:[i.jsx("span",{className:"env-key",children:f}),i.jsx("span",{className:"env-value",children:g}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>d(f),children:"Delete"})]},f))})]})},Oy=({appId:e})=>{const[t,n]=m.useState(""),[r,s]=m.useState(!0),[a,l]=m.useState(!1);m.useEffect(()=>{c()},[e]);async function c(){try{const u=await C.getGunicornConfig(e);n(u.content||"")}catch(u){console.error("Failed to load config:",u)}finally{s(!1)}}async function o(){l(!0);try{await C.updateGunicornConfig(e,t),alert("Configuration saved. Restart the app to apply changes.")}catch(u){console.error("Failed to save config:",u)}finally{l(!1)}}return r?i.jsx("div",{className:"loading",children:"Loading Gunicorn configuration..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Gunicorn Configuration"}),i.jsx("button",{className:"btn btn-primary",onClick:o,disabled:a,children:a?"Saving...":"Save"})]}),i.jsx("textarea",{className:"code-editor",value:t,onChange:u=>n(u.target.value),spellCheck:!1})]})},Ay=({appId:e,appType:t})=>{const[n,r]=m.useState(""),[s,a]=m.useState(null),[l,c]=m.useState(!1),o=t==="django"?[{label:"Run Migrations",cmd:"python manage.py migrate"},{label:"Collect Static",cmd:"python manage.py collectstatic --noinput"},{label:"Create Superuser",cmd:"python manage.py createsuperuser"},{label:"Shell",cmd:"python manage.py shell"},{label:"Check",cmd:"python manage.py check"}]:[{label:"Flask Routes",cmd:"flask routes"},{label:"Flask Shell",cmd:"flask shell"},{label:"DB Upgrade",cmd:"flask db upgrade"},{label:"DB Migrate",cmd:"flask db migrate"}];async function u(h){const d=h||n;if(d.trim()){c(!0),a(null);try{const f=await C.runPythonCommand(e,d);a(f)}catch(f){a({success:!1,stderr:f.message})}finally{c(!1)}}}return i.jsxs("div",{children:[i.jsx("h3",{children:"Run Commands"}),i.jsx("p",{className:"hint",children:"Commands run in the app's virtual environment context."}),i.jsx("div",{className:"quick-commands",children:o.map(({label:h,cmd:d})=>i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>u(d),disabled:l,children:h},d))}),i.jsxs("div",{className:"command-input",children:[i.jsx("input",{type:"text",value:n,onChange:h=>r(h.target.value),placeholder:"Enter command...",onKeyDown:h=>h.key==="Enter"&&u()}),i.jsx("button",{className:"btn btn-primary",onClick:()=>u(),disabled:l,children:l?"Running...":"Run"})]}),s&&i.jsxs("div",{className:`command-output ${s.success?"":"error"}`,children:[s.stdout&&i.jsx("pre",{children:s.stdout}),s.stderr&&i.jsx("pre",{className:"stderr",children:s.stderr}),!s.stdout&&!s.stderr&&i.jsx("pre",{children:s.success?"Command completed successfully":"Command failed"})]})]})},My=({appId:e})=>{const[t,n]=m.useState([]),[r,s]=m.useState(!0);m.useEffect(()=>{a()},[e]);async function a(){try{const o=await C.getWordPressPlugins(e);n(o.plugins||[])}catch(o){console.error("Failed to load plugins:",o)}finally{s(!1)}}async function l(o){try{await C.activateWordPressPlugin(e,o),a()}catch(u){console.error("Failed to activate plugin:",u)}}async function c(o){try{await C.deactivateWordPressPlugin(e,o),a()}catch(u){console.error("Failed to deactivate plugin:",u)}}return r?i.jsx("div",{className:"loading",children:"Loading plugins..."}):i.jsxs("div",{children:[i.jsx("h3",{children:"WordPress Plugins"}),i.jsx("div",{className:"plugins-list",children:t.map(o=>i.jsxs("div",{className:"plugin-item",children:[i.jsxs("div",{className:"plugin-info",children:[i.jsx("span",{className:"plugin-name",children:o.title||o.name}),i.jsx("span",{className:"plugin-version",children:o.version})]}),i.jsx("div",{className:"plugin-actions",children:o.status==="active"?i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>c(o.name),children:"Deactivate"}):i.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>l(o.name),children:"Activate"})})]},o.name))})]})},zy=({appId:e})=>{const[t,n]=m.useState([]),[r,s]=m.useState(!0);m.useEffect(()=>{a()},[e]);async function a(){try{const c=await C.getWordPressThemes(e);n(c.themes||[])}catch(c){console.error("Failed to load themes:",c)}finally{s(!1)}}async function l(c){try{await C.activateWordPressTheme(e,c),a()}catch(o){console.error("Failed to activate theme:",o)}}return r?i.jsx("div",{className:"loading",children:"Loading themes..."}):i.jsxs("div",{children:[i.jsx("h3",{children:"WordPress Themes"}),i.jsx("div",{className:"themes-list",children:t.map(c=>i.jsxs("div",{className:`theme-item ${c.status==="active"?"active":""}`,children:[i.jsxs("div",{className:"theme-info",children:[i.jsx("span",{className:"theme-name",children:c.title||c.name}),i.jsx("span",{className:"theme-version",children:c.version})]}),c.status!=="active"&&i.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>l(c.name),children:"Activate"}),c.status==="active"&&i.jsx("span",{className:"active-badge",children:"Active"})]},c.name))})]})},$y=({appId:e})=>{const[t,n]=m.useState([]),[r,s]=m.useState(!0),[a,l]=m.useState(!1);m.useEffect(()=>{c()},[e]);async function c(){try{const h=await C.getWordPressBackups(e);n(h.backups||[])}catch(h){console.error("Failed to load backups:",h)}finally{s(!1)}}async function o(){l(!0);try{await C.createWordPressBackup(e),c()}catch(h){console.error("Failed to create backup:",h)}finally{l(!1)}}async function u(h){if(confirm(`Restore from ${h}? This will overwrite current data.`))try{await C.restoreWordPressBackup(e,h),alert("Backup restored successfully")}catch(d){console.error("Failed to restore backup:",d)}}return r?i.jsx("div",{className:"loading",children:"Loading backups..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Backups"}),i.jsx("button",{className:"btn btn-primary",onClick:o,disabled:a,children:a?"Creating...":"Create Backup"})]}),t.length===0?i.jsx("p",{className:"hint",children:"No backups yet. Create your first backup."}):i.jsx("div",{className:"backups-list",children:t.map(h=>i.jsxs("div",{className:"backup-item",children:[i.jsxs("div",{className:"backup-info",children:[i.jsx("span",{className:"backup-name",children:h.name}),i.jsx("span",{className:"backup-size",children:Sh(h.size)}),i.jsx("span",{className:"backup-date",children:new Date(h.created_at).toLocaleString()})]}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>u(h.name),children:"Restore"})]},h.name))})]})},Fy=({app:e})=>{const[t,n]=m.useState(""),[r,s]=m.useState(!0),[a,l]=m.useState("access");m.useEffect(()=>{c()},[e,a]);async function c(){s(!0);try{const o=await C.getAppLogs(e.name,a,200);n(o.content||"No logs available")}catch{n("Failed to load logs")}finally{s(!1)}}return i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Application Logs"}),i.jsxs("div",{className:"log-controls",children:[i.jsxs("select",{value:a,onChange:o=>l(o.target.value),children:[i.jsx("option",{value:"access",children:"Access Log"}),i.jsx("option",{value:"error",children:"Error Log"})]}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:c,children:"Refresh"})]})]}),i.jsx("pre",{className:"log-viewer",children:r?"Loading...":t})]})},By=({app:e,onUpdate:t})=>{const n=$t(),[r,s]=m.useState(!1);async function a(){if(confirm(`Delete ${e.name}? This action cannot be undone.`)&&confirm('Are you sure? Type "delete" to confirm.')){s(!0);try{await C.deleteApp(e.id),n("/apps")}catch(l){console.error("Failed to delete app:",l),s(!1)}}}return i.jsxs("div",{children:[i.jsx("h3",{children:"Application Settings"}),i.jsxs("div",{className:"card danger-zone",children:[i.jsx("h4",{children:"Danger Zone"}),i.jsx("p",{children:"Once you delete an application, there is no going back."}),i.jsx("button",{className:"btn btn-danger",onClick:a,disabled:r,children:r?"Deleting...":"Delete Application"})]})]})};function Sh(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}const qy=()=>{const[e,t]=m.useState("containers"),[n,r]=m.useState(null),[s,a]=m.useState(!0);m.useEffect(()=>{l()},[]);async function l(){try{const c=await C.getDockerStatus();r(c)}catch(c){r({installed:!1,error:c.message})}finally{a(!1)}}return s?i.jsx("div",{className:"loading",children:"Checking Docker status..."}):n!=null&&n.installed?i.jsxs("div",{children:[i.jsx("header",{className:"top-bar",children:i.jsxs("div",{children:[i.jsx("h1",{children:"Docker"}),i.jsx("div",{className:"subtitle",children:"Container management"})]})}),i.jsxs("div",{className:"tabs",children:[i.jsx("button",{className:`tab ${e==="containers"?"active":""}`,onClick:()=>t("containers"),children:"Containers"}),i.jsx("button",{className:`tab ${e==="images"?"active":""}`,onClick:()=>t("images"),children:"Images"}),i.jsx("button",{className:`tab ${e==="networks"?"active":""}`,onClick:()=>t("networks"),children:"Networks"}),i.jsx("button",{className:`tab ${e==="volumes"?"active":""}`,onClick:()=>t("volumes"),children:"Volumes"})]}),i.jsxs("div",{className:"tab-content",children:[e==="containers"&&i.jsx(Iy,{}),e==="images"&&i.jsx(Wy,{}),e==="networks"&&i.jsx(Hy,{}),e==="volumes"&&i.jsx(Yy,{})]})]}):i.jsxs("div",{children:[i.jsx("header",{className:"top-bar",children:i.jsxs("div",{children:[i.jsx("h1",{children:"Docker"}),i.jsx("div",{className:"subtitle",children:"Container management"})]})}),i.jsxs("div",{className:"empty-state",children:[i.jsx("svg",{viewBox:"0 0 24 24",width:"48",height:"48",stroke:"currentColor",fill:"none",strokeWidth:"1.5",children:i.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),i.jsx("h3",{children:"Docker not available"}),i.jsx("p",{children:(n==null?void 0:n.error)||"Docker is not installed or running on this server."})]})]})},Iy=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!0),[l,c]=m.useState(!1),[o,u]=m.useState(null);m.useEffect(()=>{h()},[s]);async function h(){r(!0);try{const g=await C.getContainers(s);t(g.containers||[])}catch(g){console.error("Failed to load containers:",g)}finally{r(!1)}}async function d(g,x){try{if(x==="start")await C.startContainer(g);else if(x==="stop")await C.stopContainer(g);else if(x==="restart")await C.restartContainer(g);else if(x==="remove"){if(!confirm("Remove this container?"))return;await C.removeContainer(g,!0)}h()}catch(k){console.error(`Failed to ${x} container:`,k)}}function f(g){switch(g){case"running":return"status-active";case"exited":return"status-stopped";case"paused":return"status-warning";default:return"status-stopped"}}return n?i.jsx("div",{className:"loading",children:"Loading containers..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("div",{className:"filter-toggle",children:i.jsxs("label",{children:[i.jsx("input",{type:"checkbox",checked:s,onChange:g=>a(g.target.checked)}),"Show stopped containers"]})}),i.jsx("button",{className:"btn btn-primary",onClick:()=>c(!0),children:"Run Container"})]}),e.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No containers"}),i.jsx("p",{children:"Run your first container to get started."})]}):i.jsx("div",{className:"docker-list",children:e.map(g=>i.jsxs("div",{className:"docker-item",children:[i.jsxs("div",{className:"docker-item-info",children:[i.jsx("div",{className:"docker-item-icon",children:i.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:i.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"})})}),i.jsxs("div",{className:"docker-item-details",children:[i.jsx("h3",{children:g.name}),i.jsxs("div",{className:"docker-item-meta",children:[i.jsx("span",{className:"mono",children:g.id.substring(0,12)}),i.jsx("span",{children:g.image}),g.ports&&i.jsx("span",{children:g.ports})]})]})]}),i.jsx("div",{className:"docker-item-status",children:i.jsxs("span",{className:`status-badge ${f(g.state)}`,children:[i.jsx("span",{className:"status-dot"}),g.state]})}),i.jsx("div",{className:"docker-item-actions",children:g.state==="running"?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>u(g),children:"Logs"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>d(g.id,"restart"),children:"Restart"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>d(g.id,"stop"),children:"Stop"})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>d(g.id,"start"),children:"Start"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>d(g.id,"remove"),children:"Remove"})]})})]},g.id))}),l&&i.jsx(Uy,{onClose:()=>c(!1),onCreated:h}),o&&i.jsx(Vy,{container:o,onClose:()=>u(null)})]})},Uy=({onClose:e,onCreated:t})=>{const[n,r]=m.useState({image:"",name:"",ports:"",volumes:"",env:""}),[s,a]=m.useState(!1),[l,c]=m.useState("");function o(h){r({...n,[h.target.name]:h.target.value})}async function u(h){h.preventDefault(),c(""),a(!0);try{const d={image:n.image,name:n.name||void 0,ports:n.ports?n.ports.split(",").map(f=>f.trim()):[],volumes:n.volumes?n.volumes.split(",").map(f=>f.trim()):[],env:n.env?Object.fromEntries(n.env.split(`
-`).filter(f=>f.includes("=")).map(f=>{const[g,...x]=f.split("=");return[g.trim(),x.join("=").trim()]})):{}};await C.runContainer(d),t(),e()}catch(d){c(d.message||"Failed to run container")}finally{a(!1)}}return i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Run Container"}),i.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&i.jsx("div",{className:"error-message",children:l}),i.jsxs("form",{onSubmit:u,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Image *"}),i.jsx("input",{type:"text",name:"image",value:n.image,onChange:o,placeholder:"nginx:latest",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Container Name"}),i.jsx("input",{type:"text",name:"name",value:n.name,onChange:o,placeholder:"my-container"})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Ports (comma-separated)"}),i.jsx("input",{type:"text",name:"ports",value:n.ports,onChange:o,placeholder:"8080:80, 443:443"})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Volumes (comma-separated)"}),i.jsx("input",{type:"text",name:"volumes",value:n.volumes,onChange:o,placeholder:"/host/path:/container/path"})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Environment Variables (one per line, KEY=value)"}),i.jsx("textarea",{name:"env",value:n.env,onChange:o,placeholder:`NODE_ENV=production
-API_KEY=xxx`,rows:4})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:s,children:s?"Running...":"Run Container"})]})]})]})})},Vy=({container:e,onClose:t})=>{const[n,r]=m.useState(""),[s,a]=m.useState(!0);m.useEffect(()=>{l()},[e]);async function l(){try{const c=await C.getContainerLogs(e.id,200);r(c.logs||"No logs available")}catch{r("Failed to load logs")}finally{a(!1)}}return i.jsx("div",{className:"modal-overlay",onClick:t,children:i.jsxs("div",{className:"modal modal-lg",onClick:c=>c.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsxs("h2",{children:["Logs: ",e.name]}),i.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),i.jsx("div",{className:"modal-body",children:i.jsx("pre",{className:"log-viewer",children:s?"Loading...":n})}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{className:"btn btn-secondary",onClick:l,children:"Refresh"}),i.jsx("button",{className:"btn btn-primary",onClick:t,children:"Close"})]})]})})},Wy=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!1);m.useEffect(()=>{l()},[]);async function l(){r(!0);try{const o=await C.getImages();t(o.images||[])}catch(o){console.error("Failed to load images:",o)}finally{r(!1)}}async function c(o){if(confirm("Remove this image?"))try{await C.removeImage(o,!0),l()}catch(u){console.error("Failed to remove image:",u),alert("Failed to remove image. It may be in use by a container.")}}return n?i.jsx("div",{className:"loading",children:"Loading images..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Docker Images"}),i.jsx("button",{className:"btn btn-primary",onClick:()=>a(!0),children:"Pull Image"})]}),e.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No images"}),i.jsx("p",{children:"Pull your first image to get started."})]}):i.jsx("div",{className:"docker-list",children:e.map(o=>i.jsxs("div",{className:"docker-item",children:[i.jsxs("div",{className:"docker-item-info",children:[i.jsx("div",{className:"docker-item-icon image-icon",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),i.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),i.jsx("path",{d:"M21 15l-5-5L5 21"})]})}),i.jsxs("div",{className:"docker-item-details",children:[i.jsxs("h3",{children:[o.repository,":",o.tag]}),i.jsxs("div",{className:"docker-item-meta",children:[i.jsx("span",{className:"mono",children:o.id.substring(0,12)}),i.jsx("span",{children:o.size}),i.jsx("span",{children:o.created})]})]})]}),i.jsx("div",{className:"docker-item-actions",children:i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>c(o.id),children:"Remove"})})]},o.id))}),s&&i.jsx(Qy,{onClose:()=>a(!1),onPulled:l})]})},Qy=({onClose:e,onPulled:t})=>{const[n,r]=m.useState(""),[s,a]=m.useState("latest"),[l,c]=m.useState(!1),[o,u]=m.useState("");async function h(d){d.preventDefault(),u(""),c(!0);try{await C.pullImage(n,s),t(),e()}catch(f){u(f.message||"Failed to pull image")}finally{c(!1)}}return i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Pull Image"}),i.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),o&&i.jsx("div",{className:"error-message",children:o}),i.jsxs("form",{onSubmit:h,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Image Name *"}),i.jsx("input",{type:"text",value:n,onChange:d=>r(d.target.value),placeholder:"nginx, mysql, redis",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Tag"}),i.jsx("input",{type:"text",value:s,onChange:d=>a(d.target.value),placeholder:"latest"})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:l,children:l?"Pulling...":"Pull Image"})]})]})]})})},Hy=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!1);m.useEffect(()=>{l()},[]);async function l(){r(!0);try{const u=await C.getNetworks();t(u.networks||[])}catch(u){console.error("Failed to load networks:",u)}finally{r(!1)}}async function c(u){if(confirm("Remove this network?"))try{await C.removeNetwork(u),l()}catch(h){console.error("Failed to remove network:",h),alert("Failed to remove network. It may be in use.")}}if(n)return i.jsx("div",{className:"loading",children:"Loading networks..."});const o=["bridge","host","none"];return i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Docker Networks"}),i.jsx("button",{className:"btn btn-primary",onClick:()=>a(!0),children:"Create Network"})]}),i.jsx("div",{className:"docker-list",children:e.map(u=>i.jsxs("div",{className:"docker-item",children:[i.jsxs("div",{className:"docker-item-info",children:[i.jsx("div",{className:"docker-item-icon network-icon",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),i.jsx("path",{d:"M2 17l10 5 10-5"}),i.jsx("path",{d:"M2 12l10 5 10-5"})]})}),i.jsxs("div",{className:"docker-item-details",children:[i.jsx("h3",{children:u.name}),i.jsxs("div",{className:"docker-item-meta",children:[i.jsx("span",{className:"mono",children:u.id.substring(0,12)}),i.jsxs("span",{children:["Driver: ",u.driver]}),i.jsxs("span",{children:["Scope: ",u.scope]})]})]})]}),i.jsx("div",{className:"docker-item-actions",children:!o.includes(u.name)&&i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>c(u.id),children:"Remove"})})]},u.id))}),s&&i.jsx(Ky,{onClose:()=>a(!1),onCreated:l})]})},Ky=({onClose:e,onCreated:t})=>{const[n,r]=m.useState(""),[s,a]=m.useState("bridge"),[l,c]=m.useState(!1),[o,u]=m.useState("");async function h(d){d.preventDefault(),u(""),c(!0);try{await C.createNetwork(n,s),t(),e()}catch(f){u(f.message||"Failed to create network")}finally{c(!1)}}return i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Create Network"}),i.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),o&&i.jsx("div",{className:"error-message",children:o}),i.jsxs("form",{onSubmit:h,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Network Name *"}),i.jsx("input",{type:"text",value:n,onChange:d=>r(d.target.value),placeholder:"my-network",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Driver"}),i.jsxs("select",{value:s,onChange:d=>a(d.target.value),children:[i.jsx("option",{value:"bridge",children:"bridge"}),i.jsx("option",{value:"overlay",children:"overlay"}),i.jsx("option",{value:"macvlan",children:"macvlan"})]})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:l,children:l?"Creating...":"Create Network"})]})]})]})})},Yy=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState(!1);m.useEffect(()=>{l()},[]);async function l(){r(!0);try{const o=await C.getVolumes();t(o.volumes||[])}catch(o){console.error("Failed to load volumes:",o)}finally{r(!1)}}async function c(o){if(confirm("Remove this volume? All data will be lost."))try{await C.removeVolume(o,!0),l()}catch(u){console.error("Failed to remove volume:",u),alert("Failed to remove volume. It may be in use.")}}return n?i.jsx("div",{className:"loading",children:"Loading volumes..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Docker Volumes"}),i.jsx("button",{className:"btn btn-primary",onClick:()=>a(!0),children:"Create Volume"})]}),e.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No volumes"}),i.jsx("p",{children:"Create a volume for persistent data storage."})]}):i.jsx("div",{className:"docker-list",children:e.map(o=>i.jsxs("div",{className:"docker-item",children:[i.jsxs("div",{className:"docker-item-info",children:[i.jsx("div",{className:"docker-item-icon volume-icon",children:i.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:i.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})})}),i.jsxs("div",{className:"docker-item-details",children:[i.jsx("h3",{children:o.name}),i.jsx("div",{className:"docker-item-meta",children:i.jsxs("span",{children:["Driver: ",o.driver]})})]})]}),i.jsx("div",{className:"docker-item-actions",children:i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>c(o.name),children:"Remove"})})]},o.name))}),s&&i.jsx(Gy,{onClose:()=>a(!1),onCreated:l})]})},Gy=({onClose:e,onCreated:t})=>{const[n,r]=m.useState(""),[s,a]=m.useState(!1),[l,c]=m.useState("");async function o(u){u.preventDefault(),c(""),a(!0);try{await C.createVolume(n),t(),e()}catch(h){c(h.message||"Failed to create volume")}finally{a(!1)}}return i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Create Volume"}),i.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&i.jsx("div",{className:"error-message",children:l}),i.jsxs("form",{onSubmit:o,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Volume Name *"}),i.jsx("input",{type:"text",value:n,onChange:u=>r(u.target.value),placeholder:"my-volume",required:!0})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:s,children:s?"Creating...":"Create Volume"})]})]})]})})},Xy=()=>{var c,o,u,h;const[e,t]=m.useState("mysql"),[n,r]=m.useState(null),[s,a]=m.useState(!0);m.useEffect(()=>{l()},[]);async function l(){try{const d=await C.getDatabaseStatus();r(d),!d.mysql.running&&d.postgresql.running&&t("postgresql")}catch(d){console.error("Failed to get database status:",d)}finally{a(!1)}}return s?i.jsx("div",{className:"loading",children:"Checking database servers..."}):i.jsxs("div",{children:[i.jsxs("header",{className:"top-bar",children:[i.jsxs("div",{children:[i.jsx("h1",{children:"Databases"}),i.jsx("div",{className:"subtitle",children:"Manage MySQL and PostgreSQL databases"})]}),i.jsx("div",{className:"top-bar-actions",children:i.jsxs("div",{className:"db-status-indicators",children:[i.jsxs("span",{className:`db-status-indicator ${(c=n==null?void 0:n.mysql)!=null&&c.running?"active":"inactive"}`,children:[i.jsx("span",{className:"status-dot"}),"MySQL"]}),i.jsxs("span",{className:`db-status-indicator ${(o=n==null?void 0:n.postgresql)!=null&&o.running?"active":"inactive"}`,children:[i.jsx("span",{className:"status-dot"}),"PostgreSQL"]})]})})]}),i.jsxs("div",{className:"tabs",children:[i.jsx("button",{className:`tab ${e==="mysql"?"active":""}`,onClick:()=>t("mysql"),disabled:!((u=n==null?void 0:n.mysql)!=null&&u.installed),children:"MySQL / MariaDB"}),i.jsx("button",{className:`tab ${e==="postgresql"?"active":""}`,onClick:()=>t("postgresql"),disabled:!((h=n==null?void 0:n.postgresql)!=null&&h.installed),children:"PostgreSQL"}),i.jsx("button",{className:`tab ${e==="backups"?"active":""}`,onClick:()=>t("backups"),children:"Backups"})]}),i.jsxs("div",{className:"tab-content",children:[e==="mysql"&&i.jsx(Jy,{status:n==null?void 0:n.mysql}),e==="postgresql"&&i.jsx(Zy,{status:n==null?void 0:n.postgresql}),e==="backups"&&i.jsx(eg,{})]})]})},Jy=({status:e})=>{const[t,n]=m.useState([]),[r,s]=m.useState([]),[a,l]=m.useState(!0),[c,o]=m.useState("databases"),[u,h]=m.useState(!1),[d,f]=m.useState(!1),[g,x]=m.useState(null);m.useEffect(()=>{e!=null&&e.running?k():l(!1)},[e]);async function k(){l(!0);try{const[p,j]=await Promise.all([C.getMySQLDatabases(),C.getMySQLUsers()]);n(p.databases||[]),s(j.users||[])}catch(p){console.error("Failed to load MySQL data:",p)}finally{l(!1)}}async function N(p){if(confirm(`Drop database "${p}"? This cannot be undone!`))try{await C.dropMySQLDatabase(p),k()}catch(j){console.error("Failed to drop database:",j),alert("Failed to drop database")}}async function y(p){try{const j=await C.backupMySQLDatabase(p);j.success&&alert(`Backup created: ${j.backup_path}`)}catch(j){console.error("Failed to backup database:",j),alert("Failed to create backup")}}async function v(p,j){if(confirm(`Drop user "${p}"@"${j}"?`))try{await C.dropMySQLUser(p,j),k()}catch(S){console.error("Failed to drop user:",S),alert("Failed to drop user")}}return e!=null&&e.running?a?i.jsx("div",{className:"loading",children:"Loading MySQL data..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsxs("div",{className:"view-toggle",children:[i.jsxs("button",{className:`btn btn-sm ${c==="databases"?"btn-primary":"btn-secondary"}`,onClick:()=>o("databases"),children:["Databases (",t.length,")"]}),i.jsxs("button",{className:`btn btn-sm ${c==="users"?"btn-primary":"btn-secondary"}`,onClick:()=>o("users"),children:["Users (",r.length,")"]})]}),c==="databases"?i.jsx("button",{className:"btn btn-primary",onClick:()=>h(!0),children:"Create Database"}):i.jsx("button",{className:"btn btn-primary",onClick:()=>f(!0),children:"Create User"})]}),c==="databases"?t.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No databases"}),i.jsx("p",{children:"Create your first MySQL database."})]}):i.jsx("div",{className:"db-list",children:t.map(p=>i.jsxs("div",{className:"db-item",children:[i.jsxs("div",{className:"db-item-info",children:[i.jsx("div",{className:"db-item-icon mysql",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),i.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),i.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]})}),i.jsxs("div",{className:"db-item-details",children:[i.jsx("h3",{children:p.name}),i.jsxs("div",{className:"db-item-meta",children:[i.jsx("span",{children:Kl(p.size)}),i.jsx("span",{children:"MySQL"})]})]})]}),i.jsxs("div",{className:"db-item-actions",children:[i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>x(p),children:"Tables"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>y(p.name),children:"Backup"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>N(p.name),children:"Drop"})]})]},p.name))}):r.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No users"}),i.jsx("p",{children:"Create your first MySQL user."})]}):i.jsx("div",{className:"db-list",children:r.map(p=>i.jsxs("div",{className:"db-item",children:[i.jsxs("div",{className:"db-item-info",children:[i.jsx("div",{className:"db-item-icon user",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),i.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),i.jsxs("div",{className:"db-item-details",children:[i.jsx("h3",{children:p.user}),i.jsx("div",{className:"db-item-meta",children:i.jsxs("span",{children:["Host: ",p.host]})})]})]}),i.jsx("div",{className:"db-item-actions",children:i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>v(p.user,p.host),children:"Drop"})})]},`${p.user}@${p.host}`))}),u&&i.jsx(tg,{onClose:()=>h(!1),onCreated:k}),d&&i.jsx(ng,{databases:t,onClose:()=>f(!1),onCreated:k}),g&&i.jsx(Nh,{database:g,dbType:"mysql",onClose:()=>x(null)})]}):i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"MySQL is not running"}),i.jsx("p",{children:"Start the MySQL server to manage databases."})]})},Zy=({status:e})=>{const[t,n]=m.useState([]),[r,s]=m.useState([]),[a,l]=m.useState(!0),[c,o]=m.useState("databases"),[u,h]=m.useState(!1),[d,f]=m.useState(!1),[g,x]=m.useState(null);m.useEffect(()=>{e!=null&&e.running?k():l(!1)},[e]);async function k(){l(!0);try{const[p,j]=await Promise.all([C.getPostgreSQLDatabases(),C.getPostgreSQLUsers()]);n(p.databases||[]),s(j.users||[])}catch(p){console.error("Failed to load PostgreSQL data:",p)}finally{l(!1)}}async function N(p){if(confirm(`Drop database "${p}"? This cannot be undone!`))try{await C.dropPostgreSQLDatabase(p),k()}catch(j){console.error("Failed to drop database:",j),alert("Failed to drop database")}}async function y(p){try{const j=await C.backupPostgreSQLDatabase(p);j.success&&alert(`Backup created: ${j.backup_path}`)}catch(j){console.error("Failed to backup database:",j),alert("Failed to create backup")}}async function v(p){if(confirm(`Drop user "${p}"?`))try{await C.dropPostgreSQLUser(p),k()}catch(j){console.error("Failed to drop user:",j),alert("Failed to drop user")}}return e!=null&&e.running?a?i.jsx("div",{className:"loading",children:"Loading PostgreSQL data..."}):i.jsxs("div",{children:[i.jsxs("div",{className:"section-header",children:[i.jsxs("div",{className:"view-toggle",children:[i.jsxs("button",{className:`btn btn-sm ${c==="databases"?"btn-primary":"btn-secondary"}`,onClick:()=>o("databases"),children:["Databases (",t.length,")"]}),i.jsxs("button",{className:`btn btn-sm ${c==="users"?"btn-primary":"btn-secondary"}`,onClick:()=>o("users"),children:["Users (",r.length,")"]})]}),c==="databases"?i.jsx("button",{className:"btn btn-primary",onClick:()=>h(!0),children:"Create Database"}):i.jsx("button",{className:"btn btn-primary",onClick:()=>f(!0),children:"Create User"})]}),c==="databases"?t.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No databases"}),i.jsx("p",{children:"Create your first PostgreSQL database."})]}):i.jsx("div",{className:"db-list",children:t.map(p=>i.jsxs("div",{className:"db-item",children:[i.jsxs("div",{className:"db-item-info",children:[i.jsx("div",{className:"db-item-icon postgresql",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),i.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),i.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]})}),i.jsxs("div",{className:"db-item-details",children:[i.jsx("h3",{children:p.name}),i.jsxs("div",{className:"db-item-meta",children:[i.jsx("span",{children:Kl(p.size)}),i.jsx("span",{children:"PostgreSQL"})]})]})]}),i.jsxs("div",{className:"db-item-actions",children:[i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>x(p),children:"Tables"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>y(p.name),children:"Backup"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>N(p.name),children:"Drop"})]})]},p.name))}):r.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No users"}),i.jsx("p",{children:"Create your first PostgreSQL user."})]}):i.jsx("div",{className:"db-list",children:r.map(p=>i.jsxs("div",{className:"db-item",children:[i.jsxs("div",{className:"db-item-info",children:[i.jsx("div",{className:"db-item-icon user",children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),i.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),i.jsxs("div",{className:"db-item-details",children:[i.jsx("h3",{children:p.user}),i.jsx("div",{className:"db-item-meta",children:i.jsx("span",{children:"PostgreSQL User"})})]})]}),i.jsx("div",{className:"db-item-actions",children:i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>v(p.user),children:"Drop"})})]},p.user))}),u&&i.jsx(rg,{onClose:()=>h(!1),onCreated:k}),d&&i.jsx(sg,{databases:t,onClose:()=>f(!1),onCreated:k}),g&&i.jsx(Nh,{database:g,dbType:"postgresql",onClose:()=>x(null)})]}):i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"PostgreSQL is not running"}),i.jsx("p",{children:"Start the PostgreSQL server to manage databases."})]})},eg=()=>{const[e,t]=m.useState([]),[n,r]=m.useState(!0),[s,a]=m.useState("all");m.useEffect(()=>{l()},[s]);async function l(){r(!0);try{const o=s==="all"?null:s,u=await C.getDatabaseBackups(o);t(u.backups||[])}catch(o){console.error("Failed to load backups:",o)}finally{r(!1)}}async function c(o){if(confirm("Delete this backup?"))try{await C.deleteDatabaseBackup(o),l()}catch(u){console.error("Failed to delete backup:",u)}}return n?i.jsx("div",{className:"loading",children:"Loading backups..."}):i.jsxs("div",{children:[i.jsx("div",{className:"section-header",children:i.jsxs("div",{className:"view-toggle",children:[i.jsx("button",{className:`btn btn-sm ${s==="all"?"btn-primary":"btn-secondary"}`,onClick:()=>a("all"),children:"All"}),i.jsx("button",{className:`btn btn-sm ${s==="mysql"?"btn-primary":"btn-secondary"}`,onClick:()=>a("mysql"),children:"MySQL"}),i.jsx("button",{className:`btn btn-sm ${s==="postgresql"?"btn-primary":"btn-secondary"}`,onClick:()=>a("postgresql"),children:"PostgreSQL"})]})}),e.length===0?i.jsxs("div",{className:"empty-state",children:[i.jsx("h3",{children:"No backups"}),i.jsx("p",{children:"Database backups will appear here."})]}):i.jsx("div",{className:"db-list",children:e.map(o=>i.jsxs("div",{className:"db-item",children:[i.jsxs("div",{className:"db-item-info",children:[i.jsx("div",{className:`db-item-icon ${o.type}`,children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24",stroke:"currentColor",fill:"none",strokeWidth:"2",children:[i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i.jsx("polyline",{points:"7 10 12 15 17 10"}),i.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}),i.jsxs("div",{className:"db-item-details",children:[i.jsx("h3",{children:o.database}),i.jsxs("div",{className:"db-item-meta",children:[i.jsx("span",{className:"mono",children:o.filename}),i.jsx("span",{children:Kl(o.size)}),i.jsx("span",{children:new Date(o.created_at).toLocaleString()})]})]})]}),i.jsxs("div",{className:"db-item-actions",children:[i.jsx("span",{className:`db-type-badge ${o.type}`,children:o.type==="mysql"?"MySQL":"PostgreSQL"}),i.jsx("button",{className:"btn btn-secondary btn-sm",onClick:()=>c(o.filename),children:"Delete"})]})]},o.filename))})]})},tg=({onClose:e,onCreated:t})=>{const[n,r]=m.useState({name:"",charset:"utf8mb4",collation:"utf8mb4_unicode_ci",create_user:!0,user_password:""}),[s,a]=m.useState(!1),[l,c]=m.useState(""),[o,u]=m.useState(null);async function h(d){d.preventDefault(),c(""),a(!0);try{const f=await C.createMySQLDatabase(n);f.success&&(f.password?u({database:n.name,user:f.user,password:f.password}):(t(),e()))}catch(f){c(f.message||"Failed to create database")}finally{a(!1)}}return o?i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Database Created"}),i.jsx("button",{className:"modal-close",onClick:()=>{t(),e()},children:"×"})]}),i.jsx("div",{className:"modal-body",children:i.jsxs("div",{className:"credentials-box",children:[i.jsx("p",{children:"Save these credentials - the password won't be shown again!"}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Database:"}),i.jsx("code",{children:o.database})]}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Username:"}),i.jsx("code",{children:o.user})]}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Password:"}),i.jsx("code",{children:o.password})]})]})}),i.jsx("div",{className:"modal-actions",children:i.jsx("button",{className:"btn btn-primary",onClick:()=>{t(),e()},children:"Done"})})]})}):i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Create MySQL Database"}),i.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&i.jsx("div",{className:"error-message",children:l}),i.jsxs("form",{onSubmit:h,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Database Name *"}),i.jsx("input",{type:"text",value:n.name,onChange:d=>r({...n,name:d.target.value}),placeholder:"my_database",required:!0,pattern:"[a-zA-Z0-9_]+"})]}),i.jsxs("div",{className:"form-row",children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Character Set"}),i.jsxs("select",{value:n.charset,onChange:d=>r({...n,charset:d.target.value}),children:[i.jsx("option",{value:"utf8mb4",children:"utf8mb4"}),i.jsx("option",{value:"utf8",children:"utf8"}),i.jsx("option",{value:"latin1",children:"latin1"})]})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Collation"}),i.jsxs("select",{value:n.collation,onChange:d=>r({...n,collation:d.target.value}),children:[i.jsx("option",{value:"utf8mb4_unicode_ci",children:"utf8mb4_unicode_ci"}),i.jsx("option",{value:"utf8mb4_general_ci",children:"utf8mb4_general_ci"}),i.jsx("option",{value:"utf8_general_ci",children:"utf8_general_ci"})]})]})]}),i.jsx("div",{className:"form-group",children:i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:n.create_user,onChange:d=>r({...n,create_user:d.target.checked})}),"Create user with same name and full privileges"]})}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:s,children:s?"Creating...":"Create Database"})]})]})]})})},ng=({databases:e,onClose:t,onCreated:n})=>{const[r,s]=m.useState({username:"",password:"",host:"localhost",database:"",privileges:"ALL"}),[a,l]=m.useState(!1),[c,o]=m.useState(""),[u,h]=m.useState(null);async function d(){try{const g=await C.generateDatabasePassword();s({...r,password:g.password})}catch(g){console.error("Failed to generate password:",g)}}async function f(g){g.preventDefault(),o(""),l(!0);try{const x=await C.createMySQLUser(r);x.success&&h({username:r.username,password:x.password,host:r.host})}catch(x){o(x.message||"Failed to create user")}finally{l(!1)}}return u?i.jsx("div",{className:"modal-overlay",onClick:t,children:i.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"User Created"}),i.jsx("button",{className:"modal-close",onClick:()=>{n(),t()},children:"×"})]}),i.jsx("div",{className:"modal-body",children:i.jsxs("div",{className:"credentials-box",children:[i.jsx("p",{children:"Save these credentials!"}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Username:"}),i.jsx("code",{children:u.username})]}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Password:"}),i.jsx("code",{children:u.password})]}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Host:"}),i.jsx("code",{children:u.host})]})]})}),i.jsx("div",{className:"modal-actions",children:i.jsx("button",{className:"btn btn-primary",onClick:()=>{n(),t()},children:"Done"})})]})}):i.jsx("div",{className:"modal-overlay",onClick:t,children:i.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Create MySQL User"}),i.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),c&&i.jsx("div",{className:"error-message",children:c}),i.jsxs("form",{onSubmit:f,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Username *"}),i.jsx("input",{type:"text",value:r.username,onChange:g=>s({...r,username:g.target.value}),placeholder:"db_user",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Password"}),i.jsxs("div",{className:"input-with-button",children:[i.jsx("input",{type:"text",value:r.password,onChange:g=>s({...r,password:g.target.value}),placeholder:"Leave empty to auto-generate"}),i.jsx("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:d,children:"Generate"})]})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Host"}),i.jsxs("select",{value:r.host,onChange:g=>s({...r,host:g.target.value}),children:[i.jsx("option",{value:"localhost",children:"localhost"}),i.jsx("option",{value:"%",children:"% (any host)"}),i.jsx("option",{value:"127.0.0.1",children:"127.0.0.1"})]})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Grant privileges on database"}),i.jsxs("select",{value:r.database,onChange:g=>s({...r,database:g.target.value}),children:[i.jsx("option",{value:"",children:"-- None --"}),e.map(g=>i.jsx("option",{value:g.name,children:g.name},g.name))]})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Creating...":"Create User"})]})]})]})})},rg=({onClose:e,onCreated:t})=>{const[n,r]=m.useState({name:"",encoding:"UTF8",create_user:!0}),[s,a]=m.useState(!1),[l,c]=m.useState(""),[o,u]=m.useState(null);async function h(d){d.preventDefault(),c(""),a(!0);try{const f=await C.createPostgreSQLDatabase(n);f.success&&(f.password?u({database:n.name,user:f.user,password:f.password}):(t(),e()))}catch(f){c(f.message||"Failed to create database")}finally{a(!1)}}return o?i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Database Created"}),i.jsx("button",{className:"modal-close",onClick:()=>{t(),e()},children:"×"})]}),i.jsx("div",{className:"modal-body",children:i.jsxs("div",{className:"credentials-box",children:[i.jsx("p",{children:"Save these credentials!"}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Database:"}),i.jsx("code",{children:o.database})]}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Username:"}),i.jsx("code",{children:o.user})]}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Password:"}),i.jsx("code",{children:o.password})]})]})}),i.jsx("div",{className:"modal-actions",children:i.jsx("button",{className:"btn btn-primary",onClick:()=>{t(),e()},children:"Done"})})]})}):i.jsx("div",{className:"modal-overlay",onClick:e,children:i.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Create PostgreSQL Database"}),i.jsx("button",{className:"modal-close",onClick:e,children:"×"})]}),l&&i.jsx("div",{className:"error-message",children:l}),i.jsxs("form",{onSubmit:h,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Database Name *"}),i.jsx("input",{type:"text",value:n.name,onChange:d=>r({...n,name:d.target.value}),placeholder:"my_database",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Encoding"}),i.jsxs("select",{value:n.encoding,onChange:d=>r({...n,encoding:d.target.value}),children:[i.jsx("option",{value:"UTF8",children:"UTF8"}),i.jsx("option",{value:"LATIN1",children:"LATIN1"}),i.jsx("option",{value:"SQL_ASCII",children:"SQL_ASCII"})]})]}),i.jsx("div",{className:"form-group",children:i.jsxs("label",{className:"checkbox-label",children:[i.jsx("input",{type:"checkbox",checked:n.create_user,onChange:d=>r({...n,create_user:d.target.checked})}),"Create user with same name and full privileges"]})}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:e,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:s,children:s?"Creating...":"Create Database"})]})]})]})})},sg=({databases:e,onClose:t,onCreated:n})=>{const[r,s]=m.useState({username:"",password:"",database:""}),[a,l]=m.useState(!1),[c,o]=m.useState(""),[u,h]=m.useState(null);async function d(){try{const g=await C.generateDatabasePassword();s({...r,password:g.password})}catch(g){console.error("Failed to generate password:",g)}}async function f(g){g.preventDefault(),o(""),l(!0);try{const x=await C.createPostgreSQLUser(r);x.success&&h({username:r.username,password:x.password})}catch(x){o(x.message||"Failed to create user")}finally{l(!1)}}return u?i.jsx("div",{className:"modal-overlay",onClick:t,children:i.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"User Created"}),i.jsx("button",{className:"modal-close",onClick:()=>{n(),t()},children:"×"})]}),i.jsx("div",{className:"modal-body",children:i.jsxs("div",{className:"credentials-box",children:[i.jsx("p",{children:"Save these credentials!"}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Username:"}),i.jsx("code",{children:u.username})]}),i.jsxs("div",{className:"credential-item",children:[i.jsx("label",{children:"Password:"}),i.jsx("code",{children:u.password})]})]})}),i.jsx("div",{className:"modal-actions",children:i.jsx("button",{className:"btn btn-primary",onClick:()=>{n(),t()},children:"Done"})})]})}):i.jsx("div",{className:"modal-overlay",onClick:t,children:i.jsxs("div",{className:"modal",onClick:g=>g.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Create PostgreSQL User"}),i.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),c&&i.jsx("div",{className:"error-message",children:c}),i.jsxs("form",{onSubmit:f,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Username *"}),i.jsx("input",{type:"text",value:r.username,onChange:g=>s({...r,username:g.target.value}),placeholder:"db_user",required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Password"}),i.jsxs("div",{className:"input-with-button",children:[i.jsx("input",{type:"text",value:r.password,onChange:g=>s({...r,password:g.target.value}),placeholder:"Leave empty to auto-generate"}),i.jsx("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:d,children:"Generate"})]})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Grant privileges on database"}),i.jsxs("select",{value:r.database,onChange:g=>s({...r,database:g.target.value}),children:[i.jsx("option",{value:"",children:"-- None --"}),e.map(g=>i.jsx("option",{value:g.name,children:g.name},g.name))]})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Cancel"}),i.jsx("button",{type:"submit",className:"btn btn-primary",disabled:a,children:a?"Creating...":"Create User"})]})]})]})})},Nh=({database:e,dbType:t,onClose:n})=>{const[r,s]=m.useState([]),[a,l]=m.useState(!0);m.useEffect(()=>{c()},[e,t]);async function c(){try{let o;t==="mysql"?o=await C.getMySQLTables(e.name):o=await C.getPostgreSQLTables(e.name),s(o.tables||[])}catch(o){console.error("Failed to load tables:",o)}finally{l(!1)}}return i.jsx("div",{className:"modal-overlay",onClick:n,children:i.jsxs("div",{className:"modal",onClick:o=>o.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsxs("h2",{children:["Tables in ",e.name]}),i.jsx("button",{className:"modal-close",onClick:n,children:"×"})]}),i.jsx("div",{className:"modal-body",children:a?i.jsx("div",{className:"loading",children:"Loading tables..."}):r.length===0?i.jsx("p",{className:"hint",children:"No tables in this database."}):i.jsx("div",{className:"tables-list",children:r.map(o=>i.jsxs("div",{className:"table-item",children:[i.jsx("span",{className:"table-name",children:o.name}),i.jsxs("span",{className:"table-rows",children:[o.rows.toLocaleString()," rows"]})]},o.name))})}),i.jsx("div",{className:"modal-actions",children:i.jsx("button",{className:"btn btn-primary",onClick:n,children:"Close"})})]})})};function Kl(e){if(!e||e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}function ig({children:e}){const{isAuthenticated:t,loading:n}=Or();return n?i.jsx("div",{className:"loading",children:"Loading..."}):t?e:i.jsx(ah,{to:"/login"})}function zc({children:e}){const{isAuthenticated:t,loading:n}=Or();return n?i.jsx("div",{className:"loading",children:"Loading..."}):t?i.jsx(ah,{to:"/"}):e}function ag(){return i.jsxs(Ym,{children:[i.jsx(we,{path:"/login",element:i.jsx(zc,{children:i.jsx(_y,{})})}),i.jsx(we,{path:"/register",element:i.jsx(zc,{children:i.jsx(by,{})})}),i.jsxs(we,{path:"/",element:i.jsx(ig,{children:i.jsx(fv,{})}),children:[i.jsx(we,{index:!0,element:i.jsx(Cy,{})}),i.jsx(we,{path:"apps",element:i.jsx(Ey,{})}),i.jsx(we,{path:"apps/:id",element:i.jsx(Ty,{})}),i.jsx(we,{path:"domains",element:i.jsx("div",{className:"page",children:"Domains & Sites"})}),i.jsx(we,{path:"databases",element:i.jsx(Xy,{})}),i.jsx(we,{path:"ssl",element:i.jsx("div",{className:"page",children:"SSL Certificates"})}),i.jsx(we,{path:"docker",element:i.jsx(qy,{})}),i.jsx(we,{path:"terminal",element:i.jsx("div",{className:"page",children:"Terminal / Logs"})}),i.jsx(we,{path:"settings",element:i.jsx("div",{className:"page",children:"Settings"})})]})]})}function lg(){return i.jsx(rv,{children:i.jsx(dv,{children:i.jsx(ag,{})})})}Ii.createRoot(document.getElementById("root")).render(i.jsx(Kc.StrictMode,{children:i.jsx(lg,{})}));
diff --git a/frontend/dist/assets/index-zpQn1_s8.css b/frontend/dist/assets/index-zpQn1_s8.css
new file mode 100644
index 00000000..08499e6e
--- /dev/null
+++ b/frontend/dist/assets/index-zpQn1_s8.css
@@ -0,0 +1 @@
+*{margin:0;padding:0;box-sizing:border-box;outline:none}html{font-size:16px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background-color:#09090b;color:#f4f4f5;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;min-height:100vh}a{color:inherit;text-decoration:none}button{font-family:inherit}img{max-width:100%;height:auto}ul,ol{list-style:none}::selection{background:#6366f1;color:#fff}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#09090b}::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#71717a}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25;letter-spacing:-.5px}h1{font-size:24px}h2{font-size:18px}h3{font-size:16px}h4{font-size:14px}.text-primary{color:#f4f4f5}.text-secondary{color:#a1a1aa}.text-tertiary{color:#71717a}.text-success{color:#10b981}.text-warning{color:#f59e0b}.text-danger{color:#ef4444}.text-accent{color:#6366f1}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.subtitle{color:#71717a;margin-top:4px;font-size:14px}.section-title{font-size:18px;margin-bottom:20px;font-weight:600}.sidebar{width:280px;background-color:#0f0f11;border-right:1px solid #27272a;display:flex;flex-direction:column;position:fixed;height:100vh;z-index:30}@media (max-width: 768px){.sidebar{display:none}}.brand{padding:24px 32px;font-size:16px;font-weight:700;letter-spacing:-.5px;color:#f4f4f5;display:flex;align-items:center;justify-content:flex-start;gap:12px;border-bottom:1px solid #27272a}.brand-logo{width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:linear-gradient(135deg,#6366f1,#a9abf7);border-radius:8px;color:#fff}.menu-label{padding:24px 32px 8px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:#71717a}.nav{display:flex;flex-direction:column;padding:0 16px;gap:4px}.nav-item{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:10px 16px;color:#a1a1aa;text-decoration:none;border-radius:6px;transition:all .2s ease;font-weight:500}.nav-item:hover{background-color:#27272a;color:#f4f4f5}.nav-item.active{background-color:#6366f126;color:#6366f1}.nav-item svg{width:20px;height:20px;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none}.user-profile{margin-top:auto;padding:20px;border-top:1px solid #27272a;display:flex;align-items:center;justify-content:flex-start;gap:12px}.avatar{width:36px;height:36px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background-color:#27272a;border-radius:9999px;color:#a1a1aa;font-weight:600}.dashboard-layout{display:flex;min-height:100vh}.main-content{margin-left:280px;flex:1;padding:40px;overflow-y:auto}@media (max-width: 768px){.main-content{margin-left:0;padding:20px}}.top-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:40px}.top-bar h1{font-size:24px;font-weight:600;letter-spacing:-.5px}@media (max-width: 768px){.top-bar{flex-direction:column;align-items:flex-start;gap:16px}}.top-bar-actions{display:flex;gap:12px}.page{font-size:24px;color:#a1a1aa}.loading{display:flex;align-items:center;justify-content:center;min-height:100vh;color:#a1a1aa}.stats-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:24px;margin-bottom:32px}@media (max-width: 1280px){.stats-strip{grid-template-columns:repeat(2,1fr)}}@media (max-width: 640px){.stats-strip{grid-template-columns:1fr}}.dashboard-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:24px}.overview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:24px}@media (max-width: 768px){.overview-grid{grid-template-columns:1fr}}.btn{display:inline-flex;align-items:center;gap:8px;padding:8px 20px;border-radius:8px;border:1px solid transparent;font-size:13px;font-weight:500;cursor:pointer;transition:all .2s ease;background:none}.btn:disabled{opacity:.6;cursor:not-allowed}.btn svg{width:16px;height:16px}.btn-primary{background-color:#6366f1;color:#fff;box-shadow:0 4px 12px #6366f14d}.btn-primary:hover:not(:disabled){background-color:#4f46e5}.btn-secondary{background-color:transparent;border-color:#3f3f46;color:#f4f4f5}.btn-secondary:hover:not(:disabled){background-color:#27272a}.btn-danger{background:#ef4444;color:#fff}.btn-danger:hover:not(:disabled){background:#dc2626}.btn-ghost{background:transparent;color:#a1a1aa}.btn-ghost:hover:not(:disabled){background-color:#27272a;color:#f4f4f5}.btn-sm{padding:4px 8px;font-size:11px}.btn-lg{padding:12px 24px;font-size:14px}.btn-full{width:100%;justify-content:center}.btn-icon{padding:8px}.btn-icon svg{width:18px;height:18px}.btn-expand{background:none;border:none;color:#71717a;cursor:pointer;padding:4px 8px;font-size:12px;display:flex;align-items:center;justify-content:flex-start;gap:4px;transition:color .2s ease}.btn-expand:hover{color:#f4f4f5}.card{background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease;padding:24px;position:relative;overflow:hidden}.card:hover{border-color:#3f3f46}.card:hover{transform:translateY(-2px)}.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.card h3{font-size:16px;font-weight:600;color:#f4f4f5;margin-bottom:4px}.card-link{color:#a1a1aa;text-decoration:none;font-size:13px;transition:color .2s ease}.card-link:hover{color:#6366f1}.app-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:10px;font-size:18px;font-weight:700;color:#fff}.metric-row{margin-top:24px;padding-top:20px;border-top:1px solid #27272a;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#a1a1aa}.metric-item{display:flex;flex-direction:column;gap:4px}.metric-value{font-weight:600;color:#f4f4f5;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.stat-card{background:#18181b;padding:20px;border-radius:12px;border:1px solid #27272a;display:flex;flex-direction:column;gap:8px}.stat-label{font-size:12px;color:#71717a;text-transform:uppercase;font-weight:600}.stat-value{font-size:20px;font-weight:700;color:#f4f4f5}.stat-suffix{font-size:14px;color:#71717a;font-weight:400}.progress-bar{height:4px;background:#27272a;border-radius:2px;overflow:hidden;margin-top:4px}.progress-fill{height:100%;border-radius:2px;transition:width .2s ease}.empty-state{text-align:center;padding:64px 20px;background:#18181b;border-radius:12px;border:1px solid #27272a}.empty-state svg{color:#71717a;margin-bottom:16px}.empty-state h3{font-size:16px;font-weight:600;margin-bottom:8px}.empty-state p{color:#a1a1aa;margin-bottom:24px}.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.section-header h3{font-size:16px;font-weight:600}.danger-zone{border-color:#ef44444d;background:#ef44440d}.danger-zone h4{color:#ef4444;margin-bottom:8px}.danger-zone p{color:#a1a1aa;margin-bottom:16px}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:40;padding:20px;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.modal{background:#18181b;border:1px solid #27272a;border-radius:16px;width:100%;max-width:560px;max-height:90vh;overflow-y:auto}.modal::-webkit-scrollbar{width:6px;height:6px}.modal::-webkit-scrollbar-track{background:#09090b}.modal::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.modal::-webkit-scrollbar-thumb:hover{background:#71717a}.modal-lg{max-width:800px}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:24px;border-bottom:1px solid #27272a}.modal-header h2{font-size:18px;font-weight:600}.modal-close{background:none;border:none;color:#71717a;font-size:24px;cursor:pointer;line-height:1;padding:4px;transition:color .2s ease}.modal-close:hover{color:#f4f4f5}.modal-body{padding:24px;max-height:60vh;overflow-y:auto}.modal-body::-webkit-scrollbar{width:6px;height:6px}.modal-body::-webkit-scrollbar-track{background:#09090b}.modal-body::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.modal-body::-webkit-scrollbar-thumb:hover{background:#71717a}.modal form{padding:24px}.modal-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:24px;padding-top:24px;border-top:1px solid #27272a}.app-type-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:16px;padding:24px}.app-type-card{background:#09090b;border:1px solid #27272a;border-radius:12px;padding:24px;text-align:center;cursor:pointer;transition:all .2s ease}.app-type-card:hover{border-color:#6366f1;background:#27272a}.app-type-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:12px;font-size:20px;font-weight:700;color:#fff;margin:0 auto 16px}.app-type-card h3{font-size:14px;font-weight:600;margin-bottom:4px;color:#f4f4f5}.app-type-card p{font-size:12px;color:#71717a;line-height:1.5}.confirm-dialog{max-width:400px;text-align:center}.confirm-dialog-content{padding:32px 24px 24px}.confirm-dialog-icon{width:64px;height:64px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;margin:0 auto 16px}.confirm-dialog-icon svg{width:32px;height:32px}.confirm-dialog-icon-danger{background:#ef444426;color:#ef4444}.confirm-dialog-icon-warning{background:#f59e0b26;color:#f59e0b}.confirm-dialog-icon-info{background:#6366f126;color:#6366f1}.confirm-dialog-title{font-size:18px;font-weight:600;margin-bottom:8px}.confirm-dialog-message{font-size:12px;color:#a1a1aa;line-height:1.6}.confirm-dialog-actions{display:flex;gap:12px;justify-content:center;padding:16px 24px 24px}.form-group{margin-bottom:20px}.form-group label{display:block;font-size:13px;font-weight:500;color:#a1a1aa;margin-bottom:8px}.form-group input,.form-group select,.form-group textarea{width:100%;padding:12px 16px;background:#09090b;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-size:14px;transition:border-color .2s ease}.form-group input:focus,.form-group select:focus,.form-group textarea:focus{border-color:#6366f1;outline:none}.form-group input::placeholder,.form-group select::placeholder,.form-group textarea::placeholder{color:#71717a}.form-group select{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 16px center;padding-right:40px}.form-group textarea{font-family:Fira Code,Monaco,Consolas,monospace;resize:vertical;min-height:120px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}@media (max-width: 768px){.form-row{grid-template-columns:1fr}}.install-form,.env-form,.command-input{display:flex;gap:12px;margin-bottom:24px}.install-form input,.env-form input,.command-input input{flex:1;width:100%;padding:12px 16px;background:#09090b;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-size:14px;transition:border-color .2s ease}.install-form input:focus,.env-form input:focus,.command-input input:focus{border-color:#6366f1;outline:none}.install-form input::placeholder,.env-form input::placeholder,.command-input input::placeholder{color:#71717a}.hint{color:#71717a;font-size:13px;margin-bottom:16px}.error-message{background:#ef44441a;border:1px solid rgba(239,68,68,.2);color:#ef4444;padding:12px 16px;border-radius:8px;margin-bottom:20px;font-size:13px}.error-banner{background:#ef44441a;border:1px solid rgba(239,68,68,.2);color:#ef4444;padding:12px 16px;border-radius:8px;margin-bottom:24px}.filter-toggle{display:flex;align-items:center;justify-content:flex-start;gap:8px}.filter-toggle label{display:flex;align-items:center;justify-content:flex-start;gap:8px;color:#a1a1aa;font-size:13px;cursor:pointer}.filter-toggle input[type=checkbox]{width:16px;height:16px;accent-color:#6366f1}.code-editor{width:100%;min-height:400px;padding:16px;background:#09090b;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-family:Fira Code,Monaco,Consolas,monospace;font-size:13px;line-height:1.6;resize:vertical;transition:border-color .2s ease}.code-editor:focus{border-color:#6366f1}.status-badge{display:flex;align-items:center;gap:6px;padding:4px 10px;border-radius:9999px;font-size:11px;font-weight:600;border:1px solid transparent}.status-dot{width:6px;height:6px;background:currentColor;border-radius:9999px}.status-active{background:#10b9811a;color:#10b981;border-color:#10b98133}.status-warning{background:#f59e0b1a;color:#f59e0b;border-color:#f59e0b33}.status-stopped{background:#71717a1a;color:#71717a;border-color:#71717a33}.status-error{background:#ef44441a;color:#ef4444;border-color:#ef444433}.app-type{background:#27272a;padding:2px 8px;border-radius:4px;font-weight:600;font-size:10px;letter-spacing:.5px;text-transform:uppercase}.ssl-badge{background:#10b9811a;color:#10b981;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600}.active-badge{background:#10b9811a;color:#10b981;padding:4px 12px;border-radius:9999px;font-size:12px;font-weight:600}.db-type-badge{display:inline-flex;align-items:center;gap:4px;background:#27272a;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.3px}.db-type-badge.mysql{color:#f29111}.db-type-badge.postgresql{color:#336791}.privilege-tag{background:#6366f126;color:#6366f1;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.3px}.table-tag{background:#27272a;border:1px solid #27272a;padding:6px 12px;border-radius:6px;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;color:#a1a1aa}.tabs{display:flex;gap:4px;border-bottom:1px solid #27272a;margin-bottom:24px;overflow-x:auto}.tabs::-webkit-scrollbar{width:6px;height:6px}.tabs::-webkit-scrollbar-track{background:#09090b}.tabs::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.tabs::-webkit-scrollbar-thumb:hover{background:#71717a}@media (max-width: 768px){.tabs{overflow-x:auto;-webkit-overflow-scrolling:touch}}.tab{background:none;border:none;padding:12px 20px;color:#a1a1aa;font-size:14px;font-weight:500;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;transition:all .2s ease;white-space:nowrap}.tab:hover{color:#f4f4f5}.tab.active{color:#6366f1;border-bottom-color:#6366f1}.tab-content{min-height:400px}.list-base{display:flex;flex-direction:column;gap:8px}.info-list{display:flex;flex-direction:column;gap:12px}.info-item{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid #27272a}.info-item:last-child{border-bottom:none}.info-label{color:#71717a;font-size:13px}.info-value{color:#f4f4f5;font-weight:500}.info-value.mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.packages-list{display:flex;flex-direction:column;gap:8px}.package-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.package-item:hover{border-color:#3f3f46}.package-name{font-weight:500}.package-version{color:#71717a;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.env-list{display:flex;flex-direction:column;gap:8px}.env-item{display:flex;align-items:center;gap:16px;padding:12px 16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.env-item:hover{border-color:#3f3f46}.env-key{font-weight:600;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;color:#6366f1;min-width:150px}.env-value{flex:1;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;color:#a1a1aa;word-break:break-all}.plugins-list,.themes-list{display:flex;flex-direction:column;gap:8px}.plugin-item,.theme-item{display:flex;align-items:center;justify-content:space-between;padding:16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.plugin-item:hover,.theme-item:hover{border-color:#3f3f46}.plugin-item.active,.theme-item.active{border-color:#10b981;background:#10b9810d}.plugin-info,.theme-info{display:flex;align-items:center;justify-content:flex-start;gap:12px}.plugin-name,.theme-name{font-weight:500}.plugin-version,.theme-version{color:#71717a;font-size:12px}.backups-list{display:flex;flex-direction:column;gap:8px}.backup-item{display:flex;align-items:center;justify-content:space-between;padding:16px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.backup-item:hover{border-color:#3f3f46}.backup-info{display:flex;align-items:center;justify-content:flex-start;gap:20px}.backup-name{font-weight:500;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px}.backup-size,.backup-date{color:#71717a;font-size:13px}.domains-list{display:flex;flex-direction:column;gap:8px}.domain-item{display:flex;align-items:center;justify-content:flex-start;gap:8px}.domain-item a{color:#6366f1;transition:color .2s ease}.domain-item a:hover{text-decoration:underline}.tables-list{display:flex;flex-wrap:wrap;gap:8px}.privileges-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;padding-top:8px;border-top:1px solid #27272a}.services-grid{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:24px}.service-item{display:flex;align-items:center;justify-content:flex-start;gap:8px;padding:8px 16px;background:#18181b;border:1px solid #27272a;border-radius:8px;font-size:13px}.service-dot{width:8px;height:8px;border-radius:9999px}.service-dot.running{background:#10b981;box-shadow:0 0 8px #10b981}.service-dot.stopped{background:#71717a}.service-name{font-weight:500;color:#f4f4f5}.service-status{color:#71717a;font-size:12px}.live-indicator{color:#10b981;font-size:12px;font-weight:500}.live-indicator:before{content:"";display:inline-block;width:6px;height:6px;background:#10b981;border-radius:9999px;margin-right:4px;animation:pulse 2s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.log-viewer{background:#09090b;border:1px solid #27272a;border-radius:8px;padding:16px;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;max-height:500px;overflow-y:auto;line-height:1.5}.log-viewer::-webkit-scrollbar{width:6px;height:6px}.log-viewer::-webkit-scrollbar-track{background:#09090b}.log-viewer::-webkit-scrollbar-thumb{background:#3f3f46;border-radius:4px}.log-viewer::-webkit-scrollbar-thumb:hover{background:#71717a}.log-controls{display:flex;align-items:center;justify-content:flex-start;gap:12px}.log-controls select{padding:8px 12px;background:#09090b;border:1px solid #27272a;border-radius:6px;color:#f4f4f5;font-size:13px}.command-output{background:#09090b;border:1px solid #27272a;border-radius:8px;padding:16px;margin-top:20px}.command-output pre{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;white-space:pre-wrap;word-break:break-all;color:#f4f4f5}.command-output.error{border-color:#ef4444}.command-output .stderr{color:#ef4444}.quick-commands{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}.credentials-box{background:#09090b;border:1px solid #27272a;border-radius:8px;padding:16px;margin:16px 0}.credentials-box h4{font-size:14px;font-weight:600;margin-bottom:12px;color:#10b981}.credentials-box .warning{font-size:12px;color:#f59e0b;margin-bottom:12px;display:flex;align-items:center;justify-content:flex-start;gap:6px}.credential-row{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:8px 0;border-bottom:1px solid #27272a}.credential-row:last-child{border-bottom:none}.credential-label{font-size:12px;color:#71717a;min-width:80px}.credential-value{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;font-size:13px;color:#f4f4f5;background:#27272a;padding:4px 8px;border-radius:4px;flex:1}.credential-copy{background:none;border:none;color:#71717a;cursor:pointer;padding:4px;transition:color .2s ease}.credential-copy:hover{color:#6366f1}.toast-container{position:fixed;top:16px;right:16px;z-index:9999;display:flex;flex-direction:column;gap:8px;max-width:400px;pointer-events:none}.toast{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:6px;background:#18181b;border:1px solid #27272a;box-shadow:0 10px 15px #0000004d;pointer-events:auto;animation:toast-slide-in .3s ease-out}.toast-icon{flex-shrink:0;display:flex;align-items:center;justify-content:center}.toast-icon svg{width:18px;height:18px}.toast-message{flex:1;font-size:12px;line-height:1.4;color:#f4f4f5}.toast-dismiss{flex-shrink:0;background:none;border:none;padding:4px;cursor:pointer;color:#71717a;border-radius:4px;transition:all .2s ease}.toast-dismiss:hover{color:#f4f4f5;background:#27272a}.toast-success{border-color:#10b9814d;background:#10b9811a}.toast-success .toast-icon{color:#10b981}.toast-error{border-color:#ef44444d;background:#ef44441a}.toast-error .toast-icon{color:#ef4444}.toast-warning{border-color:#f59e0b4d;background:#f59e0b1a}.toast-warning .toast-icon{color:#f59e0b}.toast-info{border-color:#6366f14d;background:#6366f11a}.toast-info .toast-icon{color:#6366f1}@keyframes toast-slide-in{0%{opacity:0;transform:translate(100%)}to{opacity:1;transform:translate(0)}}.spinner{display:inline-flex;align-items:center;justify-content:center}.spinner-sm{width:16px;height:16px}.spinner-sm .spinner-ring{width:16px;height:16px;border-width:2px}.spinner-md{width:24px;height:24px}.spinner-md .spinner-ring{width:24px;height:24px;border-width:3px}.spinner-lg{width:40px;height:40px}.spinner-lg .spinner-ring{width:40px;height:40px;border-width:4px}.spinner-ring{border-radius:50%;border-style:solid;border-color:#6366f14d;border-top-color:#6366f1;animation:spinner-rotate .8s linear infinite}@keyframes spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:32px;color:#a1a1aa}.loading-state span{font-size:12px}.btn-loading{position:relative;pointer-events:none;color:transparent!important}.btn-loading .spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.btn-loading .spinner .spinner-ring{border-color:#27272a;border-top-color:#f4f4f5}.btn-loading.btn-primary .spinner .spinner-ring{border-color:#ffffff4d;border-top-color:#fff}.btn-loading.btn-secondary .spinner .spinner-ring{border-color:#f4f4f54d;border-top-color:#f4f4f5}.btn-loading.btn-danger .spinner .spinner-ring{border-color:#ffffff4d;border-top-color:#fff}.auth-container{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}.auth-card{width:100%;max-width:400px;background:#18181b;border:1px solid #27272a;border-radius:16px;padding:40px}.auth-header{text-align:center;margin-bottom:32px}.auth-header .brand-logo{width:48px;height:48px;margin:0 auto 16px}.auth-header h1{font-size:24px;font-weight:700;margin-bottom:8px}.auth-header p{color:#a1a1aa}.auth-footer{text-align:center;margin-top:24px;color:#a1a1aa}.auth-footer a{color:#6366f1;font-weight:500}.auth-footer a:hover{text-decoration:underline}.dashboard-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:24px;margin-bottom:32px}@media (max-width: 1280px){.dashboard-stats{grid-template-columns:repeat(2,1fr)}}@media (max-width: 640px){.dashboard-stats{grid-template-columns:1fr}}.system-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px;margin-bottom:32px}.metric-card{background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease;padding:20px}.metric-card:hover{border-color:#3f3f46}.metric-card .metric-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.metric-card .metric-header h4{font-size:12px;color:#71717a;text-transform:uppercase;font-weight:600}.metric-card .metric-header .metric-icon{color:#71717a}.metric-card .metric-main{display:flex;align-items:center;justify-content:flex-start;gap:12px;margin-bottom:12px}.metric-card .metric-main .metric-value{font-size:28px;font-weight:700;color:#f4f4f5;line-height:1}.metric-card .metric-main .metric-unit{font-size:14px;color:#71717a;align-self:flex-end;margin-bottom:4px}.metric-card .metric-sub{font-size:12px;color:#a1a1aa}.quick-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:32px}.quick-action-card{background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease;cursor:pointer;padding:20px;text-align:center}.quick-action-card:hover{border-color:#3f3f46}.quick-action-card:hover{transform:translateY(-2px)}.quick-action-card .action-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#6366f126;color:#6366f1;margin:0 auto 16px;border-radius:12px}.quick-action-card h4{font-size:14px;font-weight:600;margin-bottom:4px}.quick-action-card p{font-size:12px;color:#71717a}.activity-list{display:flex;flex-direction:column;gap:12px}.activity-item{display:flex;align-items:center;justify-content:flex-start;gap:16px;padding:12px 0;border-bottom:1px solid #27272a}.activity-item:last-child{border-bottom:none}.activity-icon{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:#27272a;border-radius:8px;color:#a1a1aa;flex-shrink:0}.activity-icon.success{background:#10b9811a;color:#10b981}.activity-icon.warning{background:#f59e0b1a;color:#f59e0b}.activity-icon.error{background:#ef44441a;color:#ef4444}.activity-content{flex:1;min-width:0}.activity-content p{font-size:13px;color:#f4f4f5;margin-bottom:4px}.activity-content span{font-size:12px;color:#71717a}.uptime-display{display:flex;align-items:center;justify-content:flex-start;gap:24px;padding:20px;background:#18181b;border:1px solid #27272a;border-radius:12px;margin-bottom:24px}.uptime-item{text-align:center}.uptime-item .uptime-value{font-size:24px;font-weight:700;color:#f4f4f5}.uptime-item .uptime-label{font-size:10px;color:#71717a;text-transform:uppercase;letter-spacing:.5px}.uptime-separator{color:#71717a;font-size:24px;font-weight:700}.apps-list{display:flex;flex-direction:column;gap:12px}.app-row{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.app-row:hover{border-color:#3f3f46}.app-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.app-details{min-width:0}.app-details h3{font-size:15px;font-weight:600;color:#f4f4f5;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-meta{display:flex;align-items:center;justify-content:flex-start;gap:12px;font-size:12px;color:#71717a}.app-meta a{color:#a1a1aa;transition:color .2s ease}.app-meta a:hover{color:#6366f1}.app-status{flex-shrink:0}.app-actions{display:flex;gap:8px;flex-shrink:0}.app-header-info{display:flex;align-items:center;justify-content:flex-start;gap:20px}@media (max-width: 768px){.app-header-info{flex-direction:column;align-items:flex-start}}.app-header-title{display:flex;align-items:center;justify-content:flex-start;gap:16px}.app-header-title h1{font-size:24px}.deploy-tab{display:flex;flex-direction:column;gap:20px}.deploy-tab .deploy-setup{padding:32px 0}.deploy-tab .deploy-header{margin-bottom:20px}.deploy-tab .deploy-status-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;background:#18181b;border:1px solid #27272a;border-radius:8px}@media (max-width: 768px){.deploy-tab .deploy-status-card{flex-direction:column;align-items:flex-start}}.deploy-tab .deploy-repo-info{display:flex;align-items:center;gap:12px}.deploy-tab .deploy-repo-info svg{flex-shrink:0;color:#a1a1aa}.deploy-tab .deploy-repo-info>div{display:flex;flex-direction:column;gap:4px}.deploy-tab .deploy-repo-info .repo-url{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;color:#f4f4f5;word-break:break-all}.deploy-tab .deploy-repo-info .repo-branch{font-size:10px;color:#71717a}.deploy-tab .deploy-actions{display:flex;gap:8px;flex-shrink:0}.deploy-tab .deploy-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px}.deploy-tab .webhook-url{display:flex;align-items:center;gap:12px;margin-top:12px;padding:12px;background:#27272a;border-radius:6px}.deploy-tab .webhook-url code{flex:1;font-size:10px;color:#a1a1aa;word-break:break-all}.deploy-tab .webhook-url .btn{flex-shrink:0}.deploy-tab .scripts-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}.deploy-tab .script-section h4{font-size:12px;font-weight:500;color:#a1a1aa;margin-bottom:8px}.deploy-tab .script-code{padding:12px;background:#27272a;border-radius:6px;font-family:Fira Code,Monaco,Consolas,monospace;font-size:10px;color:#a1a1aa;overflow-x:auto;white-space:pre-wrap;word-break:break-word;margin:0}.deploy-tab .card-actions{display:flex;gap:8px;margin-top:16px;padding-top:16px;border-top:1px solid #27272a}.deploy-tab .checkbox-label{display:flex;align-items:center;gap:8px;cursor:pointer}.deploy-tab .checkbox-label input[type=checkbox]{width:18px;height:18px;cursor:pointer}.deploy-tab .checkbox-label span{font-size:12px;color:#f4f4f5}.deploy-tab .form-help{display:block;margin-top:4px;font-size:10px;color:#71717a}.deploy-tab textarea{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;resize:vertical;min-height:80px}.deploy-tab .text-danger{color:#ef4444;font-size:12px}.deploy-tab .text-muted{color:#71717a;font-size:12px}.docker-list{display:flex;flex-direction:column;gap:12px}.docker-item{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.docker-item:hover{border-color:#3f3f46}.docker-item-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.docker-item-icon{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#27272a;border-radius:8px;color:#2496ed}.docker-item-icon.image-icon{color:#a78bfa}.docker-item-icon.network-icon{color:#34d399}.docker-item-icon.volume-icon{color:#fbbf24}.docker-item-details{min-width:0}.docker-item-details h3{font-size:14px;font-weight:600;color:#f4f4f5;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.docker-item-meta{display:flex;align-items:center;justify-content:flex-start;gap:12px;font-size:12px;color:#71717a;flex-wrap:wrap}.docker-item-meta .mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;background:#27272a;padding:2px 6px;border-radius:4px}.docker-item-status{flex-shrink:0}.docker-item-actions{display:flex;gap:8px;flex-shrink:0}.exec-modal-body{display:flex;flex-direction:column;height:400px}.exec-output{flex:1;background:#18181b;border:1px solid #27272a;border-radius:6px;padding:16px;overflow-y:auto;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;margin-bottom:12px}.exec-welcome{color:#a1a1aa;text-align:center;padding:32px 0}.exec-welcome p{margin-bottom:8px}.exec-welcome code{background:#27272a;padding:4px 8px;border-radius:4px;color:#6366f1}.exec-line{margin-bottom:8px}.exec-line pre{margin:0;white-space:pre-wrap;word-break:break-all}.exec-line.exec-command{color:#6366f1;font-weight:500}.exec-line.exec-output{color:#f4f4f5}.exec-line.exec-error{color:#ef4444}.exec-line.exec-info{color:#71717a;font-size:10px}.exec-line.exec-loading{color:#a1a1aa;display:flex;align-items:center;gap:8px}.spinner-inline{display:inline-block;width:14px;height:14px;border:2px solid #27272a;border-top-color:#6366f1;border-radius:50%;animation:spin .8s linear infinite}.exec-input-form{display:flex;align-items:center;gap:8px;background:#18181b;border:1px solid #27272a;border-radius:6px;padding:8px 12px}.exec-input-form:focus-within{border-color:#6366f1}.exec-prompt{color:#6366f1;font-family:Fira Code,Monaco,Consolas,monospace;font-weight:600}.exec-input{flex:1;border:none;background:transparent;color:#f4f4f5;font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;outline:none}.exec-input::placeholder{color:#71717a}.exec-input:disabled{opacity:.5}.db-status{display:flex;gap:24px;margin-bottom:24px}@media (max-width: 768px){.db-status{flex-direction:column}}.db-status-item{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:16px 24px;background:#18181b;border:1px solid #27272a;border-radius:12px;flex:1}.status-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:10px;font-size:20px;font-weight:700}.status-icon.mysql{background:linear-gradient(135deg,#00758f,#f29111);color:#fff}.status-icon.postgresql{background:linear-gradient(135deg,#336791,#5f9ab8);color:#fff}.status-info h3{font-size:16px;font-weight:600;margin-bottom:4px}.status-info span{font-size:13px;color:#a1a1aa}.status-info span.running{color:#10b981}.status-info span.stopped{color:#ef4444}.db-list{display:flex;flex-direction:column;gap:12px}.db-item{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.db-item:hover{border-color:#3f3f46}.db-item-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.db-item-icon{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#27272a;border-radius:8px}.db-item-icon.mysql{color:#f29111}.db-item-icon.postgresql{color:#336791}.db-item-icon.user{color:#6366f1}.db-item-details{min-width:0}.db-item-details h3{font-size:14px;font-weight:600;color:#f4f4f5;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.db-item-meta{display:flex;align-items:center;justify-content:flex-start;gap:12px;font-size:12px;color:#71717a;flex-wrap:wrap}.db-item-meta .mono{font-family:Fira Code,Monaco,Consolas,monospace;font-size:12px;background:#27272a;padding:2px 6px;border-radius:4px}.db-item-meta .host{color:#a1a1aa}.db-item-actions{display:flex;gap:8px;flex-shrink:0}.users-header{display:flex;align-items:center;justify-content:space-between;margin:32px 0 16px;padding-top:24px;border-top:1px solid #27272a}.users-header h3{font-size:16px;font-weight:600}.ssl-status-bar{display:flex;gap:24px;margin-bottom:32px}@media (max-width: 768px){.ssl-status-bar{flex-direction:column}}.ssl-status-item{display:flex;align-items:center;justify-content:flex-start;gap:16px;padding:20px;background:#18181b;border:1px solid #27272a;border-radius:12px;flex:1}.ssl-status-icon{width:48px;height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:10px}.ssl-status-icon.active{background:#10b9811a;color:#10b981}.ssl-status-icon.inactive{background:#ef44441a;color:#ef4444}.ssl-status-info h4{font-size:16px;font-weight:600;margin-bottom:4px}.ssl-status-info span{font-size:13px;color:#a1a1aa}.domain-list{display:flex;flex-direction:column;gap:12px}.domain-item{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.domain-item:hover{border-color:#3f3f46}.domain-item-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.domain-item-icon{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#27272a;border-radius:8px;color:#a1a1aa}.domain-item-icon.ssl{background:#10b9811a;color:#10b981}.domain-item-details{min-width:0}.domain-item-details h3{font-size:14px;font-weight:600;color:#f4f4f5;margin-bottom:4px;display:flex;align-items:center;justify-content:flex-start;gap:8px}.primary-badge{background:#6366f126;color:#6366f1;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600;text-transform:uppercase}.domain-item-meta{display:flex;align-items:center;justify-content:flex-start;gap:16px;font-size:12px;color:#71717a}.domain-item-meta span{display:flex;align-items:center;justify-content:flex-start;gap:4px}.app-link{color:#a1a1aa}.ssl-badge{color:#10b981}.domain-item-actions{display:flex;gap:8px;flex-shrink:0;flex-wrap:wrap}.cert-list{display:flex;flex-direction:column;gap:12px}.cert-item{display:flex;align-items:center;gap:20px;padding:16px 20px;background-color:#18181b;border:1px solid #27272a;border-radius:12px;transition:border-color .2s ease}.cert-item:hover{border-color:#3f3f46}.cert-item-info{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex:1;min-width:0}.cert-item-icon{width:40px;height:40px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:#10b9811a;border-radius:8px;color:#10b981}.cert-item-details{min-width:0}.cert-item-details h3{font-size:14px;font-weight:600;color:#f4f4f5;margin-bottom:4px}.cert-item-meta{display:flex;align-items:center;justify-content:flex-start;gap:16px;font-size:12px;color:#71717a}.cert-item-meta span{display:flex;align-items:center;justify-content:flex-start;gap:4px}.cert-item-meta span.valid{color:#10b981}.cert-item-meta span.expiring{color:#f59e0b}.cert-status{flex-shrink:0}.ssl-info-box{display:flex;align-items:center;justify-content:flex-start;gap:16px;padding:20px;background:#10b9811a;border:1px solid rgba(16,185,129,.2);border-radius:8px;margin-bottom:20px;color:#10b981}.ssl-info-box h4{font-size:14px;font-weight:600;margin-bottom:4px}.ssl-info-box p{font-size:12px;color:#a1a1aa}.ssl-info-box p strong{color:#f4f4f5}.checkbox-label{display:flex;align-items:center;justify-content:flex-start;gap:8px;cursor:pointer}.checkbox-label input[type=checkbox]{width:16px;height:16px;accent-color:#6366f1}.monitoring-page .monitoring-overview{display:flex;flex-direction:column;gap:24px}.monitoring-page .threshold-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:24px}.monitoring-page .threshold-item{display:flex;justify-content:space-between;align-items:center;padding:16px;background:var(--bg-secondary);border-radius:6px}.monitoring-page .threshold-label{color:var(--text-secondary);font-size:12px}.monitoring-page .threshold-value{font-size:18px;font-weight:600;color:var(--primary)}.monitoring-page .threshold-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:24px}.monitoring-page .alert-list{display:flex;flex-direction:column;gap:8px}.monitoring-page .alert-item{display:flex;align-items:center;gap:16px;padding:8px 16px;background:var(--bg-secondary);border-radius:6px}.monitoring-page .alert-item .badge{flex-shrink:0}.monitoring-page .alert-item .alert-message{flex:1;font-size:12px}.monitoring-page .alert-item .alert-time{color:var(--text-tertiary);font-size:10px;white-space:nowrap}.monitoring-page .stat-icon{width:48px;height:48px;border-radius:8px;display:flex;align-items:center;justify-content:center}.monitoring-page .stat-icon svg{stroke:currentColor;fill:none;stroke-width:2}.monitoring-page .stat-icon.status{background:#22c55e1a;color:#10b981}.monitoring-page .stat-icon.alerts{background:#ef44441a;color:#ef4444}.monitoring-page .stat-icon.interval{background:#3b82f61a;color:#6366f1}.monitoring-page .stat-icon.notifications{background:#a855f71a;color:#a855f7}.monitoring-page .text-success{color:#10b981}.monitoring-page .text-muted{color:var(--text-tertiary)}.monitoring-page .input-group{display:flex;gap:8px}.monitoring-page .input-group input{flex:1}.monitoring-page .input-group .btn{flex-shrink:0}.monitoring-page .checkbox-label{display:flex;align-items:center;gap:8px;cursor:pointer}.monitoring-page .checkbox-label input[type=checkbox]{width:18px;height:18px;cursor:pointer}.monitoring-page .checkbox-label span{font-size:12px;color:var(--text-primary)}.monitoring-page .form-help{display:block;margin-top:4px;font-size:10px;color:var(--text-tertiary)}.backups-page .stat-icon{width:48px;height:48px;border-radius:8px;display:flex;align-items:center;justify-content:center}.backups-page .stat-icon svg{stroke:currentColor;fill:none;stroke-width:2}.backups-page .stat-icon.backups{background:#22c55e1a;color:#10b981}.backups-page .stat-icon.apps{background:#3b82f61a;color:#6366f1}.backups-page .stat-icon.databases{background:#a855f71a;color:#a855f7}.backups-page .stat-icon.size{background:#f973161a;color:#f59e0b}.backups-page .filter-select{padding:4px 8px;border:1px solid var(--border-color);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary);font-size:12px}.backups-page .backup-name{display:flex;align-items:center;gap:8px}.backups-page .backup-name svg{stroke:currentColor;fill:none;stroke-width:2;flex-shrink:0}.backups-page .backup-name .icon-app{color:#6366f1}.backups-page .backup-name .icon-db{color:#a855f7}.backups-page .action-buttons{display:flex;gap:4px}.backups-page .checkbox-label{display:flex;align-items:center;gap:8px;cursor:pointer}.backups-page .checkbox-label input[type=checkbox]{width:18px;height:18px;cursor:pointer}.backups-page .checkbox-label span{font-size:12px;color:var(--text-primary)}.backups-page .form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}.backups-page .form-help{display:block;margin-top:4px;font-size:10px;color:var(--text-tertiary)}.backups-page .restore-warning{text-align:center;padding:24px;background:#ef44441a;border-radius:6px;margin-bottom:24px}.backups-page .restore-warning svg{stroke:#ef4444;fill:none;stroke-width:2;margin-bottom:8px}.backups-page .restore-warning h3{color:#ef4444;margin-bottom:8px}.backups-page .restore-warning p{color:var(--text-secondary);font-size:12px}.backups-page .restore-details{background:var(--bg-secondary);border-radius:6px;padding:16px}.backups-page .restore-details .detail-row{display:flex;justify-content:space-between;padding:4px 0}.backups-page .restore-details .detail-row:not(:last-child){border-bottom:1px solid var(--border-color)}.backups-page .restore-details .detail-label{color:var(--text-tertiary);font-size:12px}.backups-page .restore-details .detail-value{font-weight:500;font-size:12px}.terminal-page .tabs .tab{display:flex;align-items:center;gap:8px}.terminal-page .tabs .tab svg{stroke:currentColor;fill:none;stroke-width:2}.logs-container{height:calc(100vh - 280px);min-height:500px}.logs-layout{display:grid;grid-template-columns:300px 1fr;gap:24px;height:100%}@media (max-width: 1024px){.logs-layout{grid-template-columns:1fr;grid-template-rows:auto 1fr}}.logs-sidebar{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;display:flex;flex-direction:column;overflow:hidden}.logs-sidebar .sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid var(--border-color)}.logs-sidebar .sidebar-header h3{font-size:12px;font-weight:600;margin:0}.log-files-list{flex:1;overflow-y:auto;padding:8px}.log-files-list .empty-hint{padding:24px;text-align:center;color:var(--text-tertiary);font-size:12px}.log-file-item{display:flex;align-items:center;gap:8px;padding:8px 16px;border-radius:6px;cursor:pointer;transition:all .15s ease}.log-file-item:hover{background:var(--bg-tertiary)}.log-file-item.active{background:var(--primary);color:#fff}.log-file-item.active .log-file-path,.log-file-item.active .log-file-size{color:#ffffffb3}.log-file-item.active .log-icon{background:#fff3;color:#fff}.log-file-item .log-icon{width:32px;height:32px;border-radius:4px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--bg-tertiary)}.log-file-item .log-icon svg{stroke:currentColor;fill:none;stroke-width:2}.log-file-item .log-icon.error{color:#ef4444}.log-file-item .log-icon.access{color:#10b981}.log-file-item .log-icon.nginx{color:#6366f1}.log-file-item .log-icon.database{color:#a855f7}.log-file-item .log-file-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.log-file-item .log-file-name{font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.log-file-item .log-file-path{font-size:10px;color:var(--text-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.log-file-item .log-file-size{font-size:10px;color:var(--text-tertiary);flex-shrink:0}.logs-viewer{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;display:flex;flex-direction:column;overflow:hidden}.viewer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 16px;border-bottom:1px solid var(--border-color);flex-wrap:wrap}.viewer-toolbar .toolbar-left,.viewer-toolbar .toolbar-right{display:flex;align-items:center;gap:8px}.search-input{display:flex;align-items:center;gap:8px;padding:4px 8px;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:6px}.search-input svg{stroke:var(--text-tertiary);fill:none;stroke-width:2;flex-shrink:0}.search-input input{border:none;background:none;padding:0;font-size:12px;width:180px}.search-input input:focus{outline:none}.lines-select{padding:4px 8px;border:1px solid var(--border-color);border-radius:4px;background:var(--bg-tertiary);color:var(--text-primary);font-size:12px}.auto-refresh-toggle{display:flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:var(--text-secondary)}.auto-refresh-toggle input{cursor:pointer}.log-content{flex:1;overflow:auto;padding:16px;background:#1a1a2e}.log-content pre{margin:0;font-family:JetBrains Mono,Fira Code,monospace;font-size:12px;line-height:1.6;color:#e2e8f0;white-space:pre-wrap;word-break:break-all}.log-content .empty-viewer{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--text-tertiary)}.log-content .empty-viewer svg{stroke:currentColor;fill:none;stroke-width:1.5;margin-bottom:16px;opacity:.5}.log-content .empty-viewer p{font-size:12px}.journal-container{display:flex;flex-direction:column;gap:24px;height:calc(100vh - 280px);min-height:500px}.journal-controls{display:flex;align-items:flex-end;gap:24px;flex-wrap:wrap}.journal-controls .control-group{display:flex;flex-direction:column;gap:4px}.journal-controls .control-group label{font-size:10px;font-weight:500;color:var(--text-secondary)}.journal-controls .control-group input,.journal-controls .control-group select{padding:4px 8px;border:1px solid var(--border-color);border-radius:4px;background:var(--bg-secondary);font-size:12px}.journal-controls .control-group input{width:200px}.input-with-suggestions{display:flex;flex-direction:column;gap:8px}.quick-units{display:flex;flex-wrap:wrap;gap:4px}.unit-chip{padding:2px 8px;border:1px solid var(--border-color);border-radius:9999px;background:var(--bg-secondary);font-size:10px;cursor:pointer;transition:all .15s ease}.unit-chip:hover{border-color:var(--primary);color:var(--primary)}.unit-chip.active{background:var(--primary);border-color:var(--primary);color:#fff}.journal-viewer{flex:1;background:#1a1a2e;border-radius:8px;overflow:auto;padding:16px}.journal-viewer pre{margin:0;font-family:JetBrains Mono,Fira Code,monospace;font-size:12px;line-height:1.6;color:#e2e8f0;white-space:pre-wrap;word-break:break-all}.processes-container{display:flex;flex-direction:column;gap:24px}.processes-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.processes-toolbar .toolbar-left,.processes-toolbar .toolbar-right{display:flex;align-items:center;gap:8px}.processes-toolbar select{padding:4px 8px;border:1px solid var(--border-color);border-radius:4px;background:var(--bg-secondary);font-size:12px}.processes-table-wrapper{overflow-x:auto;background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px}.processes-table{width:100%;min-width:800px}.processes-table th{position:sticky;top:0;background:var(--bg-secondary);z-index:1}.processes-table tr{cursor:pointer;transition:background .15s ease}.processes-table tr:hover{background:var(--bg-tertiary)}.processes-table tr.selected{background:#3b82f61a}.processes-table .mono{font-family:JetBrains Mono,monospace;font-size:10px}.processes-table .process-name{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.processes-table .usage-cell{position:relative;min-width:100px}.processes-table .usage-cell .usage-bar{position:absolute;left:0;top:50%;transform:translateY(-50%);height:4px;border-radius:2px;opacity:.3}.processes-table .usage-cell .usage-bar.cpu{background:#6366f1}.processes-table .usage-cell .usage-bar.memory{background:#a855f7}.processes-table .usage-cell span{position:relative;font-size:10px;font-family:monospace}.processes-table .action-buttons{display:flex;gap:4px}.btn-xs{padding:2px 6px;font-size:11px}.btn-xs svg{stroke:currentColor;fill:none;stroke-width:2}.process-details-panel{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;overflow:hidden}.process-details-panel .panel-header{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid var(--border-color)}.process-details-panel .panel-header h3{font-size:16px;font-weight:600;margin:0}.process-details-panel .panel-body{padding:16px}.process-details-panel .details-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px}.process-details-panel .detail-item{display:flex;flex-direction:column;gap:4px}.process-details-panel .detail-item .detail-label{font-size:10px;color:var(--text-tertiary)}.process-details-panel .detail-item .detail-value{font-size:12px;font-weight:500}.process-details-panel .detail-item .detail-value.mono{font-family:monospace}.process-details-panel .command-line{margin-top:16px;padding-top:16px;border-top:1px solid var(--border-color)}.process-details-panel .command-line .detail-label{display:block;font-size:10px;color:var(--text-tertiary);margin-bottom:4px}.process-details-panel .command-line code{display:block;padding:8px;background:var(--bg-tertiary);border-radius:4px;font-family:monospace;font-size:10px;word-break:break-all}.services-container{display:flex;flex-direction:column;gap:24px}.services-toolbar{display:flex;align-items:center;gap:8px}.services-toolbar .btn svg{stroke:currentColor;fill:none;stroke-width:2}.services-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}.service-card{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:16px;display:flex;flex-direction:column;gap:8px}.service-card .service-header{display:flex;align-items:center;justify-content:space-between;gap:16px}.service-card .service-header .service-info{display:flex;align-items:center;gap:8px}.service-card .service-header .service-info .status-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.service-card .service-header .service-info .status-dot.success{background:#10b981}.service-card .service-header .service-info .status-dot.danger{background:#ef4444}.service-card .service-header .service-info .status-dot.warning{background:#f59e0b}.service-card .service-header .service-info .status-dot.secondary{background:var(--text-tertiary)}.service-card .service-header .service-info h4{font-size:12px;font-weight:600;margin:0}.service-card .service-description{font-size:10px;color:var(--text-secondary);margin:0}.service-card .service-meta{display:flex;gap:16px;font-size:10px;color:var(--text-tertiary)}.service-card .service-meta .meta-label{color:var(--text-secondary)}.service-card .service-actions{display:flex;gap:4px;margin-top:8px;padding-top:8px;border-top:1px solid var(--border-color)}.modal-lg{max-width:900px;width:90%}.modal-log-viewer{max-height:500px;overflow:auto;background:#1a1a2e;border-radius:6px;padding:16px}.modal-log-viewer pre{margin:0;font-family:JetBrains Mono,monospace;font-size:12px;line-height:1.6;color:#e2e8f0;white-space:pre-wrap;word-break:break-all}.settings-page{padding:24px;max-width:1200px;margin:0 auto}.settings-header{margin-bottom:32px}.settings-header h1{font-size:1.75rem;font-weight:600;color:#f4f4f5;margin:0 0 4px}.settings-header p{color:#a1a1aa;margin:0}.settings-content{display:flex;gap:32px}@media (max-width: 900px){.settings-content{flex-direction:column}}.settings-nav{flex:0 0 220px}@media (max-width: 900px){.settings-nav{flex:none}}.settings-nav ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:4px}@media (max-width: 900px){.settings-nav ul{flex-direction:row;flex-wrap:wrap}}.settings-nav li button{width:100%;display:flex;align-items:center;gap:8px;padding:8px 12px;background:transparent;border:none;border-radius:6px;color:#a1a1aa;font-size:.9rem;cursor:pointer;transition:all .2s ease;text-align:left}@media (max-width: 900px){.settings-nav li button{width:auto}}.settings-nav li button:hover{background:#27272a;color:#f4f4f5}.settings-nav li button.active{background:#6366f1;color:#fff}.settings-nav li button .nav-icon{font-size:1.1rem;width:20px;text-align:center}.settings-sections{flex:1;min-width:0}.settings-section{background:#18181b;border:1px solid #27272a;border-radius:8px;padding:24px;margin-bottom:24px}.settings-section:last-child{margin-bottom:0}.section-header{display:flex;align-items:center;gap:8px;margin-bottom:24px;padding-bottom:16px;border-bottom:1px solid #27272a}.section-header .section-icon{font-size:1.25rem;color:#6366f1}.section-header h2{font-size:1.1rem;font-weight:600;color:#f4f4f5;margin:0}.settings-form{display:flex;flex-direction:column;gap:24px}.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px}.form-group{display:flex;flex-direction:column;gap:4px}.form-group label{font-size:.85rem;font-weight:500;color:#a1a1aa}.form-group input,.form-group select{padding:8px 12px;background:#27272a;border:1px solid #27272a;border-radius:6px;color:#f4f4f5;font-size:.9rem;transition:border-color .2s ease}.form-group input:focus,.form-group select:focus{outline:none;border-color:#6366f1}.form-group input:disabled,.form-group select:disabled{opacity:.6;cursor:not-allowed}.form-group .input-hint{font-size:.8rem;color:#71717a}.form-actions{display:flex;gap:8px;margin-top:16px;padding-top:16px;border-top:1px solid #27272a}.form-actions.no-border{border-top:none;padding-top:0}.password-section .password-fields{display:flex;flex-direction:column;gap:16px}.password-section .password-requirements{font-size:.8rem;color:#71717a;margin-top:4px}.theme-options{display:flex;gap:16px;flex-wrap:wrap}.theme-option{flex:1;min-width:150px;padding:16px;background:#27272a;border:2px solid #27272a;border-radius:6px;cursor:pointer;transition:all .2s ease;text-align:center}.theme-option:hover{border-color:#6366f1}.theme-option.active{border-color:#6366f1;background:#6366f11a}.theme-option .theme-icon{font-size:2rem;margin-bottom:8px}.theme-option .theme-name{font-weight:500;color:#f4f4f5;margin-bottom:4px}.theme-option .theme-desc{font-size:.8rem;color:#a1a1aa}.notification-settings{display:flex;flex-direction:column;gap:16px}.notification-item{display:flex;justify-content:space-between;align-items:center;padding:16px;background:#27272a;border-radius:6px}.notification-item .notification-info{flex:1}.notification-item .notification-info .notification-label{font-weight:500;color:#f4f4f5;margin-bottom:4px}.notification-item .notification-info .notification-desc{font-size:.85rem;color:#a1a1aa}.toggle-switch{position:relative;width:48px;height:26px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-switch input:checked+.toggle-slider{background:#6366f1}.toggle-switch input:checked+.toggle-slider:before{transform:translate(22px)}.toggle-switch input:focus+.toggle-slider{box-shadow:0 0 0 2px #6366f14d}.toggle-switch .toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:#27272a;border-radius:26px;transition:all .3s ease}.toggle-switch .toggle-slider:before{content:"";position:absolute;height:20px;width:20px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:transform .3s ease}.system-info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}.info-card{padding:16px;background:#27272a;border-radius:6px;text-align:center}.info-card .info-icon{font-size:1.5rem;color:#6366f1;margin-bottom:8px}.info-card .info-label{font-size:.8rem;color:#a1a1aa;margin-bottom:4px}.info-card .info-value{font-size:1.25rem;font-weight:600;color:#f4f4f5}.info-card .info-bar{margin-top:8px;height:6px;background:#27272a;border-radius:3px;overflow:hidden}.info-card .info-bar .info-bar-fill{height:100%;background:#6366f1;border-radius:3px;transition:width .3s ease}.info-card .info-bar .info-bar-fill.warning{background:#f59e0b}.info-card .info-bar .info-bar-fill.danger{background:#ef4444}.about-section .app-info{display:flex;align-items:center;gap:24px;margin-bottom:24px;padding-bottom:24px;border-bottom:1px solid #27272a}.about-section .app-info .app-logo{width:64px;height:64px;background:linear-gradient(135deg,#6366f1,#4f46e5);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:2rem}.about-section .app-info .app-details .app-name{font-size:1.25rem;font-weight:600;color:#f4f4f5;margin-bottom:4px}.about-section .app-info .app-details .app-version{font-size:.9rem;color:#a1a1aa}.about-section .features-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;margin-bottom:24px}.about-section .features-list .feature-item{display:flex;align-items:center;gap:8px;padding:8px;color:#a1a1aa}.about-section .features-list .feature-item .feature-check{color:#10b981}.about-section .about-links{display:flex;gap:16px;flex-wrap:wrap}.about-section .about-links a{display:flex;align-items:center;gap:4px;padding:8px 12px;background:#27272a;border-radius:6px;color:#a1a1aa;text-decoration:none;transition:all .2s ease}.about-section .about-links a:hover{background:#6366f1;color:#fff}.settings-message{padding:8px 12px;border-radius:6px;margin-bottom:16px;display:flex;align-items:center;gap:8px}.settings-message.success{background:#10b98126;color:#10b981;border:1px solid rgba(16,185,129,.3)}.settings-message.error{background:#ef444426;color:#ef4444;border:1px solid rgba(239,68,68,.3)}.settings-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:64px;color:#a1a1aa}.settings-loading .spinner{width:40px;height:40px;border:3px solid #27272a;border-top-color:#6366f1;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:16px}@keyframes spin{to{transform:rotate(360deg)}}.file-manager .page-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:24px;flex-wrap:wrap;gap:16px}.file-manager .page-header .page-header-content h1{font-size:24px;font-weight:600;margin:0 0 4px}.file-manager .page-header .page-header-content .page-description{color:var(--text-secondary);margin:0}.file-manager .page-header .page-header-actions{display:flex;gap:8px}.file-manager .upload-progress{display:flex;align-items:center;gap:12px;padding:12px 16px;background:var(--card-bg);border-radius:8px;margin-bottom:16px}.file-manager .upload-progress .progress-bar{flex:1;height:8px;background:var(--border-color);border-radius:4px;overflow:hidden}.file-manager .upload-progress .progress-bar .progress-fill{height:100%;background:var(--primary);transition:width .3s ease}.file-manager .upload-progress span{font-size:13px;font-weight:500;color:var(--text-secondary);min-width:40px}.file-manager .file-manager-toolbar{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:var(--card-bg);border-radius:8px;margin-bottom:16px;gap:16px;flex-wrap:wrap}.file-manager .file-manager-toolbar .path-breadcrumb{display:flex;align-items:center;gap:8px}.file-manager .file-manager-toolbar .path-breadcrumb .current-path{font-family:var(--font-mono);font-size:13px;color:var(--text-primary);background:var(--bg-tertiary);padding:6px 12px;border-radius:4px}.file-manager .file-manager-toolbar .toolbar-actions{display:flex;align-items:center;gap:12px}.file-manager .file-manager-toolbar .toolbar-actions .search-box{display:flex;align-items:center;gap:4px;background:var(--bg-tertiary);border-radius:6px;padding:0 4px}.file-manager .file-manager-toolbar .toolbar-actions .search-box input{background:transparent;border:none;padding:8px 12px;font-size:13px;width:200px}.file-manager .file-manager-toolbar .toolbar-actions .search-box input:focus{outline:none}.file-manager .file-manager-toolbar .toolbar-actions .checkbox-label{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-secondary);cursor:pointer}.file-manager .file-manager-toolbar .toolbar-actions .checkbox-label input[type=checkbox]{width:16px;height:16px}.file-manager .disk-usage-bar{padding:12px 16px;background:var(--card-bg);border-radius:8px;margin-bottom:16px}.file-manager .disk-usage-bar .disk-usage-info{display:flex;justify-content:space-between;font-size:13px;color:var(--text-secondary);margin-bottom:8px}.file-manager .disk-usage-bar .disk-progress{height:6px;background:var(--border-color);border-radius:3px;overflow:hidden}.file-manager .disk-usage-bar .disk-progress .disk-progress-fill{height:100%;background:var(--primary);transition:width .3s ease}.file-manager .disk-usage-bar .disk-progress .disk-progress-fill.warning{background:var(--warning)}.file-manager .disk-usage-bar .disk-progress .disk-progress-fill.critical{background:var(--danger)}.file-manager .file-manager-content{display:grid;grid-template-columns:1fr 400px;gap:16px}@media (max-width: 1200px){.file-manager .file-manager-content{grid-template-columns:1fr}}.file-manager .file-list-container{background:var(--card-bg);border-radius:8px;overflow:hidden}.file-manager .file-list-container .loading-state,.file-manager .file-list-container .empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;color:var(--text-tertiary)}.file-manager .file-list-container .loading-state .icon,.file-manager .file-list-container .empty-state .icon{font-size:48px;margin-bottom:16px}.file-manager .file-list .file-list-header{display:grid;grid-template-columns:1fr 100px 120px 120px 120px;padding:12px 16px;background:var(--bg-tertiary);font-size:12px;font-weight:600;text-transform:uppercase;color:var(--text-tertiary);border-bottom:1px solid var(--border-color)}.file-manager .file-list .file-item{display:grid;grid-template-columns:1fr 100px 120px 120px 120px;padding:12px 16px;border-bottom:1px solid var(--border-color);cursor:pointer;transition:background .2s}.file-manager .file-list .file-item:hover{background:var(--bg-tertiary)}.file-manager .file-list .file-item.selected{background:rgba(var(--primary-rgb),.1)}.file-manager .file-list .file-item .col-name{display:flex;align-items:center;gap:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-manager .file-list .file-item .col-name .file-icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center}.file-manager .file-list .file-item .col-name .file-icon.folder:before{content:"📁"}.file-manager .file-list .file-item .col-name .file-icon.file:before{content:"📄"}.file-manager .file-list .file-item .col-name .file-icon.javascript:before{content:"📜"}.file-manager .file-list .file-item .col-name .file-icon.python:before{content:"🐍"}.file-manager .file-list .file-item .col-name .file-icon.image:before{content:"🖼️"}.file-manager .file-list .file-item .col-name .file-icon.text:before{content:"📝"}.file-manager .file-list .file-item .col-name .file-icon.archive:before{content:"📦"}.file-manager .file-list .file-item .col-name .file-icon.terminal:before{content:"⚡"}.file-manager .file-list .file-item .col-name .link-indicator{color:var(--text-tertiary);font-size:12px}.file-manager .file-list .file-item .col-size,.file-manager .file-list .file-item .col-modified,.file-manager .file-list .file-item .col-permissions{font-size:13px;color:var(--text-secondary)}.file-manager .file-list .file-item .col-permissions{font-family:var(--font-mono);font-size:12px}.file-manager .file-list .file-item .col-actions{display:flex;gap:4px;justify-content:flex-end}.file-manager .file-list .file-item .col-actions .btn-icon{opacity:0;transition:opacity .2s}.file-manager .file-list .file-item:hover .col-actions .btn-icon{opacity:1}.file-manager .file-preview{background:var(--card-bg);border-radius:8px;display:flex;flex-direction:column;max-height:calc(100vh - 300px)}.file-manager .file-preview .preview-header{display:flex;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--border-color)}.file-manager .file-preview .preview-header h3{margin:0;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-manager .file-preview .preview-header .preview-actions{display:flex;gap:8px}.file-manager .file-preview .preview-info{display:flex;gap:16px;padding:12px 16px;background:var(--bg-tertiary);font-size:12px;color:var(--text-secondary);flex-wrap:wrap}.file-manager .file-preview .file-editor{flex:1;padding:16px;font-family:var(--font-mono);font-size:13px;line-height:1.5;background:var(--bg-primary);border:none;resize:none;color:var(--text-primary)}.file-manager .file-preview .file-editor:focus{outline:none}.file-manager .file-preview .file-editor[readonly]{background:var(--bg-tertiary)}.file-manager .file-preview .preview-unavailable{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;color:var(--text-tertiary)}.file-manager .file-preview .preview-unavailable .icon{font-size:48px;margin-bottom:16px}.file-manager .file-preview .preview-unavailable p{margin-bottom:16px}.file-manager .permissions-help{margin-top:16px;padding:12px;background:var(--bg-tertiary);border-radius:6px;font-size:13px}.file-manager .permissions-help p{margin:0 0 8px;font-weight:500}.file-manager .permissions-help ul{margin:0;padding-left:20px}.file-manager .permissions-help ul li{margin-bottom:4px}.file-manager .permissions-help ul code{background:var(--bg-primary);padding:2px 6px;border-radius:4px}.ftp-server .page-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:24px;flex-wrap:wrap;gap:16px}.ftp-server .page-header .page-header-content h1{font-size:24px;font-weight:600;margin:0 0 4px}.ftp-server .page-header .page-header-content .page-description{color:var(--text-secondary);margin:0}.ftp-server .page-header .page-header-actions{display:flex;gap:8px}.ftp-server .page-loading{display:flex;justify-content:center;align-items:center;min-height:400px}.ftp-server .empty-state-large{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 24px;background:var(--card-bg);border-radius:12px;text-align:center}.ftp-server .empty-state-large .icon{font-size:64px;color:var(--text-tertiary);margin-bottom:24px}.ftp-server .empty-state-large h2{margin:0 0 12px;font-size:24px;font-weight:600}.ftp-server .empty-state-large p{margin:0 0 24px;color:var(--text-secondary);max-width:400px}.ftp-server .status-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:24px}.ftp-server .status-card{display:flex;align-items:center;gap:16px;padding:20px;background:var(--card-bg);border-radius:12px;border-left:4px solid var(--border-color)}.ftp-server .status-card.success{border-left-color:var(--success)}.ftp-server .status-card.success .status-icon{color:var(--success)}.ftp-server .status-card.warning{border-left-color:var(--warning)}.ftp-server .status-card.warning .status-icon{color:var(--warning)}.ftp-server .status-card .status-icon .icon{font-size:32px}.ftp-server .status-card .status-info{display:flex;flex-direction:column;gap:4px}.ftp-server .status-card .status-info .status-label{font-size:13px;color:var(--text-secondary)}.ftp-server .status-card .status-info .status-value{font-size:18px;font-weight:600}.ftp-server .tabs{display:flex;gap:4px;margin-bottom:24px;border-bottom:1px solid var(--border-color)}.ftp-server .tabs .tab{padding:12px 20px;background:none;border:none;font-size:14px;font-weight:500;color:var(--text-secondary);cursor:pointer;position:relative;transition:color .2s}.ftp-server .tabs .tab:hover{color:var(--text-primary)}.ftp-server .tabs .tab.active{color:var(--primary)}.ftp-server .tabs .tab.active:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:var(--primary)}.ftp-server .tab-content .section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.ftp-server .tab-content .section-header h3{margin:0;font-size:16px;font-weight:600}.ftp-server .tab-content .empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;background:var(--card-bg);border-radius:8px;color:var(--text-tertiary)}.ftp-server .tab-content .empty-state .icon{font-size:48px;margin-bottom:16px}.ftp-server .tab-content .empty-state p{margin-bottom:16px}.ftp-server .overview-tab{display:grid;grid-template-columns:1fr 1fr;gap:24px}@media (max-width: 900px){.ftp-server .overview-tab{grid-template-columns:1fr}}.ftp-server .overview-tab .config-section,.ftp-server .overview-tab .info-section{background:var(--card-bg);border-radius:8px;padding:20px}.ftp-server .overview-tab .config-section h3,.ftp-server .overview-tab .info-section h3{margin:0 0 16px;font-size:16px;font-weight:600}.ftp-server .overview-tab .config-grid,.ftp-server .overview-tab .info-grid{display:grid;gap:12px}.ftp-server .overview-tab .config-item,.ftp-server .overview-tab .info-item{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid var(--border-color)}.ftp-server .overview-tab .config-item:last-child,.ftp-server .overview-tab .info-item:last-child{border-bottom:none}.ftp-server .overview-tab .config-item .config-label,.ftp-server .overview-tab .info-item .config-label,.ftp-server .overview-tab .config-item .info-label,.ftp-server .overview-tab .info-item .info-label{font-size:13px;color:var(--text-secondary)}.ftp-server .overview-tab .config-item .config-value,.ftp-server .overview-tab .info-item .config-value{font-size:13px;font-weight:500}.ftp-server .overview-tab .config-item .config-value.success,.ftp-server .overview-tab .info-item .config-value.success{color:var(--success)}.ftp-server .overview-tab .config-item .config-value.warning,.ftp-server .overview-tab .info-item .config-value.warning{color:var(--warning)}.ftp-server .overview-tab .config-item code,.ftp-server .overview-tab .info-item code{font-family:var(--font-mono);font-size:13px;background:var(--bg-tertiary);padding:4px 8px;border-radius:4px}.ftp-server .users-tab .users-table,.ftp-server .connections-tab .users-table,.ftp-server .users-tab .connections-table,.ftp-server .connections-tab .connections-table{background:var(--card-bg);border-radius:8px;overflow:hidden}.ftp-server .users-tab .users-table table,.ftp-server .connections-tab .users-table table,.ftp-server .users-tab .connections-table table,.ftp-server .connections-tab .connections-table table{width:100%;border-collapse:collapse}.ftp-server .users-tab .users-table table th,.ftp-server .connections-tab .users-table table th,.ftp-server .users-tab .connections-table table th,.ftp-server .connections-tab .connections-table table th,.ftp-server .users-tab .users-table table td,.ftp-server .connections-tab .users-table table td,.ftp-server .users-tab .connections-table table td,.ftp-server .connections-tab .connections-table table td{padding:12px 16px;text-align:left}.ftp-server .users-tab .users-table table th,.ftp-server .connections-tab .users-table table th,.ftp-server .users-tab .connections-table table th,.ftp-server .connections-tab .connections-table table th{background:var(--bg-tertiary);font-size:12px;font-weight:600;text-transform:uppercase;color:var(--text-tertiary)}.ftp-server .users-tab .users-table table td,.ftp-server .connections-tab .users-table table td,.ftp-server .users-tab .connections-table table td,.ftp-server .connections-tab .connections-table table td{border-bottom:1px solid var(--border-color);font-size:13px}.ftp-server .users-tab .users-table table td:last-child,.ftp-server .connections-tab .users-table table td:last-child,.ftp-server .users-tab .connections-table table td:last-child,.ftp-server .connections-tab .connections-table table td:last-child{border-bottom:none}.ftp-server .users-tab .users-table table td code,.ftp-server .connections-tab .users-table table td code,.ftp-server .users-tab .connections-table table td code,.ftp-server .connections-tab .connections-table table td code{font-family:var(--font-mono);font-size:12px;background:var(--bg-tertiary);padding:2px 6px;border-radius:4px}.ftp-server .users-tab .users-table table tr:last-child td,.ftp-server .connections-tab .users-table table tr:last-child td,.ftp-server .users-tab .connections-table table tr:last-child td,.ftp-server .connections-tab .connections-table table tr:last-child td{border-bottom:none}.ftp-server .users-tab .users-table .user-name,.ftp-server .connections-tab .users-table .user-name,.ftp-server .users-tab .connections-table .user-name,.ftp-server .connections-tab .connections-table .user-name{font-weight:500;margin-right:8px}.ftp-server .users-tab .users-table .badge,.ftp-server .connections-tab .users-table .badge,.ftp-server .users-tab .connections-table .badge,.ftp-server .connections-tab .connections-table .badge{display:inline-block;padding:2px 8px;font-size:11px;font-weight:500;border-radius:4px}.ftp-server .users-tab .users-table .badge.badge-info,.ftp-server .connections-tab .users-table .badge.badge-info,.ftp-server .users-tab .connections-table .badge.badge-info,.ftp-server .connections-tab .connections-table .badge.badge-info{background:rgba(var(--primary-rgb),.1);color:var(--primary)}.ftp-server .users-tab .users-table .badge.badge-warning,.ftp-server .connections-tab .users-table .badge.badge-warning,.ftp-server .users-tab .connections-table .badge.badge-warning,.ftp-server .connections-tab .connections-table .badge.badge-warning{background:#ffc1071a;color:#f59e0b}.ftp-server .users-tab .users-table .status-badge,.ftp-server .connections-tab .users-table .status-badge,.ftp-server .users-tab .connections-table .status-badge,.ftp-server .connections-tab .connections-table .status-badge{display:inline-block;padding:4px 10px;font-size:12px;font-weight:500;border-radius:4px}.ftp-server .users-tab .users-table .status-badge.active,.ftp-server .connections-tab .users-table .status-badge.active,.ftp-server .users-tab .connections-table .status-badge.active,.ftp-server .connections-tab .connections-table .status-badge.active{background:#22c55e1a;color:var(--success)}.ftp-server .users-tab .users-table .status-badge.inactive,.ftp-server .connections-tab .users-table .status-badge.inactive,.ftp-server .users-tab .connections-table .status-badge.inactive,.ftp-server .connections-tab .connections-table .status-badge.inactive{background:#9ca3af1a;color:var(--text-tertiary)}.ftp-server .users-tab .users-table .actions,.ftp-server .connections-tab .users-table .actions,.ftp-server .users-tab .connections-table .actions,.ftp-server .connections-tab .connections-table .actions{display:flex;gap:4px}.ftp-server .logs-tab .log-viewer{background:var(--card-bg);border-radius:8px;padding:16px;max-height:500px;overflow:auto}.ftp-server .logs-tab .log-viewer pre{margin:0;font-family:var(--font-mono);font-size:12px;line-height:1.6;white-space:pre-wrap;word-break:break-all;color:var(--text-secondary)}.ftp-server .install-info{padding:16px;background:var(--bg-tertiary);border-radius:8px;margin-top:16px}.ftp-server .install-info p{margin:0;font-size:14px;line-height:1.6}.ftp-server .install-info p strong{color:var(--primary)}.php-management .page-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:24px;flex-wrap:wrap;gap:16px}.php-management .page-header .page-header-content h1{font-size:24px;font-weight:600;margin:0 0 4px}.php-management .page-header .page-header-content .page-description{color:#a1a1aa;margin:0}.php-management .page-header .page-header-actions{display:flex;gap:8px}.php-management .page-loading{display:flex;justify-content:center;align-items:center;min-height:400px}.php-management .empty-state-large{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 24px;background:#18181b;border-radius:12px;text-align:center}.php-management .empty-state-large .icon{font-size:64px;color:#71717a;margin-bottom:24px}.php-management .empty-state-large h2{margin:0 0 12px;font-size:24px;font-weight:600}.php-management .empty-state-large p{margin:0 0 24px;color:#a1a1aa;max-width:400px}.php-management .version-selector{display:flex;align-items:center;gap:12px;margin-bottom:24px;padding:16px;background:#18181b;border-radius:8px}.php-management .version-selector label{font-weight:500;color:#a1a1aa}.php-management .version-selector select{min-width:200px}.php-management .status-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:24px}.php-management .status-card{display:flex;align-items:center;gap:16px;padding:20px;background:#18181b;border-radius:12px;border-left:4px solid #27272a}.php-management .status-card.success{border-left-color:#10b981}.php-management .status-card.success .status-icon{color:#10b981}.php-management .status-card.warning{border-left-color:#f59e0b}.php-management .status-card.warning .status-icon{color:#f59e0b}.php-management .status-card .status-icon .icon{font-size:32px}.php-management .status-card .status-info{display:flex;flex-direction:column;gap:4px}.php-management .status-card .status-info .status-label{font-size:12px;color:#a1a1aa}.php-management .status-card .status-info .status-value{font-size:18px;font-weight:600}.php-management .tabs{display:flex;gap:4px;margin-bottom:24px;border-bottom:1px solid #27272a}.php-management .tabs .tab{padding:12px 20px;background:none;border:none;font-size:14px;font-weight:500;color:#a1a1aa;cursor:pointer;position:relative;transition:color .15s ease}.php-management .tabs .tab:hover{color:#f4f4f5}.php-management .tabs .tab.active{color:#6366f1}.php-management .tabs .tab.active:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:#6366f1}.php-management .tab-content .section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.php-management .tab-content .section-header h3{margin:0;font-size:16px;font-weight:600}.php-management .tab-content .empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;background:#18181b;border-radius:8px;color:#71717a}.php-management .tab-content .empty-state .icon{font-size:48px;margin-bottom:16px}.php-management .tab-content .empty-state p{margin-bottom:16px}.php-management .versions-tab .versions-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}.php-management .version-card{background:#18181b;border-radius:8px;padding:20px;border:1px solid #27272a;cursor:pointer;transition:all .15s ease}.php-management .version-card:hover{border-color:#3f3f46}.php-management .version-card.selected{border-color:#6366f1;box-shadow:0 0 0 1px #6366f1}.php-management .version-card .version-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.php-management .version-card .version-header .version-number{font-size:18px;font-weight:600;color:#777bb4}.php-management .version-card .version-details{margin-bottom:16px}.php-management .version-card .version-details .detail-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0;font-size:12px}.php-management .version-card .version-details .detail-row .label{color:#71717a}.php-management .version-card .version-details .detail-row code{font-family:Fira Code,Monaco,Consolas,monospace;font-size:10px;background:#27272a;padding:4px 8px;border-radius:4px}.php-management .version-card .version-details .detail-row .status.active{color:#10b981}.php-management .version-card .version-details .detail-row .status.inactive{color:#71717a}.php-management .version-card .version-actions{display:flex;gap:8px}.php-management .extensions-tab .extensions-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}.php-management .extension-card{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#18181b;border-radius:6px;border:1px solid #27272a}.php-management .extension-card .extension-name{font-weight:500}.php-management .extension-card .extension-version{font-size:12px;color:#71717a}.php-management .common-extensions{margin-top:16px}.php-management .common-extensions .extension-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.php-management .common-extensions .extension-chips .chip{padding:4px 12px;background:#27272a;border:1px solid #27272a;border-radius:9999px;font-size:12px;cursor:pointer;transition:all .15s ease}.php-management .common-extensions .extension-chips .chip:hover{background:#6366f1;color:#fff;border-color:#6366f1}.php-management .pools-tab .pools-table{background:#18181b;border-radius:8px;overflow:hidden}.php-management .pools-tab .pools-table table{width:100%;border-collapse:collapse}.php-management .pools-tab .pools-table table th,.php-management .pools-tab .pools-table table td{padding:12px 16px;text-align:left}.php-management .pools-tab .pools-table table th{background:#27272a;font-size:10px;font-weight:600;text-transform:uppercase;color:#71717a}.php-management .pools-tab .pools-table table td{border-bottom:1px solid #27272a;font-size:12px}.php-management .pools-tab .pools-table table td code{font-family:Fira Code,Monaco,Consolas,monospace;font-size:10px;background:#27272a;padding:4px 8px;border-radius:4px}.php-management .pools-tab .pools-table table tr:last-child td{border-bottom:none}.php-management .form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}.php-management .form-row.form-row-4{grid-template-columns:repeat(4,1fr)}.firewall-page .page-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:24px;flex-wrap:wrap;gap:16px}.firewall-page .page-header .page-header-content h1{font-size:24px;font-weight:600;margin:0 0 4px}.firewall-page .page-header .page-header-content .page-description{color:#a1a1aa;margin:0}.firewall-page .page-header .page-header-actions{display:flex;gap:8px}.firewall-page .page-loading{display:flex;justify-content:center;align-items:center;min-height:400px}.firewall-page .empty-state-large{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 24px;background:#18181b;border-radius:12px;text-align:center}.firewall-page .empty-state-large .icon{font-size:64px;color:#71717a;margin-bottom:24px}.firewall-page .empty-state-large h2{margin:0 0 12px;font-size:24px;font-weight:600}.firewall-page .empty-state-large p{margin:0 0 24px;color:#a1a1aa;max-width:400px}.firewall-page .status-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:24px}.firewall-page .status-card{display:flex;align-items:center;gap:16px;padding:20px;background:#18181b;border-radius:12px;border-left:4px solid #27272a}.firewall-page .status-card.success{border-left-color:#10b981}.firewall-page .status-card.success .status-icon{color:#10b981}.firewall-page .status-card.danger{border-left-color:#ef4444}.firewall-page .status-card.danger .status-icon{color:#ef4444}.firewall-page .status-card.warning{border-left-color:#f59e0b}.firewall-page .status-card.warning .status-icon{color:#f59e0b}.firewall-page .status-card .status-icon .icon{font-size:32px}.firewall-page .status-card .status-info{display:flex;flex-direction:column;gap:4px}.firewall-page .status-card .status-info .status-label{font-size:12px;color:#a1a1aa}.firewall-page .status-card .status-info .status-value{font-size:18px;font-weight:600}.firewall-page .tabs{display:flex;gap:4px;margin-bottom:24px;border-bottom:1px solid #27272a}.firewall-page .tabs .tab{padding:12px 20px;background:none;border:none;font-size:14px;font-weight:500;color:#a1a1aa;cursor:pointer;position:relative;transition:color .15s ease}.firewall-page .tabs .tab:hover{color:#f4f4f5}.firewall-page .tabs .tab.active{color:#6366f1}.firewall-page .tabs .tab.active:after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:#6366f1}.firewall-page .tab-content .section-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.firewall-page .tab-content .section-header h3{margin:0;font-size:16px;font-weight:600}.firewall-page .tab-content .empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px;background:#18181b;border-radius:8px;color:#71717a}.firewall-page .tab-content .empty-state .icon{font-size:48px;margin-bottom:16px}.firewall-page .tab-content .empty-state p{margin-bottom:16px}.firewall-page .overview-tab{display:grid;grid-template-columns:1fr 1fr;gap:24px}@media (max-width: 768px){.firewall-page .overview-tab{grid-template-columns:1fr}}.firewall-page .overview-tab .info-card,.firewall-page .overview-tab .protection-summary{background:#18181b;border-radius:8px;padding:20px}.firewall-page .overview-tab .info-card h3,.firewall-page .overview-tab .protection-summary h3{margin:0 0 16px;font-size:16px;font-weight:600}.firewall-page .overview-tab .info-grid{display:grid;gap:12px}.firewall-page .overview-tab .info-item{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #27272a}.firewall-page .overview-tab .info-item:last-child{border-bottom:none}.firewall-page .overview-tab .info-item .info-label{font-size:12px;color:#a1a1aa}.firewall-page .overview-tab .info-item .info-value{font-size:12px;font-weight:500}.firewall-page .overview-tab .info-item .info-value.text-success{color:#10b981}.firewall-page .overview-tab .info-item .info-value.text-danger{color:#ef4444}.firewall-page .overview-tab .summary-grid{display:flex;flex-direction:column;gap:12px}.firewall-page .overview-tab .summary-item{display:flex;align-items:center;gap:12px}.firewall-page .overview-tab .summary-item .summary-icon.text-success{color:#10b981}.firewall-page .overview-tab .summary-item .summary-icon.text-danger{color:#ef4444}.firewall-page .overview-tab .summary-item .summary-text{font-size:12px}.firewall-page .rules-tab .rules-table{background:#18181b;border-radius:8px;overflow:hidden}.firewall-page .rules-tab .rules-table table{width:100%;border-collapse:collapse}.firewall-page .rules-tab .rules-table table th,.firewall-page .rules-tab .rules-table table td{padding:12px 16px;text-align:left}.firewall-page .rules-tab .rules-table table th{background:#27272a;font-size:10px;font-weight:600;text-transform:uppercase;color:#71717a}.firewall-page .rules-tab .rules-table table td{border-bottom:1px solid #27272a;font-size:12px}.firewall-page .rules-tab .rules-table table td .rule-code{font-family:Fira Code,Monaco,Consolas,monospace;font-size:10px;background:#27272a;padding:4px 8px;border-radius:4px}.firewall-page .rules-tab .rules-table table tr:last-child td{border-bottom:none}.firewall-page .blocked-tab .blocked-list{display:flex;flex-direction:column;gap:12px}.firewall-page .blocked-tab .blocked-item{display:flex;justify-content:space-between;align-items:center;padding:16px;background:#18181b;border-radius:8px;border:1px solid #27272a}.firewall-page .blocked-tab .blocked-item .blocked-info{display:flex;flex-direction:column;gap:4px}.firewall-page .blocked-tab .blocked-item .blocked-info .blocked-ip{font-weight:600;color:#ef4444}.firewall-page .blocked-tab .blocked-item .blocked-info .blocked-rule{font-family:Fira Code,Monaco,Consolas,monospace;font-size:10px;color:#71717a}.firewall-page .quick-tab h3{margin:0 0 8px;font-size:16px;font-weight:600}.firewall-page .quick-tab .quick-ports{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin-top:24px}.firewall-page .quick-tab .quick-port-item{display:flex;justify-content:space-between;align-items:center;padding:16px;background:#18181b;border-radius:8px;border:1px solid #27272a}.firewall-page .quick-tab .quick-port-item .port-info{display:flex;flex-direction:column;gap:4px}.firewall-page .quick-tab .quick-port-item .port-info .port-name{font-weight:500}.firewall-page .quick-tab .quick-port-item .port-info .port-number{font-size:12px;color:#71717a;font-family:Fira Code,Monaco,Consolas,monospace}.firewall-page .install-info{padding:16px;background:#27272a;border-radius:8px;margin-top:16px}.firewall-page .install-info p{margin:0;font-size:12px;line-height:1.6}.firewall-page .install-info p strong{color:#6366f1}.firewall-page .form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
diff --git a/frontend/dist/index.html b/frontend/dist/index.html
index c61bee20..ad5cc6fb 100644
--- a/frontend/dist/index.html
+++ b/frontend/dist/index.html
@@ -6,8 +6,8 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Dashboard Template</title>
- <script type="module" crossorigin src="/assets/index-Ev8u7xXg.js"></script>
- <link rel="stylesheet" crossorigin href="/assets/index-CpeIL9J_.css">
+ <script type="module" crossorigin src="/assets/index-BT_A2C8f.js"></script>
+ <link rel="stylesheet" crossorigin href="/assets/index-zpQn1_s8.css">
</head>
<body>
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index eea0eb43..392e1236 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -18,6 +18,8 @@ import Terminal from './pages/Terminal';
import Settings from './pages/Settings';
import FileManager from './pages/FileManager';
import FTPServer from './pages/FTPServer';
+import PHP from './pages/PHP';
+import Firewall from './pages/Firewall';
function PrivateRoute({ children }) {
const { isAuthenticated, loading } = useAuth();
@@ -64,6 +66,8 @@ function AppRoutes() {
<Route path="databases" element={<Databases />} />
<Route path="ssl" element={<div className="page">SSL Certificates</div>} />
<Route path="docker" element={<Docker />} />
+ <Route path="php" element={<PHP />} />
+ <Route path="firewall" element={<Firewall />} />
<Route path="files" element={<FileManager />} />
<Route path="ftp" element={<FTPServer />} />
<Route path="monitoring" element={<Monitoring />} />
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx
index 361dbdcf..2e74ef44 100644
--- a/frontend/src/components/Sidebar.jsx
+++ b/frontend/src/components/Sidebar.jsx
@@ -72,6 +72,19 @@ const Sidebar = () => {
</svg>
Docker
</NavLink>
+ <NavLink to="/php" className={({ isActive }) => `nav-item ${isActive ? 'active' : ''}`}>
+ <svg viewBox="0 0 24 24">
+ <ellipse cx="12" cy="12" rx="10" ry="6"/>
+ <text x="12" y="15" textAnchor="middle" fontSize="8" fill="currentColor" stroke="none">php</text>
+ </svg>
+ PHP
+ </NavLink>
+ <NavLink to="/firewall" className={({ isActive }) => `nav-item ${isActive ? 'active' : ''}`}>
+ <svg viewBox="0 0 24 24">
+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
+ </svg>
+ Firewall
+ </NavLink>
</nav>
<div className="menu-label">Operations</div>
diff --git a/frontend/src/layouts/DashboardLayout.jsx b/frontend/src/layouts/DashboardLayout.jsx
index 3cafdfaa..dc36b4f0 100644
--- a/frontend/src/layouts/DashboardLayout.jsx
+++ b/frontend/src/layouts/DashboardLayout.jsx
@@ -7,9 +7,6 @@ const DashboardLayout = () => {
<div className="dashboard-layout">
<Sidebar />
<main className="main-content">
- <div className="header">
- <h2>Dashboard</h2>
- </div>
<Outlet />
</main>
</div>
diff --git a/frontend/src/pages/Docker.jsx b/frontend/src/pages/Docker.jsx
index 0fe2ccd7..036789a3 100644
--- a/frontend/src/pages/Docker.jsx
+++ b/frontend/src/pages/Docker.jsx
@@ -98,6 +98,7 @@ const ContainersTab = () => {
const [showAll, setShowAll] = useState(true);
const [showRunModal, setShowRunModal] = useState(false);
const [selectedContainer, setSelectedContainer] = useState(null);
+ const [execContainer, setExecContainer] = useState(null);
useEffect(() => {
loadContainers();
@@ -203,6 +204,12 @@ const ContainersTab = () => {
>
Logs
</button>
+ <button
+ className="btn btn-secondary btn-sm"
+ onClick={() => setExecContainer(container)}
+ >
+ Exec
+ </button>
<button
className="btn btn-secondary btn-sm"
onClick={() => handleAction(container.id, 'restart')}
@@ -251,6 +258,13 @@ const ContainersTab = () => {
onClose={() => setSelectedContainer(null)}
/>
)}
+
+ {execContainer && (
+ <ContainerExecModal
+ container={execContainer}
+ onClose={() => setExecContainer(null)}
+ />
+ )}
</div>
);
};
@@ -418,6 +432,139 @@ const ContainerLogsModal = ({ container, onClose }) => {
);
};
+const ContainerExecModal = ({ container, onClose }) => {
+ const [command, setCommand] = useState('');
+ const [output, setOutput] = useState([]);
+ const [loading, setLoading] = useState(false);
+ const [history, setHistory] = useState([]);
+ const [historyIndex, setHistoryIndex] = useState(-1);
+ const outputRef = React.useRef(null);
+ const inputRef = React.useRef(null);
+
+ useEffect(() => {
+ if (inputRef.current) {
+ inputRef.current.focus();
+ }
+ }, []);
+
+ useEffect(() => {
+ if (outputRef.current) {
+ outputRef.current.scrollTop = outputRef.current.scrollHeight;
+ }
+ }, [output]);
+
+ async function executeCommand(e) {
+ e.preventDefault();
+ if (!command.trim() || loading) return;
+
+ const cmd = command.trim();
+ setOutput(prev => [...prev, { type: 'command', text: `$ ${cmd}` }]);
+ setHistory(prev => [cmd, ...prev.slice(0, 49)]);
+ setHistoryIndex(-1);
+ setCommand('');
+ setLoading(true);
+
+ try {
+ const result = await api.execContainer(container.id, cmd);
+ if (result.output) {
+ setOutput(prev => [...prev, { type: 'output', text: result.output }]);
+ }
+ if (result.error) {
+ setOutput(prev => [...prev, { type: 'error', text: result.error }]);
+ }
+ if (result.exit_code !== 0) {
+ setOutput(prev => [...prev, { type: 'info', text: `Exit code: ${result.exit_code}` }]);
+ }
+ } catch (err) {
+ setOutput(prev => [...prev, { type: 'error', text: err.message || 'Failed to execute command' }]);
+ } finally {
+ setLoading(false);
+ if (inputRef.current) {
+ inputRef.current.focus();
+ }
+ }
+ }
+
+ function handleKeyDown(e) {
+ if (e.key === 'ArrowUp') {
+ e.preventDefault();
+ if (history.length > 0 && historyIndex < history.length - 1) {
+ const newIndex = historyIndex + 1;
+ setHistoryIndex(newIndex);
+ setCommand(history[newIndex]);
+ }
+ } else if (e.key === 'ArrowDown') {
+ e.preventDefault();
+ if (historyIndex > 0) {
+ const newIndex = historyIndex - 1;
+ setHistoryIndex(newIndex);
+ setCommand(history[newIndex]);
+ } else if (historyIndex === 0) {
+ setHistoryIndex(-1);
+ setCommand('');
+ }
+ }
+ }
+
+ function clearOutput() {
+ setOutput([]);
+ }
+
+ return (
+ <div className="modal-overlay" onClick={onClose}>
+ <div className="modal modal-lg" onClick={e => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>Exec: {container.name}</h2>
+ <button className="modal-close" onClick={onClose}>&times;</button>
+ </div>
+ <div className="modal-body exec-modal-body">
+ <div className="exec-output" ref={outputRef}>
+ {output.length === 0 ? (
+ <div className="exec-welcome">
+ <p>Execute commands in container <code>{container.name}</code></p>
+ <p className="text-muted">Type a command and press Enter</p>
+ </div>
+ ) : (
+ output.map((line, idx) => (
+ <div key={idx} className={`exec-line exec-${line.type}`}>
+ <pre>{line.text}</pre>
+ </div>
+ ))
+ )}
+ {loading && (
+ <div className="exec-line exec-loading">
+ <span className="spinner-inline"></span> Running...
+ </div>
+ )}
+ </div>
+ <form onSubmit={executeCommand} className="exec-input-form">
+ <span className="exec-prompt">$</span>
+ <input
+ ref={inputRef}
+ type="text"
+ value={command}
+ onChange={(e) => setCommand(e.target.value)}
+ onKeyDown={handleKeyDown}
+ placeholder="Enter command..."
+ className="exec-input"
+ disabled={loading}
+ autoComplete="off"
+ spellCheck="false"
+ />
+ <button type="submit" className="btn btn-primary btn-sm" disabled={loading || !command.trim()}>
+ Run
+ </button>
+ </form>
+ </div>
+ <div className="modal-actions">
+ <button className="btn btn-secondary" onClick={clearOutput}>Clear</button>
+ <button className="btn btn-primary" onClick={onClose}>Close</button>
+ </div>
+ </div>
+ </div>
+ );
+};
+
const ImagesTab = () => {
const toast = useToast();
const [images, setImages] = useState([]);
diff --git a/frontend/src/pages/Firewall.jsx b/frontend/src/pages/Firewall.jsx
new file mode 100644
index 00000000..4e532418
--- /dev/null
+++ b/frontend/src/pages/Firewall.jsx
@@ -0,0 +1,703 @@
+import { useState, useEffect } from 'react';
+import { api } from '../services/api';
+import { useToast } from '../contexts/ToastContext';
+import Spinner from '../components/Spinner';
+import ConfirmDialog from '../components/ConfirmDialog';
+
+function Firewall() {
+ const [status, setStatus] = useState(null);
+ const [rules, setRules] = useState([]);
+ const [blockedIPs, setBlockedIPs] = useState([]);
+ const [loading, setLoading] = useState(true);
+ const [activeTab, setActiveTab] = useState('overview');
+ const [showBlockIPModal, setShowBlockIPModal] = useState(false);
+ const [showPortModal, setShowPortModal] = useState(false);
+ const [showInstallModal, setShowInstallModal] = useState(false);
+ const [blockIP, setBlockIP] = useState('');
+ const [newPort, setNewPort] = useState({ port: '', protocol: 'tcp' });
+ const [selectedFirewall, setSelectedFirewall] = useState('ufw');
+ const [actionLoading, setActionLoading] = useState(false);
+ const [confirmDialog, setConfirmDialog] = useState(null);
+ const toast = useToast();
+
+ const commonPorts = [
+ { port: 22, name: 'SSH', protocol: 'tcp' },
+ { port: 80, name: 'HTTP', protocol: 'tcp' },
+ { port: 443, name: 'HTTPS', protocol: 'tcp' },
+ { port: 21, name: 'FTP', protocol: 'tcp' },
+ { port: 25, name: 'SMTP', protocol: 'tcp' },
+ { port: 3306, name: 'MySQL', protocol: 'tcp' },
+ { port: 5432, name: 'PostgreSQL', protocol: 'tcp' },
+ { port: 6379, name: 'Redis', protocol: 'tcp' },
+ { port: 27017, name: 'MongoDB', protocol: 'tcp' },
+ ];
+
+ useEffect(() => {
+ loadData();
+ }, []);
+
+ const loadData = async () => {
+ setLoading(true);
+ try {
+ await Promise.all([
+ loadStatus(),
+ loadRules(),
+ loadBlockedIPs()
+ ]);
+ } catch (error) {
+ console.error('Failed to load firewall data:', error);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const loadStatus = async () => {
+ try {
+ const data = await api.getFirewallStatus();
+ setStatus(data);
+ } catch (error) {
+ console.error('Failed to load status:', error);
+ }
+ };
+
+ const loadRules = async () => {
+ try {
+ const data = await api.getFirewallRules();
+ setRules(data.rules || []);
+ } catch (error) {
+ console.error('Failed to load rules:', error);
+ }
+ };
+
+ const loadBlockedIPs = async () => {
+ try {
+ const data = await api.getBlockedIPs();
+ setBlockedIPs(data.blocked_ips || []);
+ } catch (error) {
+ console.error('Failed to load blocked IPs:', error);
+ }
+ };
+
+ const handleEnable = async () => {
+ setActionLoading(true);
+ try {
+ await api.enableFirewall();
+ toast.success('Firewall enabled');
+ await loadStatus();
+ } catch (error) {
+ toast.error(`Failed to enable firewall: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleDisable = async () => {
+ setConfirmDialog({
+ title: 'Disable Firewall',
+ message: 'Are you sure you want to disable the firewall? This will leave your server unprotected.',
+ confirmText: 'Disable',
+ variant: 'danger',
+ onConfirm: async () => {
+ setActionLoading(true);
+ try {
+ await api.disableFirewall();
+ toast.success('Firewall disabled');
+ await loadStatus();
+ } catch (error) {
+ toast.error(`Failed to disable firewall: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ setConfirmDialog(null);
+ }
+ },
+ onCancel: () => setConfirmDialog(null)
+ });
+ };
+
+ const handleBlockIP = async () => {
+ if (!blockIP.trim()) return;
+ setActionLoading(true);
+ try {
+ await api.blockIP(blockIP);
+ toast.success(`IP ${blockIP} blocked`);
+ setShowBlockIPModal(false);
+ setBlockIP('');
+ await loadBlockedIPs();
+ await loadRules();
+ } catch (error) {
+ toast.error(`Failed to block IP: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleUnblockIP = async (ip) => {
+ setConfirmDialog({
+ title: 'Unblock IP',
+ message: `Are you sure you want to unblock ${ip}?`,
+ confirmText: 'Unblock',
+ variant: 'warning',
+ onConfirm: async () => {
+ try {
+ await api.unblockIP(ip);
+ toast.success(`IP ${ip} unblocked`);
+ await loadBlockedIPs();
+ await loadRules();
+ } catch (error) {
+ toast.error(`Failed to unblock IP: ${error.message}`);
+ }
+ setConfirmDialog(null);
+ },
+ onCancel: () => setConfirmDialog(null)
+ });
+ };
+
+ const handleAllowPort = async () => {
+ if (!newPort.port) return;
+ setActionLoading(true);
+ try {
+ await api.allowPort(parseInt(newPort.port), newPort.protocol);
+ toast.success(`Port ${newPort.port}/${newPort.protocol} allowed`);
+ setShowPortModal(false);
+ setNewPort({ port: '', protocol: 'tcp' });
+ await loadRules();
+ } catch (error) {
+ toast.error(`Failed to allow port: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleQuickAllowPort = async (port, protocol) => {
+ setActionLoading(true);
+ try {
+ await api.allowPort(port, protocol);
+ toast.success(`Port ${port}/${protocol} allowed`);
+ await loadRules();
+ } catch (error) {
+ toast.error(`Failed to allow port: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleRemovePort = async (port, protocol) => {
+ setConfirmDialog({
+ title: 'Remove Port Rule',
+ message: `Are you sure you want to remove the rule for port ${port}/${protocol}?`,
+ confirmText: 'Remove',
+ variant: 'danger',
+ onConfirm: async () => {
+ try {
+ await api.denyPort(parseInt(port), protocol);
+ toast.success(`Port ${port}/${protocol} rule removed`);
+ await loadRules();
+ } catch (error) {
+ toast.error(`Failed to remove port: ${error.message}`);
+ }
+ setConfirmDialog(null);
+ },
+ onCancel: () => setConfirmDialog(null)
+ });
+ };
+
+ const handleInstall = async () => {
+ setActionLoading(true);
+ try {
+ await api.installFirewall(selectedFirewall);
+ toast.success(`${selectedFirewall.toUpperCase()} installed successfully`);
+ setShowInstallModal(false);
+ await loadData();
+ } catch (error) {
+ toast.error(`Failed to install firewall: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const isActive = status?.any_active;
+ const activeFirewall = status?.active_firewall;
+
+ if (loading) {
+ return (
+ <div className="page-loading">
+ <Spinner size="lg" />
+ </div>
+ );
+ }
+
+ return (
+ <div className="firewall-page">
+ <div className="page-header">
+ <div className="page-header-content">
+ <h1>Firewall</h1>
+ <p className="page-description">Manage firewall rules and IP blocking</p>
+ </div>
+ <div className="page-header-actions">
+ {!status?.any_installed ? (
+ <button className="btn btn-primary" onClick={() => setShowInstallModal(true)}>
+ Install Firewall
+ </button>
+ ) : (
+ <>
+ <button
+ className="btn btn-secondary"
+ onClick={() => setShowBlockIPModal(true)}
+ >
+ Block IP
+ </button>
+ <button
+ className="btn btn-secondary"
+ onClick={() => setShowPortModal(true)}
+ >
+ Allow Port
+ </button>
+ {isActive ? (
+ <button
+ className="btn btn-danger"
+ onClick={handleDisable}
+ disabled={actionLoading}
+ >
+ Disable Firewall
+ </button>
+ ) : (
+ <button
+ className="btn btn-primary"
+ onClick={handleEnable}
+ disabled={actionLoading}
+ >
+ Enable Firewall
+ </button>
+ )}
+ </>
+ )}
+ </div>
+ </div>
+
+ {!status?.any_installed ? (
+ <div className="empty-state-large">
+ <span className="icon">security</span>
+ <h2>No Firewall Installed</h2>
+ <p>Install a firewall to protect your server from unauthorized access.</p>
+ <button className="btn btn-primary btn-lg" onClick={() => setShowInstallModal(true)}>
+ Install Firewall
+ </button>
+ </div>
+ ) : (
+ <>
+ <div className="status-cards">
+ <div className={`status-card ${isActive ? 'success' : 'danger'}`}>
+ <div className="status-icon">
+ <span className="icon">{isActive ? 'shield' : 'shield_outlined'}</span>
+ </div>
+ <div className="status-info">
+ <span className="status-label">Firewall Status</span>
+ <span className="status-value">{isActive ? 'Active' : 'Inactive'}</span>
+ </div>
+ </div>
+ <div className="status-card">
+ <div className="status-icon">
+ <span className="icon">dns</span>
+ </div>
+ <div className="status-info">
+ <span className="status-label">Firewall Type</span>
+ <span className="status-value">{activeFirewall?.toUpperCase() || 'None'}</span>
+ </div>
+ </div>
+ <div className="status-card">
+ <div className="status-icon">
+ <span className="icon">rule</span>
+ </div>
+ <div className="status-info">
+ <span className="status-label">Active Rules</span>
+ <span className="status-value">{rules.length}</span>
+ </div>
+ </div>
+ <div className="status-card warning">
+ <div className="status-icon">
+ <span className="icon">block</span>
+ </div>
+ <div className="status-info">
+ <span className="status-label">Blocked IPs</span>
+ <span className="status-value">{blockedIPs.length}</span>
+ </div>
+ </div>
+ </div>
+
+ <div className="tabs">
+ <button
+ className={`tab ${activeTab === 'overview' ? 'active' : ''}`}
+ onClick={() => setActiveTab('overview')}
+ >
+ Overview
+ </button>
+ <button
+ className={`tab ${activeTab === 'rules' ? 'active' : ''}`}
+ onClick={() => setActiveTab('rules')}
+ >
+ Rules
+ </button>
+ <button
+ className={`tab ${activeTab === 'blocked' ? 'active' : ''}`}
+ onClick={() => setActiveTab('blocked')}
+ >
+ Blocked IPs
+ </button>
+ <button
+ className={`tab ${activeTab === 'quick' ? 'active' : ''}`}
+ onClick={() => setActiveTab('quick')}
+ >
+ Quick Actions
+ </button>
+ </div>
+
+ <div className="tab-content">
+ {activeTab === 'overview' && (
+ <div className="overview-tab">
+ <div className="info-card">
+ <h3>Firewall Information</h3>
+ <div className="info-grid">
+ <div className="info-item">
+ <span className="info-label">Type</span>
+ <span className="info-value">{activeFirewall?.toUpperCase()}</span>
+ </div>
+ <div className="info-item">
+ <span className="info-label">Status</span>
+ <span className={`info-value ${isActive ? 'text-success' : 'text-danger'}`}>
+ {isActive ? 'Active' : 'Inactive'}
+ </span>
+ </div>
+ {activeFirewall === 'firewalld' && status?.firewalld?.default_zone && (
+ <div className="info-item">
+ <span className="info-label">Default Zone</span>
+ <span className="info-value">{status.firewalld.default_zone}</span>
+ </div>
+ )}
+ </div>
+ </div>
+ <div className="protection-summary">
+ <h3>Protection Summary</h3>
+ <div className="summary-grid">
+ <div className="summary-item">
+ <span className="summary-icon text-success">
+ <span className="icon">check_circle</span>
+ </span>
+ <span className="summary-text">
+ {rules.filter(r => r.type === 'port' || r.port).length} ports allowed
+ </span>
+ </div>
+ <div className="summary-item">
+ <span className="summary-icon text-success">
+ <span className="icon">check_circle</span>
+ </span>
+ <span className="summary-text">
+ {rules.filter(r => r.type === 'service' || r.service).length} services allowed
+ </span>
+ </div>
+ <div className="summary-item">
+ <span className="summary-icon text-danger">
+ <span className="icon">block</span>
+ </span>
+ <span className="summary-text">
+ {blockedIPs.length} IPs blocked
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {activeTab === 'rules' && (
+ <div className="rules-tab">
+ <div className="section-header">
+ <h3>Firewall Rules</h3>
+ <button className="btn btn-primary" onClick={() => setShowPortModal(true)}>
+ Add Rule
+ </button>
+ </div>
+ {rules.length === 0 ? (
+ <div className="empty-state">
+ <span className="icon">rule</span>
+ <p>No rules configured</p>
+ </div>
+ ) : (
+ <div className="rules-table">
+ <table>
+ <thead>
+ <tr>
+ <th>Type</th>
+ <th>Target</th>
+ <th>Protocol</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ {rules.map((rule, index) => (
+ <tr key={index}>
+ <td>
+ <span className="badge badge-info">{rule.type}</span>
+ </td>
+ <td>
+ {rule.type === 'service' && rule.service}
+ {rule.type === 'port' && rule.port}
+ {rule.type === 'rich' && (
+ <code className="rule-code">{rule.rule}</code>
+ )}
+ </td>
+ <td>{rule.protocol || '-'}</td>
+ <td>
+ {rule.type === 'port' && (
+ <button
+ className="btn btn-sm btn-danger"
+ onClick={() => handleRemovePort(rule.port, rule.protocol)}
+ >
+ <span className="icon">delete</span>
+ </button>
+ )}
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ )}
+ </div>
+ )}
+
+ {activeTab === 'blocked' && (
+ <div className="blocked-tab">
+ <div className="section-header">
+ <h3>Blocked IP Addresses</h3>
+ <button className="btn btn-primary" onClick={() => setShowBlockIPModal(true)}>
+ Block IP
+ </button>
+ </div>
+ {blockedIPs.length === 0 ? (
+ <div className="empty-state">
+ <span className="icon">verified_user</span>
+ <p>No blocked IPs</p>
+ </div>
+ ) : (
+ <div className="blocked-list">
+ {blockedIPs.map((item, index) => (
+ <div key={index} className="blocked-item">
+ <div className="blocked-info">
+ <span className="blocked-ip">{item.ip}</span>
+ <code className="blocked-rule">{item.rule}</code>
+ </div>
+ <button
+ className="btn btn-sm btn-warning"
+ onClick={() => handleUnblockIP(item.ip)}
+ >
+ Unblock
+ </button>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ )}
+
+ {activeTab === 'quick' && (
+ <div className="quick-tab">
+ <h3>Quick Port Access</h3>
+ <p className="text-muted">One-click enable/disable common service ports</p>
+ <div className="quick-ports">
+ {commonPorts.map(({ port, name, protocol }) => {
+ const isAllowed = rules.some(r =>
+ (r.port === String(port) || r.port === port) && r.protocol === protocol
+ );
+ return (
+ <div key={port} className="quick-port-item">
+ <div className="port-info">
+ <span className="port-name">{name}</span>
+ <span className="port-number">{port}/{protocol}</span>
+ </div>
+ <div className="port-status">
+ {isAllowed ? (
+ <button
+ className="btn btn-sm btn-danger"
+ onClick={() => handleRemovePort(port, protocol)}
+ disabled={actionLoading}
+ >
+ Block
+ </button>
+ ) : (
+ <button
+ className="btn btn-sm btn-success"
+ onClick={() => handleQuickAllowPort(port, protocol)}
+ disabled={actionLoading}
+ >
+ Allow
+ </button>
+ )}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ )}
+ </div>
+ </>
+ )}
+
+ {/* Block IP Modal */}
+ {showBlockIPModal && (
+ <div className="modal-overlay" onClick={() => setShowBlockIPModal(false)}>
+ <div className="modal" onClick={(e) => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>Block IP Address</h2>
+ <button className="btn btn-icon" onClick={() => setShowBlockIPModal(false)}>
+ <span className="icon">close</span>
+ </button>
+ </div>
+ <div className="modal-body">
+ <div className="form-group">
+ <label>IP Address</label>
+ <input
+ type="text"
+ value={blockIP}
+ onChange={(e) => setBlockIP(e.target.value)}
+ placeholder="192.168.1.100 or 10.0.0.0/24"
+ />
+ </div>
+ <p className="text-muted">
+ You can block a single IP (192.168.1.100) or a range using CIDR notation (10.0.0.0/24).
+ </p>
+ </div>
+ <div className="modal-footer">
+ <button className="btn btn-secondary" onClick={() => setShowBlockIPModal(false)}>
+ Cancel
+ </button>
+ <button
+ className="btn btn-danger"
+ onClick={handleBlockIP}
+ disabled={actionLoading || !blockIP.trim()}
+ >
+ {actionLoading ? 'Blocking...' : 'Block IP'}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Allow Port Modal */}
+ {showPortModal && (
+ <div className="modal-overlay" onClick={() => setShowPortModal(false)}>
+ <div className="modal" onClick={(e) => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>Allow Port</h2>
+ <button className="btn btn-icon" onClick={() => setShowPortModal(false)}>
+ <span className="icon">close</span>
+ </button>
+ </div>
+ <div className="modal-body">
+ <div className="form-row">
+ <div className="form-group">
+ <label>Port Number</label>
+ <input
+ type="number"
+ value={newPort.port}
+ onChange={(e) => setNewPort({ ...newPort, port: e.target.value })}
+ placeholder="8080"
+ min="1"
+ max="65535"
+ />
+ </div>
+ <div className="form-group">
+ <label>Protocol</label>
+ <select
+ value={newPort.protocol}
+ onChange={(e) => setNewPort({ ...newPort, protocol: e.target.value })}
+ >
+ <option value="tcp">TCP</option>
+ <option value="udp">UDP</option>
+ </select>
+ </div>
+ </div>
+ </div>
+ <div className="modal-footer">
+ <button className="btn btn-secondary" onClick={() => setShowPortModal(false)}>
+ Cancel
+ </button>
+ <button
+ className="btn btn-primary"
+ onClick={handleAllowPort}
+ disabled={actionLoading || !newPort.port}
+ >
+ {actionLoading ? 'Adding...' : 'Allow Port'}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Install Firewall Modal */}
+ {showInstallModal && (
+ <div className="modal-overlay" onClick={() => setShowInstallModal(false)}>
+ <div className="modal" onClick={(e) => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>Install Firewall</h2>
+ <button className="btn btn-icon" onClick={() => setShowInstallModal(false)}>
+ <span className="icon">close</span>
+ </button>
+ </div>
+ <div className="modal-body">
+ <div className="form-group">
+ <label>Select Firewall</label>
+ <select
+ value={selectedFirewall}
+ onChange={(e) => setSelectedFirewall(e.target.value)}
+ >
+ <option value="ufw">UFW (Recommended for Ubuntu)</option>
+ <option value="firewalld">firewalld (CentOS/RHEL)</option>
+ </select>
+ </div>
+ <div className="install-info">
+ {selectedFirewall === 'ufw' ? (
+ <p>
+ <strong>UFW (Uncomplicated Firewall)</strong> is a simple and easy-to-use
+ firewall for Ubuntu and Debian systems. It provides a user-friendly interface
+ for iptables.
+ </p>
+ ) : (
+ <p>
+ <strong>firewalld</strong> is a dynamically managed firewall with zone-based
+ configuration. It's the default firewall on CentOS and RHEL systems.
+ </p>
+ )}
+ </div>
+ </div>
+ <div className="modal-footer">
+ <button className="btn btn-secondary" onClick={() => setShowInstallModal(false)}>
+ Cancel
+ </button>
+ <button
+ className="btn btn-primary"
+ onClick={handleInstall}
+ disabled={actionLoading}
+ >
+ {actionLoading ? 'Installing...' : 'Install'}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Confirm Dialog */}
+ {confirmDialog && (
+ <ConfirmDialog
+ title={confirmDialog.title}
+ message={confirmDialog.message}
+ confirmText={confirmDialog.confirmText}
+ variant={confirmDialog.variant}
+ onConfirm={confirmDialog.onConfirm}
+ onCancel={confirmDialog.onCancel}
+ />
+ )}
+ </div>
+ );
+}
+
+export default Firewall;
diff --git a/frontend/src/pages/PHP.jsx b/frontend/src/pages/PHP.jsx
new file mode 100644
index 00000000..b25dd996
--- /dev/null
+++ b/frontend/src/pages/PHP.jsx
@@ -0,0 +1,681 @@
+import { useState, useEffect } from 'react';
+import { api } from '../services/api';
+import { useToast } from '../contexts/ToastContext';
+import Spinner from '../components/Spinner';
+import ConfirmDialog from '../components/ConfirmDialog';
+
+function PHP() {
+ const [versions, setVersions] = useState([]);
+ const [selectedVersion, setSelectedVersion] = useState(null);
+ const [extensions, setExtensions] = useState([]);
+ const [pools, setPools] = useState([]);
+ const [fpmStatus, setFpmStatus] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [activeTab, setActiveTab] = useState('versions');
+ const [showInstallModal, setShowInstallModal] = useState(false);
+ const [showExtensionModal, setShowExtensionModal] = useState(false);
+ const [showPoolModal, setShowPoolModal] = useState(false);
+ const [installVersion, setInstallVersion] = useState('8.2');
+ const [newExtension, setNewExtension] = useState('');
+ const [newPool, setNewPool] = useState({
+ name: '',
+ user: 'www-data',
+ group: 'www-data',
+ listen: '',
+ pm: 'dynamic',
+ pm_max_children: 5,
+ pm_start_servers: 2,
+ pm_min_spare_servers: 1,
+ pm_max_spare_servers: 3
+ });
+ const [actionLoading, setActionLoading] = useState(false);
+ const [confirmDialog, setConfirmDialog] = useState(null);
+ const toast = useToast();
+
+ const availableVersions = ['8.0', '8.1', '8.2', '8.3'];
+
+ useEffect(() => {
+ loadVersions();
+ }, []);
+
+ useEffect(() => {
+ if (selectedVersion) {
+ loadVersionDetails(selectedVersion);
+ }
+ }, [selectedVersion]);
+
+ const loadVersions = async () => {
+ setLoading(true);
+ try {
+ const data = await api.getPHPVersions();
+ setVersions(data.versions || []);
+ if (data.versions?.length > 0) {
+ const defaultVersion = data.versions.find(v => v.is_default) || data.versions[0];
+ setSelectedVersion(defaultVersion.version);
+ }
+ } catch (error) {
+ toast.error(`Failed to load PHP versions: ${error.message}`);
+ } finally {
+ setLoading(false);
+ }
+ };
+
+ const loadVersionDetails = async (version) => {
+ try {
+ const [extData, poolData, statusData] = await Promise.all([
+ api.getPHPExtensions(version).catch(() => ({ extensions: [] })),
+ api.getPHPPools(version).catch(() => ({ pools: [] })),
+ api.getPHPFPMStatus(version).catch(() => null)
+ ]);
+ setExtensions(extData.extensions || []);
+ setPools(poolData.pools || []);
+ setFpmStatus(statusData);
+ } catch (error) {
+ console.error('Failed to load version details:', error);
+ }
+ };
+
+ const handleInstallVersion = async () => {
+ setActionLoading(true);
+ try {
+ await api.installPHPVersion(installVersion);
+ toast.success(`PHP ${installVersion} installation started`);
+ setShowInstallModal(false);
+ await loadVersions();
+ } catch (error) {
+ toast.error(`Failed to install PHP ${installVersion}: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleSetDefault = async (version) => {
+ setActionLoading(true);
+ try {
+ await api.setDefaultPHPVersion(version);
+ toast.success(`PHP ${version} is now the default version`);
+ await loadVersions();
+ } catch (error) {
+ toast.error(`Failed to set default version: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleInstallExtension = async () => {
+ if (!newExtension.trim() || !selectedVersion) return;
+ setActionLoading(true);
+ try {
+ await api.installPHPExtension(selectedVersion, newExtension);
+ toast.success(`Extension ${newExtension} installation started`);
+ setShowExtensionModal(false);
+ setNewExtension('');
+ await loadVersionDetails(selectedVersion);
+ } catch (error) {
+ toast.error(`Failed to install extension: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleCreatePool = async () => {
+ if (!newPool.name.trim() || !selectedVersion) return;
+ setActionLoading(true);
+ try {
+ const poolData = {
+ ...newPool,
+ listen: newPool.listen || `/run/php/php${selectedVersion}-fpm-${newPool.name}.sock`
+ };
+ await api.createPHPPool(selectedVersion, poolData);
+ toast.success(`Pool ${newPool.name} created successfully`);
+ setShowPoolModal(false);
+ setNewPool({
+ name: '',
+ user: 'www-data',
+ group: 'www-data',
+ listen: '',
+ pm: 'dynamic',
+ pm_max_children: 5,
+ pm_start_servers: 2,
+ pm_min_spare_servers: 1,
+ pm_max_spare_servers: 3
+ });
+ await loadVersionDetails(selectedVersion);
+ } catch (error) {
+ toast.error(`Failed to create pool: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const handleDeletePool = async (poolName) => {
+ setConfirmDialog({
+ title: 'Delete Pool',
+ message: `Are you sure you want to delete the pool "${poolName}"?`,
+ confirmText: 'Delete',
+ variant: 'danger',
+ onConfirm: async () => {
+ try {
+ await api.deletePHPPool(selectedVersion, poolName);
+ toast.success(`Pool ${poolName} deleted`);
+ await loadVersionDetails(selectedVersion);
+ } catch (error) {
+ toast.error(`Failed to delete pool: ${error.message}`);
+ }
+ setConfirmDialog(null);
+ },
+ onCancel: () => setConfirmDialog(null)
+ });
+ };
+
+ const handleRestartFPM = async () => {
+ if (!selectedVersion) return;
+ setActionLoading(true);
+ try {
+ await api.restartPHPFPM(selectedVersion);
+ toast.success(`PHP-FPM ${selectedVersion} restarted`);
+ await loadVersionDetails(selectedVersion);
+ } catch (error) {
+ toast.error(`Failed to restart PHP-FPM: ${error.message}`);
+ } finally {
+ setActionLoading(false);
+ }
+ };
+
+ const currentVersion = versions.find(v => v.version === selectedVersion);
+
+ if (loading) {
+ return (
+ <div className="page-loading">
+ <Spinner size="lg" />
+ </div>
+ );
+ }
+
+ return (
+ <div className="php-management">
+ <div className="page-header">
+ <div className="page-header-content">
+ <h1>PHP Management</h1>
+ <p className="page-description">Manage PHP versions, extensions, and FPM pools</p>
+ </div>
+ <div className="page-header-actions">
+ <button
+ className="btn btn-secondary"
+ onClick={handleRestartFPM}
+ disabled={!selectedVersion || actionLoading}
+ >
+ Restart FPM
+ </button>
+ <button
+ className="btn btn-primary"
+ onClick={() => setShowInstallModal(true)}
+ >
+ Install PHP Version
+ </button>
+ </div>
+ </div>
+
+ {versions.length === 0 ? (
+ <div className="empty-state-large">
+ <span className="icon">code</span>
+ <h2>No PHP Versions Installed</h2>
+ <p>Install a PHP version to get started with PHP development.</p>
+ <button className="btn btn-primary btn-lg" onClick={() => setShowInstallModal(true)}>
+ Install PHP
+ </button>
+ </div>
+ ) : (
+ <>
+ <div className="version-selector">
+ <label>Active Version:</label>
+ <select
+ value={selectedVersion || ''}
+ onChange={(e) => setSelectedVersion(e.target.value)}
+ >
+ {versions.map(v => (
+ <option key={v.version} value={v.version}>
+ PHP {v.version} {v.is_default ? '(Default)' : ''}
+ </option>
+ ))}
+ </select>
+ {currentVersion && !currentVersion.is_default && (
+ <button
+ className="btn btn-sm btn-secondary"
+ onClick={() => handleSetDefault(selectedVersion)}
+ disabled={actionLoading}
+ >
+ Set as Default
+ </button>
+ )}
+ </div>
+
+ {fpmStatus && (
+ <div className="status-cards">
+ <div className={`status-card ${fpmStatus.active ? 'success' : 'warning'}`}>
+ <div className="status-icon">
+ <span className="icon">{fpmStatus.active ? 'check_circle' : 'error'}</span>
+ </div>
+ <div className="status-info">
+ <span className="status-label">FPM Status</span>
+ <span className="status-value">{fpmStatus.active ? 'Running' : 'Stopped'}</span>
+ </div>
+ </div>
+ <div className="status-card">
+ <div className="status-icon">
+ <span className="icon">extension</span>
+ </div>
+ <div className="status-info">
+ <span className="status-label">Extensions</span>
+ <span className="status-value">{extensions.length}</span>
+ </div>
+ </div>
+ <div className="status-card">
+ <div className="status-icon">
+ <span className="icon">layers</span>
+ </div>
+ <div className="status-info">
+ <span className="status-label">FPM Pools</span>
+ <span className="status-value">{pools.length}</span>
+ </div>
+ </div>
+ </div>
+ )}
+
+ <div className="tabs">
+ <button
+ className={`tab ${activeTab === 'versions' ? 'active' : ''}`}
+ onClick={() => setActiveTab('versions')}
+ >
+ Installed Versions
+ </button>
+ <button
+ className={`tab ${activeTab === 'extensions' ? 'active' : ''}`}
+ onClick={() => setActiveTab('extensions')}
+ >
+ Extensions
+ </button>
+ <button
+ className={`tab ${activeTab === 'pools' ? 'active' : ''}`}
+ onClick={() => setActiveTab('pools')}
+ >
+ FPM Pools
+ </button>
+ </div>
+
+ <div className="tab-content">
+ {activeTab === 'versions' && (
+ <div className="versions-tab">
+ <div className="versions-grid">
+ {versions.map(v => (
+ <div
+ key={v.version}
+ className={`version-card ${v.version === selectedVersion ? 'selected' : ''}`}
+ onClick={() => setSelectedVersion(v.version)}
+ >
+ <div className="version-header">
+ <span className="version-number">PHP {v.version}</span>
+ {v.is_default && <span className="badge badge-primary">Default</span>}
+ </div>
+ <div className="version-details">
+ <div className="detail-row">
+ <span className="label">Binary:</span>
+ <code>{v.binary || `/usr/bin/php${v.version}`}</code>
+ </div>
+ <div className="detail-row">
+ <span className="label">FPM:</span>
+ <span className={`status ${v.fpm_active ? 'active' : 'inactive'}`}>
+ {v.fpm_active ? 'Running' : 'Stopped'}
+ </span>
+ </div>
+ </div>
+ <div className="version-actions">
+ {!v.is_default && (
+ <button
+ className="btn btn-sm btn-secondary"
+ onClick={(e) => {
+ e.stopPropagation();
+ handleSetDefault(v.version);
+ }}
+ >
+ Set Default
+ </button>
+ )}
+ </div>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+
+ {activeTab === 'extensions' && (
+ <div className="extensions-tab">
+ <div className="section-header">
+ <h3>Installed Extensions (PHP {selectedVersion})</h3>
+ <button
+ className="btn btn-primary"
+ onClick={() => setShowExtensionModal(true)}
+ >
+ Install Extension
+ </button>
+ </div>
+ {extensions.length === 0 ? (
+ <div className="empty-state">
+ <span className="icon">extension</span>
+ <p>No extensions found</p>
+ </div>
+ ) : (
+ <div className="extensions-grid">
+ {extensions.map(ext => (
+ <div key={ext.name || ext} className="extension-card">
+ <span className="extension-name">{ext.name || ext}</span>
+ {ext.version && (
+ <span className="extension-version">{ext.version}</span>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ )}
+
+ {activeTab === 'pools' && (
+ <div className="pools-tab">
+ <div className="section-header">
+ <h3>FPM Pools (PHP {selectedVersion})</h3>
+ <button
+ className="btn btn-primary"
+ onClick={() => setShowPoolModal(true)}
+ >
+ Create Pool
+ </button>
+ </div>
+ {pools.length === 0 ? (
+ <div className="empty-state">
+ <span className="icon">layers</span>
+ <p>No FPM pools configured</p>
+ <button
+ className="btn btn-primary"
+ onClick={() => setShowPoolModal(true)}
+ >
+ Create Pool
+ </button>
+ </div>
+ ) : (
+ <div className="pools-table">
+ <table>
+ <thead>
+ <tr>
+ <th>Pool Name</th>
+ <th>User</th>
+ <th>Listen</th>
+ <th>Process Manager</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ {pools.map(pool => (
+ <tr key={pool.name}>
+ <td>
+ <strong>{pool.name}</strong>
+ </td>
+ <td>{pool.user}:{pool.group}</td>
+ <td><code>{pool.listen}</code></td>
+ <td>
+ <span className="badge">{pool.pm || 'dynamic'}</span>
+ </td>
+ <td>
+ <button
+ className="btn btn-sm btn-danger"
+ onClick={() => handleDeletePool(pool.name)}
+ disabled={pool.name === 'www'}
+ title={pool.name === 'www' ? 'Cannot delete default pool' : 'Delete pool'}
+ >
+ <span className="icon">delete</span>
+ </button>
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ </>
+ )}
+
+ {/* Install Version Modal */}
+ {showInstallModal && (
+ <div className="modal-overlay" onClick={() => setShowInstallModal(false)}>
+ <div className="modal" onClick={(e) => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>Install PHP Version</h2>
+ <button className="btn btn-icon" onClick={() => setShowInstallModal(false)}>
+ <span className="icon">close</span>
+ </button>
+ </div>
+ <div className="modal-body">
+ <div className="form-group">
+ <label>PHP Version</label>
+ <select
+ value={installVersion}
+ onChange={(e) => setInstallVersion(e.target.value)}
+ >
+ {availableVersions.map(v => (
+ <option
+ key={v}
+ value={v}
+ disabled={versions.some(iv => iv.version === v)}
+ >
+ PHP {v} {versions.some(iv => iv.version === v) ? '(Installed)' : ''}
+ </option>
+ ))}
+ </select>
+ </div>
+ <p className="text-muted">
+ This will install PHP {installVersion} with common extensions including
+ cli, fpm, mysql, pgsql, sqlite3, curl, gd, mbstring, xml, and zip.
+ </p>
+ </div>
+ <div className="modal-footer">
+ <button className="btn btn-secondary" onClick={() => setShowInstallModal(false)}>
+ Cancel
+ </button>
+ <button
+ className="btn btn-primary"
+ onClick={handleInstallVersion}
+ disabled={actionLoading || versions.some(v => v.version === installVersion)}
+ >
+ {actionLoading ? 'Installing...' : 'Install'}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Install Extension Modal */}
+ {showExtensionModal && (
+ <div className="modal-overlay" onClick={() => setShowExtensionModal(false)}>
+ <div className="modal" onClick={(e) => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>Install PHP Extension</h2>
+ <button className="btn btn-icon" onClick={() => setShowExtensionModal(false)}>
+ <span className="icon">close</span>
+ </button>
+ </div>
+ <div className="modal-body">
+ <div className="form-group">
+ <label>Extension Name</label>
+ <input
+ type="text"
+ value={newExtension}
+ onChange={(e) => setNewExtension(e.target.value)}
+ placeholder="e.g., redis, imagick, xdebug"
+ />
+ </div>
+ <div className="common-extensions">
+ <p className="text-muted">Common extensions:</p>
+ <div className="extension-chips">
+ {['redis', 'imagick', 'xdebug', 'memcached', 'opcache', 'intl', 'soap', 'ldap'].map(ext => (
+ <button
+ key={ext}
+ className="chip"
+ onClick={() => setNewExtension(ext)}
+ >
+ {ext}
+ </button>
+ ))}
+ </div>
+ </div>
+ </div>
+ <div className="modal-footer">
+ <button className="btn btn-secondary" onClick={() => setShowExtensionModal(false)}>
+ Cancel
+ </button>
+ <button
+ className="btn btn-primary"
+ onClick={handleInstallExtension}
+ disabled={actionLoading || !newExtension.trim()}
+ >
+ {actionLoading ? 'Installing...' : 'Install'}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Create Pool Modal */}
+ {showPoolModal && (
+ <div className="modal-overlay" onClick={() => setShowPoolModal(false)}>
+ <div className="modal modal-lg" onClick={(e) => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>Create FPM Pool</h2>
+ <button className="btn btn-icon" onClick={() => setShowPoolModal(false)}>
+ <span className="icon">close</span>
+ </button>
+ </div>
+ <div className="modal-body">
+ <div className="form-row">
+ <div className="form-group">
+ <label>Pool Name *</label>
+ <input
+ type="text"
+ value={newPool.name}
+ onChange={(e) => setNewPool({ ...newPool, name: e.target.value })}
+ placeholder="myapp"
+ />
+ </div>
+ <div className="form-group">
+ <label>Process Manager</label>
+ <select
+ value={newPool.pm}
+ onChange={(e) => setNewPool({ ...newPool, pm: e.target.value })}
+ >
+ <option value="dynamic">Dynamic</option>
+ <option value="static">Static</option>
+ <option value="ondemand">On Demand</option>
+ </select>
+ </div>
+ </div>
+ <div className="form-row">
+ <div className="form-group">
+ <label>User</label>
+ <input
+ type="text"
+ value={newPool.user}
+ onChange={(e) => setNewPool({ ...newPool, user: e.target.value })}
+ />
+ </div>
+ <div className="form-group">
+ <label>Group</label>
+ <input
+ type="text"
+ value={newPool.group}
+ onChange={(e) => setNewPool({ ...newPool, group: e.target.value })}
+ />
+ </div>
+ </div>
+ <div className="form-group">
+ <label>Listen Socket (leave empty for default)</label>
+ <input
+ type="text"
+ value={newPool.listen}
+ onChange={(e) => setNewPool({ ...newPool, listen: e.target.value })}
+ placeholder={`/run/php/php${selectedVersion}-fpm-${newPool.name || 'poolname'}.sock`}
+ />
+ </div>
+ {newPool.pm === 'dynamic' && (
+ <div className="form-row form-row-4">
+ <div className="form-group">
+ <label>Max Children</label>
+ <input
+ type="number"
+ value={newPool.pm_max_children}
+ onChange={(e) => setNewPool({ ...newPool, pm_max_children: parseInt(e.target.value) })}
+ min="1"
+ />
+ </div>
+ <div className="form-group">
+ <label>Start Servers</label>
+ <input
+ type="number"
+ value={newPool.pm_start_servers}
+ onChange={(e) => setNewPool({ ...newPool, pm_start_servers: parseInt(e.target.value) })}
+ min="1"
+ />
+ </div>
+ <div className="form-group">
+ <label>Min Spare</label>
+ <input
+ type="number"
+ value={newPool.pm_min_spare_servers}
+ onChange={(e) => setNewPool({ ...newPool, pm_min_spare_servers: parseInt(e.target.value) })}
+ min="1"
+ />
+ </div>
+ <div className="form-group">
+ <label>Max Spare</label>
+ <input
+ type="number"
+ value={newPool.pm_max_spare_servers}
+ onChange={(e) => setNewPool({ ...newPool, pm_max_spare_servers: parseInt(e.target.value) })}
+ min="1"
+ />
+ </div>
+ </div>
+ )}
+ </div>
+ <div className="modal-footer">
+ <button className="btn btn-secondary" onClick={() => setShowPoolModal(false)}>
+ Cancel
+ </button>
+ <button
+ className="btn btn-primary"
+ onClick={handleCreatePool}
+ disabled={actionLoading || !newPool.name.trim()}
+ >
+ {actionLoading ? 'Creating...' : 'Create Pool'}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Confirm Dialog */}
+ {confirmDialog && (
+ <ConfirmDialog
+ title={confirmDialog.title}
+ message={confirmDialog.message}
+ confirmText={confirmDialog.confirmText}
+ variant={confirmDialog.variant}
+ onConfirm={confirmDialog.onConfirm}
+ onCancel={confirmDialog.onCancel}
+ />
+ )}
+ </div>
+ );
+}
+
+export default PHP;
diff --git a/frontend/src/services/api.js b/frontend/src/services/api.js
index b78988b0..ededf680 100644
--- a/frontend/src/services/api.js
+++ b/frontend/src/services/api.js
@@ -1,4 +1,6 @@
-const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:5000/api/v1';
+// Use relative URL in production (served from Flask), absolute in development
+const API_BASE_URL = import.meta.env.VITE_API_URL ||
+ (import.meta.env.PROD ? '/api/v1' : 'http://localhost:5000/api/v1');
class ApiService {
constructor() {
@@ -1364,6 +1366,96 @@ class ApiService {
body: { host, port, username, password }
});
}
+
+ // ========================================
+ // Firewall endpoints
+ // ========================================
+ async getFirewallStatus() {
+ return this.request('/firewall/status');
+ }
+
+ async enableFirewall(firewall = null) {
+ return this.request('/firewall/enable', {
+ method: 'POST',
+ body: firewall ? { firewall } : {}
+ });
+ }
+
+ async disableFirewall(firewall = null) {
+ return this.request('/firewall/disable', {
+ method: 'POST',
+ body: firewall ? { firewall } : {}
+ });
+ }
+
+ async getFirewallRules(firewall = null) {
+ const params = firewall ? `?firewall=${firewall}` : '';
+ return this.request(`/firewall/rules${params}`);
+ }
+
+ async addFirewallRule(ruleData) {
+ return this.request('/firewall/rules', {
+ method: 'POST',
+ body: ruleData
+ });
+ }
+
+ async removeFirewallRule(ruleData) {
+ return this.request('/firewall/rules', {
+ method: 'DELETE',
+ body: ruleData
+ });
+ }
+
+ async blockIP(ip, permanent = true) {
+ return this.request('/firewall/block-ip', {
+ method: 'POST',
+ body: { ip, permanent }
+ });
+ }
+
+ async unblockIP(ip, permanent = true) {
+ return this.request('/firewall/unblock-ip', {
+ method: 'POST',
+ body: { ip, permanent }
+ });
+ }
+
+ async getBlockedIPs() {
+ return this.request('/firewall/blocked-ips');
+ }
+
+ async allowPort(port, protocol = 'tcp', permanent = true) {
+ return this.request('/firewall/allow-port', {
+ method: 'POST',
+ body: { port, protocol, permanent }
+ });
+ }
+
+ async denyPort(port, protocol = 'tcp', permanent = true) {
+ return this.request('/firewall/deny-port', {
+ method: 'POST',
+ body: { port, protocol, permanent }
+ });
+ }
+
+ async getFirewallZones() {
+ return this.request('/firewall/zones');
+ }
+
+ async setDefaultZone(zone) {
+ return this.request('/firewall/zones/default', {
+ method: 'POST',
+ body: { zone }
+ });
+ }
+
+ async installFirewall(firewall = 'ufw') {
+ return this.request('/firewall/install', {
+ method: 'POST',
+ body: { firewall }
+ });
+ }
}
export const api = new ApiService();
diff --git a/frontend/src/styles/components/_spinner.less b/frontend/src/styles/components/_spinner.less
index 4cba0b9d..c1c55100 100644
--- a/frontend/src/styles/components/_spinner.less
+++ b/frontend/src/styles/components/_spinner.less
@@ -86,13 +86,13 @@
transform: translate(-50%, -50%);
.spinner-ring {
- border-color: fade(currentColor, 30%);
- border-top-color: currentColor;
+ border-color: @border-subtle;
+ border-top-color: @text-primary;
}
}
&.btn-primary .spinner .spinner-ring {
- border-color: fade(#fff, 30%);
+ border-color: rgba(255, 255, 255, 0.3);
border-top-color: #fff;
}
@@ -100,4 +100,9 @@
border-color: fade(@text-primary, 30%);
border-top-color: @text-primary;
}
+
+ &.btn-danger .spinner .spinner-ring {
+ border-color: rgba(255, 255, 255, 0.3);
+ border-top-color: #fff;
+ }
}
diff --git a/frontend/src/styles/components/_toasts.less b/frontend/src/styles/components/_toasts.less
index 582d354e..0ca592f7 100644
--- a/frontend/src/styles/components/_toasts.less
+++ b/frontend/src/styles/components/_toasts.less
@@ -20,8 +20,8 @@
gap: @space-3;
padding: @space-3 @space-4;
border-radius: @radius-md;
- background: @bg-secondary;
- border: 1px solid @border-default;
+ background: @bg-card;
+ border: 1px solid @border-subtle;
box-shadow: @shadow-lg;
pointer-events: auto;
animation: toast-slide-in 0.3s ease-out;
diff --git a/frontend/src/styles/main.less b/frontend/src/styles/main.less
index 1a9dd14b..88e0e21c 100644
--- a/frontend/src/styles/main.less
+++ b/frontend/src/styles/main.less
@@ -55,3 +55,5 @@
@import 'pages/_settings';
@import 'pages/_file-manager';
@import 'pages/_ftp-server';
+@import 'pages/_php';
+@import 'pages/_firewall';
diff --git a/frontend/src/styles/pages/_applications.less b/frontend/src/styles/pages/_applications.less
index 1f2f87e1..0d3a866a 100644
--- a/frontend/src/styles/pages/_applications.less
+++ b/frontend/src/styles/pages/_applications.less
@@ -97,9 +97,9 @@
justify-content: space-between;
gap: @space-4;
padding: @space-4 @space-5;
- background: @surface-secondary;
- border: 1px solid @border-primary;
- border-radius: @border-radius-lg;
+ background: @bg-card;
+ border: 1px solid @border-subtle;
+ border-radius: @radius-lg;
@media (max-width: @breakpoint-md) {
flex-direction: column;
@@ -124,7 +124,7 @@
}
.repo-url {
- font-family: @font-family-mono;
+ font-family: @font-mono;
font-size: @font-size-sm;
color: @text-primary;
word-break: break-all;
@@ -154,8 +154,8 @@
gap: @space-3;
margin-top: @space-3;
padding: @space-3;
- background: @surface-tertiary;
- border-radius: @border-radius-md;
+ background: @bg-hover;
+ border-radius: @radius-md;
code {
flex: 1;
@@ -186,9 +186,9 @@
.script-code {
padding: @space-3;
- background: @surface-tertiary;
- border-radius: @border-radius-md;
- font-family: @font-family-mono;
+ background: @bg-hover;
+ border-radius: @radius-md;
+ font-family: @font-mono;
font-size: @font-size-xs;
color: @text-secondary;
overflow-x: auto;
@@ -202,7 +202,7 @@
gap: @space-2;
margin-top: @space-4;
padding-top: @space-4;
- border-top: 1px solid @border-primary;
+ border-top: 1px solid @border-subtle;
}
.checkbox-label {
@@ -231,7 +231,7 @@
}
textarea {
- font-family: @font-family-mono;
+ font-family: @font-mono;
font-size: @font-size-sm;
resize: vertical;
min-height: 80px;
diff --git a/frontend/src/styles/pages/_backups.less b/frontend/src/styles/pages/_backups.less
index 64ac45f0..6cc56da8 100644
--- a/frontend/src/styles/pages/_backups.less
+++ b/frontend/src/styles/pages/_backups.less
@@ -22,7 +22,7 @@
&.apps {
background: rgba(59, 130, 246, 0.1);
- color: @primary;
+ color: @accent-primary;
}
&.databases {
@@ -37,18 +37,18 @@
}
.filter-select {
- padding: @spacing-xs @spacing-sm;
+ padding: @space-1 @space-2;
border: 1px solid var(--border-color);
border-radius: @radius-sm;
background: var(--bg-secondary);
color: var(--text-primary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
.backup-name {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
svg {
stroke: currentColor;
@@ -58,7 +58,7 @@
}
.icon-app {
- color: @primary;
+ color: @accent-primary;
}
.icon-db {
@@ -68,13 +68,13 @@
.action-buttons {
display: flex;
- gap: @spacing-xs;
+ gap: @space-1;
}
.checkbox-label {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
cursor: pointer;
input[type="checkbox"] {
@@ -84,7 +84,7 @@
}
span {
- font-size: @font-sm;
+ font-size: @font-size-sm;
color: var(--text-primary);
}
}
@@ -92,50 +92,50 @@
.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
- gap: @spacing-md;
+ gap: @space-4;
}
.form-help {
display: block;
- margin-top: @spacing-xs;
- font-size: @font-xs;
+ margin-top: @space-1;
+ font-size: @font-size-xs;
color: var(--text-tertiary);
}
.restore-warning {
text-align: center;
- padding: @spacing-lg;
+ padding: @space-6;
background: rgba(239, 68, 68, 0.1);
border-radius: @radius-md;
- margin-bottom: @spacing-lg;
+ margin-bottom: @space-6;
svg {
stroke: @danger;
fill: none;
stroke-width: 2;
- margin-bottom: @spacing-sm;
+ margin-bottom: @space-2;
}
h3 {
color: @danger;
- margin-bottom: @spacing-sm;
+ margin-bottom: @space-2;
}
p {
color: var(--text-secondary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
}
.restore-details {
background: var(--bg-secondary);
border-radius: @radius-md;
- padding: @spacing-md;
+ padding: @space-4;
.detail-row {
display: flex;
justify-content: space-between;
- padding: @spacing-xs 0;
+ padding: @space-1 0;
&:not(:last-child) {
border-bottom: 1px solid var(--border-color);
@@ -144,12 +144,12 @@
.detail-label {
color: var(--text-tertiary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
.detail-value {
font-weight: 500;
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
}
}
diff --git a/frontend/src/styles/pages/_docker.less b/frontend/src/styles/pages/_docker.less
index 65a7fb7a..9d24e474 100644
--- a/frontend/src/styles/pages/_docker.less
+++ b/frontend/src/styles/pages/_docker.less
@@ -72,3 +72,122 @@
gap: @space-2;
flex-shrink: 0;
}
+
+// Container Exec Modal
+.exec-modal-body {
+ display: flex;
+ flex-direction: column;
+ height: 400px;
+}
+
+.exec-output {
+ flex: 1;
+ background: @bg-card;
+ border: 1px solid @border-subtle;
+ border-radius: @radius-md;
+ padding: @space-4;
+ overflow-y: auto;
+ font-family: @font-mono;
+ font-size: @font-size-sm;
+ margin-bottom: @space-3;
+}
+
+.exec-welcome {
+ color: @text-secondary;
+ text-align: center;
+ padding: @space-8 0;
+
+ p {
+ margin-bottom: @space-2;
+ }
+
+ code {
+ background: @bg-hover;
+ padding: @space-1 @space-2;
+ border-radius: @radius-sm;
+ color: @accent-primary;
+ }
+}
+
+.exec-line {
+ margin-bottom: @space-2;
+
+ pre {
+ margin: 0;
+ white-space: pre-wrap;
+ word-break: break-all;
+ }
+
+ &.exec-command {
+ color: @accent-primary;
+ font-weight: @font-weight-medium;
+ }
+
+ &.exec-output {
+ color: @text-primary;
+ }
+
+ &.exec-error {
+ color: @danger;
+ }
+
+ &.exec-info {
+ color: @text-tertiary;
+ font-size: @font-size-xs;
+ }
+
+ &.exec-loading {
+ color: @text-secondary;
+ display: flex;
+ align-items: center;
+ gap: @space-2;
+ }
+}
+
+.spinner-inline {
+ display: inline-block;
+ width: 14px;
+ height: 14px;
+ border: 2px solid @border-subtle;
+ border-top-color: @accent-primary;
+ border-radius: 50%;
+ animation: spin 0.8s linear infinite;
+}
+
+.exec-input-form {
+ display: flex;
+ align-items: center;
+ gap: @space-2;
+ background: @bg-card;
+ border: 1px solid @border-subtle;
+ border-radius: @radius-md;
+ padding: @space-2 @space-3;
+
+ &:focus-within {
+ border-color: @accent-primary;
+ }
+}
+
+.exec-prompt {
+ color: @accent-primary;
+ font-family: @font-mono;
+ font-weight: @font-weight-semibold;
+}
+
+.exec-input {
+ flex: 1;
+ border: none;
+ background: transparent;
+ color: @text-primary;
+ font-family: @font-mono;
+ font-size: @font-size-sm;
+ outline: none;
+
+ &::placeholder {
+ color: @text-tertiary;
+ }
+
+ &:disabled {
+ opacity: 0.5;
+ }
+}
diff --git a/frontend/src/styles/pages/_firewall.less b/frontend/src/styles/pages/_firewall.less
new file mode 100644
index 00000000..7513039c
--- /dev/null
+++ b/frontend/src/styles/pages/_firewall.less
@@ -0,0 +1,436 @@
+// ============================================
+// FIREWALL PAGE
+// ============================================
+
+.firewall-page {
+ .page-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: @space-6;
+ flex-wrap: wrap;
+ gap: @space-4;
+
+ .page-header-content {
+ h1 {
+ font-size: @font-size-2xl;
+ font-weight: @font-weight-semibold;
+ margin: 0 0 @space-1 0;
+ }
+
+ .page-description {
+ color: @text-secondary;
+ margin: 0;
+ }
+ }
+
+ .page-header-actions {
+ display: flex;
+ gap: @space-2;
+ }
+ }
+
+ .page-loading {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ min-height: 400px;
+ }
+
+ .empty-state-large {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 80px @space-6;
+ background: @bg-card;
+ border-radius: @radius-xl;
+ text-align: center;
+
+ .icon {
+ font-size: 64px;
+ color: @text-tertiary;
+ margin-bottom: @space-6;
+ }
+
+ h2 {
+ margin: 0 0 @space-3 0;
+ font-size: @font-size-2xl;
+ font-weight: @font-weight-semibold;
+ }
+
+ p {
+ margin: 0 0 @space-6 0;
+ color: @text-secondary;
+ max-width: 400px;
+ }
+ }
+
+ .status-cards {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
+ gap: @space-4;
+ margin-bottom: @space-6;
+ }
+
+ .status-card {
+ display: flex;
+ align-items: center;
+ gap: @space-4;
+ padding: @space-5;
+ background: @bg-card;
+ border-radius: @radius-xl;
+ border-left: 4px solid @border-subtle;
+
+ &.success {
+ border-left-color: @success;
+
+ .status-icon {
+ color: @success;
+ }
+ }
+
+ &.danger {
+ border-left-color: @danger;
+
+ .status-icon {
+ color: @danger;
+ }
+ }
+
+ &.warning {
+ border-left-color: @warning;
+
+ .status-icon {
+ color: @warning;
+ }
+ }
+
+ .status-icon {
+ .icon {
+ font-size: 32px;
+ }
+ }
+
+ .status-info {
+ display: flex;
+ flex-direction: column;
+ gap: @space-1;
+
+ .status-label {
+ font-size: @font-size-sm;
+ color: @text-secondary;
+ }
+
+ .status-value {
+ font-size: @font-size-lg;
+ font-weight: @font-weight-semibold;
+ }
+ }
+ }
+
+ .tabs {
+ display: flex;
+ gap: @space-1;
+ margin-bottom: @space-6;
+ border-bottom: 1px solid @border-subtle;
+
+ .tab {
+ padding: @space-3 @space-5;
+ background: none;
+ border: none;
+ font-size: @font-size-base;
+ font-weight: @font-weight-medium;
+ color: @text-secondary;
+ cursor: pointer;
+ position: relative;
+ transition: color @transition-fast;
+
+ &:hover {
+ color: @text-primary;
+ }
+
+ &.active {
+ color: @accent-primary;
+
+ &::after {
+ content: '';
+ position: absolute;
+ bottom: -1px;
+ left: 0;
+ right: 0;
+ height: 2px;
+ background: @accent-primary;
+ }
+ }
+ }
+ }
+
+ .tab-content {
+ .section-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: @space-4;
+
+ h3 {
+ margin: 0;
+ font-size: @font-size-md;
+ font-weight: @font-weight-semibold;
+ }
+ }
+
+ .empty-state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: @space-12;
+ background: @bg-card;
+ border-radius: @radius-lg;
+ color: @text-tertiary;
+
+ .icon {
+ font-size: 48px;
+ margin-bottom: @space-4;
+ }
+
+ p {
+ margin-bottom: @space-4;
+ }
+ }
+ }
+
+ // Overview Tab
+ .overview-tab {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: @space-6;
+
+ @media (max-width: @breakpoint-md) {
+ grid-template-columns: 1fr;
+ }
+
+ .info-card,
+ .protection-summary {
+ background: @bg-card;
+ border-radius: @radius-lg;
+ padding: @space-5;
+
+ h3 {
+ margin: 0 0 @space-4 0;
+ font-size: @font-size-md;
+ font-weight: @font-weight-semibold;
+ }
+ }
+
+ .info-grid {
+ display: grid;
+ gap: @space-3;
+ }
+
+ .info-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: @space-2 0;
+ border-bottom: 1px solid @border-subtle;
+
+ &:last-child {
+ border-bottom: none;
+ }
+
+ .info-label {
+ font-size: @font-size-sm;
+ color: @text-secondary;
+ }
+
+ .info-value {
+ font-size: @font-size-sm;
+ font-weight: @font-weight-medium;
+
+ &.text-success {
+ color: @success;
+ }
+
+ &.text-danger {
+ color: @danger;
+ }
+ }
+ }
+
+ .summary-grid {
+ display: flex;
+ flex-direction: column;
+ gap: @space-3;
+ }
+
+ .summary-item {
+ display: flex;
+ align-items: center;
+ gap: @space-3;
+
+ .summary-icon {
+ &.text-success {
+ color: @success;
+ }
+
+ &.text-danger {
+ color: @danger;
+ }
+ }
+
+ .summary-text {
+ font-size: @font-size-sm;
+ }
+ }
+ }
+
+ // Rules Tab
+ .rules-tab {
+ .rules-table {
+ background: @bg-card;
+ border-radius: @radius-lg;
+ overflow: hidden;
+
+ table {
+ width: 100%;
+ border-collapse: collapse;
+
+ th,
+ td {
+ padding: @space-3 @space-4;
+ text-align: left;
+ }
+
+ th {
+ background: @bg-hover;
+ font-size: @font-size-xs;
+ font-weight: @font-weight-semibold;
+ text-transform: uppercase;
+ color: @text-tertiary;
+ }
+
+ td {
+ border-bottom: 1px solid @border-subtle;
+ font-size: @font-size-sm;
+
+ .rule-code {
+ font-family: @font-mono;
+ font-size: @font-size-xs;
+ background: @bg-hover;
+ padding: @space-1 @space-2;
+ border-radius: @radius-sm;
+ }
+ }
+
+ tr:last-child td {
+ border-bottom: none;
+ }
+ }
+ }
+ }
+
+ // Blocked IPs Tab
+ .blocked-tab {
+ .blocked-list {
+ display: flex;
+ flex-direction: column;
+ gap: @space-3;
+ }
+
+ .blocked-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: @space-4;
+ background: @bg-card;
+ border-radius: @radius-lg;
+ border: 1px solid @border-subtle;
+
+ .blocked-info {
+ display: flex;
+ flex-direction: column;
+ gap: @space-1;
+
+ .blocked-ip {
+ font-weight: @font-weight-semibold;
+ color: @danger;
+ }
+
+ .blocked-rule {
+ font-family: @font-mono;
+ font-size: @font-size-xs;
+ color: @text-tertiary;
+ }
+ }
+ }
+ }
+
+ // Quick Actions Tab
+ .quick-tab {
+ h3 {
+ margin: 0 0 @space-2 0;
+ font-size: @font-size-md;
+ font-weight: @font-weight-semibold;
+ }
+
+ .quick-ports {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
+ gap: @space-3;
+ margin-top: @space-6;
+ }
+
+ .quick-port-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: @space-4;
+ background: @bg-card;
+ border-radius: @radius-lg;
+ border: 1px solid @border-subtle;
+
+ .port-info {
+ display: flex;
+ flex-direction: column;
+ gap: @space-1;
+
+ .port-name {
+ font-weight: @font-weight-medium;
+ }
+
+ .port-number {
+ font-size: @font-size-sm;
+ color: @text-tertiary;
+ font-family: @font-mono;
+ }
+ }
+ }
+ }
+
+ // Install info
+ .install-info {
+ padding: @space-4;
+ background: @bg-hover;
+ border-radius: @radius-lg;
+ margin-top: @space-4;
+
+ p {
+ margin: 0;
+ font-size: @font-size-sm;
+ line-height: @line-height-relaxed;
+
+ strong {
+ color: @accent-primary;
+ }
+ }
+ }
+
+ // Form helpers
+ .form-row {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: @space-4;
+ }
+}
diff --git a/frontend/src/styles/pages/_monitoring.less b/frontend/src/styles/pages/_monitoring.less
index cc2e7015..91768be9 100644
--- a/frontend/src/styles/pages/_monitoring.less
+++ b/frontend/src/styles/pages/_monitoring.less
@@ -4,31 +4,31 @@
.monitoring-overview {
display: flex;
flex-direction: column;
- gap: @spacing-lg;
+ gap: @space-6;
}
.threshold-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
- gap: @spacing-lg;
+ gap: @space-6;
}
.threshold-item {
display: flex;
justify-content: space-between;
align-items: center;
- padding: @spacing-md;
+ padding: @space-4;
background: var(--bg-secondary);
border-radius: @radius-md;
}
.threshold-label {
color: var(--text-secondary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
.threshold-value {
- font-size: @font-lg;
+ font-size: @font-size-lg;
font-weight: 600;
color: var(--primary);
}
@@ -36,20 +36,20 @@
.threshold-form-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
- gap: @spacing-lg;
+ gap: @space-6;
}
.alert-list {
display: flex;
flex-direction: column;
- gap: @spacing-sm;
+ gap: @space-2;
}
.alert-item {
display: flex;
align-items: center;
- gap: @spacing-md;
- padding: @spacing-sm @spacing-md;
+ gap: @space-4;
+ padding: @space-2 @space-4;
background: var(--bg-secondary);
border-radius: @radius-md;
@@ -59,12 +59,12 @@
.alert-message {
flex: 1;
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
.alert-time {
color: var(--text-tertiary);
- font-size: @font-xs;
+ font-size: @font-size-xs;
white-space: nowrap;
}
}
@@ -95,7 +95,7 @@
&.interval {
background: rgba(59, 130, 246, 0.1);
- color: @primary;
+ color: @accent-primary;
}
&.notifications {
@@ -114,7 +114,7 @@
.input-group {
display: flex;
- gap: @spacing-sm;
+ gap: @space-2;
input {
flex: 1;
@@ -128,7 +128,7 @@
.checkbox-label {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
cursor: pointer;
input[type="checkbox"] {
@@ -138,15 +138,15 @@
}
span {
- font-size: @font-sm;
+ font-size: @font-size-sm;
color: var(--text-primary);
}
}
.form-help {
display: block;
- margin-top: @spacing-xs;
- font-size: @font-xs;
+ margin-top: @space-1;
+ font-size: @font-size-xs;
color: var(--text-tertiary);
}
}
diff --git a/frontend/src/styles/pages/_php.less b/frontend/src/styles/pages/_php.less
new file mode 100644
index 00000000..377ed119
--- /dev/null
+++ b/frontend/src/styles/pages/_php.less
@@ -0,0 +1,404 @@
+// ============================================
+// PHP MANAGEMENT PAGE
+// ============================================
+
+.php-management {
+ .page-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: @space-6;
+ flex-wrap: wrap;
+ gap: @space-4;
+
+ .page-header-content {
+ h1 {
+ font-size: @font-size-2xl;
+ font-weight: @font-weight-semibold;
+ margin: 0 0 @space-1 0;
+ }
+
+ .page-description {
+ color: @text-secondary;
+ margin: 0;
+ }
+ }
+
+ .page-header-actions {
+ display: flex;
+ gap: @space-2;
+ }
+ }
+
+ .page-loading {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ min-height: 400px;
+ }
+
+ .empty-state-large {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 80px @space-6;
+ background: @bg-card;
+ border-radius: @radius-xl;
+ text-align: center;
+
+ .icon {
+ font-size: 64px;
+ color: @text-tertiary;
+ margin-bottom: @space-6;
+ }
+
+ h2 {
+ margin: 0 0 @space-3 0;
+ font-size: @font-size-2xl;
+ font-weight: @font-weight-semibold;
+ }
+
+ p {
+ margin: 0 0 @space-6 0;
+ color: @text-secondary;
+ max-width: 400px;
+ }
+ }
+
+ .version-selector {
+ display: flex;
+ align-items: center;
+ gap: @space-3;
+ margin-bottom: @space-6;
+ padding: @space-4;
+ background: @bg-card;
+ border-radius: @radius-lg;
+
+ label {
+ font-weight: @font-weight-medium;
+ color: @text-secondary;
+ }
+
+ select {
+ min-width: 200px;
+ }
+ }
+
+ .status-cards {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
+ gap: @space-4;
+ margin-bottom: @space-6;
+ }
+
+ .status-card {
+ display: flex;
+ align-items: center;
+ gap: @space-4;
+ padding: @space-5;
+ background: @bg-card;
+ border-radius: @radius-xl;
+ border-left: 4px solid @border-subtle;
+
+ &.success {
+ border-left-color: @success;
+
+ .status-icon {
+ color: @success;
+ }
+ }
+
+ &.warning {
+ border-left-color: @warning;
+
+ .status-icon {
+ color: @warning;
+ }
+ }
+
+ .status-icon {
+ .icon {
+ font-size: 32px;
+ }
+ }
+
+ .status-info {
+ display: flex;
+ flex-direction: column;
+ gap: @space-1;
+
+ .status-label {
+ font-size: @font-size-sm;
+ color: @text-secondary;
+ }
+
+ .status-value {
+ font-size: @font-size-lg;
+ font-weight: @font-weight-semibold;
+ }
+ }
+ }
+
+ .tabs {
+ display: flex;
+ gap: @space-1;
+ margin-bottom: @space-6;
+ border-bottom: 1px solid @border-subtle;
+
+ .tab {
+ padding: @space-3 @space-5;
+ background: none;
+ border: none;
+ font-size: @font-size-base;
+ font-weight: @font-weight-medium;
+ color: @text-secondary;
+ cursor: pointer;
+ position: relative;
+ transition: color @transition-fast;
+
+ &:hover {
+ color: @text-primary;
+ }
+
+ &.active {
+ color: @accent-primary;
+
+ &::after {
+ content: '';
+ position: absolute;
+ bottom: -1px;
+ left: 0;
+ right: 0;
+ height: 2px;
+ background: @accent-primary;
+ }
+ }
+ }
+ }
+
+ .tab-content {
+ .section-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: @space-4;
+
+ h3 {
+ margin: 0;
+ font-size: @font-size-md;
+ font-weight: @font-weight-semibold;
+ }
+ }
+
+ .empty-state {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: @space-12;
+ background: @bg-card;
+ border-radius: @radius-lg;
+ color: @text-tertiary;
+
+ .icon {
+ font-size: 48px;
+ margin-bottom: @space-4;
+ }
+
+ p {
+ margin-bottom: @space-4;
+ }
+ }
+ }
+
+ // Versions Tab
+ .versions-tab {
+ .versions-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
+ gap: @space-4;
+ }
+ }
+
+ .version-card {
+ background: @bg-card;
+ border-radius: @radius-lg;
+ padding: @space-5;
+ border: 1px solid @border-subtle;
+ cursor: pointer;
+ transition: all @transition-fast;
+
+ &:hover {
+ border-color: @border-active;
+ }
+
+ &.selected {
+ border-color: @accent-primary;
+ box-shadow: 0 0 0 1px @accent-primary;
+ }
+
+ .version-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: @space-4;
+
+ .version-number {
+ font-size: @font-size-lg;
+ font-weight: @font-weight-semibold;
+ color: @color-php;
+ }
+ }
+
+ .version-details {
+ margin-bottom: @space-4;
+
+ .detail-row {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: @space-2 0;
+ font-size: @font-size-sm;
+
+ .label {
+ color: @text-tertiary;
+ }
+
+ code {
+ font-family: @font-mono;
+ font-size: @font-size-xs;
+ background: @bg-hover;
+ padding: @space-1 @space-2;
+ border-radius: @radius-sm;
+ }
+
+ .status {
+ &.active {
+ color: @success;
+ }
+
+ &.inactive {
+ color: @text-tertiary;
+ }
+ }
+ }
+ }
+
+ .version-actions {
+ display: flex;
+ gap: @space-2;
+ }
+ }
+
+ // Extensions Tab
+ .extensions-tab {
+ .extensions-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
+ gap: @space-3;
+ }
+ }
+
+ .extension-card {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: @space-3 @space-4;
+ background: @bg-card;
+ border-radius: @radius-md;
+ border: 1px solid @border-subtle;
+
+ .extension-name {
+ font-weight: @font-weight-medium;
+ }
+
+ .extension-version {
+ font-size: @font-size-sm;
+ color: @text-tertiary;
+ }
+ }
+
+ .common-extensions {
+ margin-top: @space-4;
+
+ .extension-chips {
+ display: flex;
+ flex-wrap: wrap;
+ gap: @space-2;
+ margin-top: @space-2;
+
+ .chip {
+ padding: @space-1 @space-3;
+ background: @bg-hover;
+ border: 1px solid @border-subtle;
+ border-radius: @radius-full;
+ font-size: @font-size-sm;
+ cursor: pointer;
+ transition: all @transition-fast;
+
+ &:hover {
+ background: @accent-primary;
+ color: white;
+ border-color: @accent-primary;
+ }
+ }
+ }
+ }
+
+ // Pools Tab
+ .pools-tab {
+ .pools-table {
+ background: @bg-card;
+ border-radius: @radius-lg;
+ overflow: hidden;
+
+ table {
+ width: 100%;
+ border-collapse: collapse;
+
+ th,
+ td {
+ padding: @space-3 @space-4;
+ text-align: left;
+ }
+
+ th {
+ background: @bg-hover;
+ font-size: @font-size-xs;
+ font-weight: @font-weight-semibold;
+ text-transform: uppercase;
+ color: @text-tertiary;
+ }
+
+ td {
+ border-bottom: 1px solid @border-subtle;
+ font-size: @font-size-sm;
+
+ code {
+ font-family: @font-mono;
+ font-size: @font-size-xs;
+ background: @bg-hover;
+ padding: @space-1 @space-2;
+ border-radius: @radius-sm;
+ }
+ }
+
+ tr:last-child td {
+ border-bottom: none;
+ }
+ }
+ }
+ }
+
+ // Form helpers
+ .form-row {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: @space-4;
+
+ &.form-row-4 {
+ grid-template-columns: repeat(4, 1fr);
+ }
+ }
+}
diff --git a/frontend/src/styles/pages/_settings.less b/frontend/src/styles/pages/_settings.less
index 9aa87a5d..443cc7cf 100644
--- a/frontend/src/styles/pages/_settings.less
+++ b/frontend/src/styles/pages/_settings.less
@@ -3,19 +3,19 @@
// ============================================
.settings-page {
- padding: @spacing-lg;
+ padding: @space-6;
max-width: 1200px;
margin: 0 auto;
}
.settings-header {
- margin-bottom: @spacing-xl;
+ margin-bottom: @space-8;
h1 {
font-size: 1.75rem;
font-weight: 600;
color: @text-primary;
- margin: 0 0 @spacing-xs 0;
+ margin: 0 0 @space-1 0;
}
p {
@@ -26,7 +26,7 @@
.settings-content {
display: flex;
- gap: @spacing-xl;
+ gap: @space-8;
@media (max-width: 900px) {
flex-direction: column;
@@ -47,7 +47,7 @@
margin: 0;
display: flex;
flex-direction: column;
- gap: @spacing-xs;
+ gap: @space-1;
@media (max-width: 900px) {
flex-direction: row;
@@ -59,8 +59,8 @@
width: 100%;
display: flex;
align-items: center;
- gap: @spacing-sm;
- padding: @spacing-sm @spacing-md;
+ gap: @space-2;
+ padding: @space-2 @space-3;
background: transparent;
border: none;
border-radius: @radius-md;
@@ -75,12 +75,12 @@
}
&:hover {
- background: @bg-tertiary;
+ background: @bg-hover;
color: @text-primary;
}
&.active {
- background: @primary-color;
+ background: @accent-primary;
color: white;
}
@@ -100,11 +100,11 @@
// Individual Settings Section
.settings-section {
- background: @bg-secondary;
- border: 1px solid @border-color;
+ background: @bg-card;
+ border: 1px solid @border-subtle;
border-radius: @radius-lg;
- padding: @spacing-lg;
- margin-bottom: @spacing-lg;
+ padding: @space-6;
+ margin-bottom: @space-6;
&:last-child {
margin-bottom: 0;
@@ -114,14 +114,14 @@
.section-header {
display: flex;
align-items: center;
- gap: @spacing-sm;
- margin-bottom: @spacing-lg;
- padding-bottom: @spacing-md;
- border-bottom: 1px solid @border-color;
+ gap: @space-2;
+ margin-bottom: @space-6;
+ padding-bottom: @space-4;
+ border-bottom: 1px solid @border-subtle;
.section-icon {
font-size: 1.25rem;
- color: @primary-color;
+ color: @accent-primary;
}
h2 {
@@ -136,19 +136,19 @@
.settings-form {
display: flex;
flex-direction: column;
- gap: @spacing-lg;
+ gap: @space-6;
}
.form-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
- gap: @spacing-md;
+ gap: @space-4;
}
.form-group {
display: flex;
flex-direction: column;
- gap: @spacing-xs;
+ gap: @space-1;
label {
font-size: 0.85rem;
@@ -157,9 +157,9 @@
}
input, select {
- padding: @spacing-sm @spacing-md;
- background: @bg-tertiary;
- border: 1px solid @border-color;
+ padding: @space-2 @space-3;
+ background: @bg-hover;
+ border: 1px solid @border-subtle;
border-radius: @radius-md;
color: @text-primary;
font-size: 0.9rem;
@@ -167,7 +167,7 @@
&:focus {
outline: none;
- border-color: @primary-color;
+ border-color: @accent-primary;
}
&:disabled {
@@ -178,16 +178,16 @@
.input-hint {
font-size: 0.8rem;
- color: @text-muted;
+ color: @text-tertiary;
}
}
.form-actions {
display: flex;
- gap: @spacing-sm;
- margin-top: @spacing-md;
- padding-top: @spacing-md;
- border-top: 1px solid @border-color;
+ gap: @space-2;
+ margin-top: @space-4;
+ padding-top: @space-4;
+ border-top: 1px solid @border-subtle;
&.no-border {
border-top: none;
@@ -200,52 +200,52 @@
.password-fields {
display: flex;
flex-direction: column;
- gap: @spacing-md;
+ gap: @space-4;
}
.password-requirements {
font-size: 0.8rem;
- color: @text-muted;
- margin-top: @spacing-xs;
+ color: @text-tertiary;
+ margin-top: @space-1;
}
}
// Theme Options
.theme-options {
display: flex;
- gap: @spacing-md;
+ gap: @space-4;
flex-wrap: wrap;
}
.theme-option {
flex: 1;
min-width: 150px;
- padding: @spacing-md;
- background: @bg-tertiary;
- border: 2px solid @border-color;
+ padding: @space-4;
+ background: @bg-hover;
+ border: 2px solid @border-subtle;
border-radius: @radius-md;
cursor: pointer;
transition: all 0.2s ease;
text-align: center;
&:hover {
- border-color: @primary-color;
+ border-color: @accent-primary;
}
&.active {
- border-color: @primary-color;
- background: fade(@primary-color, 10%);
+ border-color: @accent-primary;
+ background: fade(@accent-primary, 10%);
}
.theme-icon {
font-size: 2rem;
- margin-bottom: @spacing-sm;
+ margin-bottom: @space-2;
}
.theme-name {
font-weight: 500;
color: @text-primary;
- margin-bottom: @spacing-xs;
+ margin-bottom: @space-1;
}
.theme-desc {
@@ -258,15 +258,15 @@
.notification-settings {
display: flex;
flex-direction: column;
- gap: @spacing-md;
+ gap: @space-4;
}
.notification-item {
display: flex;
justify-content: space-between;
align-items: center;
- padding: @spacing-md;
- background: @bg-tertiary;
+ padding: @space-4;
+ background: @bg-hover;
border-radius: @radius-md;
.notification-info {
@@ -275,7 +275,7 @@
.notification-label {
font-weight: 500;
color: @text-primary;
- margin-bottom: @spacing-xs;
+ margin-bottom: @space-1;
}
.notification-desc {
@@ -297,7 +297,7 @@
height: 0;
&:checked + .toggle-slider {
- background: @primary-color;
+ background: @accent-primary;
&::before {
transform: translateX(22px);
@@ -305,7 +305,7 @@
}
&:focus + .toggle-slider {
- box-shadow: 0 0 0 2px fade(@primary-color, 30%);
+ box-shadow: 0 0 0 2px fade(@accent-primary, 30%);
}
}
@@ -316,7 +316,7 @@
left: 0;
right: 0;
bottom: 0;
- background: @border-color;
+ background: @border-subtle;
border-radius: 26px;
transition: all 0.3s ease;
@@ -338,25 +338,25 @@
.system-info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
- gap: @spacing-md;
+ gap: @space-4;
}
.info-card {
- padding: @spacing-md;
- background: @bg-tertiary;
+ padding: @space-4;
+ background: @bg-hover;
border-radius: @radius-md;
text-align: center;
.info-icon {
font-size: 1.5rem;
- color: @primary-color;
- margin-bottom: @spacing-sm;
+ color: @accent-primary;
+ margin-bottom: @space-2;
}
.info-label {
font-size: 0.8rem;
color: @text-secondary;
- margin-bottom: @spacing-xs;
+ margin-bottom: @space-1;
}
.info-value {
@@ -366,24 +366,24 @@
}
.info-bar {
- margin-top: @spacing-sm;
+ margin-top: @space-2;
height: 6px;
- background: @border-color;
+ background: @border-subtle;
border-radius: 3px;
overflow: hidden;
.info-bar-fill {
height: 100%;
- background: @primary-color;
+ background: @accent-primary;
border-radius: 3px;
transition: width 0.3s ease;
&.warning {
- background: @warning-color;
+ background: @warning;
}
&.danger {
- background: @danger-color;
+ background: @danger;
}
}
}
@@ -394,15 +394,15 @@
.app-info {
display: flex;
align-items: center;
- gap: @spacing-lg;
- margin-bottom: @spacing-lg;
- padding-bottom: @spacing-lg;
- border-bottom: 1px solid @border-color;
+ gap: @space-6;
+ margin-bottom: @space-6;
+ padding-bottom: @space-6;
+ border-bottom: 1px solid @border-subtle;
.app-logo {
width: 64px;
height: 64px;
- background: @gradient-primary;
+ background: linear-gradient(135deg, @accent-primary 0%, @accent-hover 100%);
border-radius: @radius-lg;
display: flex;
align-items: center;
@@ -415,7 +415,7 @@
font-size: 1.25rem;
font-weight: 600;
color: @text-primary;
- margin-bottom: @spacing-xs;
+ margin-bottom: @space-1;
}
.app-version {
@@ -428,40 +428,40 @@
.features-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
- gap: @spacing-sm;
- margin-bottom: @spacing-lg;
+ gap: @space-2;
+ margin-bottom: @space-6;
.feature-item {
display: flex;
align-items: center;
- gap: @spacing-sm;
- padding: @spacing-sm;
+ gap: @space-2;
+ padding: @space-2;
color: @text-secondary;
.feature-check {
- color: @success-color;
+ color: @success;
}
}
}
.about-links {
display: flex;
- gap: @spacing-md;
+ gap: @space-4;
flex-wrap: wrap;
a {
display: flex;
align-items: center;
- gap: @spacing-xs;
- padding: @spacing-sm @spacing-md;
- background: @bg-tertiary;
+ gap: @space-1;
+ padding: @space-2 @space-3;
+ background: @bg-hover;
border-radius: @radius-md;
color: @text-secondary;
text-decoration: none;
transition: all 0.2s ease;
&:hover {
- background: @primary-color;
+ background: @accent-primary;
color: white;
}
}
@@ -470,23 +470,23 @@
// Success/Error Messages
.settings-message {
- padding: @spacing-sm @spacing-md;
+ padding: @space-2 @space-3;
border-radius: @radius-md;
- margin-bottom: @spacing-md;
+ margin-bottom: @space-4;
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
&.success {
- background: fade(@success-color, 15%);
- color: @success-color;
- border: 1px solid fade(@success-color, 30%);
+ background: fade(@success, 15%);
+ color: @success;
+ border: 1px solid fade(@success, 30%);
}
&.error {
- background: fade(@danger-color, 15%);
- color: @danger-color;
- border: 1px solid fade(@danger-color, 30%);
+ background: fade(@danger, 15%);
+ color: @danger;
+ border: 1px solid fade(@danger, 30%);
}
}
@@ -496,17 +496,17 @@
flex-direction: column;
align-items: center;
justify-content: center;
- padding: @spacing-xxl;
+ padding: @space-16;
color: @text-secondary;
.spinner {
width: 40px;
height: 40px;
- border: 3px solid @border-color;
- border-top-color: @primary-color;
+ border: 3px solid @border-subtle;
+ border-top-color: @accent-primary;
border-radius: 50%;
animation: spin 1s linear infinite;
- margin-bottom: @spacing-md;
+ margin-bottom: @space-4;
}
}
diff --git a/frontend/src/styles/pages/_terminal.less b/frontend/src/styles/pages/_terminal.less
index fa7d3d94..ecc10a40 100644
--- a/frontend/src/styles/pages/_terminal.less
+++ b/frontend/src/styles/pages/_terminal.less
@@ -5,7 +5,7 @@
.tab {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
svg {
stroke: currentColor;
@@ -28,7 +28,7 @@
.logs-layout {
display: grid;
grid-template-columns: 300px 1fr;
- gap: @spacing-lg;
+ gap: @space-6;
height: 100%;
@media (max-width: @breakpoint-lg) {
@@ -49,11 +49,11 @@
display: flex;
align-items: center;
justify-content: space-between;
- padding: @spacing-md;
+ padding: @space-4;
border-bottom: 1px solid var(--border-color);
h3 {
- font-size: @font-sm;
+ font-size: @font-size-sm;
font-weight: 600;
margin: 0;
}
@@ -63,21 +63,21 @@
.log-files-list {
flex: 1;
overflow-y: auto;
- padding: @spacing-sm;
+ padding: @space-2;
.empty-hint {
- padding: @spacing-lg;
+ padding: @space-6;
text-align: center;
color: var(--text-tertiary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
}
.log-file-item {
display: flex;
align-items: center;
- gap: @spacing-sm;
- padding: @spacing-sm @spacing-md;
+ gap: @space-2;
+ padding: @space-2 @space-4;
border-radius: @radius-md;
cursor: pointer;
transition: all 0.15s ease;
@@ -126,7 +126,7 @@
}
&.nginx {
- color: @primary;
+ color: @accent-primary;
}
&.database {
@@ -143,7 +143,7 @@
}
.log-file-name {
- font-size: @font-sm;
+ font-size: @font-size-sm;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
@@ -151,7 +151,7 @@
}
.log-file-path {
- font-size: @font-xs;
+ font-size: @font-size-xs;
color: var(--text-tertiary);
white-space: nowrap;
overflow: hidden;
@@ -159,7 +159,7 @@
}
.log-file-size {
- font-size: @font-xs;
+ font-size: @font-size-xs;
color: var(--text-tertiary);
flex-shrink: 0;
}
@@ -178,8 +178,8 @@
display: flex;
align-items: center;
justify-content: space-between;
- gap: @spacing-md;
- padding: @spacing-sm @spacing-md;
+ gap: @space-4;
+ padding: @space-2 @space-4;
border-bottom: 1px solid var(--border-color);
flex-wrap: wrap;
@@ -187,15 +187,15 @@
.toolbar-right {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
}
}
.search-input {
display: flex;
align-items: center;
- gap: @spacing-sm;
- padding: @spacing-xs @spacing-sm;
+ gap: @space-2;
+ padding: @space-1 @space-2;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: @radius-md;
@@ -211,7 +211,7 @@
border: none;
background: none;
padding: 0;
- font-size: @font-sm;
+ font-size: @font-size-sm;
width: 180px;
&:focus {
@@ -221,20 +221,20 @@
}
.lines-select {
- padding: @spacing-xs @spacing-sm;
+ padding: @space-1 @space-2;
border: 1px solid var(--border-color);
border-radius: @radius-sm;
background: var(--bg-tertiary);
color: var(--text-primary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
.auto-refresh-toggle {
display: flex;
align-items: center;
- gap: @spacing-xs;
+ gap: @space-1;
cursor: pointer;
- font-size: @font-sm;
+ font-size: @font-size-sm;
color: var(--text-secondary);
input {
@@ -245,7 +245,7 @@
.log-content {
flex: 1;
overflow: auto;
- padding: @spacing-md;
+ padding: @space-4;
background: #1a1a2e;
pre {
@@ -270,12 +270,12 @@
stroke: currentColor;
fill: none;
stroke-width: 1.5;
- margin-bottom: @spacing-md;
+ margin-bottom: @space-4;
opacity: 0.5;
}
p {
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
}
}
@@ -287,7 +287,7 @@
.journal-container {
display: flex;
flex-direction: column;
- gap: @spacing-lg;
+ gap: @space-6;
height: calc(100vh - 280px);
min-height: 500px;
}
@@ -295,27 +295,27 @@
.journal-controls {
display: flex;
align-items: flex-end;
- gap: @spacing-lg;
+ gap: @space-6;
flex-wrap: wrap;
.control-group {
display: flex;
flex-direction: column;
- gap: @spacing-xs;
+ gap: @space-1;
label {
- font-size: @font-xs;
+ font-size: @font-size-xs;
font-weight: 500;
color: var(--text-secondary);
}
input,
select {
- padding: @spacing-xs @spacing-sm;
+ padding: @space-1 @space-2;
border: 1px solid var(--border-color);
border-radius: @radius-sm;
background: var(--bg-secondary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
input {
@@ -327,21 +327,21 @@
.input-with-suggestions {
display: flex;
flex-direction: column;
- gap: @spacing-sm;
+ gap: @space-2;
}
.quick-units {
display: flex;
flex-wrap: wrap;
- gap: @spacing-xs;
+ gap: @space-1;
}
.unit-chip {
- padding: 2px @spacing-sm;
+ padding: 2px @space-2;
border: 1px solid var(--border-color);
border-radius: @radius-full;
background: var(--bg-secondary);
- font-size: @font-xs;
+ font-size: @font-size-xs;
cursor: pointer;
transition: all 0.15s ease;
@@ -362,7 +362,7 @@
background: #1a1a2e;
border-radius: @radius-lg;
overflow: auto;
- padding: @spacing-md;
+ padding: @space-4;
pre {
margin: 0;
@@ -382,29 +382,29 @@
.processes-container {
display: flex;
flex-direction: column;
- gap: @spacing-lg;
+ gap: @space-6;
}
.processes-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
- gap: @spacing-md;
+ gap: @space-4;
flex-wrap: wrap;
.toolbar-left,
.toolbar-right {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
}
select {
- padding: @spacing-xs @spacing-sm;
+ padding: @space-1 @space-2;
border: 1px solid var(--border-color);
border-radius: @radius-sm;
background: var(--bg-secondary);
- font-size: @font-sm;
+ font-size: @font-size-sm;
}
}
@@ -441,7 +441,7 @@
.mono {
font-family: 'JetBrains Mono', monospace;
- font-size: @font-xs;
+ font-size: @font-size-xs;
}
.process-name {
@@ -465,7 +465,7 @@
opacity: 0.3;
&.cpu {
- background: @primary;
+ background: @accent-primary;
}
&.memory {
@@ -475,14 +475,14 @@
span {
position: relative;
- font-size: @font-xs;
+ font-size: @font-size-xs;
font-family: monospace;
}
}
.action-buttons {
display: flex;
- gap: @spacing-xs;
+ gap: @space-1;
}
}
@@ -507,38 +507,38 @@
display: flex;
align-items: center;
justify-content: space-between;
- padding: @spacing-md;
+ padding: @space-4;
border-bottom: 1px solid var(--border-color);
h3 {
- font-size: @font-md;
+ font-size: @font-size-md;
font-weight: 600;
margin: 0;
}
}
.panel-body {
- padding: @spacing-md;
+ padding: @space-4;
}
.details-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
- gap: @spacing-md;
+ gap: @space-4;
}
.detail-item {
display: flex;
flex-direction: column;
- gap: @spacing-xs;
+ gap: @space-1;
.detail-label {
- font-size: @font-xs;
+ font-size: @font-size-xs;
color: var(--text-tertiary);
}
.detail-value {
- font-size: @font-sm;
+ font-size: @font-size-sm;
font-weight: 500;
&.mono {
@@ -548,24 +548,24 @@
}
.command-line {
- margin-top: @spacing-md;
- padding-top: @spacing-md;
+ margin-top: @space-4;
+ padding-top: @space-4;
border-top: 1px solid var(--border-color);
.detail-label {
display: block;
- font-size: @font-xs;
+ font-size: @font-size-xs;
color: var(--text-tertiary);
- margin-bottom: @spacing-xs;
+ margin-bottom: @space-1;
}
code {
display: block;
- padding: @spacing-sm;
+ padding: @space-2;
background: var(--bg-tertiary);
border-radius: @radius-sm;
font-family: monospace;
- font-size: @font-xs;
+ font-size: @font-size-xs;
word-break: break-all;
}
}
@@ -578,13 +578,13 @@
.services-container {
display: flex;
flex-direction: column;
- gap: @spacing-lg;
+ gap: @space-6;
}
.services-toolbar {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
.btn svg {
stroke: currentColor;
@@ -596,28 +596,28 @@
.services-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
- gap: @spacing-md;
+ gap: @space-4;
}
.service-card {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: @radius-lg;
- padding: @spacing-md;
+ padding: @space-4;
display: flex;
flex-direction: column;
- gap: @spacing-sm;
+ gap: @space-2;
.service-header {
display: flex;
align-items: center;
justify-content: space-between;
- gap: @spacing-md;
+ gap: @space-4;
.service-info {
display: flex;
align-items: center;
- gap: @spacing-sm;
+ gap: @space-2;
.status-dot {
width: 8px;
@@ -643,7 +643,7 @@
}
h4 {
- font-size: @font-sm;
+ font-size: @font-size-sm;
font-weight: 600;
margin: 0;
}
@@ -651,15 +651,15 @@
}
.service-description {
- font-size: @font-xs;
+ font-size: @font-size-xs;
color: var(--text-secondary);
margin: 0;
}
.service-meta {
display: flex;
- gap: @spacing-md;
- font-size: @font-xs;
+ gap: @space-4;
+ font-size: @font-size-xs;
color: var(--text-tertiary);
.meta-label {
@@ -669,9 +669,9 @@
.service-actions {
display: flex;
- gap: @spacing-xs;
- margin-top: @spacing-sm;
- padding-top: @spacing-sm;
+ gap: @space-1;
+ margin-top: @space-2;
+ padding-top: @space-2;
border-top: 1px solid var(--border-color);
}
}
@@ -687,7 +687,7 @@
overflow: auto;
background: #1a1a2e;
border-radius: @radius-md;
- padding: @spacing-md;
+ padding: @space-4;
pre {
margin: 0;