diff --git a/examples/evaluate/agent-scenarios/README.md b/examples/evaluate/agent-scenarios/README.md index b28e3bbf1e..99cec29302 100644 --- a/examples/evaluate/agent-scenarios/README.md +++ b/examples/evaluate/agent-scenarios/README.md @@ -48,7 +48,7 @@ uv run python examples/evaluate/agent-scenarios/duet_cli.py \ --scenarios-file examples/evaluate/agent-scenarios/scenarios.json ``` -To use a specific personality for the simulated user: +To use a specific persona for the simulated user: ```bash uv run python examples/evaluate/agent-scenarios/duet_cli.py \ @@ -60,22 +60,23 @@ uv run python examples/evaluate/agent-scenarios/duet_cli.py \ --checker-model-name gpt-4o-mini \ --log-file examples/evaluate/agent-scenarios/duet_conversation.log \ --scenarios-file examples/evaluate/agent-scenarios/scenarios.json \ - --personality-id 1 \ - --personalities-file examples/evaluate/agent-scenarios/personalities.json + --persona-id 1 \ + --personas-file examples/evaluate/agent-scenarios/personas.json ``` ## Command-Line Options - `--scenario-id` (required): Select a scenario from scenarios.json (1, 2, 3, or 4) - `--scenarios-file`: Path to scenarios file (default: `scenarios.json`) -- `--personality-id` (optional): Select a personality from personalities.json (1-based index). If not provided, no specific personality is used -- `--personalities-file`: Path to personalities file (default: `personalities.json`) +- `--persona-id` (optional): Select a persona from personas.json (1-based index). If not provided, no specific persona is used +- `--personas-file`: Path to personas file (default: `personas.json`) - `--max-turns-scenario`: Maximum number of conversation turns for the entire scenario (default: 15). If exceeded, the conversation exits - `--max-turns-task`: Maximum number of conversation turns per task (default: 4). If exceeded, the conversation exits (same behavior as max_turns_scenario) - `--log-file`: Path to log file for conversation history (default: `duet_conversations.log`) - `--agent-model-name`: LLM model for the hotel booking agent (defaults to `config.llm_model`) - `--sim-user-model-name`: LLM model for the simulated user (defaults to `config.llm_model`) - `--checker-model-name`: LLM model for the goal checker (defaults to `config.llm_model`) +- `--enable-metrics`: Enable custom metric collectors (latency, token usage, tool usage) for detailed performance analysis ## Scenarios @@ -117,22 +118,22 @@ When `expected_tools` is specified, the system will: - Use an LLM to evaluate if the tool usage was appropriate for the task - Log the results and display feedback in the console -## Personalities +## Personas -Personalities are defined in `personalities.json` and allow you to customize the behavior and communication style of the simulated user. Each personality has: +Personas are defined in `personas.json` and allow you to customize the behavior and communication style of the simulated user. Each persona has: -- **name**: Descriptive name for the personality +- **name**: Descriptive name for the persona - **description**: Instructions that modify how the simulated user communicates (e.g., formal vs. casual, budget-conscious vs. luxury-focused) -Example personality: +Example persona: ```json { - "name": "Personality 1", + "name": "Friendly Enthusiast", "description": "You are a friendly and enthusiastic person. You use casual language and show excitement about your travel plans. You often use exclamation marks and express gratitude." } ``` -When a personality is selected via `--personality-id`, the personality description is included in the system prompt for the simulated user, influencing how they phrase their messages and interact with the agent. If no personality is specified, the simulated user uses default behavior without any personality-specific instructions. +When a persona is selected via `--persona-id`, the persona description is included in the system prompt for the simulated user, influencing how they phrase their messages and interact with the agent. If no persona is specified, the simulated user uses default behavior without any persona-specific instructions. Available hotel booking tools: - `list_cities` - Get a list of all available cities @@ -146,16 +147,16 @@ Available hotel booking tools: ## How It Works -1. **Initialization**: The hotel booking agent is created with hotel booking tools from the shared `fixtures.hotel` module. If a personality is specified, it is loaded and will influence the simulated user's communication style. +1. **Initialization**: The hotel booking agent is created with hotel booking tools from the shared `fixtures.hotel` module. If a persona is specified, it is loaded and will influence the simulated user's communication style. 2. **Task Selection**: The simulated user selects the first task from the scenario 3. **Conversation Loop**: - - Simulated user generates a message based on the current task (and personality, if specified) + - Simulated user generates a message based on the current task (and persona, if specified) - Hotel booking agent processes the message and may call tools - Tool usage checker verifies expected tools were used (if `expected_tools` is specified) - Goal checker evaluates if the task is complete - If complete, move to the next task; otherwise, continue the conversation - The conversation stops when all tasks are completed, the per-task turn limit (`max_turns_task`) is exceeded, or the scenario turn limit (`max_turns_scenario`) is reached -4. **Logging**: All turns, tool calls, tool usage checks, task completions, and the selected personality (if any) are logged to a file +4. **Logging**: All turns, tool calls, tool usage checks, task completions, and the selected persona (if any) are logged to a file ## Architecture @@ -170,7 +171,7 @@ This modular design allows the hotel booking functionality to be reused across d - `duet_cli.py` - Main CLI application for running conversations - `scenarios.json` - Task scenarios for testing -- `personalities.json` - Personality definitions for the simulated user +- `personas.json` - Persona definitions for the simulated user - `config.py` - Configuration settings (LLM model, API keys, etc.) - `README.md` - This file diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel-api/README.md b/examples/evaluate/agent-scenarios/fixtures/hotel-api/README.md deleted file mode 100644 index c1dab74a8e..0000000000 --- a/examples/evaluate/agent-scenarios/fixtures/hotel-api/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# Hotel API Test Fixture - -A simple mock hotel booking API for demonstrating agent-based interactions and evaluation. This FastAPI service manages hotel availability and reservations with data for 15 hotels across 3 Polish cities (Kraków, Warszawa, Gdańsk). - -**Note:** This is a mock API with no authentication, payment processing, or real booking functionality. It is designed as a test fixture for ragbits evaluation examples. - -## Quick Start - -### 1. Set Up Database - -```bash -# Create database and populate with mock data -cd examples/evaluate/agent-scenarios/fixtures/hotel-api -uv run python populate_db.py -``` - -### 2. Run the API - -```bash -uv run uvicorn app:app --reload --port 8000 -``` - - -The API will be available at `http://localhost:8000`. View interactive docs at `http://localhost:8000/docs`. - -## Database Management - -### Create Database Schema -```bash -uv run python create_db.py -``` -Creates the database schema without any data. - -### Populate Database -```bash -uv run python populate_db.py -``` -Loads hotel data from `hotel_config.json` into the database. Clears existing data first. - -### Clear Database -```bash -uv run python clear_db.py -``` -Drops all tables and deletes the database file. Requires confirmation. - -## Configuration - -Edit `hotel_config.json` to modify hotels, rooms, prices, amenities, and availability. Run `populate_db.py` after making changes. - -## API Endpoints - -### Cities -- `GET /cities` - List all cities - -### Hotels -- `GET /hotels?city=Kraków` - List hotels (optionally filter by city) -- `GET /hotels/{hotel_id}` - Get hotel details with all rooms - -### Room Search -- `GET /rooms/available?start_date=2025-01-15&end_date=2025-01-20&city=Warszawa&min_price=300&max_price=500&room_type=deluxe` - Search available rooms with filters - -### Reservations -- `POST /reservations` - Create a new reservation -- `GET /reservations?guest_name=Smith` - List reservations (optionally filter by guest) -- `GET /reservations/{reservation_id}` - Get specific reservation -- `DELETE /reservations/{reservation_id}` - Cancel a reservation - -## Example Usage - -### Search Available Rooms -```bash -curl "http://localhost:8000/rooms/available?start_date=2025-03-01&end_date=2025-03-05&city=Kraków&max_price=400" -``` - -### Create Reservation -```bash -curl -X POST "http://localhost:8000/reservations" \ - -H "Content-Type: application/json" \ - -d '{ - "hotel_id": 1, - "room_id": 3, - "guest_name": "Jan Kowalski", - "start_date": "2025-03-10", - "end_date": "2025-03-12" - }' -``` - -## Data Structure - -- **3 cities**: Kraków, Warszawa, Gdańsk -- **15 hotels** (5 per city) with varying amenities (spa, pool, gym, etc.) -- **80+ rooms** with different types (standard, deluxe, suite) -- **Prices**: 280-850 PLN per night -- **Availability**: Multiple date windows throughout 2025 - -## Integration with Ragbits Examples - -This API is designed to work with ragbits agent examples, particularly: -- **Agent Scenarios** (`examples/evaluate/agent-scenarios/`) - Demonstrates agent-to-agent communication with a simulated user -- **Shared Hotel Tools** (`examples/evaluate/agent-scenarios/fixtures/hotel/`) - Reusable hotel booking tools that connect to this API - -The hotel tools in `examples/evaluate/agent-scenarios/fixtures/hotel/tools.py` are configured to connect to `http://localhost:8000` by default. - -## Files - -- `app.py` - Main FastAPI application with all endpoints -- `hotel_config.json` - Mock data configuration -- `create_db.py` - Database schema creation script -- `populate_db.py` - Data population script -- `clear_db.py` - Database cleanup script -- `hotel.db` - SQLite database (created automatically) - diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel-api/app.py b/examples/evaluate/agent-scenarios/fixtures/hotel-api/app.py deleted file mode 100644 index 7bb976973f..0000000000 --- a/examples/evaluate/agent-scenarios/fixtures/hotel-api/app.py +++ /dev/null @@ -1,596 +0,0 @@ -from __future__ import annotations - -import json -from collections.abc import Generator -from datetime import date, datetime, timedelta -from pathlib import Path - -from fastapi import Depends, FastAPI, HTTPException, Query, status -from fastapi.middleware.cors import CORSMiddleware -from pydantic import BaseModel, Field -from sqlalchemy import ( - Boolean, - Date, - DateTime, - Float, - ForeignKey, - Integer, - String, - Text, - UniqueConstraint, - create_engine, -) -from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column, relationship, sessionmaker - -# ============================================================================= -# Configuration & Database Setup -# ============================================================================= - -BASE_DIR = Path(__file__).resolve().parent -CONFIG_PATH = BASE_DIR / "hotel_config.json" -DATABASE_PATH = BASE_DIR / "hotel.db" -DATABASE_URL = f"sqlite:///{DATABASE_PATH}" - -engine = create_engine( - DATABASE_URL, - connect_args={"check_same_thread": False}, - future=True, -) -SessionLocal = sessionmaker(bind=engine, autoflush=False, autocommit=False) - - -# ============================================================================= -# SQLAlchemy Models -# ============================================================================= - - -class Base(DeclarativeBase): - """Base class for declarative SQLAlchemy models.""" - - -class Hotel(Base): - """SQLAlchemy model for a hotel.""" - - __tablename__ = "hotels" - - id: Mapped[int] = mapped_column(primary_key=True, index=True) - name: Mapped[str] = mapped_column(String, unique=True, nullable=False) - city: Mapped[str] = mapped_column(String, nullable=False, index=True) - address: Mapped[str] = mapped_column(String, nullable=False) - rating: Mapped[float] = mapped_column(Float, nullable=False) - amenities: Mapped[str] = mapped_column(Text, nullable=False) # JSON stored as text - - rooms: Mapped[list[Room]] = relationship("Room", back_populates="hotel", cascade="all, delete-orphan") - - -class Room(Base): - """SQLAlchemy model for a hotel room.""" - - __tablename__ = "rooms" - __table_args__ = (UniqueConstraint("hotel_id", "number", name="uq_room_number"),) - - id: Mapped[int] = mapped_column(primary_key=True, index=True) - number: Mapped[str] = mapped_column(String, nullable=False) - hotel_id: Mapped[int] = mapped_column(ForeignKey("hotels.id"), nullable=False) - room_type: Mapped[str] = mapped_column(String, nullable=False) # standard, deluxe, suite - price_per_night: Mapped[float] = mapped_column(Float, nullable=False) - capacity: Mapped[int] = mapped_column(Integer, nullable=False) - amenities: Mapped[str] = mapped_column(Text, nullable=False) # JSON stored as text - - hotel: Mapped[Hotel] = relationship("Hotel", back_populates="rooms") - availability: Mapped[list[RoomAvailability]] = relationship( - "RoomAvailability", back_populates="room", cascade="all, delete-orphan" - ) - reservations: Mapped[list[Reservation]] = relationship( - "Reservation", back_populates="room", cascade="all, delete-orphan" - ) - - -class RoomAvailability(Base): - """Tracks per-day availability for a specific room.""" - - __tablename__ = "room_availability" - __table_args__ = (UniqueConstraint("room_id", "available_date", name="uq_room_date"),) - - id: Mapped[int] = mapped_column(primary_key=True, index=True) - room_id: Mapped[int] = mapped_column(ForeignKey("rooms.id"), nullable=False) - available_date: Mapped[date] = mapped_column(Date, nullable=False, index=True) - is_reserved: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False) - - room: Mapped[Room] = relationship("Room", back_populates="availability") - - -class Reservation(Base): - """Reservation record for a room on specific dates.""" - - __tablename__ = "reservations" - - id: Mapped[int] = mapped_column(primary_key=True, index=True) - room_id: Mapped[int] = mapped_column(ForeignKey("rooms.id"), nullable=False) - guest_name: Mapped[str] = mapped_column(String, nullable=False) - start_date: Mapped[date] = mapped_column(Date, nullable=False) - end_date: Mapped[date] = mapped_column(Date, nullable=False) - created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow, nullable=False) - - room: Mapped[Room] = relationship("Room", back_populates="reservations") - - -# ============================================================================= -# Pydantic Schemas -# ============================================================================= - - -class HotelResponse(BaseModel): - """Response model for hotel information.""" - - id: int - name: str - city: str - address: str - rating: float - amenities: list[str] - - -class RoomResponse(BaseModel): - """Response model for room information.""" - - id: int - number: str - room_type: str - price_per_night: float - capacity: int - amenities: list[str] - - -class HotelDetailResponse(BaseModel): - """Response model for detailed hotel information including rooms.""" - - id: int - name: str - city: str - address: str - rating: float - amenities: list[str] - rooms: list[RoomResponse] - - -class AvailabilityWindow(BaseModel): - """Continuous date window when a room is available.""" - - start: date - end: date - - -class AvailableRoomResponse(BaseModel): - """Response for available rooms search.""" - - hotel_id: int - hotel_name: str - city: str - room_id: int - room_number: str - room_type: str - price_per_night: float - capacity: int - amenities: list[str] - - -class ReservationRequest(BaseModel): - """Request body for creating a reservation.""" - - hotel_id: int = Field(..., description="Hotel ID") - room_id: int = Field(..., description="Room ID") - guest_name: str = Field(..., description="Name for the reservation") - start_date: date - end_date: date - - -class ReservationResponse(BaseModel): - """Response payload that represents a reservation.""" - - reservation_id: int - hotel_name: str - city: str - room_number: str - room_type: str - guest_name: str - start_date: date - end_date: date - total_price: float - - -class MessageResponse(BaseModel): - """Generic response body with a single detail message.""" - - detail: str - - -# ============================================================================= -# Utility Functions -# ============================================================================= - - -def get_session() -> Generator[Session, None, None]: - """Yield a SQLAlchemy session that is closed afterwards.""" - session = SessionLocal() - try: - yield session - finally: - session.close() - - -def daterange(start: date, end: date) -> Generator[date, None, None]: - """Yield each date between start and end, inclusive.""" - current = start - while current <= end: - yield current - current += timedelta(days=1) - - -def load_config() -> dict: - """Load the hotel configuration from disk.""" - if not CONFIG_PATH.exists(): - raise RuntimeError(f"Config file not found at {CONFIG_PATH}") - with CONFIG_PATH.open("r", encoding="utf-8") as stream: - return json.load(stream) - - -def initialize_database() -> None: - """Create tables if they don't exist. Does not populate data.""" - if not DATABASE_PATH.exists(): - DATABASE_PATH.touch() - Base.metadata.create_all(bind=engine) - - -# ============================================================================= -# FastAPI Application -# ============================================================================= - -app = FastAPI( - title="RAGBits Hotel API Example", - version="0.2.0", - description="Simple hotel availability and reservation API backed by SQLite.", -) - -app.add_middleware( - CORSMiddleware, - allow_origins=["*"], - allow_credentials=True, - allow_methods=["*"], - allow_headers=["*"], -) - - -@app.on_event("startup") -def on_startup() -> None: - """Ensure the SQLite database schema exists on service startup.""" - initialize_database() - - -# ============================================================================= -# API Endpoints - Cities -# ============================================================================= - - -@app.get("/cities", response_model=list[str]) -def list_cities(session: Session = Depends(get_session)) -> list[str]: # noqa: B008 - """Return all available cities.""" - cities = session.query(Hotel.city).distinct().order_by(Hotel.city).all() - return [city[0] for city in cities] - - -# ============================================================================= -# API Endpoints - Hotels -# ============================================================================= - - -@app.get("/hotels", response_model=list[HotelResponse]) -def list_hotels( - city: str | None = Query(None, description="Filter by city"), # noqa: B008 - session: Session = Depends(get_session), # noqa: B008 -) -> list[HotelResponse]: - """Return hotels, optionally filtered by city.""" - query = session.query(Hotel) - if city: - query = query.filter(Hotel.city == city) - hotels = query.order_by(Hotel.name).all() - - return [ - HotelResponse( - id=hotel.id, - name=hotel.name, - city=hotel.city, - address=hotel.address, - rating=hotel.rating, - amenities=json.loads(hotel.amenities), - ) - for hotel in hotels - ] - - -@app.get("/hotels/{hotel_id}", response_model=HotelDetailResponse) -def get_hotel_detail( - hotel_id: int, - session: Session = Depends(get_session), # noqa: B008 -) -> HotelDetailResponse: - """Get detailed information about a specific hotel including all rooms.""" - hotel = session.query(Hotel).filter(Hotel.id == hotel_id).one_or_none() - if hotel is None: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=f"Hotel with ID {hotel_id} not found.", - ) - - rooms = [ - RoomResponse( - id=room.id, - number=room.number, - room_type=room.room_type, - price_per_night=room.price_per_night, - capacity=room.capacity, - amenities=json.loads(room.amenities), - ) - for room in hotel.rooms - ] - - return HotelDetailResponse( - id=hotel.id, - name=hotel.name, - city=hotel.city, - address=hotel.address, - rating=hotel.rating, - amenities=json.loads(hotel.amenities), - rooms=rooms, - ) - - -# ============================================================================= -# API Endpoints - Room Availability -# ============================================================================= - - -@app.get("/rooms/available", response_model=list[AvailableRoomResponse]) -def find_available_rooms( - start_date: date = Query(..., description="Check-in date"), # noqa: B008 - end_date: date = Query(..., description="Check-out date"), # noqa: B008 - city: str | None = Query(None, description="Filter by city"), # noqa: B008 - min_price: float | None = Query(None, description="Minimum price per night"), # noqa: B008 - max_price: float | None = Query(None, description="Maximum price per night"), # noqa: B008 - room_type: str | None = Query(None, description="Filter by room type (standard, deluxe, suite)"), # noqa: B008 - session: Session = Depends(get_session), # noqa: B008 -) -> list[AvailableRoomResponse]: - """Find available rooms matching the search criteria.""" - if end_date < start_date: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail="end_date must be on or after start_date.", - ) - - # Build hotel query with filters - hotel_query = session.query(Hotel) - if city: - hotel_query = hotel_query.filter(Hotel.city == city) - - available_rooms: list[AvailableRoomResponse] = [] - - for hotel in hotel_query.all(): - room_query = session.query(Room).filter(Room.hotel_id == hotel.id) - - # Apply room filters - if min_price is not None: - room_query = room_query.filter(Room.price_per_night >= min_price) - if max_price is not None: - room_query = room_query.filter(Room.price_per_night <= max_price) - if room_type: - room_query = room_query.filter(Room.room_type == room_type) - - for room in room_query.all(): - # Check if room is available for all requested dates - availability_entries = ( - session.query(RoomAvailability) - .filter( - RoomAvailability.room_id == room.id, - RoomAvailability.available_date >= start_date, - RoomAvailability.available_date <= end_date, - RoomAvailability.is_reserved.is_(False), - ) - .count() - ) - - expected_nights = (end_date - start_date).days + 1 - if availability_entries == expected_nights: - available_rooms.append( - AvailableRoomResponse( - hotel_id=hotel.id, - hotel_name=hotel.name, - city=hotel.city, - room_id=room.id, - room_number=room.number, - room_type=room.room_type, - price_per_night=room.price_per_night, - capacity=room.capacity, - amenities=json.loads(room.amenities), - ) - ) - - return available_rooms - - -# ============================================================================= -# API Endpoints - Reservations -# ============================================================================= - - -@app.post("/reservations", response_model=ReservationResponse, status_code=status.HTTP_201_CREATED) -def create_reservation( - reservation: ReservationRequest, - session: Session = Depends(get_session), # noqa: B008 -) -> ReservationResponse: - """Create a reservation if the requested room is available.""" - if reservation.end_date < reservation.start_date: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail="end_date must be on or after start_date.", - ) - - # Verify hotel exists - hotel = session.query(Hotel).filter(Hotel.id == reservation.hotel_id).one_or_none() - if hotel is None: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=f"Hotel with ID {reservation.hotel_id} not found.", - ) - - # Verify room exists and belongs to hotel - room = session.query(Room).filter(Room.id == reservation.room_id, Room.hotel_id == hotel.id).one_or_none() - if room is None: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=f"Room with ID {reservation.room_id} not found in hotel {hotel.name}.", - ) - - # Check availability for all requested dates - availability_entries = ( - session.query(RoomAvailability) - .filter( - RoomAvailability.room_id == room.id, - RoomAvailability.available_date >= reservation.start_date, - RoomAvailability.available_date <= reservation.end_date, - RoomAvailability.is_reserved.is_(False), - ) - .all() - ) - - expected_nights = (reservation.end_date - reservation.start_date).days + 1 - if len(availability_entries) != expected_nights: - raise HTTPException( - status_code=status.HTTP_400_BAD_REQUEST, - detail="Requested room is not available for the full date range.", - ) - - # Mark dates as reserved - for entry in availability_entries: - entry.is_reserved = True - - # Create reservation - reservation_record = Reservation( - room_id=room.id, - guest_name=reservation.guest_name, - start_date=reservation.start_date, - end_date=reservation.end_date, - ) - session.add(reservation_record) - session.commit() - session.refresh(reservation_record) - - # Calculate total price - total_price = room.price_per_night * expected_nights - - return ReservationResponse( - reservation_id=reservation_record.id, - hotel_name=hotel.name, - city=hotel.city, - room_number=room.number, - room_type=room.room_type, - guest_name=reservation_record.guest_name, - start_date=reservation_record.start_date, - end_date=reservation_record.end_date, - total_price=total_price, - ) - - -@app.get("/reservations", response_model=list[ReservationResponse]) -def list_reservations( - guest_name: str | None = Query(None, description="Filter by guest name"), # noqa: B008 - session: Session = Depends(get_session), # noqa: B008 -) -> list[ReservationResponse]: - """Return all reservations, optionally filtered by guest name.""" - query = session.query(Reservation).join(Room).join(Hotel) - - if guest_name: - query = query.filter(Reservation.guest_name.ilike(f"%{guest_name}%")) - - reservations = query.order_by(Reservation.created_at.desc()).all() - - response: list[ReservationResponse] = [] - for res in reservations: - nights = (res.end_date - res.start_date).days + 1 - total_price = res.room.price_per_night * nights - - response.append( - ReservationResponse( - reservation_id=res.id, - hotel_name=res.room.hotel.name, - city=res.room.hotel.city, - room_number=res.room.number, - room_type=res.room.room_type, - guest_name=res.guest_name, - start_date=res.start_date, - end_date=res.end_date, - total_price=total_price, - ) - ) - return response - - -@app.get("/reservations/{reservation_id}", response_model=ReservationResponse) -def get_reservation( - reservation_id: int, - session: Session = Depends(get_session), # noqa: B008 -) -> ReservationResponse: - """Get details of a specific reservation.""" - reservation = ( - session.query(Reservation).filter(Reservation.id == reservation_id).join(Room).join(Hotel).one_or_none() - ) - - if reservation is None: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=f"Reservation {reservation_id} not found.", - ) - - nights = (reservation.end_date - reservation.start_date).days + 1 - total_price = reservation.room.price_per_night * nights - - return ReservationResponse( - reservation_id=reservation.id, - hotel_name=reservation.room.hotel.name, - city=reservation.room.hotel.city, - room_number=reservation.room.number, - room_type=reservation.room.room_type, - guest_name=reservation.guest_name, - start_date=reservation.start_date, - end_date=reservation.end_date, - total_price=total_price, - ) - - -@app.delete("/reservations/{reservation_id}", response_model=MessageResponse) -def cancel_reservation( - reservation_id: int, - session: Session = Depends(get_session), # noqa: B008 -) -> MessageResponse: - """Cancel an existing reservation and free the associated room nights.""" - reservation_obj = session.query(Reservation).filter(Reservation.id == reservation_id).one_or_none() - if reservation_obj is None: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=f"Reservation {reservation_id} not found.", - ) - - # Free up the reserved dates - availability_entries = ( - session.query(RoomAvailability) - .filter( - RoomAvailability.room_id == reservation_obj.room_id, - RoomAvailability.available_date >= reservation_obj.start_date, - RoomAvailability.available_date <= reservation_obj.end_date, - ) - .all() - ) - for entry in availability_entries: - entry.is_reserved = False - - session.delete(reservation_obj) - session.commit() - return MessageResponse(detail=f"Reservation {reservation_id} canceled successfully.") diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel-api/clear_db.py b/examples/evaluate/agent-scenarios/fixtures/hotel-api/clear_db.py deleted file mode 100644 index a314a8c7ef..0000000000 --- a/examples/evaluate/agent-scenarios/fixtures/hotel-api/clear_db.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Script to clear the hotel database - drops all tables and removes the database file.""" - -from __future__ import annotations - -from app import DATABASE_PATH, Base, engine - - -def clear_database() -> None: - """Drop all tables and delete the database file.""" - if DATABASE_PATH.exists(): - # Drop all tables - Base.metadata.drop_all(bind=engine) - print("Dropped all database tables.") - - # Delete the database file - DATABASE_PATH.unlink() - print(f"Deleted database file: {DATABASE_PATH}") - - print("\n" + "=" * 60) - print("Database cleared successfully!") - print("=" * 60) - else: - print(f"Database file not found: {DATABASE_PATH}") - print("Nothing to clear.") - - -if __name__ == "__main__": - # Ask for confirmation - print("=" * 60) - print("WARNING: This will delete all data and the database file!") - print("=" * 60) - confirmation = input("Are you sure you want to continue? (yes/no): ") - - if confirmation.lower() in ["yes", "y"]: - clear_database() - else: - print("Operation cancelled.") diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel-api/create_db.py b/examples/evaluate/agent-scenarios/fixtures/hotel-api/create_db.py deleted file mode 100644 index fdd041c10e..0000000000 --- a/examples/evaluate/agent-scenarios/fixtures/hotel-api/create_db.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Script to create the hotel database schema without populating data.""" - -from __future__ import annotations - -from app import DATABASE_PATH, Base, engine - - -def create_database() -> None: - """Create all database tables.""" - if not DATABASE_PATH.exists(): - DATABASE_PATH.touch() - print(f"Created database file: {DATABASE_PATH}") - - Base.metadata.create_all(bind=engine) - print("Database schema created successfully!") - print(f"Location: {DATABASE_PATH}") - - -if __name__ == "__main__": - create_database() diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel-api/hotel.db b/examples/evaluate/agent-scenarios/fixtures/hotel-api/hotel.db deleted file mode 100644 index 643382e664..0000000000 Binary files a/examples/evaluate/agent-scenarios/fixtures/hotel-api/hotel.db and /dev/null differ diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel-api/populate_db.py b/examples/evaluate/agent-scenarios/fixtures/hotel-api/populate_db.py deleted file mode 100644 index cb5fdf7ead..0000000000 --- a/examples/evaluate/agent-scenarios/fixtures/hotel-api/populate_db.py +++ /dev/null @@ -1,125 +0,0 @@ -"""Script to populate the hotel database from the configuration file.""" - -from __future__ import annotations - -import json -from datetime import date, timedelta - -from app import ( - CONFIG_PATH, - DATABASE_PATH, - Base, - Hotel, - Room, - RoomAvailability, - SessionLocal, - engine, -) - - -def daterange(start: date, end: date) -> list[date]: - """Generate a list of dates between start and end, inclusive.""" - dates = [] - current = start - while current <= end: - dates.append(current) - current += timedelta(days=1) - return dates - - -def clear_existing_data(session: SessionLocal) -> None: - """Clear all existing data from the database.""" - # Delete in order to respect foreign key constraints - session.query(RoomAvailability).delete() - session.query(Room).delete() - session.query(Hotel).delete() - session.commit() - print("Cleared existing data from database.") - - -def populate_from_config() -> None: - """Populate the database from the JSON configuration file.""" - # Ensure database exists - if not DATABASE_PATH.exists(): - DATABASE_PATH.touch() - Base.metadata.create_all(bind=engine) - print(f"Created new database: {DATABASE_PATH}") - - # Load configuration - if not CONFIG_PATH.exists(): - raise RuntimeError(f"Config file not found at {CONFIG_PATH}") - - with CONFIG_PATH.open("r", encoding="utf-8") as f: - config = json.load(f) - - session = SessionLocal() - try: - # Clear existing data - clear_existing_data(session) - - # Populate hotels and rooms - hotels_count = 0 - rooms_count = 0 - availability_count = 0 - - for hotel_data in config.get("hotels", []): - # Create hotel - hotel = Hotel( - name=hotel_data["name"], - city=hotel_data["city"], - address=hotel_data["address"], - rating=hotel_data["rating"], - amenities=json.dumps(hotel_data["amenities"]), - ) - session.add(hotel) - session.flush() - hotels_count += 1 - - # Create rooms - for room_data in hotel_data.get("rooms", []): - room = Room( - number=room_data["number"], - hotel_id=hotel.id, - room_type=room_data["room_type"], - price_per_night=float(room_data["price_per_night"]), - capacity=room_data["capacity"], - amenities=json.dumps(room_data["amenities"]), - ) - session.add(room) - session.flush() - rooms_count += 1 - - # Create availability windows - for window in room_data.get("availability", []): - start = date.fromisoformat(window["start"]) - end = date.fromisoformat(window["end"]) - - if end < start: - print(f"Warning: Invalid availability range for room {room.number}: {window}") - continue - - for day in daterange(start, end): - availability = RoomAvailability(room_id=room.id, available_date=day, is_reserved=False) - session.add(availability) - availability_count += 1 - - session.commit() - - print("\n" + "=" * 60) - print("Database populated successfully!") - print("=" * 60) - print(f"Hotels created: {hotels_count}") - print(f"Rooms created: {rooms_count}") - print(f"Availability dates: {availability_count}") - print("=" * 60) - - except Exception as e: - session.rollback() - print(f"Error populating database: {e}") - raise - finally: - session.close() - - -if __name__ == "__main__": - populate_from_config() diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel/__init__.py b/examples/evaluate/agent-scenarios/fixtures/hotel/__init__.py index 79812bf88b..fafce52c4b 100644 --- a/examples/evaluate/agent-scenarios/fixtures/hotel/__init__.py +++ b/examples/evaluate/agent-scenarios/fixtures/hotel/__init__.py @@ -2,10 +2,14 @@ This module provides reusable hotel booking tools and prompts that can be used across different evaluation examples and agent scenarios. + +The hotel booking functionality uses an in-memory SQLite database populated +from a JSON configuration file. No external HTTP API server is required. """ from . import prompt, tools from .hotel_chat import HotelChat +from .service import HotelService # Re-export prompt classes HotelPrompt = prompt.HotelPrompt @@ -26,6 +30,7 @@ "HotelChat", "HotelPrompt", "HotelPromptInput", + "HotelService", "cancel_reservation", "create_reservation", "get_hotel_details", diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel/hotel_chat.py b/examples/evaluate/agent-scenarios/fixtures/hotel/hotel_chat.py index 120cbc75a1..cde9ce2a29 100644 --- a/examples/evaluate/agent-scenarios/fixtures/hotel/hotel_chat.py +++ b/examples/evaluate/agent-scenarios/fixtures/hotel/hotel_chat.py @@ -1,5 +1,6 @@ from collections.abc import AsyncGenerator from logging import getLogger +from pathlib import Path from ragbits.agents import Agent from ragbits.agents.tool import ToolCallResult @@ -10,6 +11,7 @@ from ragbits.core.prompt import ChatFormat from .prompt import HotelPrompt, HotelPromptInput +from .service import HotelService from .tools import ( cancel_reservation, create_reservation, @@ -19,15 +21,32 @@ list_hotels, list_reservations, search_available_rooms, + set_service, ) logger = getLogger(__name__) class HotelChat(ChatInterface): - """A simple example implementation of the ChatInterface for hotel booking agent.""" + """A simple example implementation of the ChatInterface for hotel booking agent. + + This implementation uses an in-memory SQLite database populated from a JSON + configuration file. No external HTTP API server is required. + """ + + def __init__(self, model_name: str, api_key: str, config_path: Path | str | None = None) -> None: + """Initialize the hotel chat agent. + + Args: + model_name: The name of the LLM model to use. + api_key: The API key for the LLM provider. + config_path: Optional path to the hotel configuration JSON file. + If None, uses the default config path. + """ + # Initialize the in-memory hotel service + self._service = HotelService(config_path) + set_service(self._service) - def __init__(self, model_name: str, api_key: str) -> None: self.llm = LiteLLM(model_name=model_name, use_structured_output=True, api_key=api_key) self.agent = Agent( llm=self.llm, @@ -77,7 +96,4 @@ async def chat( async def generate_conversation_summary(self, message: str, history: ChatFormat, context: ChatContext) -> str: """Delegate to the configured summary generator.""" - if not self.summary_generator: - return "Dummy summary: No summary generator configured." - return await self.summary_generator.generate(message, history, context) diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel-api/hotel_config.json b/examples/evaluate/agent-scenarios/fixtures/hotel/hotel_config.json similarity index 100% rename from examples/evaluate/agent-scenarios/fixtures/hotel-api/hotel_config.json rename to examples/evaluate/agent-scenarios/fixtures/hotel/hotel_config.json diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel/service.py b/examples/evaluate/agent-scenarios/fixtures/hotel/service.py new file mode 100644 index 0000000000..3261363aa5 --- /dev/null +++ b/examples/evaluate/agent-scenarios/fixtures/hotel/service.py @@ -0,0 +1,628 @@ +"""In-memory hotel service for agent scenarios. + +This module provides an in-process hotel booking service that uses an in-memory +SQLite database, eliminating the need for a separate HTTP API server. +""" + +from __future__ import annotations + +import json +from collections.abc import Generator +from datetime import date, datetime, timedelta, timezone +from pathlib import Path + +from pydantic import BaseModel, Field +from sqlalchemy import ( + Boolean, + Date, + DateTime, + Float, + ForeignKey, + Integer, + String, + Text, + UniqueConstraint, + create_engine, +) +from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column, relationship, sessionmaker + +# ============================================================================= +# Configuration +# ============================================================================= + +DEFAULT_CONFIG_PATH = Path(__file__).parent / "hotel_config.json" + + +# ============================================================================= +# SQLAlchemy Models +# ============================================================================= + + +class Base(DeclarativeBase): + """Base class for declarative SQLAlchemy models.""" + + +class Hotel(Base): + """SQLAlchemy model for a hotel.""" + + __tablename__ = "hotels" + + id: Mapped[int] = mapped_column(primary_key=True, index=True) + name: Mapped[str] = mapped_column(String, unique=True, nullable=False) + city: Mapped[str] = mapped_column(String, nullable=False, index=True) + address: Mapped[str] = mapped_column(String, nullable=False) + rating: Mapped[float] = mapped_column(Float, nullable=False) + amenities: Mapped[str] = mapped_column(Text, nullable=False) # JSON stored as text + + rooms: Mapped[list[Room]] = relationship("Room", back_populates="hotel", cascade="all, delete-orphan") + + +class Room(Base): + """SQLAlchemy model for a hotel room.""" + + __tablename__ = "rooms" + __table_args__ = (UniqueConstraint("hotel_id", "number", name="uq_room_number"),) + + id: Mapped[int] = mapped_column(primary_key=True, index=True) + number: Mapped[str] = mapped_column(String, nullable=False) + hotel_id: Mapped[int] = mapped_column(ForeignKey("hotels.id"), nullable=False) + room_type: Mapped[str] = mapped_column(String, nullable=False) # standard, deluxe, suite + price_per_night: Mapped[float] = mapped_column(Float, nullable=False) + capacity: Mapped[int] = mapped_column(Integer, nullable=False) + amenities: Mapped[str] = mapped_column(Text, nullable=False) # JSON stored as text + + hotel: Mapped[Hotel] = relationship("Hotel", back_populates="rooms") + availability: Mapped[list[RoomAvailability]] = relationship( + "RoomAvailability", back_populates="room", cascade="all, delete-orphan" + ) + reservations: Mapped[list[Reservation]] = relationship( + "Reservation", back_populates="room", cascade="all, delete-orphan" + ) + + +class RoomAvailability(Base): + """Tracks per-day availability for a specific room.""" + + __tablename__ = "room_availability" + __table_args__ = (UniqueConstraint("room_id", "available_date", name="uq_room_date"),) + + id: Mapped[int] = mapped_column(primary_key=True, index=True) + room_id: Mapped[int] = mapped_column(ForeignKey("rooms.id"), nullable=False) + available_date: Mapped[date] = mapped_column(Date, nullable=False, index=True) + is_reserved: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False) + + room: Mapped[Room] = relationship("Room", back_populates="availability") + + +class Reservation(Base): + """Reservation record for a room on specific dates.""" + + __tablename__ = "reservations" + + id: Mapped[int] = mapped_column(primary_key=True, index=True) + room_id: Mapped[int] = mapped_column(ForeignKey("rooms.id"), nullable=False) + guest_name: Mapped[str] = mapped_column(String, nullable=False) + start_date: Mapped[date] = mapped_column(Date, nullable=False) + end_date: Mapped[date] = mapped_column(Date, nullable=False) + created_at: Mapped[datetime] = mapped_column(DateTime, default=lambda: datetime.now(timezone.utc), nullable=False) + + room: Mapped[Room] = relationship("Room", back_populates="reservations") + + +# ============================================================================= +# Pydantic Response Models +# ============================================================================= + + +class HotelResponse(BaseModel): + """Response model for hotel information.""" + + id: int + name: str + city: str + address: str + rating: float + amenities: list[str] + + +class RoomResponse(BaseModel): + """Response model for room information.""" + + id: int + number: str + room_type: str + price_per_night: float + capacity: int + amenities: list[str] + + +class HotelDetailResponse(BaseModel): + """Response model for detailed hotel information including rooms.""" + + id: int + name: str + city: str + address: str + rating: float + amenities: list[str] + rooms: list[RoomResponse] + + +class AvailableRoomResponse(BaseModel): + """Response for available rooms search.""" + + hotel_id: int + hotel_name: str + city: str + room_id: int + room_number: str + room_type: str + price_per_night: float + capacity: int + amenities: list[str] + + +class ReservationRequest(BaseModel): + """Request body for creating a reservation.""" + + hotel_id: int = Field(..., description="Hotel ID") + room_id: int = Field(..., description="Room ID") + guest_name: str = Field(..., description="Name for the reservation") + start_date: date + end_date: date + + +class ReservationResponse(BaseModel): + """Response payload that represents a reservation.""" + + reservation_id: int + hotel_name: str + city: str + room_number: str + room_type: str + guest_name: str + start_date: date + end_date: date + total_price: float + + +# ============================================================================= +# Utility Functions +# ============================================================================= + + +def daterange(start: date, end: date) -> Generator[date, None, None]: + """Yield each date between start and end, inclusive.""" + current = start + while current <= end: + yield current + current += timedelta(days=1) + + +# ============================================================================= +# Hotel Service +# ============================================================================= + + +class HotelService: + """In-memory hotel booking service. + + This service provides hotel booking functionality using an in-memory SQLite + database. The database is populated from a JSON configuration file on + initialization. + + Example: + >>> service = HotelService() + >>> cities = service.list_cities() + >>> hotels = service.list_hotels(city="Kraków") + """ + + def __init__(self, config_path: Path | str | None = None) -> None: + """Initialize the hotel service with an in-memory database. + + Args: + config_path: Path to the hotel configuration JSON file. + If None, uses the default config path. + """ + self._config_path = Path(config_path) if config_path else DEFAULT_CONFIG_PATH + + # Create in-memory SQLite database + self._engine = create_engine( + "sqlite:///:memory:", + connect_args={"check_same_thread": False}, + future=True, + ) + self._SessionLocal = sessionmaker(bind=self._engine, autoflush=False, autocommit=False) + + # Initialize database schema and populate data + self._initialize_database() + + def _initialize_database(self) -> None: + """Create database schema and populate with data from config.""" + Base.metadata.create_all(bind=self._engine) + self._populate_from_config() + + def _populate_from_config(self) -> None: + """Populate the database from the JSON configuration file.""" + if not self._config_path.exists(): + raise RuntimeError(f"Config file not found at {self._config_path}") + + with self._config_path.open("r", encoding="utf-8") as f: + config = json.load(f) + + session = self._SessionLocal() + try: + for hotel_data in config.get("hotels", []): + hotel = Hotel( + name=hotel_data["name"], + city=hotel_data["city"], + address=hotel_data["address"], + rating=hotel_data["rating"], + amenities=json.dumps(hotel_data["amenities"]), + ) + session.add(hotel) + session.flush() + + for room_data in hotel_data.get("rooms", []): + room = Room( + number=room_data["number"], + hotel_id=hotel.id, + room_type=room_data["room_type"], + price_per_night=float(room_data["price_per_night"]), + capacity=room_data["capacity"], + amenities=json.dumps(room_data["amenities"]), + ) + session.add(room) + session.flush() + + for window in room_data.get("availability", []): + start = date.fromisoformat(window["start"]) + end = date.fromisoformat(window["end"]) + + if end < start: + continue + + for day in daterange(start, end): + availability = RoomAvailability(room_id=room.id, available_date=day, is_reserved=False) + session.add(availability) + + session.commit() + except Exception: + session.rollback() + raise + finally: + session.close() + + def _get_session(self) -> Session: + """Get a new database session.""" + return self._SessionLocal() + + # ------------------------------------------------------------------------- + # Cities + # ------------------------------------------------------------------------- + + def list_cities(self) -> list[str]: + """Return all available cities.""" + session = self._get_session() + try: + cities = session.query(Hotel.city).distinct().order_by(Hotel.city).all() + return [city[0] for city in cities] + finally: + session.close() + + # ------------------------------------------------------------------------- + # Hotels + # ------------------------------------------------------------------------- + + def list_hotels(self, city: str | None = None) -> list[HotelResponse]: + """Return hotels, optionally filtered by city.""" + session = self._get_session() + try: + query = session.query(Hotel) + if city: + query = query.filter(Hotel.city == city) + hotels = query.order_by(Hotel.name).all() + + return [ + HotelResponse( + id=hotel.id, + name=hotel.name, + city=hotel.city, + address=hotel.address, + rating=hotel.rating, + amenities=json.loads(hotel.amenities), + ) + for hotel in hotels + ] + finally: + session.close() + + def get_hotel_detail(self, hotel_id: int) -> HotelDetailResponse: + """Get detailed information about a specific hotel including all rooms. + + Raises: + LookupError: If hotel is not found. + """ + session = self._get_session() + try: + hotel = session.query(Hotel).filter(Hotel.id == hotel_id).one_or_none() + if hotel is None: + raise LookupError(f"Hotel with ID {hotel_id} not found.") + + rooms = [ + RoomResponse( + id=room.id, + number=room.number, + room_type=room.room_type, + price_per_night=room.price_per_night, + capacity=room.capacity, + amenities=json.loads(room.amenities), + ) + for room in hotel.rooms + ] + + return HotelDetailResponse( + id=hotel.id, + name=hotel.name, + city=hotel.city, + address=hotel.address, + rating=hotel.rating, + amenities=json.loads(hotel.amenities), + rooms=rooms, + ) + finally: + session.close() + + # ------------------------------------------------------------------------- + # Room Availability + # ------------------------------------------------------------------------- + + def find_available_rooms( + self, + start_date: date, + end_date: date, + city: str | None = None, + min_price: float | None = None, + max_price: float | None = None, + room_type: str | None = None, + ) -> list[AvailableRoomResponse]: + """Find available rooms matching the search criteria. + + Raises: + ValueError: If end_date is before start_date. + """ + if end_date < start_date: + raise ValueError("end_date must be on or after start_date.") + + session = self._get_session() + try: + hotel_query = session.query(Hotel) + if city: + hotel_query = hotel_query.filter(Hotel.city == city) + + available_rooms: list[AvailableRoomResponse] = [] + + for hotel in hotel_query.all(): + room_query = session.query(Room).filter(Room.hotel_id == hotel.id) + + if min_price is not None: + room_query = room_query.filter(Room.price_per_night >= min_price) + if max_price is not None: + room_query = room_query.filter(Room.price_per_night <= max_price) + if room_type: + room_query = room_query.filter(Room.room_type == room_type) + + for room in room_query.all(): + availability_entries = ( + session.query(RoomAvailability) + .filter( + RoomAvailability.room_id == room.id, + RoomAvailability.available_date >= start_date, + RoomAvailability.available_date <= end_date, + RoomAvailability.is_reserved.is_(False), + ) + .count() + ) + + expected_nights = (end_date - start_date).days + 1 + if availability_entries == expected_nights: + available_rooms.append( + AvailableRoomResponse( + hotel_id=hotel.id, + hotel_name=hotel.name, + city=hotel.city, + room_id=room.id, + room_number=room.number, + room_type=room.room_type, + price_per_night=room.price_per_night, + capacity=room.capacity, + amenities=json.loads(room.amenities), + ) + ) + + return available_rooms + finally: + session.close() + + # ------------------------------------------------------------------------- + # Reservations + # ------------------------------------------------------------------------- + + def create_reservation( + self, + hotel_id: int, + room_id: int, + guest_name: str, + start_date: date, + end_date: date, + ) -> ReservationResponse: + """Create a reservation if the requested room is available. + + Raises: + ValueError: If dates are invalid or room is not available. + LookupError: If hotel or room is not found. + """ + if end_date < start_date: + raise ValueError("end_date must be on or after start_date.") + + session = self._get_session() + try: + # Verify hotel exists + hotel = session.query(Hotel).filter(Hotel.id == hotel_id).one_or_none() + if hotel is None: + raise LookupError(f"Hotel with ID {hotel_id} not found.") + + # Verify room exists and belongs to hotel + room = session.query(Room).filter(Room.id == room_id, Room.hotel_id == hotel.id).one_or_none() + if room is None: + raise LookupError(f"Room with ID {room_id} not found in hotel {hotel.name}.") + + # Check availability for all requested dates + availability_entries = ( + session.query(RoomAvailability) + .filter( + RoomAvailability.room_id == room.id, + RoomAvailability.available_date >= start_date, + RoomAvailability.available_date <= end_date, + RoomAvailability.is_reserved.is_(False), + ) + .all() + ) + + expected_nights = (end_date - start_date).days + 1 + if len(availability_entries) != expected_nights: + raise ValueError("Requested room is not available for the full date range.") + + # Mark dates as reserved + for entry in availability_entries: + entry.is_reserved = True + + # Create reservation + reservation_record = Reservation( + room_id=room.id, + guest_name=guest_name, + start_date=start_date, + end_date=end_date, + ) + session.add(reservation_record) + session.commit() + session.refresh(reservation_record) + + # Calculate total price + total_price = room.price_per_night * expected_nights + + return ReservationResponse( + reservation_id=reservation_record.id, + hotel_name=hotel.name, + city=hotel.city, + room_number=room.number, + room_type=room.room_type, + guest_name=reservation_record.guest_name, + start_date=reservation_record.start_date, + end_date=reservation_record.end_date, + total_price=total_price, + ) + except Exception: + session.rollback() + raise + finally: + session.close() + + def list_reservations(self, guest_name: str | None = None) -> list[ReservationResponse]: + """Return all reservations, optionally filtered by guest name.""" + session = self._get_session() + try: + query = session.query(Reservation).join(Room).join(Hotel) + + if guest_name: + query = query.filter(Reservation.guest_name.ilike(f"%{guest_name}%")) + + reservations = query.order_by(Reservation.created_at.desc()).all() + + response: list[ReservationResponse] = [] + for res in reservations: + nights = (res.end_date - res.start_date).days + 1 + total_price = res.room.price_per_night * nights + + response.append( + ReservationResponse( + reservation_id=res.id, + hotel_name=res.room.hotel.name, + city=res.room.hotel.city, + room_number=res.room.number, + room_type=res.room.room_type, + guest_name=res.guest_name, + start_date=res.start_date, + end_date=res.end_date, + total_price=total_price, + ) + ) + return response + finally: + session.close() + + def get_reservation(self, reservation_id: int) -> ReservationResponse: + """Get details of a specific reservation. + + Raises: + LookupError: If reservation is not found. + """ + session = self._get_session() + try: + reservation = ( + session.query(Reservation).filter(Reservation.id == reservation_id).join(Room).join(Hotel).one_or_none() + ) + + if reservation is None: + raise LookupError(f"Reservation {reservation_id} not found.") + + nights = (reservation.end_date - reservation.start_date).days + 1 + total_price = reservation.room.price_per_night * nights + + return ReservationResponse( + reservation_id=reservation.id, + hotel_name=reservation.room.hotel.name, + city=reservation.room.hotel.city, + room_number=reservation.room.number, + room_type=reservation.room.room_type, + guest_name=reservation.guest_name, + start_date=reservation.start_date, + end_date=reservation.end_date, + total_price=total_price, + ) + finally: + session.close() + + def cancel_reservation(self, reservation_id: int) -> str: + """Cancel an existing reservation and free the associated room nights. + + Raises: + LookupError: If reservation is not found. + """ + session = self._get_session() + try: + reservation_obj = session.query(Reservation).filter(Reservation.id == reservation_id).one_or_none() + if reservation_obj is None: + raise LookupError(f"Reservation {reservation_id} not found.") + + # Free up the reserved dates + availability_entries = ( + session.query(RoomAvailability) + .filter( + RoomAvailability.room_id == reservation_obj.room_id, + RoomAvailability.available_date >= reservation_obj.start_date, + RoomAvailability.available_date <= reservation_obj.end_date, + ) + .all() + ) + for entry in availability_entries: + entry.is_reserved = False + + session.delete(reservation_obj) + session.commit() + return f"Reservation {reservation_id} canceled successfully." + except Exception: + session.rollback() + raise + finally: + session.close() diff --git a/examples/evaluate/agent-scenarios/fixtures/hotel/tools.py b/examples/evaluate/agent-scenarios/fixtures/hotel/tools.py index de8ef86b19..a19ed32033 100644 --- a/examples/evaluate/agent-scenarios/fixtures/hotel/tools.py +++ b/examples/evaluate/agent-scenarios/fixtures/hotel/tools.py @@ -1,19 +1,40 @@ """Hotel API tools for ragbits agents. -These tools provide access to hotel booking functionality via HTTP API calls. -The tools are designed to work with the hotel_api FastAPI service. +These tools provide access to hotel booking functionality via direct service calls. +The tools use an in-memory SQLite database populated from the hotel configuration. """ +from __future__ import annotations + import json +from contextvars import ContextVar +from datetime import date +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .service import HotelService + +# Context variable for thread/async-safe service instance +_service_var: ContextVar[HotelService | None] = ContextVar("hotel_service", default=None) + + +def _get_service() -> HotelService: + """Get the current service instance from context.""" + service = _service_var.get() + if service is None: + raise RuntimeError("HotelService not initialized. Tools must be used with HotelChat.") + return service + + +def set_service(service: HotelService) -> None: + """Set the service instance in context. Called by HotelChat during initialization.""" + _service_var.set(service) -import httpx # ============================================================================= # Hotel API Tools # ============================================================================= -HOTEL_API_BASE_URL = "http://localhost:8000" - async def list_cities() -> str: """ @@ -23,17 +44,11 @@ async def list_cities() -> str: str: JSON string containing list of city names """ try: - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.get(f"{HOTEL_API_BASE_URL}/cities") - response.raise_for_status() - cities = response.json() - return json.dumps(cities, indent=2) - except httpx.RequestError as e: - return f"Error fetching cities: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + cities = service.list_cities() + return json.dumps(cities, indent=2) except Exception as e: - return f"Error processing cities: {e}" + return f"Error fetching cities: {e}" async def list_hotels(city: str | None = None) -> str: @@ -47,21 +62,11 @@ async def list_hotels(city: str | None = None) -> str: str: JSON string containing list of hotels with id, name, city, address, rating, and amenities """ try: - params = {} - if city: - params["city"] = city - - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.get(f"{HOTEL_API_BASE_URL}/hotels", params=params) - response.raise_for_status() - hotels = response.json() - return json.dumps(hotels, indent=2) - except httpx.RequestError as e: - return f"Error fetching hotels: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + hotels = service.list_hotels(city=city) + return json.dumps([h.model_dump() for h in hotels], indent=2) except Exception as e: - return f"Error processing hotels: {e}" + return f"Error fetching hotels: {e}" async def get_hotel_details(hotel_id: int) -> str: @@ -76,17 +81,13 @@ async def get_hotel_details(hotel_id: int) -> str: number, type, price, capacity, and amenities """ try: - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.get(f"{HOTEL_API_BASE_URL}/hotels/{hotel_id}") - response.raise_for_status() - hotel = response.json() - return json.dumps(hotel, indent=2) - except httpx.RequestError as e: - return f"Error fetching hotel details: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + hotel = service.get_hotel_detail(hotel_id) + return json.dumps(hotel.model_dump(), indent=2) + except LookupError as e: + return f"Error: {e}" except Exception as e: - return f"Error processing hotel details: {e}" + return f"Error fetching hotel details: {e}" async def search_available_rooms( @@ -112,30 +113,22 @@ async def search_available_rooms( str: JSON string containing list of available rooms with hotel and room details """ try: - params = { - "start_date": start_date, - "end_date": end_date, - } - if city: - params["city"] = city - if min_price is not None: - params["min_price"] = min_price - if max_price is not None: - params["max_price"] = max_price - if room_type: - params["room_type"] = room_type - - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.get(f"{HOTEL_API_BASE_URL}/rooms/available", params=params) - response.raise_for_status() - rooms = response.json() - return json.dumps(rooms, indent=2) - except httpx.RequestError as e: - return f"Error searching rooms: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + start = date.fromisoformat(start_date) + end = date.fromisoformat(end_date) + rooms = service.find_available_rooms( + start_date=start, + end_date=end, + city=city, + min_price=min_price, + max_price=max_price, + room_type=room_type, + ) + return json.dumps([r.model_dump() for r in rooms], indent=2, default=str) + except ValueError as e: + return f"Error: {e}" except Exception as e: - return f"Error processing room search: {e}" + return f"Error searching rooms: {e}" async def create_reservation( @@ -160,29 +153,21 @@ async def create_reservation( hotel_name, room details, and total_price """ try: - payload = { - "hotel_id": hotel_id, - "room_id": room_id, - "guest_name": guest_name, - "start_date": start_date, - "end_date": end_date, - } - - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.post( - f"{HOTEL_API_BASE_URL}/reservations", - json=payload, - headers={"Content-Type": "application/json"}, - ) - response.raise_for_status() - reservation = response.json() - return json.dumps(reservation, indent=2) - except httpx.RequestError as e: - return f"Error creating reservation: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + start = date.fromisoformat(start_date) + end = date.fromisoformat(end_date) + reservation = service.create_reservation( + hotel_id=hotel_id, + room_id=room_id, + guest_name=guest_name, + start_date=start, + end_date=end, + ) + return json.dumps(reservation.model_dump(), indent=2, default=str) + except (ValueError, LookupError) as e: + return f"Error: {e}" except Exception as e: - return f"Error processing reservation: {e}" + return f"Error creating reservation: {e}" async def list_reservations(guest_name: str | None = None) -> str: @@ -196,21 +181,11 @@ async def list_reservations(guest_name: str | None = None) -> str: str: JSON string containing list of reservations with details """ try: - params = {} - if guest_name: - params["guest_name"] = guest_name - - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.get(f"{HOTEL_API_BASE_URL}/reservations", params=params) - response.raise_for_status() - reservations = response.json() - return json.dumps(reservations, indent=2) - except httpx.RequestError as e: - return f"Error fetching reservations: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + reservations = service.list_reservations(guest_name=guest_name) + return json.dumps([r.model_dump() for r in reservations], indent=2, default=str) except Exception as e: - return f"Error processing reservations: {e}" + return f"Error fetching reservations: {e}" async def get_reservation(reservation_id: int) -> str: @@ -224,17 +199,13 @@ async def get_reservation(reservation_id: int) -> str: str: JSON string containing reservation details including hotel, room, guest, dates, and total price """ try: - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.get(f"{HOTEL_API_BASE_URL}/reservations/{reservation_id}") - response.raise_for_status() - reservation = response.json() - return json.dumps(reservation, indent=2) - except httpx.RequestError as e: - return f"Error fetching reservation: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + reservation = service.get_reservation(reservation_id) + return json.dumps(reservation.model_dump(), indent=2, default=str) + except LookupError as e: + return f"Error: {e}" except Exception as e: - return f"Error processing reservation: {e}" + return f"Error fetching reservation: {e}" async def cancel_reservation(reservation_id: int) -> str: @@ -248,14 +219,10 @@ async def cancel_reservation(reservation_id: int) -> str: str: Success message confirming the cancellation """ try: - async with httpx.AsyncClient(timeout=10.0) as client: - response = await client.delete(f"{HOTEL_API_BASE_URL}/reservations/{reservation_id}") - response.raise_for_status() - result = response.json() - return json.dumps(result, indent=2) - except httpx.RequestError as e: - return f"Error canceling reservation: {e}" - except httpx.HTTPStatusError as e: - return f"HTTP error: {e.response.status_code} - {e.response.text}" + service = _get_service() + message = service.cancel_reservation(reservation_id) + return json.dumps({"detail": message}, indent=2) + except LookupError as e: + return f"Error: {e}" except Exception as e: - return f"Error processing cancellation: {e}" + return f"Error canceling reservation: {e}" diff --git a/examples/evaluate/agent-scenarios/duet_cli.py b/examples/evaluate/agent-scenarios/hotel_simulation.py similarity index 60% rename from examples/evaluate/agent-scenarios/duet_cli.py rename to examples/evaluate/agent-scenarios/hotel_simulation.py index bc432c327e..938d26456c 100644 --- a/examples/evaluate/agent-scenarios/duet_cli.py +++ b/examples/evaluate/agent-scenarios/hotel_simulation.py @@ -7,7 +7,14 @@ from config import config from fixtures.hotel.hotel_chat import HotelChat -from ragbits.evaluate.agent_simulation import load_personalities, load_scenarios, run_simulation +from ragbits.evaluate.agent_simulation import ( + LatencyMetricCollector, + TokenUsageMetricCollector, + ToolUsageMetricCollector, + load_personalities, + load_scenarios, + run_simulation, +) def parse_args() -> argparse.Namespace: @@ -15,10 +22,8 @@ def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description="Two-agent terminal chat (ragbits hotel agent + simulated user)") parser.add_argument("--scenario-id", type=int, required=True, help="Scenario ID (1-based index)") parser.add_argument("--scenarios-file", type=str, default="scenarios.json", help="Path to scenarios file") - parser.add_argument("--personality-id", type=int, help="Personality ID (1-based index, optional)") - parser.add_argument( - "--personalities-file", type=str, default="personalities.json", help="Path to personalities file" - ) + parser.add_argument("--persona-id", type=int, help="Persona ID (1-based index, optional)") + parser.add_argument("--personas-file", type=str, default="personas.json", help="Path to personas file") parser.add_argument( "--max-turns-scenario", type=int, default=15, help="Max number of conversation turns for the entire scenario" ) @@ -28,6 +33,11 @@ def parse_args() -> argparse.Namespace: parser.add_argument("--sim-user-model-name", type=str, help="Override simulated user LLM model name") parser.add_argument("--checker-model-name", type=str, help="Override goal checker LLM model name") parser.add_argument("--output-json", type=str, help="Path to output JSON file for structured results") + parser.add_argument( + "--enable-metrics", + action="store_true", + help="Enable custom metric collectors (latency, token usage, tool usage)", + ) return parser.parse_args() @@ -41,13 +51,13 @@ def main() -> None: raise ValueError(f"Scenario ID {args.scenario_id} out of range. Available: 1-{len(scenarios)}") scenario = scenarios[args.scenario_id - 1] - # Load and validate personality (if provided) - personality = None - if args.personality_id is not None: - personalities = load_personalities(args.personalities_file) - if args.personality_id < 1 or args.personality_id > len(personalities): - raise ValueError(f"Personality ID {args.personality_id} out of range. Available: 1-{len(personalities)}") - personality = personalities[args.personality_id - 1] + # Load and validate persona (if provided) + persona = None + if args.persona_id is not None: + personas = load_personalities(args.personas_file) + if args.persona_id < 1 or args.persona_id > len(personas): + raise ValueError(f"Persona ID {args.persona_id} out of range. Available: 1-{len(personas)}") + persona = personas[args.persona_id - 1] # Hotel-specific message prefix message_prefix = ( @@ -56,6 +66,17 @@ def main() -> None: "If information is unavailable, explain why briefly.\n\n" ) + # Initialize metric collectors if enabled + metric_collectors = ( + [ + LatencyMetricCollector(), + TokenUsageMetricCollector(), + ToolUsageMetricCollector(), + ] + if args.enable_metrics + else None + ) + hotel_chat = HotelChat(args.agent_model_name or config.llm_model, config.openai_api_key) result = asyncio.run( run_simulation( @@ -70,7 +91,8 @@ def main() -> None: default_model=config.llm_model, api_key=config.openai_api_key, user_message_prefix=message_prefix, - personality=personality, + personality=persona, + metric_collectors=metric_collectors, ) ) @@ -81,6 +103,27 @@ def main() -> None: print(f"Success rate: {result.metrics.success_rate:.1%}") print(f"Total turns: {result.metrics.total_turns}") + # Print custom metrics if enabled + if result.metrics.custom: + print("\n=== Custom Metrics ===") + custom = result.metrics.custom + + # Latency metrics + if "latency_avg_ms" in custom: + print(f"Latency (avg): {custom['latency_avg_ms']:.1f}ms") + print(f"Latency (min/max): {custom['latency_min_ms']:.1f}ms / {custom['latency_max_ms']:.1f}ms") + + # Token usage metrics + if "tokens_total" in custom: + print(f"Tokens (total): {custom['tokens_total']}") + print(f"Tokens (avg/turn): {custom['tokens_avg_per_turn']:.1f}") + + # Tool usage metrics + if "tools_total_calls" in custom: + print(f"Tool calls (total): {custom['tools_total_calls']}") + print(f"Unique tools used: {', '.join(custom['tools_unique'])}") + print(f"Turns with tools: {custom['turns_with_tools']}") + # Save to JSON if requested if args.output_json: with open(args.output_json, "w") as f: diff --git a/examples/evaluate/agent-scenarios/personalities.json b/examples/evaluate/agent-scenarios/personas.json similarity index 86% rename from examples/evaluate/agent-scenarios/personalities.json rename to examples/evaluate/agent-scenarios/personas.json index 55749ac2dc..2eb2744c73 100644 --- a/examples/evaluate/agent-scenarios/personalities.json +++ b/examples/evaluate/agent-scenarios/personas.json @@ -1,22 +1,22 @@ [ { - "name": "Personality 1", + "name": "Friendly Enthusiast", "description": "You are a friendly and enthusiastic person. You use casual language and show excitement about your travel plans. You often use exclamation marks and express gratitude." }, { - "name": "Personality 2", + "name": "Business Professional", "description": "You are a business professional who is direct and efficient. You prefer concise communication and value your time. You use formal language and expect quick, accurate responses." }, { - "name": "Personality 3", + "name": "Budget Conscious", "description": "You are a budget-conscious traveler who is very price-sensitive. You frequently ask about costs, discounts, and budget-friendly options. You are detail-oriented and want to make sure you get the best value." }, { - "name": "Personality 4", + "name": "Luxury Seeker", "description": "You are a luxury traveler who values quality and premium experiences. You ask about high-end amenities, premium room types, and exclusive services. You are willing to pay more for superior quality." }, { - "name": "Personality 5", + "name": "Indecisive Hesitator", "description": "You are an indecisive person who often changes your mind and asks many clarifying questions. You need reassurance and may ask the same question in different ways to make sure you understand correctly." } ] diff --git a/examples/evaluate/agent-scenarios/run_eval_ui.py b/examples/evaluate/agent-scenarios/run_eval_ui.py new file mode 100644 index 0000000000..1fee88791a --- /dev/null +++ b/examples/evaluate/agent-scenarios/run_eval_ui.py @@ -0,0 +1,62 @@ +"""Run the Evaluation UI server with the hotel booking agent.""" + +import argparse +import sys +from pathlib import Path + +# Add parent to path so we can import config and fixtures +sys.path.insert(0, str(Path(__file__).parent)) + +from config import config +from fixtures.hotel.hotel_chat import HotelChat + +from ragbits.evaluate.api import EvalAPI + + +def create_hotel_chat() -> HotelChat: + """Factory function to create HotelChat instances.""" + return HotelChat(model_name=config.llm_model, api_key=config.openai_api_key) + + +def parse_args() -> argparse.Namespace: + """Parse command-line arguments.""" + parser = argparse.ArgumentParser(description="Run the Evaluation UI server") + parser.add_argument("--host", type=str, default="127.0.0.1", help="Host to bind to") + parser.add_argument("--port", type=int, default=8001, help="Port to bind to") + parser.add_argument( + "--scenarios-dir", + type=str, + default=str(Path(__file__).parent), + help="Directory containing scenario JSON files", + ) + parser.add_argument( + "--results-dir", + type=str, + default=str(Path(__file__).parent / "eval_results"), + help="Directory for storing evaluation results", + ) + return parser.parse_args() + + +def main() -> None: + """Main entry point.""" + args = parse_args() + + print(f"Starting Eval UI server on http://{args.host}:{args.port}") + print(f"Scenarios directory: {args.scenarios_dir}") + print(f"Results directory: {args.results_dir}") + print("\nOpen the frontend at: http://localhost:5173/eval.html") + print("(Run 'npm run dev:eval' in typescript/ui/ first)\n") + + api = EvalAPI( + chat_factory=create_hotel_chat, + scenarios_dir=args.scenarios_dir, + results_dir=args.results_dir, + cors_origins=["http://localhost:5173", "http://127.0.0.1:5173"], + ) + + api.run(host=args.host, port=args.port) + + +if __name__ == "__main__": + main() diff --git a/examples/evaluate/agent-scenarios/scenarios.json b/examples/evaluate/agent-scenarios/scenarios.json index 3a67aee111..2e67eb23ce 100644 --- a/examples/evaluate/agent-scenarios/scenarios.json +++ b/examples/evaluate/agent-scenarios/scenarios.json @@ -1,6 +1,6 @@ [ { - "name": "Scenario 1", + "name": "Krakow Deluxe Room Search and Booking", "tasks": [ { "task": "are there rooms available in Krakow on 2025-06-01", @@ -20,7 +20,7 @@ ] }, { - "name": "Scenario 2", + "name": "Warsaw Budget Room Multi-Night Booking", "tasks": [ { "task": "find hotels in Warsaw", @@ -40,7 +40,7 @@ ] }, { - "name": "Scenario 3", + "name": "Gdańsk Suite Weekend Reservation", "tasks": [ { "task": "search for hotels in Gdańsk", @@ -60,7 +60,7 @@ ] }, { - "name": "Scenario 4", + "name": "Krakow Best Hotel Premium Room Availability Check", "tasks": [ { "task": "I would like to travel to Krakow. What is the best raded hotel there", @@ -90,7 +90,7 @@ ] }, { - "name": "Scenario 5", + "name": "Future Date Booking Attempt", "tasks": [ { "task": "book room in Krakow on 2030-06-01", @@ -105,7 +105,7 @@ ] }, { - "name": "Scenario 6", + "name": "Gdańsk Suite Booking with Guest Name", "tasks": [ { "task": "search for hotels in Gdańsk", diff --git a/packages/ragbits-chat/CHANGELOG.md b/packages/ragbits-chat/CHANGELOG.md index 586eaec622..059ae33a1f 100644 --- a/packages/ragbits-chat/CHANGELOG.md +++ b/packages/ragbits-chat/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Make `SummaryGenerator` optional in `ChatInterface` by providing a default Heuristic implementation. +- Feat: add response adapter system for transforming chat response streams (`ResponseAdapter` protocol, `AdapterPipeline`, `ChatResponseAdapter`, `ToolResultTextAdapter`, `FilterAdapter`, and more) - Refactor ragbits-client types to remove excessive use of any (#881) - Split params into path params, query params in API client (#871) - Fix bug causing conversation not to be selected when navigating to it from url(#872) diff --git a/packages/ragbits-chat/src/ragbits/chat/adapters/__init__.py b/packages/ragbits-chat/src/ragbits/chat/adapters/__init__.py new file mode 100644 index 0000000000..1deb3370d0 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/adapters/__init__.py @@ -0,0 +1,58 @@ +"""Response adapters for transforming chat response streams. + +This module provides a composable adapter system for transforming chat responses +through a pipeline of adapters, each handling a specific concern. + +Example: + >>> from ragbits.chat.adapters import ( + ... AdapterPipeline, + ... ChatResponseAdapter, + ... FilterAdapter, + ... ToolResultTextAdapter, + ... ) + >>> + >>> async def render_products(tool_call): + ... return f"Found {len(tool_call.result)} products" + >>> + >>> pipeline = AdapterPipeline( + ... [ + ... ChatResponseAdapter(), + ... FilterAdapter(exclude_types=(SomeUICommand,)), + ... ToolResultTextAdapter( + ... renderers={"show_products": render_products}, + ... pass_through=True, + ... ), + ... ] + ... ) + >>> + >>> async for chunk in pipeline.process(chat_stream, context): + ... print(chunk) +""" + +from ragbits.chat.adapters.builtin import ( + ChatResponseAdapter, + FilterAdapter, + TextAccumulatorAdapter, + ToolCallAccumulatorAdapter, + ToolResultTextAdapter, + UsageAggregatorAdapter, +) +from ragbits.chat.adapters.pipeline import AdapterPipeline +from ragbits.chat.adapters.protocol import ( + AdapterContext, + BaseAdapter, + ResponseAdapter, +) + +__all__ = [ + "AdapterContext", + "AdapterPipeline", + "BaseAdapter", + "ChatResponseAdapter", + "FilterAdapter", + "ResponseAdapter", + "TextAccumulatorAdapter", + "ToolCallAccumulatorAdapter", + "ToolResultTextAdapter", + "UsageAggregatorAdapter", +] diff --git a/packages/ragbits-chat/src/ragbits/chat/adapters/builtin.py b/packages/ragbits-chat/src/ragbits/chat/adapters/builtin.py new file mode 100644 index 0000000000..ce285002fb --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/adapters/builtin.py @@ -0,0 +1,434 @@ +"""Built-in adapters for common response transformations.""" + +from __future__ import annotations + +from collections.abc import AsyncGenerator, Awaitable, Callable +from typing import TYPE_CHECKING, Any + +from ragbits.chat.adapters.protocol import AdapterContext, BaseAdapter + +if TYPE_CHECKING: + from ragbits.agents.tool import ToolCallResult + from ragbits.chat.interface.types import ChatResponse + from ragbits.core.llms import Usage + + +class ChatResponseAdapter(BaseAdapter): + """Extracts text and content from ChatResponse objects. + + This adapter handles the common case of extracting text from + ChatResponse objects yielded by production ChatInterface implementations. + + Example: + >>> adapter = ChatResponseAdapter() + >>> pipeline = AdapterPipeline([adapter]) + >>> # Processes TextResponse, extracts text, passes through other types + """ + + @property + def input_types(self) -> tuple[type, ...]: + """Return accepted input types.""" + from ragbits.chat.interface.types import TextResponse + + return (TextResponse,) + + @property + def output_types(self) -> tuple[type, ...]: + """Return produced output types.""" + return (str,) + + async def adapt( # noqa: PLR6301 + self, + chunk: ChatResponse, + context: AdapterContext, + ) -> AsyncGenerator[str | Any, None]: + """Extract text and embedded content from ChatResponse. + + Args: + chunk: ChatResponse to process. + context: Adapter context. + + Yields: + Extracted text strings and embedded objects. + """ + content = chunk.content + + if content.text: + yield content.text + # Handle other content types - yield the content itself + elif content is not None: + yield content + + +class ToolResultTextAdapter(BaseAdapter): + """Renders tool call results as human-readable text. + + Use this adapter to make tool results visible in the conversation + by rendering them as text. Supports per-tool custom renderers. + + Example: + >>> async def render_products(tool_call): + ... return f"Found {len(tool_call.result)} products" + >>> adapter = ToolResultTextAdapter( + ... renderers={"show_products": render_products}, + ... pass_through=True, + ... ) + """ + + def __init__( + self, + renderers: dict[str, Callable[[ToolCallResult], Awaitable[str]]] | None = None, + default_renderer: Callable[[ToolCallResult], Awaitable[str]] | None = None, + pass_through: bool = True, + ) -> None: + """Initialize the adapter. + + Args: + renderers: Tool name to async render function mapping. + default_renderer: Fallback renderer for tools without specific renderer. + pass_through: If True, also yield original ToolCallResult after text. + """ + self._renderers = renderers or {} + self._default_renderer = default_renderer + self._pass_through = pass_through + + @property + def input_types(self) -> tuple[type, ...]: + """Return accepted input types.""" + from ragbits.agents.tool import ToolCallResult + + return (ToolCallResult,) + + @property + def output_types(self) -> tuple[type, ...]: + """Return produced output types.""" + from ragbits.agents.tool import ToolCallResult + + return (str, ToolCallResult) + + async def adapt( + self, + chunk: ToolCallResult, + context: AdapterContext, + ) -> AsyncGenerator[str | ToolCallResult, None]: + """Render tool result as text and optionally pass through. + + Args: + chunk: ToolCallResult to process. + context: Adapter context. + + Yields: + Rendered text and/or original ToolCallResult. + """ + renderer = self._renderers.get(chunk.name, self._default_renderer) + + if renderer: + text = await renderer(chunk) + if text: + yield text + + if self._pass_through: + yield chunk + + +class FilterAdapter(BaseAdapter): + """Filters out chunks of specified types. + + Use this adapter to remove unwanted types from the stream, + such as UI-specific commands that aren't needed for evaluation. + + Example: + >>> adapter = FilterAdapter( + ... exclude_types=(ShowSlidersCommand, ShowOrderCommand), + ... ) + >>> # These command types will be filtered out + """ + + def __init__( + self, + exclude_types: tuple[type, ...] = (), + include_types: tuple[type, ...] | None = None, + ) -> None: + """Initialize the adapter. + + Args: + exclude_types: Types to filter out (blacklist). + include_types: If set, only these types pass through (whitelist). + Takes precedence over exclude_types. + """ + self._exclude = exclude_types + self._include = include_types + + @property + def input_types(self) -> tuple[type, ...]: + """Return accepted input types.""" + return (object,) + + @property + def output_types(self) -> tuple[type, ...]: + """Return produced output types.""" + return (object,) + + async def adapt( # noqa: PLR6301 + self, + chunk: Any, # noqa: ANN401 + context: AdapterContext, + ) -> AsyncGenerator[Any, None]: + """Filter chunks based on type. + + Args: + chunk: Any chunk to potentially filter. + context: Adapter context. + + Yields: + The chunk if it passes the filter, nothing otherwise. + """ + if self._include is not None: + if isinstance(chunk, self._include): + yield chunk + elif not isinstance(chunk, self._exclude): + yield chunk + + +class TextAccumulatorAdapter(BaseAdapter): + """Accumulates text chunks into context for other adapters. + + This adapter stores text in `context.text_parts` and optionally + passes through the original text chunks. + + Example: + >>> adapter = TextAccumulatorAdapter(emit=True) + >>> # Text chunks are stored in context.text_parts and passed through + """ + + def __init__(self, emit: bool = True) -> None: + """Initialize the adapter. + + Args: + emit: If True, also yield text chunks (pass-through). + """ + self._emit = emit + + @property + def input_types(self) -> tuple[type, ...]: + """Return accepted input types.""" + return (str,) + + @property + def output_types(self) -> tuple[type, ...]: + """Return produced output types.""" + return (str,) if self._emit else () + + async def adapt( + self, + chunk: str, + context: AdapterContext, + ) -> AsyncGenerator[str, None]: + """Accumulate text and optionally emit. + + Args: + chunk: Text string to accumulate. + context: Adapter context. + + Yields: + The text chunk if emit is True. + """ + context.text_parts.append(chunk) + if self._emit: + yield chunk + + +class ToolCallAccumulatorAdapter(BaseAdapter): + """Accumulates tool calls into context for other adapters. + + This adapter stores ToolCallResult in `context.tool_calls` and + optionally passes through the original chunks. + + Example: + >>> adapter = ToolCallAccumulatorAdapter(emit=True) + >>> # Tool calls are stored in context.tool_calls and passed through + """ + + def __init__(self, emit: bool = True) -> None: + """Initialize the adapter. + + Args: + emit: If True, also yield tool call chunks (pass-through). + """ + self._emit = emit + + @property + def input_types(self) -> tuple[type, ...]: + """Return accepted input types.""" + from ragbits.agents.tool import ToolCallResult + + return (ToolCallResult,) + + @property + def output_types(self) -> tuple[type, ...]: + """Return produced output types.""" + from ragbits.agents.tool import ToolCallResult + + return (ToolCallResult,) if self._emit else () + + async def adapt( + self, + chunk: ToolCallResult, + context: AdapterContext, + ) -> AsyncGenerator[ToolCallResult, None]: + """Accumulate tool call and optionally emit. + + Args: + chunk: ToolCallResult to accumulate. + context: Adapter context. + + Yields: + The tool call if emit is True. + """ + context.tool_calls.append(chunk) + if self._emit: + yield chunk + + +class SourceCaptureAdapter(BaseAdapter): + """Captures ReferenceResponse objects and stores them in context. + + Use this adapter to collect source/reference documents from the chat + response stream for tracking and display purposes. + + Example: + >>> adapter = SourceCaptureAdapter(emit=True) + >>> # References are stored in context.sources and optionally passed through + """ + + def __init__(self, emit: bool = True) -> None: + """Initialize the adapter. + + Args: + emit: If True, also yield reference chunks (pass-through). + """ + self._emit = emit + + @property + def input_types(self) -> tuple[type, ...]: + """Return accepted input types.""" + from ragbits.chat.interface.types import ReferenceResponse + + return (ReferenceResponse,) + + @property + def output_types(self) -> tuple[type, ...]: + """Return produced output types.""" + from ragbits.chat.interface.types import ReferenceResponse + + return (ReferenceResponse,) if self._emit else () + + async def adapt( + self, + chunk: Any, # noqa: ANN401 + context: AdapterContext, + ) -> AsyncGenerator[Any, None]: + """Capture reference and optionally emit. + + Args: + chunk: ReferenceResponse to capture. + context: Adapter context. + + Yields: + The reference if emit is True. + """ + # Store the reference in context for later use + context.sources.append(chunk.content) + + if self._emit: + yield chunk + + +class UsageAggregatorAdapter(BaseAdapter): + """Aggregates token usage across chunks. + + This adapter accumulates Usage objects and can emit per-chunk + and/or aggregated usage at stream end. + + Example: + >>> adapter = UsageAggregatorAdapter( + ... emit_per_chunk=False, + ... emit_aggregated_at_end=True, + ... ) + >>> # Single aggregated Usage emitted at end + """ + + def __init__( + self, + emit_per_chunk: bool = False, + emit_aggregated_at_end: bool = True, + ) -> None: + """Initialize the adapter. + + Args: + emit_per_chunk: If True, yield each Usage chunk as received. + emit_aggregated_at_end: If True, yield aggregated Usage at stream end. + """ + self._emit_per_chunk = emit_per_chunk + self._emit_at_end = emit_aggregated_at_end + self._total: Usage | None = None + + @property + def input_types(self) -> tuple[type, ...]: + """Return accepted input types.""" + from ragbits.core.llms import Usage + + return (Usage,) + + @property + def output_types(self) -> tuple[type, ...]: + """Return produced output types.""" + from ragbits.core.llms import Usage + + return (Usage,) + + async def adapt( + self, + chunk: Usage, + context: AdapterContext, + ) -> AsyncGenerator[Usage, None]: + """Aggregate usage and optionally emit per-chunk. + + Args: + chunk: Usage to aggregate. + context: Adapter context. + + Yields: + The Usage chunk if emit_per_chunk is True. + """ + if self._total is None: + self._total = chunk + else: + self._total = self._total + chunk + + if self._emit_per_chunk: + yield chunk + + async def on_stream_end(self, context: AdapterContext) -> AsyncGenerator[Usage, None]: + """Emit aggregated usage at stream end. + + Args: + context: Adapter context. + + Yields: + Aggregated Usage if emit_aggregated_at_end is True and we have data. + """ + if self._emit_at_end and self._total is not None: + yield self._total + + def get_total(self) -> Usage | None: + """Get the accumulated total usage. + + Returns: + The aggregated Usage or None if no usage was recorded. + """ + return self._total + + def reset(self) -> None: + """Reset accumulated usage for reuse.""" + self._total = None diff --git a/packages/ragbits-chat/src/ragbits/chat/adapters/pipeline.py b/packages/ragbits-chat/src/ragbits/chat/adapters/pipeline.py new file mode 100644 index 0000000000..187823becf --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/adapters/pipeline.py @@ -0,0 +1,97 @@ +"""Adapter pipeline for composing multiple response adapters.""" + +from __future__ import annotations + +from collections.abc import AsyncGenerator +from typing import Any + +from ragbits.chat.adapters.protocol import AdapterContext, ResponseAdapter + + +class AdapterPipeline: + """Composes multiple adapters into a single transformation pipeline. + + Chunks flow through adapters in order. Each adapter may: + - Transform a chunk (1 -> 1) + - Expand a chunk (1 -> N) + - Filter a chunk (1 -> 0) + - Pass through unchanged (for non-matching types) + + Example: + >>> from ragbits.chat.adapters import ( + ... AdapterPipeline, + ... ChatResponseAdapter, + ... FilterAdapter, + ... ) + >>> pipeline = AdapterPipeline( + ... [ + ... ChatResponseAdapter(), + ... FilterAdapter(exclude_types=(SomeCommand,)), + ... ] + ... ) + >>> async for chunk in pipeline.process(stream, context): + ... print(chunk) + """ + + def __init__(self, adapters: list[ResponseAdapter] | None = None) -> None: + """Initialize the pipeline with a list of adapters. + + Args: + adapters: List of adapters to compose. Order matters - chunks + flow through adapters in the order provided. + """ + self._adapters: list[ResponseAdapter] = adapters or [] + + def add(self, adapter: ResponseAdapter) -> None: + """Add an adapter to the end of the pipeline. + + Args: + adapter: Adapter to add. + """ + self._adapters.append(adapter) + + async def process( + self, + stream: AsyncGenerator[Any, None], + context: AdapterContext, + ) -> AsyncGenerator[Any, None]: + """Process a stream through all adapters. + + Args: + stream: Input async generator of chunks. + context: Shared context for the current turn. + + Yields: + Transformed chunks after passing through all adapters. + """ + # Notify adapters of stream start + for adapter in self._adapters: + await adapter.on_stream_start(context) + + # Process chunks through pipeline + async for chunk in stream: + results: list[Any] = [chunk] + + for adapter in self._adapters: + next_results: list[Any] = [] + for item in results: + if isinstance(item, adapter.input_types): + async for transformed in adapter.adapt(item, context): + next_results.append(transformed) + else: + # Pass through unchanged + next_results.append(item) + results = next_results + + for result in results: + yield result + + # Notify adapters of stream end and collect final emissions + for adapter in self._adapters: + async for final_chunk in adapter.on_stream_end(context): + yield final_chunk + + def reset(self) -> None: + """Reset all adapters for reuse.""" + for adapter in self._adapters: + adapter.reset() diff --git a/packages/ragbits-chat/src/ragbits/chat/adapters/protocol.py b/packages/ragbits-chat/src/ragbits/chat/adapters/protocol.py new file mode 100644 index 0000000000..38b4b6fbb0 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/adapters/protocol.py @@ -0,0 +1,194 @@ +"""Protocol and context definitions for response adapters.""" + +from __future__ import annotations + +from collections.abc import AsyncGenerator, Coroutine +from dataclasses import dataclass, field +from typing import Any, Protocol, TypeVar, runtime_checkable + +InputT_contra = TypeVar("InputT_contra", contravariant=True) +OutputT_co = TypeVar("OutputT_co", covariant=True) + + +@dataclass +class AdapterContext: + """Shared context available to all adapters in a pipeline. + + Provides turn-level information and accumulator storage for adapters + to coordinate and share state during response processing. + + Attributes: + turn_index: 1-based index of the current turn. + task_index: 0-based index of the current task. + user_message: The user message for this turn. + history: Conversation history before this turn (list of turn objects). + text_parts: Accumulator for text chunks in the current turn. + tool_calls: Accumulator for tool calls in the current turn. + metadata: Extensible metadata storage for custom adapters. + """ + + turn_index: int + task_index: int + user_message: str + history: list[Any] + + # Accumulators for the current turn + text_parts: list[str] = field(default_factory=list) + tool_calls: list[Any] = field(default_factory=list) + sources: list[Any] = field(default_factory=list) + + # Extensible metadata for custom adapters + metadata: dict[str, Any] = field(default_factory=dict) + + +@runtime_checkable +class ResponseAdapter(Protocol[InputT_contra, OutputT_co]): + """Protocol for transforming chat response chunks. + + Implement this protocol to create custom adapters that transform + chat response streams. Adapters can: + - Transform chunks (1 -> 1) + - Expand chunks (1 -> N) + - Filter chunks (1 -> 0) + - Pass through non-matching types unchanged + + Type Parameters: + InputT: The input type(s) this adapter accepts. + OutputT: The output type(s) this adapter produces. + + Example: + >>> class MyAdapter: + ... @property + ... def input_types(self) -> tuple[type, ...]: + ... return (MyInputType,) + ... + ... @property + ... def output_types(self) -> tuple[type, ...]: + ... return (str,) + ... + ... async def adapt( + ... self, + ... chunk: MyInputType, + ... context: AdapterContext, + ... ) -> AsyncGenerator[str, None]: + ... yield f"Transformed: {chunk.value}" + ... + ... async def on_stream_start(self, context: AdapterContext) -> None: + ... pass + ... + ... async def on_stream_end(self, context: AdapterContext) -> AsyncGenerator[str, None]: + ... return + ... yield # Make it a generator + ... + ... def reset(self) -> None: + ... pass + """ + + @property + def input_types(self) -> tuple[type, ...]: + """Types this adapter can process. Others pass through unchanged.""" + ... + + @property + def output_types(self) -> tuple[type, ...]: + """Types this adapter may produce.""" + ... + + def adapt( + self, + chunk: InputT_contra, + context: AdapterContext, + ) -> AsyncGenerator[OutputT_co, None]: + """Transform a single chunk, potentially yielding zero or more output chunks. + + Args: + chunk: Input chunk to transform. + context: Shared context for the current turn. + + Yields: + Transformed chunk(s). + """ + ... + + def on_stream_start(self, context: AdapterContext) -> Coroutine[None, None, None]: + """Called when a new response stream begins. + + Use for initialization or setup before processing chunks. + + Args: + context: Shared context for the current turn. + """ + ... + + def on_stream_end(self, context: AdapterContext) -> AsyncGenerator[OutputT_co, None]: + """Called when the response stream ends. + + Use for cleanup or emitting final aggregated values. + + Args: + context: Shared context for the current turn. + + Yields: + Any final chunks to emit after stream processing. + """ + ... + + def reset(self) -> None: + """Reset adapter state for reuse across multiple conversations.""" + ... + + +class BaseAdapter: + """Base class providing default implementations for ResponseAdapter. + + Inherit from this class to get sensible defaults and only override + the methods you need. + + Example: + >>> class MyAdapter(BaseAdapter): + ... @property + ... def input_types(self) -> tuple[type, ...]: + ... return (str,) + ... + ... @property + ... def output_types(self) -> tuple[type, ...]: + ... return (str,) + ... + ... async def adapt( + ... self, + ... chunk: str, + ... context: AdapterContext, + ... ) -> AsyncGenerator[str, None]: + ... yield chunk.upper() + """ + + @property + def input_types(self) -> tuple[type, ...]: + """Types this adapter can process.""" + return (object,) + + @property + def output_types(self) -> tuple[type, ...]: + """Types this adapter may produce.""" + return (object,) + + async def adapt( # noqa: PLR6301 + self, + chunk: Any, # noqa: ANN401 + context: AdapterContext, + ) -> AsyncGenerator[Any, None]: + """Default: pass through unchanged.""" + yield chunk + + async def on_stream_start(self, context: AdapterContext) -> None: # noqa: PLR6301 + """Default: no-op.""" + pass + + async def on_stream_end(self, context: AdapterContext) -> AsyncGenerator[Any, None]: # noqa: PLR6301 + """Default: emit nothing.""" + return + yield # Make it a generator + + def reset(self) -> None: + """Default: no-op.""" + pass diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-B326tmZN.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-B326tmZN.js deleted file mode 100644 index 7d9fe6d3c0..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-B326tmZN.js +++ /dev/null @@ -1 +0,0 @@ -import{r as a,j as s,aW as c,h as x,aE as g,bp as m,bq as p,br as v,bs as b,bt as j}from"./index-B3hlerKe.js";import{a as r}from"./authStore-DATNN-ps.js";const k=a.createContext(null);function A({children:o}){const[n]=a.useState(()=>r);return s.jsx(k.Provider,{value:n,children:o})}function C(){const{token:o,tokenExpiration:n,logout:l}=c(r,e=>e),i=x(e=>e.isLoading),u=g(),d=a.useRef(i);a.useEffect(()=>{d.current=i},[i]);const t=a.useCallback(()=>{const e=()=>{d.current?setTimeout(e,500):(l(),u("/login"))};e()},[l,u]);return a.useEffect(()=>{if(!o||!n)return;const e=Date.now(),h=n-e;if(h<=0){t();return}const f=setTimeout(()=>{t()},h);return()=>clearTimeout(f)},[o,n,t]),null}function S({children:o}){const n=m(),l=c(r,t=>t.isAuthenticated),i=c(r,t=>t.hasHydrated),u=c(r,t=>t.token?.access_token),d=c(r,t=>t.logout);return i?n.pathname==="/login"?o:l&&u?s.jsx(A,{children:s.jsxs(v,{baseUrl:b,auth:{getToken:()=>u,onUnauthorized:d},children:[o,s.jsx(C,{})]})}):s.jsx(j,{to:"/login",replace:!0}):s.jsx(p,{})}export{S as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-CMdWyaYN.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-CMdWyaYN.js new file mode 100644 index 0000000000..7d4ebd03f0 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/AuthGuard-CMdWyaYN.js @@ -0,0 +1 @@ +import{r as s,E as a,a4 as c,ai as x,aJ as g,au as m,av as p,aL as v}from"./useThemeContext-DkrqKvLn.js";import{a as r}from"./authStore-BZmq_GrX.js";import{d as k,I as j}from"./main-BJLJjzL4.js";const A=s.createContext(null);function C({children:o}){const[n]=s.useState(()=>r);return a.jsx(A.Provider,{value:n,children:o})}function E(){const{token:o,tokenExpiration:n,logout:l}=c(r,e=>e),i=k(e=>e.isLoading),u=x(),d=s.useRef(i);s.useEffect(()=>{d.current=i},[i]);const t=s.useCallback(()=>{const e=()=>{d.current?setTimeout(e,500):(l(),u("/login"))};e()},[l,u]);return s.useEffect(()=>{if(!o||!n)return;const e=Date.now(),f=n-e;if(f<=0){t();return}const h=setTimeout(()=>{t()},f);return()=>clearTimeout(h)},[o,n,t]),null}function P({children:o}){const n=g(),l=c(r,t=>t.isAuthenticated),i=c(r,t=>t.hasHydrated),u=c(r,t=>t.token?.access_token),d=c(r,t=>t.logout);return i?n.pathname==="/login"?o:l&&u?a.jsx(C,{children:a.jsxs(m,{baseUrl:p,auth:{getToken:()=>u,onUnauthorized:d},children:[o,a.jsx(E,{})]})}):a.jsx(v,{to:"/login",replace:!0}):a.jsx(j,{})}export{P as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-C8f_Ecrr.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-C8f_Ecrr.js new file mode 100644 index 0000000000..2070c65c2f --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-C8f_Ecrr.js @@ -0,0 +1 @@ +import{ai as A,r as n,E as t,H as K,a7 as c,a8 as i}from"./useThemeContext-DkrqKvLn.js";import{a as V,e as u,h as w,m,D as y,l as W,i as F,j as C}from"./main-BJLJjzL4.js";import{i as G}from"./chunk-SSA7SXE4-BswVq7lY.js";import{d as J,a as L,b as M,m as N}from"./chunk-XHRYXXZA-eia5gCmD.js";import"./useMenuTriggerState-DfYBgrZh.js";import"./useSelectableItem-BR0VPP-3.js";function te(){const{selectConversation:E,deleteConversation:S,newConversation:_,setConversationProperties:$}=V(),h=A(),P=u(w(e=>Object.keys(e.conversations).reverse())),I=u(w(e=>Object.values(e.conversations).reverse().map(s=>s.summary))),O=u(e=>e.currentConversation),[a,B]=n.useState(!1),[f,d]=n.useState(null),[p,o]=n.useState(""),[T,l]=n.useState(!1),x=n.useRef(null),v=a?"Open sidebar":"Close sidebar",D=t.jsx(i,{icon:"heroicons:pencil-square"}),H=(e,s)=>{d(e),o(s??""),l(!0),setTimeout(()=>{x.current?.focus?.(),setTimeout(()=>l(!1),120)},0)},j=e=>{if(f!==e)return;const s=(p||"").trim();s&&$(e,{summary:s}),d(null),o(""),l(!1)},R=()=>{d(null),o(""),l(!1)},k=()=>{const e=_();h(C(e))},q=e=>{E(e),h(C(e))};return t.jsx(m.div,{initial:!1,animate:{maxWidth:a?"4.5rem":"16rem"},className:"rounded-l-medium border-small border-divider ml-4 flex h-full w-full min-w-[4.5rem] flex-grow flex-col space-y-2 overflow-hidden border-r-0 p-4 py-3",children:t.jsxs(K,{children:[t.jsx(y,{content:v,placement:"bottom",children:t.jsx(c,{isIconOnly:!0,"aria-label":v,variant:"ghost",onPress:()=>B(e=>!e),"data-testid":"chat-history-collapse-button",className:"ml-auto",children:t.jsx(i,{icon:a?"heroicons:chevron-double-right":"heroicons:chevron-double-left"})})},"collapse-button"),!a&&t.jsx(m.p,{initial:!1,animate:{opacity:1,width:"100%",height:"auto"},exit:{opacity:0,width:0,height:0,marginBottom:0},className:"text-small text-foreground truncate leading-5 font-semibold",children:"Conversations"},"conversations"),t.jsx(y,{content:"New conversation",placement:"right",children:t.jsx(c,{"aria-label":"New conversation",variant:"ghost",onPress:k,"data-testid":"chat-history-clear-chat-button",startContent:D,isIconOnly:a,children:!a&&"New conversation"})},"new-conversation-button"),!a&&t.jsx(m.div,{className:"mt-2 flex flex-1 flex-col gap-2 overflow-auto overflow-x-hidden",initial:!1,animate:{opacity:1,width:"100%"},exit:{opacity:0,width:0},children:W.zip(P,I).map(([e,s])=>{if(!e||F(e))return null;const g=e===O,z=e===f,b=g?"solid":"light";return t.jsxs("div",{className:"flex w-full justify-between gap-2",children:[z?t.jsx(G,{ref:x,size:"sm",variant:"bordered",value:p,onChange:r=>o(r.target.value),onBlur:()=>{T||j(e)},onKeyDown:r=>{r.key==="Enter"&&j(e),r.key==="Escape"&&R()},className:"flex-1","data-testid":`input-conversation-${e}`}):t.jsx(c,{variant:b,"aria-label":`Select conversation ${e}`,"data-active":g,onPress:()=>q(e),title:s??e,"data-testid":`select-conversation-${e}`,className:"flex-1 justify-start",children:t.jsx("div",{className:"text-small truncate",children:s??e})}),t.jsxs(J,{children:[t.jsx(L,{children:t.jsx(c,{isIconOnly:!0,variant:"light","aria-label":`Conversation actions for ${e}`,"data-testid":`dropdown-conversation-${e}`,children:t.jsx(i,{icon:"heroicons:ellipsis-vertical",className:"rotate-90"})})}),t.jsxs(M,{"aria-label":"Conversation actions",children:[t.jsx(N,{startContent:t.jsx(i,{icon:"heroicons:pencil-square",className:"mb-0.5"}),onPress:()=>H(e,s??e),"data-testid":`edit-conversation-${e}`,children:"Edit"},"edit"),t.jsx(N,{className:"text-danger mb-0.5",color:"danger",startContent:t.jsx(i,{icon:"heroicons:trash"}),onPress:()=>S(e),"data-testid":`delete-conversation-${e}`,children:"Delete conversation"},"delete")]})]})]},`${e}-${b}`)})},"conversation-list")]})})}export{te as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-Cp_DhrUx.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-Cp_DhrUx.js deleted file mode 100644 index e295258856..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-Cp_DhrUx.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C_JcEI3R.js","assets/index-B3hlerKe.js","assets/index-CmsICuOz.css"])))=>i.map(i=>d[i]); -import{r as P,t as ae,k as Xe,Z as W,ax as Me,$ as Ze,j as t,q as me,L as xe,_ as Ye,n as ye,T as Pe,s as et,v as R,V as tt,d as X,l as se,aq as Ie,o as ot,H as ke,a9 as rt,J as Ne,ay as at,ac as pe,U as st,X as _e,af as he,az as nt,aA as lt,ag as it,K as dt,O as be,Q as ct,W as ut,a0 as pt,ah as ft,a2 as K,a3 as Ae,ai as vt,R as ht,aB as bt,a8 as gt,aC as mt,aD as xt,a5 as yt,a as Pt,aE as Ct,i as fe,aF as Ce,aG as ve,D as we,I as Q,as as wt,aH as $t,aI as $e}from"./index-B3hlerKe.js";import{u as jt,b as St,c as je,d as Dt,e as Mt,m as It,$ as kt,a as Nt}from"./useMenuTriggerState-CTz3KfPq.js";import{$ as _t}from"./useSelectableItem-DK6eABKK.js";import{i as At}from"./chunk-SSA7SXE4-BJI2Gxdq.js";var Ot=(e,r)=>{var n;let s=[];const a=(n=P.Children.map(e,d=>P.isValidElement(d)&&d.type===r?(s.push(d),null):d))==null?void 0:n.filter(Boolean),u=s.length>=0?s:void 0;return[a,u]},Ft=ae({base:["w-full","p-1","min-w-[200px]"]});ae({slots:{base:["flex","group","gap-2","items-center","justify-between","relative","px-2","py-1.5","w-full","h-full","box-border","rounded-small","outline-hidden","cursor-pointer","tap-highlight-transparent","data-[pressed=true]:opacity-70",...Xe,"data-[focus-visible=true]:dark:ring-offset-background-content1"],wrapper:"w-full flex flex-col items-start justify-center",title:"flex-1 text-small font-normal truncate",description:["w-full","text-tiny","text-foreground-500","group-hover:text-current"],selectedIcon:["text-inherit","w-3","h-3","shrink-0"],shortcut:["px-1","py-0.5","rounded-sm","font-sans","text-foreground-500","text-tiny","border-small","border-default-300","group-hover:border-current"]},variants:{variant:{solid:{base:""},bordered:{base:"border-medium border-transparent bg-transparent"},light:{base:"bg-transparent"},faded:{base:"border-small border-transparent hover:border-default data-[hover=true]:bg-default-100"},flat:{base:""},shadow:{base:"data-[hover=true]:shadow-lg"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{},false:{}}},defaultVariants:{variant:"solid",color:"default"},compoundVariants:[{variant:"solid",color:"default",class:{base:"data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"solid",color:"primary",class:{base:"data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"solid",color:"secondary",class:{base:"data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"solid",color:"success",class:{base:"data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"solid",color:"warning",class:{base:"data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"solid",color:"danger",class:{base:"data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"shadow",color:"default",class:{base:"data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"shadow",color:"primary",class:{base:"data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"shadow",color:"secondary",class:{base:"data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"shadow",color:"success",class:{base:"data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"shadow",color:"warning",class:{base:"data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"shadow",color:"danger",class:{base:"data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"bordered",color:"default",class:{base:"data-[hover=true]:border-default"}},{variant:"bordered",color:"primary",class:{base:"data-[hover=true]:border-primary data-[hover=true]:text-primary"}},{variant:"bordered",color:"secondary",class:{base:"data-[hover=true]:border-secondary data-[hover=true]:text-secondary"}},{variant:"bordered",color:"success",class:{base:"data-[hover=true]:border-success data-[hover=true]:text-success"}},{variant:"bordered",color:"warning",class:{base:"data-[hover=true]:border-warning data-[hover=true]:text-warning"}},{variant:"bordered",color:"danger",class:{base:"data-[hover=true]:border-danger data-[hover=true]:text-danger"}},{variant:"flat",color:"default",class:{base:"data-[hover=true]:bg-default/40 data-[hover=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{base:"data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary"}},{variant:"flat",color:"secondary",class:{base:"data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary"}},{variant:"flat",color:"success",class:{base:"data-[hover=true]:bg-success/20 data-[hover=true]:text-success "}},{variant:"flat",color:"warning",class:{base:"data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning"}},{variant:"flat",color:"danger",class:{base:"data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger"}},{variant:"faded",color:"default",class:{base:"data-[hover=true]:text-default-foreground"}},{variant:"faded",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"faded",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"faded",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"faded",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"faded",color:"danger",class:{base:"data-[hover=true]:text-danger"}},{variant:"light",color:"default",class:{base:"data-[hover=true]:text-default-500"}},{variant:"light",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"light",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"light",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"light",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"light",color:"danger",class:{base:"data-[hover=true]:text-danger"}}]});ae({slots:{base:"relative mb-2",heading:"pl-1 text-tiny text-foreground-500",group:"data-[has-title=true]:pt-1",divider:"mt-2"}});ae({base:"w-full flex flex-col gap-0.5 p-1"});var Et=(e,r)=>{if(!e&&!r)return{};const n=new Set([...Object.keys(e||{}),...Object.keys(r||{})]);return Array.from(n).reduce((s,a)=>({...s,[a]:W(e?.[a],r?.[a])}),{})},[Tt,Oe]=Me({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),Se=()=>Ye(()=>import("./index-C_JcEI3R.js"),__vite__mapDeps([0,1,2])).then(e=>e.default),Fe=e=>{const{as:r,children:n,className:s,...a}=e,{Component:u,placement:d,backdrop:h,motionProps:l,disableAnimation:c,getPopoverProps:p,getDialogProps:w,getBackdropProps:b,getContentProps:x,isNonModal:I,onClose:j}=Oe(),f=P.useRef(null),{dialogProps:M,titleProps:D}=Ze({},f),y=w({ref:f,...M,...a}),S=r||u||"div",i=t.jsxs(t.Fragment,{children:[!I&&t.jsx(me,{onDismiss:j}),t.jsx(S,{...y,children:t.jsx("div",{...x({className:s}),children:typeof n=="function"?n(D):n})}),t.jsx(me,{onDismiss:j})]}),v=P.useMemo(()=>h==="transparent"?null:c?t.jsx("div",{...b()}):t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"exit",variants:Pe.fade,...b()})}),[h,c,b]),k=d?et(d==="center"?"top":d):void 0,o=t.jsx(t.Fragment,{children:c?i:t.jsx(xe,{features:Se,children:t.jsx(ye.div,{animate:"enter",exit:"exit",initial:"initial",style:k,variants:Pe.scaleSpringOpacity,...l,children:i})})});return t.jsxs("div",{...p(),children:[v,o]})};Fe.displayName="HeroUI.PopoverContent";var Rt=Fe,Ee=e=>{var r;const{triggerRef:n,getTriggerProps:s}=Oe(),{children:a,...u}=e,d=P.useMemo(()=>typeof a=="string"?t.jsx("p",{children:a}):P.Children.only(a),[a]),h=(r=d.props.ref)!=null?r:d.ref,{onPress:l,isDisabled:c,...p}=P.useMemo(()=>s(R(u,d.props),h),[s,d.props,u,h]),[,w]=Ot(a,X),{buttonProps:b}=tt({onPress:l,isDisabled:c},n),x=P.useMemo(()=>w?.[0]!==void 0,[w]);return x||delete p.preventFocusOnPress,P.cloneElement(d,R(p,x?{onPress:l,isDisabled:c}:b))};Ee.displayName="HeroUI.PopoverTrigger";var Ht=Ee,Te=se((e,r)=>{const{children:n,...s}=e,a=jt({...s,ref:r}),[u,d]=P.Children.toArray(n),h=t.jsx(ot,{portalContainer:a.portalContainer,children:d});return t.jsxs(Tt,{value:a,children:[u,a.disableAnimation&&a.isOpen?h:t.jsx(Ie,{children:a.isOpen?h:null})]})});Te.displayName="HeroUI.Popover";var Ut=Te,[Kt,Re]=Me({name:"DropdownContext",errorMessage:"useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"});function Bt(e){const{isSelected:r,disableAnimation:n,...s}=e;return t.jsx("svg",{"aria-hidden":"true","data-selected":r,role:"presentation",viewBox:"0 0 17 18",...s,children:t.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:r?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:n?{}:{transition:"stroke-dashoffset 200ms ease"}})})}const He=new WeakMap;function Vt(e,r,n){let{shouldFocusWrap:s=!0,onKeyDown:a,onKeyUp:u,...d}=e;!e["aria-label"]&&e["aria-labelledby"];let h=ke(e,{labelable:!0}),{listProps:l}=rt({...d,ref:n,selectionManager:r.selectionManager,collection:r.collection,disabledKeys:r.disabledKeys,shouldFocusWrap:s,linkBehavior:"override"});return He.set(r,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:Ne(h,{onKeyDown:a,onKeyUp:u},{role:"menu",...l,onKeyDown:c=>{var p;(c.key!=="Escape"||e.shouldUseVirtualFocus)&&((p=l.onKeyDown)===null||p===void 0||p.call(l,c))}})}}function Lt(e,r,n){let{id:s,key:a,closeOnSelect:u,isVirtualized:d,"aria-haspopup":h,onPressStart:l,onPressUp:c,onPress:p,onPressChange:w,onPressEnd:b,onHoverStart:x,onHoverChange:I,onHoverEnd:j,onKeyDown:f,onKeyUp:M,onFocus:D,onFocusChange:y,onBlur:S,selectionManager:i=r.selectionManager}=e,v=!!h,k=v&&e["aria-expanded"]==="true";var o;let C=(o=e.isDisabled)!==null&&o!==void 0?o:i.isDisabled(a);var _;let A=(_=e.isSelected)!==null&&_!==void 0?_:i.isSelected(a),N=He.get(r),g=r.collection.getItem(a),T=e.onClose||N.onClose,B=at(),$=m=>{var J;if(!v){if(!(g==null||(J=g.props)===null||J===void 0)&&J.onAction?g.props.onAction():e.onAction&&e.onAction(a),N.onAction){let ce=N.onAction;ce(a)}m.target instanceof HTMLAnchorElement&&g&&B.open(m.target,m,g.props.href,g.props.routerOptions)}},E="menuitem";v||(i.selectionMode==="single"?E="menuitemradio":i.selectionMode==="multiple"&&(E="menuitemcheckbox"));let O=pe(),H=pe(),q=pe(),V={id:s,"aria-disabled":C||void 0,role:E,"aria-label":e["aria-label"],"aria-labelledby":O,"aria-describedby":[H,q].filter(Boolean).join(" ")||void 0,"aria-controls":e["aria-controls"],"aria-haspopup":h,"aria-expanded":e["aria-expanded"]};i.selectionMode!=="none"&&!v&&(V["aria-checked"]=A),d&&(V["aria-posinset"]=g?.index,V["aria-setsize"]=St(r.collection));let G=m=>{m.pointerType==="keyboard"&&$(m),l?.(m)},Z=()=>{!v&&T&&(u??(i.selectionMode!=="multiple"||i.isLink(a)))&&T()},Y=m=>{m.pointerType==="mouse"&&($(m),Z()),c?.(m)},ne=m=>{m.pointerType!=="keyboard"&&m.pointerType!=="mouse"&&($(m),Z()),p?.(m)},{itemProps:L,isFocused:ee}=_t({id:s,selectionManager:i,key:a,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:N.shouldUseVirtualFocus}),{pressProps:le,isPressed:te}=st({onPressStart:G,onPress:ne,onPressUp:Y,onPressChange:w,onPressEnd:b,isDisabled:C}),{hoverProps:ie}=_e({isDisabled:C,onHoverStart(m){!he()&&!(k&&h)&&(i.setFocused(!0),i.setFocusedKey(a)),x?.(m)},onHoverChange:I,onHoverEnd:j}),{keyboardProps:oe}=nt({onKeyDown:m=>{if(m.repeat){m.continuePropagation();return}switch(m.key){case" ":!C&&i.selectionMode==="none"&&!v&&u!==!1&&T&&T();break;case"Enter":!C&&u!==!1&&!v&&T&&T();break;default:v||m.continuePropagation(),f?.(m);break}},onKeyUp:M}),{focusProps:U}=lt({onBlur:S,onFocus:D,onFocusChange:y}),re=ke(g?.props);delete re.id;let de=it(g?.props);return{menuItemProps:{...V,...Ne(re,de,v?{onFocus:L.onFocus,"data-collection":L["data-collection"],"data-key":L["data-key"]}:L,le,ie,oe,U,N.shouldUseVirtualFocus||v?{onMouseDown:m=>m.preventDefault()}:void 0),tabIndex:L.tabIndex!=null&&k&&!N.shouldUseVirtualFocus?-1:L.tabIndex},labelProps:{id:O},descriptionProps:{id:H},keyboardShortcutProps:{id:q},isFocused:ee,isFocusVisible:ee&&i.isFocused&&he()&&!k,isSelected:A,isPressed:te,isDisabled:C}}function zt(e){let{heading:r,"aria-label":n}=e,s=dt();return{itemProps:{role:"presentation"},headingProps:r?{id:s,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":r?s:void 0}}}function Wt(e){var r,n;const s=be(),[a,u]=ct(e,je.variantKeys),{as:d,item:h,state:l,shortcut:c,description:p,startContent:w,endContent:b,isVirtualized:x,selectedIcon:I,className:j,classNames:f,onAction:M,autoFocus:D,onPress:y,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,onHoverStart:o,onHoverChange:C,onHoverEnd:_,hideSelectedIcon:A=!1,isReadOnly:N=!1,closeOnSelect:g,onClose:T,onClick:B,...$}=a,E=(n=(r=e.disableAnimation)!=null?r:s?.disableAnimation)!=null?n:!1,O=P.useRef(null),H=d||($?.href?"a":"li"),q=typeof H=="string",{rendered:V,key:G}=h,Z=l.disabledKeys.has(G)||e.isDisabled,Y=l.selectionManager.selectionMode!=="none",ne=Dt(),{isFocusVisible:L,focusProps:ee}=ut({autoFocus:D}),le=P.useCallback(F=>{B?.(F),y?.(F)},[B,y]),{isPressed:te,isFocused:ie,isSelected:oe,isDisabled:U,menuItemProps:re,labelProps:de,descriptionProps:m,keyboardShortcutProps:J}=Lt({key:G,onClose:T,isDisabled:Z,onPress:le,onPressStart:S,onPressUp:i,onPressEnd:v,onPressChange:k,"aria-label":a["aria-label"],closeOnSelect:g,isVirtualized:x,onAction:M},l,O);let{hoverProps:ce,isHovered:ge}=_e({isDisabled:U,onHoverStart(F){he()||(l.selectionManager.setFocused(!0),l.selectionManager.setFocusedKey(G)),o?.(F)},onHoverChange:C,onHoverEnd:_}),ue=re;const z=P.useMemo(()=>je({...u,isDisabled:U,disableAnimation:E,hasTitleTextChild:typeof V=="string",hasDescriptionTextChild:typeof p=="string"}),[pt(u),U,E,V,p]),ze=W(f?.base,j);N&&(ue=ft(ue));const We=(F={})=>({ref:O,...R(N?{}:ee,Ae($,{enabled:q}),ue,ce,F),"data-focus":K(ie),"data-selectable":K(Y),"data-hover":K(ne?ge||te:ge),"data-disabled":K(U),"data-selected":K(oe),"data-pressed":K(te),"data-focus-visible":K(L),className:z.base({class:W(ze,F.className)})}),qe=(F={})=>({...R(de,F),className:z.title({class:f?.title})}),Ge=(F={})=>({...R(m,F),className:z.description({class:f?.description})}),Je=(F={})=>({...R(J,F),className:z.shortcut({class:f?.shortcut})}),Qe=P.useCallback((F={})=>({"aria-hidden":K(!0),"data-disabled":K(U),className:z.selectedIcon({class:f?.selectedIcon}),...F}),[U,z,f]);return{Component:H,domRef:O,slots:z,classNames:f,isSelectable:Y,isSelected:oe,isDisabled:U,rendered:V,shortcut:c,description:p,startContent:w,endContent:b,selectedIcon:I,disableAnimation:E,getItemProps:We,getLabelProps:qe,hideSelectedIcon:A,getDescriptionProps:Ge,getKeyboardShortcutProps:Je,getSelectedIconProps:Qe}}var Ue=e=>{const{Component:r,slots:n,classNames:s,rendered:a,shortcut:u,description:d,isSelectable:h,isSelected:l,isDisabled:c,selectedIcon:p,startContent:w,endContent:b,disableAnimation:x,hideSelectedIcon:I,getItemProps:j,getLabelProps:f,getDescriptionProps:M,getKeyboardShortcutProps:D,getSelectedIconProps:y}=Wt(e),S=P.useMemo(()=>{const i=t.jsx(Bt,{disableAnimation:x,isSelected:l});return typeof p=="function"?p({icon:i,isSelected:l,isDisabled:c}):p||i},[p,l,c,x]);return t.jsxs(r,{...j(),children:[w,d?t.jsxs("div",{className:n.wrapper({class:s?.wrapper}),children:[t.jsx("span",{...f(),children:a}),t.jsx("span",{...M(),children:d})]}):t.jsx("span",{...f(),children:a}),u&&t.jsx("kbd",{...D(),children:u}),h&&!I&&t.jsx("span",{...y(),children:S}),b]})};Ue.displayName="HeroUI.MenuItem";var Ke=Ue,Be=se(({item:e,state:r,as:n,variant:s,color:a,disableAnimation:u,onAction:d,closeOnSelect:h,className:l,classNames:c,showDivider:p=!1,hideSelectedIcon:w,dividerProps:b={},itemClasses:x,title:I,...j},f)=>{const M=n||"li",D=P.useMemo(()=>Mt(),[]),y=W(c?.base,l),S=W(c?.divider,b?.className),{itemProps:i,headingProps:v,groupProps:k}=zt({heading:e.rendered,"aria-label":e["aria-label"]});return t.jsxs(M,{"data-slot":"base",...R(i,j),className:D.base({class:y}),children:[e.rendered&&t.jsx("span",{...v,className:D.heading({class:c?.heading}),"data-slot":"heading",children:e.rendered}),t.jsxs("ul",{...k,className:D.group({class:c?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map(o=>{const{key:C,props:_}=o;let A=t.jsx(Ke,{classNames:x,closeOnSelect:h,color:a,disableAnimation:u,hideSelectedIcon:w,item:o,state:r,variant:s,onAction:d,..._},C);return o.wrapper&&(A=o.wrapper(A)),A}),p&&t.jsx(vt,{as:"li",className:D.divider({class:S}),...b})]})]})});Be.displayName="HeroUI.MenuSection";var qt=Be;function Gt(e){var r;const n=be(),{as:s,ref:a,variant:u,color:d,children:h,disableAnimation:l=(r=n?.disableAnimation)!=null?r:!1,onAction:c,closeOnSelect:p,itemClasses:w,className:b,state:x,topContent:I,bottomContent:j,hideEmptyContent:f=!1,hideSelectedIcon:M=!1,emptyContent:D="No items.",menuProps:y,onClose:S,classNames:i,...v}=e,k=s||"ul",o=ht(a),C=typeof k=="string",_=bt({...v,...y,children:h}),A=x||_,{menuProps:N}=Vt({...v,...y,onAction:c},A,o),g=P.useMemo(()=>It({className:b}),[b]),T=W(i?.base,b);return{Component:k,state:A,variant:u,color:d,disableAnimation:l,onClose:S,topContent:I,bottomContent:j,closeOnSelect:p,className:b,itemClasses:w,getBaseProps:(O={})=>({ref:o,"data-slot":"base",className:g.base({class:T}),...Ae(v,{enabled:C}),...O}),getListProps:(O={})=>({"data-slot":"list",className:g.list({class:i?.list}),...N,...O}),hideEmptyContent:f,hideSelectedIcon:M,getEmptyContentProps:(O={})=>({children:D,className:g.emptyContent({class:i?.emptyContent}),...O})}}var Jt=se(function(r,n){const{Component:s,state:a,closeOnSelect:u,color:d,disableAnimation:h,hideSelectedIcon:l,hideEmptyContent:c,variant:p,onClose:w,topContent:b,bottomContent:x,itemClasses:I,getBaseProps:j,getListProps:f,getEmptyContentProps:M}=Gt({...r,ref:n}),D=t.jsxs(s,{...f(),children:[!a.collection.size&&!c&&t.jsx("li",{children:t.jsx("div",{...M()})}),[...a.collection].map(y=>{const S={closeOnSelect:u,color:d,disableAnimation:h,item:y,state:a,variant:p,onClose:w,hideSelectedIcon:l,...y.props},i=Et(I,S?.classNames);if(y.type==="section")return t.jsx(qt,{...S,itemClasses:i},y.key);let v=t.jsx(Ke,{...S,classNames:i},y.key);return y.wrapper&&(v=y.wrapper(v)),v})]});return t.jsxs("div",{...j(),children:[b,D,x]})}),Qt=Jt,Xt=gt,De=Xt,Zt=se(function(r,n){const{getMenuProps:s}=Re();return t.jsx(Rt,{children:t.jsx(mt,{contain:!0,restoreFocus:!0,children:t.jsx(Qt,{...s(r,n)})})})}),Yt=Zt,Ve=e=>{const{getMenuTriggerProps:r}=Re(),{children:n,...s}=e;return t.jsx(Ht,{...r(s),children:n})};Ve.displayName="HeroUI.DropdownTrigger";var eo=Ve,to=(e,r)=>{if(e){const n=Array.isArray(e.children)?e.children:[...e?.items||[]];if(n&&n.length)return n.find(a=>{if(a&&a.key===r)return a})||{}}return null},oo=(e,r,n)=>{const s=n||to(e,r);return s&&s.props&&"closeOnSelect"in s.props?s.props.closeOnSelect:e?.closeOnSelect};function ro(e){var r;const n=be(),{as:s,triggerRef:a,isOpen:u,defaultOpen:d,onOpenChange:h,isDisabled:l,type:c="menu",trigger:p="press",placement:w="bottom",closeOnSelect:b=!0,shouldBlockScroll:x=!0,classNames:I,disableAnimation:j=(r=n?.disableAnimation)!=null?r:!1,onClose:f,className:M,...D}=e,y=s||"div",S=P.useRef(null),i=a||S,v=P.useRef(null),k=P.useRef(null),o=kt({trigger:p,isOpen:u,defaultOpen:d,onOpenChange:$=>{h?.($),$||f?.()}}),{menuTriggerProps:C,menuProps:_}=Nt({type:c,trigger:p,isDisabled:l},o,i),A=P.useMemo(()=>Ft({className:M}),[M]),N=$=>{$!==void 0&&!$||b&&o.close()},g=($={})=>{const E=R(D,$);return{state:o,placement:w,ref:k,disableAnimation:j,shouldBlockScroll:x,scrollRef:v,triggerRef:i,...E,classNames:{...I,...$.classNames,content:W(A,I?.content,$.className)}}},T=($={})=>{const{onPress:E,onPressStart:O,...H}=C;return R(H,{isDisabled:l},$)},B=($,E=null)=>({ref:xt(E,v),menuProps:_,closeOnSelect:b,...R($,{onAction:(O,H)=>{const q=oo($,O,H);N(q)},onClose:o.close})});return{Component:y,menuRef:v,menuProps:_,closeOnSelect:b,onClose:o.close,autoFocus:o.focusStrategy||!0,disableAnimation:j,getPopoverProps:g,getMenuProps:B,getMenuTriggerProps:T}}var Le=e=>{const{children:r,...n}=e,s=ro(n),[a,u]=yt.Children.toArray(r);return t.jsx(Kt,{value:s,children:t.jsxs(Ut,{...s.getPopoverProps(),children:[a,u]})})};Le.displayName="HeroUI.Dropdown";var ao=Le;function co(){const{selectConversation:e,deleteConversation:r,newConversation:n,setConversationProperties:s}=Pt(),a=Ct(),u=fe(Ce(o=>Object.keys(o.conversations).reverse())),d=fe(Ce(o=>Object.values(o.conversations).reverse().map(C=>C.summary))),h=fe(o=>o.currentConversation),[l,c]=P.useState(!1),[p,w]=P.useState(null),[b,x]=P.useState(""),[I,j]=P.useState(!1),f=P.useRef(null),M=l?"Open sidebar":"Close sidebar",D=t.jsx(Q,{icon:"heroicons:pencil-square"}),y=(o,C)=>{w(o),x(C??""),j(!0),setTimeout(()=>{f.current?.focus?.(),setTimeout(()=>j(!1),120)},0)},S=o=>{if(p!==o)return;const C=(b||"").trim();C&&s(o,{summary:C}),w(null),x(""),j(!1)},i=()=>{w(null),x(""),j(!1)},v=()=>{const o=n();a($e(o))},k=o=>{e(o),a($e(o))};return t.jsx(ve.div,{initial:!1,animate:{maxWidth:l?"4.5rem":"16rem"},className:"rounded-l-medium border-small border-divider ml-4 flex h-full w-full min-w-[4.5rem] flex-grow flex-col space-y-2 overflow-hidden border-r-0 p-4 py-3",children:t.jsxs(Ie,{children:[t.jsx(we,{content:M,placement:"bottom",children:t.jsx(X,{isIconOnly:!0,"aria-label":M,variant:"ghost",onPress:()=>c(o=>!o),"data-testid":"chat-history-collapse-button",className:"ml-auto",children:t.jsx(Q,{icon:l?"heroicons:chevron-double-right":"heroicons:chevron-double-left"})})},"collapse-button"),!l&&t.jsx(ve.p,{initial:!1,animate:{opacity:1,width:"100%",height:"auto"},exit:{opacity:0,width:0,height:0,marginBottom:0},className:"text-small text-foreground truncate leading-5 font-semibold",children:"Conversations"},"conversations"),t.jsx(we,{content:"New conversation",placement:"right",children:t.jsx(X,{"aria-label":"New conversation",variant:"ghost",onPress:v,"data-testid":"chat-history-clear-chat-button",startContent:D,isIconOnly:l,children:!l&&"New conversation"})},"new-conversation-button"),!l&&t.jsx(ve.div,{className:"mt-2 flex flex-1 flex-col gap-2 overflow-auto overflow-x-hidden",initial:!1,animate:{opacity:1,width:"100%"},exit:{opacity:0,width:0},children:wt.zip(u,d).map(([o,C])=>{if(!o||$t(o))return null;const _=o===h,A=o===p,N=_?"solid":"light";return t.jsxs("div",{className:"flex w-full justify-between gap-2",children:[A?t.jsx(At,{ref:f,size:"sm",variant:"bordered",value:b,onChange:g=>x(g.target.value),onBlur:()=>{I||S(o)},onKeyDown:g=>{g.key==="Enter"&&S(o),g.key==="Escape"&&i()},className:"flex-1","data-testid":`input-conversation-${o}`}):t.jsx(X,{variant:N,"aria-label":`Select conversation ${o}`,"data-active":_,onPress:()=>k(o),title:C??o,"data-testid":`select-conversation-${o}`,className:"flex-1 justify-start",children:t.jsx("div",{className:"text-small truncate",children:C??o})}),t.jsxs(ao,{children:[t.jsx(eo,{children:t.jsx(X,{isIconOnly:!0,variant:"light","aria-label":`Conversation actions for ${o}`,"data-testid":`dropdown-conversation-${o}`,children:t.jsx(Q,{icon:"heroicons:ellipsis-vertical",className:"rotate-90"})})}),t.jsxs(Yt,{"aria-label":"Conversation actions",children:[t.jsx(De,{startContent:t.jsx(Q,{icon:"heroicons:pencil-square",className:"mb-0.5"}),onPress:()=>y(o,C??o),"data-testid":`edit-conversation-${o}`,children:"Edit"},"edit"),t.jsx(De,{className:"text-danger mb-0.5",color:"danger",startContent:t.jsx(Q,{icon:"heroicons:trash"}),onPress:()=>r(o),"data-testid":`delete-conversation-${o}`,children:"Delete conversation"},"delete")]})]})]},`${o}-${N}`)})},"conversation-list")]})})}export{co as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-CNjzbIqN.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-CNjzbIqN.js deleted file mode 100644 index 8ce092d860..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-CNjzbIqN.js +++ /dev/null @@ -1 +0,0 @@ -import{g as z,r as f,u as ie,h as ce,a as ue,i as le,b as fe,p as Y,C as Q,j as l,D as de,d as A,I as me,m as ge,e as he,f as pe}from"./index-B3hlerKe.js";import{g as Z,v as W,F as ve,t as be}from"./index-B7bSwAmw.js";import{m as Se}from"./chunk-IGSAU2ZA-CsJAveMU.js";import"./chunk-SSA7SXE4-BJI2Gxdq.js";import"./useMenuTriggerState-CTz3KfPq.js";import"./useSelectableItem-DK6eABKK.js";import"./index-v15bx9Do.js";var B,V;function xe(){if(V)return B;V=1;var n="Expected a function",t=NaN,s="[object Symbol]",m=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,i=/^0o[0-7]+$/i,b=parseInt,S=typeof z=="object"&&z&&z.Object===Object&&z,y=typeof self=="object"&&self&&self.Object===Object&&self,C=S||y||Function("return this")(),d=Object.prototype,r=d.toString,c=Math.max,O=Math.min,E=function(){return C.Date.now()};function $(e,u,v){var T,L,P,I,p,j,R=0,G=!1,D=!1,k=!0;if(typeof e!="function")throw new TypeError(n);u=q(u)||0,_(v)&&(G=!!v.leading,D="maxWait"in v,P=D?c(q(v.maxWait)||0,u):P,k="trailing"in v?!!v.trailing:k);function H(o){var x=T,F=L;return T=L=void 0,R=o,I=e.apply(F,x),I}function re(o){return R=o,p=setTimeout(N,u),G?H(o):I}function oe(o){var x=o-j,F=o-R,X=u-x;return D?O(X,P-F):X}function U(o){var x=o-j,F=o-R;return j===void 0||x>=u||x<0||D&&F>=P}function N(){var o=E();if(U(o))return K(o);p=setTimeout(N,oe(o))}function K(o){return p=void 0,k&&T?H(o):(T=L=void 0,I)}function se(){p!==void 0&&clearTimeout(p),R=0,T=j=L=p=void 0}function ae(){return p===void 0?I:K(E())}function M(){var o=E(),x=U(o);if(T=arguments,L=this,j=o,x){if(p===void 0)return re(j);if(D)return p=setTimeout(N,u),H(j)}return p===void 0&&(p=setTimeout(N,u)),I}return M.cancel=se,M.flush=ae,M}function _(e){var u=typeof e;return!!e&&(u=="object"||u=="function")}function a(e){return!!e&&typeof e=="object"}function w(e){return typeof e=="symbol"||a(e)&&r.call(e)==s}function q(e){if(typeof e=="number")return e;if(w(e))return t;if(_(e)){var u=typeof e.valueOf=="function"?e.valueOf():e;e=_(u)?u+"":u}if(typeof e!="string")return e===0?e:+e;e=e.replace(m,"");var v=h.test(e);return v||i.test(e)?b(e.slice(2),v?2:8):g.test(e)?t:+e}return B=$,B}xe();var ne=typeof window<"u"?f.useLayoutEffect:f.useEffect;function ee(n,t,s,m){const g=f.useRef(t);ne(()=>{g.current=t},[t]),f.useEffect(()=>{const h=window;if(!(h&&h.addEventListener))return;const i=b=>{g.current(b)};return h.addEventListener(n,i,m),()=>{h.removeEventListener(n,i,m)}},[n,s,m])}function te(n){const t=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return ne(()=>{t.current=n},[n]),f.useCallback((...s)=>{var m;return(m=t.current)==null?void 0:m.call(t,...s)},[t])}var J=typeof window>"u";function ye(n,t,s={}){const{initializeWithValue:m=!0}=s,g=f.useCallback(r=>s.serializer?s.serializer(r):JSON.stringify(r),[s]),h=f.useCallback(r=>{if(s.deserializer)return s.deserializer(r);if(r==="undefined")return;const c=t instanceof Function?t():t;let O;try{O=JSON.parse(r)}catch(E){return console.error("Error parsing JSON:",E),c}return O},[s,t]),i=f.useCallback(()=>{const r=t instanceof Function?t():t;if(J)return r;try{const c=window.localStorage.getItem(n);return c?h(c):r}catch(c){return console.warn(`Error reading localStorage key “${n}”:`,c),r}},[t,n,h]),[b,S]=f.useState(()=>m?i():t instanceof Function?t():t),y=te(r=>{J&&console.warn(`Tried setting localStorage key “${n}” even though environment is not a client`);try{const c=r instanceof Function?r(i()):r;window.localStorage.setItem(n,g(c)),S(c),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}catch(c){console.warn(`Error setting localStorage key “${n}”:`,c)}}),C=te(()=>{J&&console.warn(`Tried removing localStorage key “${n}” even though environment is not a client`);const r=t instanceof Function?t():t;window.localStorage.removeItem(n),S(r),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))});f.useEffect(()=>{S(i())},[n]);const d=f.useCallback(r=>{r.key&&r.key!==n||S(i())},[n,i]);return ee("storage",d),ee("local-storage",d),[b,y,C]}const Ce="ragbits-no-history-chat-options";function Le(){const{isOpen:n,onOpen:t,onClose:s}=ie(),m=ce(a=>a.chatOptions),g=f.useRef(null),{setConversationProperties:h,initializeChatOptions:i}=ue(),b=le(a=>a.currentConversation),{config:{user_settings:S}}=fe(),[y,C]=ye(Ce,null),d=S?.form,r=a=>{Y.isPluginActivated(Q.name)||C(a)},c=()=>{t()},O=(a,w)=>{w.preventDefault(),g.current=a.formData,s()},E=()=>{if(!d)return;const a=Z(W,d);g.current=a,s()},$=()=>{s()},_=a=>{if(a!=="exit"||!g.current)return;const w=g.current;h(b,{chatOptions:w}),r(w),g.current=null};return f.useEffect(()=>{if(!d)return;const a=Z(W,d);Y.isPluginActivated(Q.name)?i(a):y!==null?i(y):(i(a),C(a))},[i,d,b,y,C]),d?l.jsxs(l.Fragment,{children:[l.jsx(de,{content:"Chat Options",placement:"bottom",children:l.jsx(A,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open chat options",onPress:c,"data-testid":"open-chat-options",children:l.jsx(me,{icon:"heroicons:cog-6-tooth"})})}),l.jsx(ge,{isOpen:n,onOpenChange:$,motionProps:{onAnimationComplete:_},children:l.jsxs(he,{children:[l.jsx(Se,{className:"text-default-900 flex flex-col gap-1",children:d.title||"Chat Options"}),l.jsx(pe,{children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsx(ve,{schema:d,validator:W,formData:m,onSubmit:O,transformErrors:be,liveValidate:!0,children:l.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[l.jsx(A,{className:"mr-auto",color:"primary",variant:"light",onPress:E,"aria-label":"Restore default user settings",children:"Restore defaults"}),l.jsx(A,{color:"danger",variant:"light",onPress:s,"aria-label":"Close chat options form",children:"Cancel"}),l.jsx(A,{color:"primary",type:"submit","aria-label":"Save chat options","data-testid":"chat-options-submit",children:"Save"})]})})})})]})})]}):null}export{Le as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-Cu-K6fNh.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-Cu-K6fNh.js new file mode 100644 index 0000000000..7ad0ea5290 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-Cu-K6fNh.js @@ -0,0 +1 @@ +import{a1 as z,r as f,E as l,a7 as A,a8 as ie,a9 as ce,aa as ue,ab as le}from"./useThemeContext-DkrqKvLn.js";import{u as fe,d as de,a as me,e as ge,b as he,p as Y,C as Q,D as pe}from"./main-BJLJjzL4.js";import{g as Z,v as W,F as be,t as ve}from"./index-DKFkwhs4.js";import{m as Se}from"./chunk-IGSAU2ZA-CRWCDn7K.js";import"./chunk-SSA7SXE4-BswVq7lY.js";import"./chunk-Y2AYO5NJ-Crd-u0HB.js";import"./useMenuTriggerState-DfYBgrZh.js";import"./useSelectableItem-BR0VPP-3.js";import"./index-B9NaYZAN.js";var B,V;function xe(){if(V)return B;V=1;var n="Expected a function",t=NaN,s="[object Symbol]",m=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,i=/^0o[0-7]+$/i,v=parseInt,S=typeof z=="object"&&z&&z.Object===Object&&z,y=typeof self=="object"&&self&&self.Object===Object&&self,C=S||y||Function("return this")(),d=Object.prototype,r=d.toString,c=Math.max,O=Math.min,E=function(){return C.Date.now()};function $(e,u,b){var T,L,P,I,p,j,R=0,G=!1,D=!1,k=!0;if(typeof e!="function")throw new TypeError(n);u=q(u)||0,_(b)&&(G=!!b.leading,D="maxWait"in b,P=D?c(q(b.maxWait)||0,u):P,k="trailing"in b?!!b.trailing:k);function H(o){var x=T,F=L;return T=L=void 0,R=o,I=e.apply(F,x),I}function re(o){return R=o,p=setTimeout(N,u),G?H(o):I}function oe(o){var x=o-j,F=o-R,X=u-x;return D?O(X,P-F):X}function U(o){var x=o-j,F=o-R;return j===void 0||x>=u||x<0||D&&F>=P}function N(){var o=E();if(U(o))return K(o);p=setTimeout(N,oe(o))}function K(o){return p=void 0,k&&T?H(o):(T=L=void 0,I)}function se(){p!==void 0&&clearTimeout(p),R=0,T=j=L=p=void 0}function ae(){return p===void 0?I:K(E())}function M(){var o=E(),x=U(o);if(T=arguments,L=this,j=o,x){if(p===void 0)return re(j);if(D)return p=setTimeout(N,u),H(j)}return p===void 0&&(p=setTimeout(N,u)),I}return M.cancel=se,M.flush=ae,M}function _(e){var u=typeof e;return!!e&&(u=="object"||u=="function")}function a(e){return!!e&&typeof e=="object"}function w(e){return typeof e=="symbol"||a(e)&&r.call(e)==s}function q(e){if(typeof e=="number")return e;if(w(e))return t;if(_(e)){var u=typeof e.valueOf=="function"?e.valueOf():e;e=_(u)?u+"":u}if(typeof e!="string")return e===0?e:+e;e=e.replace(m,"");var b=h.test(e);return b||i.test(e)?v(e.slice(2),b?2:8):g.test(e)?t:+e}return B=$,B}xe();var ne=typeof window<"u"?f.useLayoutEffect:f.useEffect;function ee(n,t,s,m){const g=f.useRef(t);ne(()=>{g.current=t},[t]),f.useEffect(()=>{const h=window;if(!(h&&h.addEventListener))return;const i=v=>{g.current(v)};return h.addEventListener(n,i,m),()=>{h.removeEventListener(n,i,m)}},[n,s,m])}function te(n){const t=f.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return ne(()=>{t.current=n},[n]),f.useCallback((...s)=>{var m;return(m=t.current)==null?void 0:m.call(t,...s)},[t])}var J=typeof window>"u";function ye(n,t,s={}){const{initializeWithValue:m=!0}=s,g=f.useCallback(r=>s.serializer?s.serializer(r):JSON.stringify(r),[s]),h=f.useCallback(r=>{if(s.deserializer)return s.deserializer(r);if(r==="undefined")return;const c=t instanceof Function?t():t;let O;try{O=JSON.parse(r)}catch(E){return console.error("Error parsing JSON:",E),c}return O},[s,t]),i=f.useCallback(()=>{const r=t instanceof Function?t():t;if(J)return r;try{const c=window.localStorage.getItem(n);return c?h(c):r}catch(c){return console.warn(`Error reading localStorage key “${n}”:`,c),r}},[t,n,h]),[v,S]=f.useState(()=>m?i():t instanceof Function?t():t),y=te(r=>{J&&console.warn(`Tried setting localStorage key “${n}” even though environment is not a client`);try{const c=r instanceof Function?r(i()):r;window.localStorage.setItem(n,g(c)),S(c),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))}catch(c){console.warn(`Error setting localStorage key “${n}”:`,c)}}),C=te(()=>{J&&console.warn(`Tried removing localStorage key “${n}” even though environment is not a client`);const r=t instanceof Function?t():t;window.localStorage.removeItem(n),S(r),window.dispatchEvent(new StorageEvent("local-storage",{key:n}))});f.useEffect(()=>{S(i())},[n]);const d=f.useCallback(r=>{r.key&&r.key!==n||S(i())},[n,i]);return ee("storage",d),ee("local-storage",d),[v,y,C]}const Ce="ragbits-no-history-chat-options";function De(){const{isOpen:n,onOpen:t,onClose:s}=fe(),m=de(a=>a.chatOptions),g=f.useRef(null),{setConversationProperties:h,initializeChatOptions:i}=me(),v=ge(a=>a.currentConversation),{config:{user_settings:S}}=he(),[y,C]=ye(Ce,null),d=S?.form,r=a=>{Y.isPluginActivated(Q.name)||C(a)},c=()=>{t()},O=(a,w)=>{w.preventDefault(),g.current=a.formData,s()},E=()=>{if(!d)return;const a=Z(W,d);g.current=a,s()},$=()=>{s()},_=a=>{if(a!=="exit"||!g.current)return;const w=g.current;h(v,{chatOptions:w}),r(w),g.current=null};return f.useEffect(()=>{if(!d)return;const a=Z(W,d);Y.isPluginActivated(Q.name)?i(a):y!==null?i(y):(i(a),C(a))},[i,d,v,y,C]),d?l.jsxs(l.Fragment,{children:[l.jsx(pe,{content:"Chat Options",placement:"bottom",children:l.jsx(A,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open chat options",onPress:c,"data-testid":"open-chat-options",children:l.jsx(ie,{icon:"heroicons:cog-6-tooth"})})}),l.jsx(ce,{isOpen:n,onOpenChange:$,motionProps:{onAnimationComplete:_},children:l.jsxs(ue,{children:[l.jsx(Se,{className:"text-default-900 flex flex-col gap-1",children:d.title||"Chat Options"}),l.jsx(le,{children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsx(be,{schema:d,validator:W,formData:m,onSubmit:O,transformErrors:ve,liveValidate:!0,children:l.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[l.jsx(A,{className:"mr-auto",color:"primary",variant:"light",onPress:E,"aria-label":"Restore default user settings",children:"Restore defaults"}),l.jsx(A,{color:"danger",variant:"light",onPress:s,"aria-label":"Close chat options form",children:"Cancel"}),l.jsx(A,{color:"primary",type:"submit","aria-label":"Save chat options","data-testid":"chat-options-submit",children:"Save"})]})})})})]})})]}):null}export{De as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-CmRSbYPS.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-CmRSbYPS.js deleted file mode 100644 index c2e67e4c4e..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-CmRSbYPS.js +++ /dev/null @@ -1 +0,0 @@ -import{u as g,a as v,b as C,r as _,F as s,c as T,j as e,D as b,d as n,I as u,m as w,e as D,f as I}from"./index-B3hlerKe.js";import{F as O,t as S,v as E}from"./index-B7bSwAmw.js";import{m as N}from"./chunk-IGSAU2ZA-CsJAveMU.js";import"./chunk-SSA7SXE4-BJI2Gxdq.js";import"./useMenuTriggerState-CTz3KfPq.js";import"./useSelectableItem-DK6eABKK.js";import"./index-v15bx9Do.js";function z({message:t}){const{isOpen:f,onOpen:h,onClose:r}=g(),{mergeExtensions:p}=v(),{config:{feedback:o}}=C(),[i,x]=_.useState(s.Like),k=T("/api/feedback",{headers:{"Content-Type":"application/json"},method:"POST"}),l=o[i].form,j=()=>{r()},c=async a=>{if(!t.serverId)throw new Error('Feedback is only available for messages with "serverId" set');try{await k.call({body:{message_id:t.serverId,feedback:i,payload:a??{}}})}catch(F){console.error(F)}},y=a=>{p(t.id,{feedbackType:i}),c(a.formData),r()},d=async a=>{if(x(a),o[a].form===null){await c(null);return}h()};if(!l)return null;const m=t.extensions?.feedbackType;return e.jsxs(e.Fragment,{children:[o.like.enabled&&e.jsx(b,{content:"Like",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as helpful",onPress:()=>d(s.Like),"data-testid":"feedback-like",children:e.jsx(u,{icon:m===s.Like?"heroicons:hand-thumb-up-solid":"heroicons:hand-thumb-up"})})}),o.dislike.enabled&&e.jsx(b,{content:"Dislike",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as unhelpful",onPress:()=>d(s.Dislike),"data-testid":"feedback-dislike",children:e.jsx(u,{icon:m===s.Dislike?"heroicons:hand-thumb-down-solid":"heroicons:hand-thumb-down"})})}),e.jsx(w,{isOpen:f,onOpenChange:j,children:e.jsx(D,{children:a=>e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"text-default-900 flex flex-col gap-1",children:l.title}),e.jsx(I,{children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(O,{schema:l,validator:E,onSubmit:y,transformErrors:S,liveValidate:!0,children:e.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[e.jsx(n,{color:"danger",variant:"light",onPress:a,"aria-label":"Close feedback form",children:"Cancel"}),e.jsx(n,{color:"primary",type:"submit","aria-label":"Submit feedback","data-testid":"feedback-submit",children:"Submit"})]})})})})]})})})]})}export{z as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-DTURkDjZ.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-DTURkDjZ.js new file mode 100644 index 0000000000..552509b775 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-DTURkDjZ.js @@ -0,0 +1 @@ +import{r as g,E as e,a7 as n,a8 as b,a9 as v,aa as C,ab as _}from"./useThemeContext-DkrqKvLn.js";import{u as T,a as w,b as D,F as s,c as O,D as u}from"./main-BJLJjzL4.js";import{F as S,t as E,v as I}from"./index-DKFkwhs4.js";import{m as N}from"./chunk-IGSAU2ZA-CRWCDn7K.js";import"./chunk-SSA7SXE4-BswVq7lY.js";import"./chunk-Y2AYO5NJ-Crd-u0HB.js";import"./useMenuTriggerState-DfYBgrZh.js";import"./useSelectableItem-BR0VPP-3.js";import"./index-B9NaYZAN.js";function G({message:t}){const{isOpen:f,onOpen:h,onClose:l}=T(),{mergeExtensions:p}=w(),{config:{feedback:o}}=D(),[i,x]=g.useState(s.Like),k=O("/api/feedback",{headers:{"Content-Type":"application/json"},method:"POST"}),r=o[i].form,j=()=>{l()},c=async a=>{if(!t.serverId)throw new Error('Feedback is only available for messages with "serverId" set');try{await k.call({body:{message_id:t.serverId,feedback:i,payload:a??{}}})}catch(F){console.error(F)}},y=a=>{p(t.id,{feedbackType:i}),c(a.formData),l()},d=async a=>{if(x(a),o[a].form===null){await c(null);return}h()};if(!r)return null;const m=t.extensions?.feedbackType;return e.jsxs(e.Fragment,{children:[o.like.enabled&&e.jsx(u,{content:"Like",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as helpful",onPress:()=>d(s.Like),"data-testid":"feedback-like",children:e.jsx(b,{icon:m===s.Like?"heroicons:hand-thumb-up-solid":"heroicons:hand-thumb-up"})})}),o.dislike.enabled&&e.jsx(u,{content:"Dislike",placement:"bottom",children:e.jsx(n,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Rate message as unhelpful",onPress:()=>d(s.Dislike),"data-testid":"feedback-dislike",children:e.jsx(b,{icon:m===s.Dislike?"heroicons:hand-thumb-down-solid":"heroicons:hand-thumb-down"})})}),e.jsx(v,{isOpen:f,onOpenChange:j,children:e.jsx(C,{children:a=>e.jsxs(e.Fragment,{children:[e.jsx(N,{className:"text-default-900 flex flex-col gap-1",children:r.title}),e.jsx(_,{children:e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(S,{schema:r,validator:I,onSubmit:y,transformErrors:E,liveValidate:!0,children:e.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[e.jsx(n,{color:"danger",variant:"light",onPress:a,"aria-label":"Close feedback form",children:"Cancel"}),e.jsx(n,{color:"primary",type:"submit","aria-label":"Submit feedback","data-testid":"feedback-submit",children:"Submit"})]})})})})]})})})]})}export{G as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-CKTxWXmQ.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-CKTxWXmQ.js new file mode 100644 index 0000000000..a35624c9e1 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-CKTxWXmQ.js @@ -0,0 +1 @@ +import{r as o,a4 as w,ai as y,E as e,H as S,a7 as b,a2 as j}from"./useThemeContext-DkrqKvLn.js";import{H as v,c as C,m as P}from"./main-BJLJjzL4.js";import{a as E}from"./authStore-BZmq_GrX.js";import{i as c}from"./chunk-SSA7SXE4-BswVq7lY.js";const N=()=>{const a=o.useContext(v);if(!a)throw new Error("useInitializeUserStore must be used within a HistoryStoreContextProvider");return a.initializeUserStore};function _(){const[a,m]=o.useState({username:"",password:""}),u=C("/api/auth/login",{headers:{"Content-Type":"application/json"},method:"POST"}),p=w(E,s=>s.login),g=y(),x=N(),[f,n]=o.useState(!1),h=async s=>{n(!1),s.preventDefault(),s.stopPropagation();const r=new FormData(s.currentTarget),i=r.get("username"),l=r.get("password");try{const t=await u.call({body:{username:i,password:l}});if(!t.success||!t.jwt_token||!t.user){n(!0);return}p(t.user,t.jwt_token),x(t.user.user_id),g("/")}catch(t){n(!0),console.error("Failed to login",t)}},d=s=>r=>m(i=>j(i,l=>{l[s]=r.target.value}));return o.useEffect(()=>{document.title="Login"},[]),e.jsx("div",{className:"flex h-screen w-screen",children:e.jsxs("form",{className:"rounded-medium border-small border-divider m-auto flex w-full max-w-xs flex-col gap-4 p-4",onSubmit:h,children:[e.jsxs("div",{className:"text-small",children:[e.jsx("div",{className:"text-foreground truncate leading-5 font-semibold",children:"Sign in"}),e.jsx("div",{className:"text-default-500 truncate leading-5 font-normal",children:"Sign in to start chatting."})]}),e.jsx(c,{label:"Username",name:"username",labelPlacement:"outside",placeholder:"Your username",required:!0,isRequired:!0,value:a.username,onChange:d("username")}),e.jsx(c,{label:"Password",labelPlacement:"outside",id:"password",name:"password",type:"password",placeholder:"••••••••",required:!0,isRequired:!0,value:a.password,onChange:d("password")}),e.jsx(S,{children:f&&!u.isLoading&&e.jsx(P.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:"We couldn't sign you in. Please verify your credentials and try again."})}),e.jsx(b,{type:"submit",color:a.password&&a.username?"primary":"default",children:"Sign in"})]})})}export{_ as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-Djq6QJ18.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-Djq6QJ18.js deleted file mode 100644 index bcd0e5e868..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/Login-Djq6QJ18.js +++ /dev/null @@ -1 +0,0 @@ -import{r as n,bm as w,c as y,aW as b,aE as S,j as e,aq as j,aG as v,d as C,bn as P}from"./index-B3hlerKe.js";import{a as E}from"./authStore-DATNN-ps.js";import{i as c}from"./chunk-SSA7SXE4-BJI2Gxdq.js";const N=()=>{const a=n.useContext(w);if(!a)throw new Error("useInitializeUserStore must be used within a HistoryStoreContextProvider");return a.initializeUserStore};function U(){const[a,m]=n.useState({username:"",password:""}),u=y("/api/auth/login",{headers:{"Content-Type":"application/json"},method:"POST"}),p=b(E,s=>s.login),g=S(),x=N(),[f,o]=n.useState(!1),h=async s=>{o(!1),s.preventDefault(),s.stopPropagation();const r=new FormData(s.currentTarget),i=r.get("username"),l=r.get("password");try{const t=await u.call({body:{username:i,password:l}});if(!t.success||!t.jwt_token||!t.user){o(!0);return}p(t.user,t.jwt_token),x(t.user.user_id),g("/")}catch(t){o(!0),console.error("Failed to login",t)}},d=s=>r=>m(i=>P(i,l=>{l[s]=r.target.value}));return n.useEffect(()=>{document.title="Login"},[]),e.jsx("div",{className:"flex h-screen w-screen",children:e.jsxs("form",{className:"rounded-medium border-small border-divider m-auto flex w-full max-w-xs flex-col gap-4 p-4",onSubmit:h,children:[e.jsxs("div",{className:"text-small",children:[e.jsx("div",{className:"text-foreground truncate leading-5 font-semibold",children:"Sign in"}),e.jsx("div",{className:"text-default-500 truncate leading-5 font-normal",children:"Sign in to start chatting."})]}),e.jsx(c,{label:"Username",name:"username",labelPlacement:"outside",placeholder:"Your username",required:!0,isRequired:!0,value:a.username,onChange:d("username")}),e.jsx(c,{label:"Password",labelPlacement:"outside",id:"password",name:"password",type:"password",placeholder:"••••••••",required:!0,isRequired:!0,value:a.password,onChange:d("password")}),e.jsx(j,{children:f&&!u.isLoading&&e.jsx(v.div,{className:"text-small text-danger",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:"easeOut"},children:"We couldn't sign you in. Please verify your credentials and try again."})}),e.jsx(C,{type:"submit",color:a.password&&a.username?"primary":"default",children:"Sign in"})]})})}export{U as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton--mpGjRbY.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton--mpGjRbY.js new file mode 100644 index 0000000000..79aefc6d9d --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton--mpGjRbY.js @@ -0,0 +1 @@ +import{a4 as s,ai as u,E as t,a7 as i,a8 as g}from"./useThemeContext-DkrqKvLn.js";import{a as n}from"./authStore-BZmq_GrX.js";import{c as p,D as d}from"./main-BJLJjzL4.js";function y(){const r=p("/api/auth/logout",{headers:{"Content-Type":"application/json"},method:"POST"}),c=s(n,o=>o.logout),e=s(n,o=>o.token?.access_token),a=u(),l=async()=>{if(!e){a("/login");return}try{if(!(await r.call({body:{token:e}})).success)return;c(),a("/login")}catch(o){console.error("Failed to logout",o)}};return t.jsx(d,{content:"Logout",placement:"bottom",children:t.jsx(i,{isIconOnly:!0,"aria-label":"Logout",variant:"ghost",onPress:l,"data-testid":"logout-button",children:t.jsx(g,{icon:"heroicons:arrow-left-start-on-rectangle"})})})}export{y as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-Cn2L63Hk.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-Cn2L63Hk.js deleted file mode 100644 index 61d9813584..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/LogoutButton-Cn2L63Hk.js +++ /dev/null @@ -1 +0,0 @@ -import{c as u,aW as s,aE as i,j as o,D as g,d,I as p}from"./index-B3hlerKe.js";import{a as n}from"./authStore-DATNN-ps.js";function m(){const r=u("/api/auth/logout",{headers:{"Content-Type":"application/json"},method:"POST"}),c=s(n,t=>t.logout),e=s(n,t=>t.token?.access_token),a=i(),l=async()=>{if(!e){a("/login");return}try{if(!(await r.call({body:{token:e}})).success)return;c(),a("/login")}catch(t){console.error("Failed to logout",t)}};return o.jsx(g,{content:"Logout",placement:"bottom",children:o.jsx(d,{isIconOnly:!0,"aria-label":"Logout",variant:"ghost",onPress:l,"data-testid":"logout-button",children:o.jsx(p,{icon:"heroicons:arrow-left-start-on-rectangle"})})})}export{m as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-D01t_E39.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-D01t_E39.js new file mode 100644 index 0000000000..ec29b1f5a6 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-D01t_E39.js @@ -0,0 +1 @@ +import{r as hr,E as I,a7 as gr,a8 as Gr,a9 as Jr,aa as Wr,ab as qr}from"./useThemeContext-DkrqKvLn.js";import{g as Yr,u as Kr,e as Lr,D as Qr,t as Vr}from"./main-BJLJjzL4.js";import{m as Xr}from"./chunk-IGSAU2ZA-CRWCDn7K.js";var T=Uint8Array,$=Uint16Array,Ar=Int32Array,lr=new T([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sr=new T([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pr=new T([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nr=function(r,e){for(var a=new $(31),n=0;n<31;++n)a[n]=e+=1<>1|(y&21845)<<1;Q=(Q&52428)>>2|(Q&13107)<<2,Q=(Q&61680)>>4|(Q&3855)<<4,Cr[y]=((Q&65280)>>8|(Q&255)<<8)>>1}var q=function(r,e,a){for(var n=r.length,t=0,o=new $(e);t>h]=c}else for(l=new $(n),t=0;t>15-r[t]);return l},V=new T(288);for(var y=0;y<144;++y)V[y]=8;for(var y=144;y<256;++y)V[y]=9;for(var y=256;y<280;++y)V[y]=7;for(var y=280;y<288;++y)V[y]=8;var fr=new T(32);for(var y=0;y<32;++y)fr[y]=5;var re=q(V,9,0),ee=q(V,9,1),ae=q(fr,5,0),ne=q(fr,5,1),wr=function(r){for(var e=r[0],a=1;ae&&(e=r[a]);return e},J=function(r,e,a){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&a},xr=function(r,e){var a=e/8|0;return(r[a]|r[a+1]<<8|r[a+2]<<16)>>(e&7)},Mr=function(r){return(r+7)/8|0},cr=function(r,e,a){return(e==null||e<0)&&(e=0),(a==null||a>r.length)&&(a=r.length),new T(r.subarray(e,a))},te=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],G=function(r,e,a){var n=new Error(e||te[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,G),!a)throw n;return n},oe=function(r,e,a,n){var t=r.length,o=0;if(!t||e.f&&!e.l)return a||new T(0);var v=!a,l=v||e.i!=2,h=e.i;v&&(a=new T(t*3));var c=function(ar){var nr=a.length;if(ar>nr){var rr=new T(Math.max(nr*2,ar));rr.set(a),a=rr}},f=e.f||0,i=e.p||0,u=e.b||0,x=e.l,S=e.d,w=e.m,d=e.n,m=t*8;do{if(!x){f=J(r,i,1);var R=J(r,i+1,3);if(i+=3,R)if(R==1)x=ee,S=ne,w=9,d=5;else if(R==2){var N=J(r,i,31)+257,M=J(r,i+10,15)+4,g=N+J(r,i+5,31)+1;i+=14;for(var s=new T(g),j=new T(19),C=0;C>4;if(A<16)s[C++]=A;else{var E=0,b=0;for(A==16?(b=3+J(r,i,3),i+=2,E=s[C-1]):A==17?(b=3+J(r,i,7),i+=3):A==18&&(b=11+J(r,i,127),i+=7);b--;)s[C++]=E}}var z=s.subarray(0,N),F=s.subarray(N);w=wr(z),d=wr(F),x=q(z,w,1),S=q(F,d,1)}else G(1);else{var A=Mr(i)+4,D=r[A-4]|r[A-3]<<8,O=A+D;if(O>t){h&&G(0);break}l&&c(u+D),a.set(r.subarray(A,O),u),e.b=u+=D,e.p=i=O*8,e.f=f;continue}if(i>m){h&&G(0);break}}l&&c(u+131072);for(var er=(1<>4;if(i+=E&15,i>m){h&&G(0);break}if(E||G(2),H<256)a[u++]=H;else if(H==256){Y=i,x=null;break}else{var P=H-254;if(H>264){var C=H-257,p=lr[C];P=J(r,i,(1<>4;W||G(3),i+=W&15;var F=Zr[X];if(X>3){var p=sr[X];F+=xr(r,i)&(1<m){h&&G(0);break}l&&c(u+131072);var Z=u+P;if(u>8},tr=function(r,e,a){a<<=e&7;var n=e/8|0;r[n]|=a,r[n+1]|=a>>8,r[n+2]|=a>>16},yr=function(r,e){for(var a=[],n=0;nu&&(u=o[n].s);var x=new $(u+1),S=Tr(a[f-1],x,0);if(S>e){var n=0,w=0,d=S-e,m=1<e)w+=m-(1<>=d;w>0;){var A=o[n].s;x[A]=0&&w;--n){var D=o[n].s;x[D]==e&&(--x[D],++w)}S=e}return{t:new T(x),l:S}},Tr=function(r,e,a){return r.s==-1?Math.max(Tr(r.l,e,a+1),Tr(r.r,e,a+1)):e[r.s]=a},Er=function(r){for(var e=r.length;e&&!r[--e];);for(var a=new $(++e),n=0,t=r[0],o=1,v=function(h){a[n++]=h},l=1;l<=e;++l)if(r[l]==t&&l!=e)++o;else{if(!t&&o>2){for(;o>138;o-=138)v(32754);o>2&&(v(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(v(t),--o;o>6;o-=6)v(8304);o>2&&(v(o-3<<5|8208),o=0)}for(;o--;)v(t);o=1,t=r[l]}return{c:a.subarray(0,n),n:e}},or=function(r,e){for(var a=0,n=0;n>8,r[t+2]=r[t]^255,r[t+3]=r[t+1]^255;for(var o=0;o4&&!j[pr[k-1]];--k);var L=c+5<<3,U=or(t,V)+or(o,fr)+v,_=or(t,u)+or(o,w)+v+14+3*k+or(M,j)+2*M[16]+3*M[17]+7*M[18];if(h>=0&&L<=U&&L<=_)return Ur(e,f,r.subarray(h,h+c));var E,b,z,F;if(K(e,f,1+(_15&&(K(e,f,H[g]>>5&127),f+=H[g]>>12)}}else E=re,b=V,z=ae,F=fr;for(var g=0;g255){var P=p>>18&31;tr(e,f,E[P+257]),f+=b[P+257],P>7&&(K(e,f,p>>23&31),f+=lr[P]);var W=p&31;tr(e,f,z[W]),f+=F[W],W>3&&(tr(e,f,p>>5&8191),f+=sr[W])}else tr(e,f,E[p]),f+=b[p]}return tr(e,f,E[256]),f+b[256]},fe=new Ar([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Hr=new T(0),ie=function(r,e,a,n,t,o){var v=o.z||r.length,l=new T(n+v+5*(1+Math.ceil(v/7e3))+t),h=l.subarray(n,l.length-t),c=o.l,f=(o.r||0)&7;if(e){f&&(h[0]=o.r>>3);for(var i=fe[e-1],u=i>>13,x=i&8191,S=(1<7e3||j>24576)&&(E>423||!c)){f=Fr(r,h,0,D,O,N,g,j,k,s-k,f),j=M=g=0,k=s;for(var b=0;b<286;++b)O[b]=0;for(var b=0;b<30;++b)N[b]=0}var z=2,F=0,er=x,B=U-_&32767;if(E>2&&L==A(s-B))for(var Y=Math.min(u,E)-1,H=Math.min(32767,s),P=Math.min(258,E);B<=H&&--er&&U!=_;){if(r[s+z]==r[s+z-B]){for(var p=0;pz){if(z=p,F=B,p>Y)break;for(var W=Math.min(B,p-2),X=0,b=0;bX&&(X=vr,_=Z)}}}U=_,_=w[U],B+=U-_&32767}if(F){D[j++]=268435456|mr[z]<<18|jr[F];var ar=mr[z]&31,nr=jr[F]&31;g+=lr[ar]+sr[nr],++O[257+ar],++N[nr],C=s+z,++M}else D[j++]=r[s],++O[r[s]]}}for(s=Math.max(s,C);s=v&&(h[f/8|0]=c,rr=v),f=Ur(h,f+1,r.subarray(s,rr))}o.i=v}return cr(l,0,n+Mr(f)+t)},Pr=function(){var r=1,e=0;return{p:function(a){for(var n=r,t=e,o=a.length|0,v=0;v!=o;){for(var l=Math.min(v+2655,o);v>16),t=(t&65535)+15*(t>>16)}r=n,e=t},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},ve=function(r,e,a,n,t){if(!t&&(t={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),v=new T(o.length+r.length);v.set(o),v.set(r,o.length),r=v,t.w=o.length}return ie(r,e.level==null?6:e.level,e.mem==null?t.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,a,n,t)},$r=function(r,e,a){for(;a;++e)r[e]=a,a>>>=8},le=function(r,e){var a=e.level,n=a==0?0:a<6?1:a==9?3:2;if(r[0]=120,r[1]=n<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var t=Pr();t.p(e.dictionary),$r(r,2,t.d())}},se=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&G(6,"invalid zlib data"),(r[1]>>5&1)==1&&G(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ce(r,e){e||(e={});var a=Pr();a.p(r);var n=ve(r,e,e.dictionary?6:2,4);return le(n,e),$r(n,n.length-4,a.d()),n}function ue(r,e){return oe(r.subarray(se(r),-4),{i:2},e,e)}var Or=typeof TextEncoder<"u"&&new TextEncoder,dr=typeof TextDecoder<"u"&&new TextDecoder,he=0;try{dr.decode(Hr,{stream:!0}),he=1}catch{}var ge=function(r){for(var e="",a=0;;){var n=r[a++],t=(n>127)+(n>223)+(n>239);if(a+t>r.length)return{s:e,r:cr(r,a-1)};t?t==3?(n=((n&15)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):t&1?e+=String.fromCharCode((n&31)<<6|r[a++]&63):e+=String.fromCharCode((n&15)<<12|(r[a++]&63)<<6|r[a++]&63):e+=String.fromCharCode(n)}};function kr(r,e){if(e){for(var a=new T(r.length),n=0;n>1)),v=0,l=function(f){o[v++]=f},n=0;no.length){var h=new T(v+8+(t-n<<1));h.set(o),o=h}var c=r.charCodeAt(n);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|r.charCodeAt(++n)&1023,l(240|c>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|c&63)):(l(224|c>>12),l(128|c>>6&63),l(128|c&63))}return cr(o,0,v)}function Ir(r,e){if(e){for(var a="",n=0;n`,br=``;function xe(r){if(typeof r!="object"||r===null)return!1;const e=r;return!(typeof e.history!="object"||"followupMessages"in e&&typeof e.followupMessages!="object"||"chatOptions"in e&&typeof e.chatOptions!="object"||"serverState"in e&&typeof e.serverState!="object"||"conversationId"in e&&typeof e.conversationId!="string"&&typeof e.conversationId!="object")}function pe(){const{restore:r}=Yr(),{isOpen:e,onOpen:a,onClose:n}=Kr(),[t,o]=hr.useState(Dr),v=hr.useRef(null),{getCurrentConversation:l}=Lr(f=>f.primitives),h=()=>{const{chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}=l(),w=Vr({chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}),d=kr(`${Sr}${JSON.stringify(w)}${br}`),m=btoa(Ir(ce(d,{level:9}),!0));navigator.clipboard.writeText(m),o(we),n(),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{o(Dr)},2e3)},c=()=>{n()};return hr.useEffect(()=>{const f=i=>{if(!i.clipboardData)return;const u=i.clipboardData.types;if(!u.includes("text/plain")&&!u.includes("text"))return;const x=i.clipboardData.getData("text/plain")??i.clipboardData.getData("text");try{const S=atob(x);if(!S.startsWith("xÚ"))return;const w=Ir(ue(kr(S,!0)));if(!w.startsWith(Sr)||!w.endsWith(br))return;i.preventDefault(),i.stopPropagation();const d=w.slice(Sr.length,-br.length),m=JSON.parse(d);if(!xe(m))return;r(m.history,m.followupMessages,m.chatOptions,m.serverState,m.conversationId)}catch(S){console.error("Couldn't parse pasted string as valid Ragbits state",S)}};return window.addEventListener("paste",f),()=>{window.removeEventListener("paste",f)}}),I.jsxs(I.Fragment,{children:[I.jsx(Qr,{content:"Share conversation",placement:"bottom",children:I.jsx(gr,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Share conversation",onPress:a,children:I.jsx(Gr,{icon:t})})}),I.jsx(Jr,{isOpen:e,onOpenChange:c,children:I.jsx(Wr,{children:f=>I.jsxs(I.Fragment,{children:[I.jsx(Xr,{className:"text-default-900 flex flex-col gap-1",children:"Share conversation"}),I.jsx(qr,{children:I.jsxs("div",{className:"flex flex-col gap-4",children:[I.jsx("p",{className:"text-medium text-default-500",children:"You are about to copy a code that allows sharing and storing your current app state. Once copied, you can paste this code anywhere on the site to instantly return to this exact setup. It’s a quick way to save your progress or share it with others."}),I.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[I.jsx(gr,{color:"danger",variant:"light",onPress:f,"aria-label":"Close share modal",children:"Cancel"}),I.jsx(gr,{color:"primary",onPress:h,"aria-label":"Copy to clipboard to share the conversation",children:"Copy to clipboard"})]})]})})]})})})]})}export{pe as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-lYj0v67r.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-lYj0v67r.js deleted file mode 100644 index 6cae766e5a..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ShareButton-lYj0v67r.js +++ /dev/null @@ -1 +0,0 @@ -import{av as Gr,u as Jr,r as hr,i as Wr,j as I,D as qr,d as gr,I as Yr,m as Kr,e as Lr,f as Qr,aw as Vr}from"./index-B3hlerKe.js";import{m as Xr}from"./chunk-IGSAU2ZA-CsJAveMU.js";var T=Uint8Array,$=Uint16Array,jr=Int32Array,lr=new T([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sr=new T([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),pr=new T([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nr=function(r,e){for(var a=new $(31),n=0;n<31;++n)a[n]=e+=1<>1|(y&21845)<<1;Q=(Q&52428)>>2|(Q&13107)<<2,Q=(Q&61680)>>4|(Q&3855)<<4,Cr[y]=((Q&65280)>>8|(Q&255)<<8)>>1}var q=function(r,e,a){for(var n=r.length,t=0,o=new $(e);t>h]=c}else for(l=new $(n),t=0;t>15-r[t]);return l},V=new T(288);for(var y=0;y<144;++y)V[y]=8;for(var y=144;y<256;++y)V[y]=9;for(var y=256;y<280;++y)V[y]=7;for(var y=280;y<288;++y)V[y]=8;var fr=new T(32);for(var y=0;y<32;++y)fr[y]=5;var re=q(V,9,0),ee=q(V,9,1),ae=q(fr,5,0),ne=q(fr,5,1),wr=function(r){for(var e=r[0],a=1;ae&&(e=r[a]);return e},J=function(r,e,a){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&a},xr=function(r,e){var a=e/8|0;return(r[a]|r[a+1]<<8|r[a+2]<<16)>>(e&7)},Ar=function(r){return(r+7)/8|0},cr=function(r,e,a){return(e==null||e<0)&&(e=0),(a==null||a>r.length)&&(a=r.length),new T(r.subarray(e,a))},te=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],G=function(r,e,a){var n=new Error(e||te[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,G),!a)throw n;return n},oe=function(r,e,a,n){var t=r.length,o=0;if(!t||e.f&&!e.l)return a||new T(0);var v=!a,l=v||e.i!=2,h=e.i;v&&(a=new T(t*3));var c=function(ar){var nr=a.length;if(ar>nr){var rr=new T(Math.max(nr*2,ar));rr.set(a),a=rr}},f=e.f||0,i=e.p||0,u=e.b||0,x=e.l,S=e.d,w=e.m,d=e.n,m=t*8;do{if(!x){f=J(r,i,1);var R=J(r,i+1,3);if(i+=3,R)if(R==1)x=ee,S=ne,w=9,d=5;else if(R==2){var N=J(r,i,31)+257,A=J(r,i+10,15)+4,g=N+J(r,i+5,31)+1;i+=14;for(var s=new T(g),M=new T(19),C=0;C>4;if(j<16)s[C++]=j;else{var E=0,b=0;for(j==16?(b=3+J(r,i,3),i+=2,E=s[C-1]):j==17?(b=3+J(r,i,7),i+=3):j==18&&(b=11+J(r,i,127),i+=7);b--;)s[C++]=E}}var z=s.subarray(0,N),F=s.subarray(N);w=wr(z),d=wr(F),x=q(z,w,1),S=q(F,d,1)}else G(1);else{var j=Ar(i)+4,D=r[j-4]|r[j-3]<<8,O=j+D;if(O>t){h&&G(0);break}l&&c(u+D),a.set(r.subarray(j,O),u),e.b=u+=D,e.p=i=O*8,e.f=f;continue}if(i>m){h&&G(0);break}}l&&c(u+131072);for(var er=(1<>4;if(i+=E&15,i>m){h&&G(0);break}if(E||G(2),H<256)a[u++]=H;else if(H==256){Y=i,x=null;break}else{var P=H-254;if(H>264){var C=H-257,p=lr[C];P=J(r,i,(1<>4;W||G(3),i+=W&15;var F=Zr[X];if(X>3){var p=sr[X];F+=xr(r,i)&(1<m){h&&G(0);break}l&&c(u+131072);var Z=u+P;if(u>8},tr=function(r,e,a){a<<=e&7;var n=e/8|0;r[n]|=a,r[n+1]|=a>>8,r[n+2]|=a>>16},yr=function(r,e){for(var a=[],n=0;nu&&(u=o[n].s);var x=new $(u+1),S=Tr(a[f-1],x,0);if(S>e){var n=0,w=0,d=S-e,m=1<e)w+=m-(1<>=d;w>0;){var j=o[n].s;x[j]=0&&w;--n){var D=o[n].s;x[D]==e&&(--x[D],++w)}S=e}return{t:new T(x),l:S}},Tr=function(r,e,a){return r.s==-1?Math.max(Tr(r.l,e,a+1),Tr(r.r,e,a+1)):e[r.s]=a},Er=function(r){for(var e=r.length;e&&!r[--e];);for(var a=new $(++e),n=0,t=r[0],o=1,v=function(h){a[n++]=h},l=1;l<=e;++l)if(r[l]==t&&l!=e)++o;else{if(!t&&o>2){for(;o>138;o-=138)v(32754);o>2&&(v(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(v(t),--o;o>6;o-=6)v(8304);o>2&&(v(o-3<<5|8208),o=0)}for(;o--;)v(t);o=1,t=r[l]}return{c:a.subarray(0,n),n:e}},or=function(r,e){for(var a=0,n=0;n>8,r[t+2]=r[t]^255,r[t+3]=r[t+1]^255;for(var o=0;o4&&!M[pr[k-1]];--k);var L=c+5<<3,U=or(t,V)+or(o,fr)+v,_=or(t,u)+or(o,w)+v+14+3*k+or(A,M)+2*A[16]+3*A[17]+7*A[18];if(h>=0&&L<=U&&L<=_)return Ur(e,f,r.subarray(h,h+c));var E,b,z,F;if(K(e,f,1+(_15&&(K(e,f,H[g]>>5&127),f+=H[g]>>12)}}else E=re,b=V,z=ae,F=fr;for(var g=0;g255){var P=p>>18&31;tr(e,f,E[P+257]),f+=b[P+257],P>7&&(K(e,f,p>>23&31),f+=lr[P]);var W=p&31;tr(e,f,z[W]),f+=F[W],W>3&&(tr(e,f,p>>5&8191),f+=sr[W])}else tr(e,f,E[p]),f+=b[p]}return tr(e,f,E[256]),f+b[256]},fe=new jr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Hr=new T(0),ie=function(r,e,a,n,t,o){var v=o.z||r.length,l=new T(n+v+5*(1+Math.ceil(v/7e3))+t),h=l.subarray(n,l.length-t),c=o.l,f=(o.r||0)&7;if(e){f&&(h[0]=o.r>>3);for(var i=fe[e-1],u=i>>13,x=i&8191,S=(1<7e3||M>24576)&&(E>423||!c)){f=Fr(r,h,0,D,O,N,g,M,k,s-k,f),M=A=g=0,k=s;for(var b=0;b<286;++b)O[b]=0;for(var b=0;b<30;++b)N[b]=0}var z=2,F=0,er=x,B=U-_&32767;if(E>2&&L==j(s-B))for(var Y=Math.min(u,E)-1,H=Math.min(32767,s),P=Math.min(258,E);B<=H&&--er&&U!=_;){if(r[s+z]==r[s+z-B]){for(var p=0;pz){if(z=p,F=B,p>Y)break;for(var W=Math.min(B,p-2),X=0,b=0;bX&&(X=vr,_=Z)}}}U=_,_=w[U],B+=U-_&32767}if(F){D[M++]=268435456|mr[z]<<18|Mr[F];var ar=mr[z]&31,nr=Mr[F]&31;g+=lr[ar]+sr[nr],++O[257+ar],++N[nr],C=s+z,++A}else D[M++]=r[s],++O[r[s]]}}for(s=Math.max(s,C);s=v&&(h[f/8|0]=c,rr=v),f=Ur(h,f+1,r.subarray(s,rr))}o.i=v}return cr(l,0,n+Ar(f)+t)},Pr=function(){var r=1,e=0;return{p:function(a){for(var n=r,t=e,o=a.length|0,v=0;v!=o;){for(var l=Math.min(v+2655,o);v>16),t=(t&65535)+15*(t>>16)}r=n,e=t},d:function(){return r%=65521,e%=65521,(r&255)<<24|(r&65280)<<8|(e&255)<<8|e>>8}}},ve=function(r,e,a,n,t){if(!t&&(t={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),v=new T(o.length+r.length);v.set(o),v.set(r,o.length),r=v,t.w=o.length}return ie(r,e.level==null?6:e.level,e.mem==null?t.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,a,n,t)},$r=function(r,e,a){for(;a;++e)r[e]=a,a>>>=8},le=function(r,e){var a=e.level,n=a==0?0:a<6?1:a==9?3:2;if(r[0]=120,r[1]=n<<6|(e.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,e.dictionary){var t=Pr();t.p(e.dictionary),$r(r,2,t.d())}},se=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&G(6,"invalid zlib data"),(r[1]>>5&1)==1&&G(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ce(r,e){e||(e={});var a=Pr();a.p(r);var n=ve(r,e,e.dictionary?6:2,4);return le(n,e),$r(n,n.length-4,a.d()),n}function ue(r,e){return oe(r.subarray(se(r),-4),{i:2},e,e)}var Or=typeof TextEncoder<"u"&&new TextEncoder,dr=typeof TextDecoder<"u"&&new TextDecoder,he=0;try{dr.decode(Hr,{stream:!0}),he=1}catch{}var ge=function(r){for(var e="",a=0;;){var n=r[a++],t=(n>127)+(n>223)+(n>239);if(a+t>r.length)return{s:e,r:cr(r,a-1)};t?t==3?(n=((n&15)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,e+=String.fromCharCode(55296|n>>10,56320|n&1023)):t&1?e+=String.fromCharCode((n&31)<<6|r[a++]&63):e+=String.fromCharCode((n&15)<<12|(r[a++]&63)<<6|r[a++]&63):e+=String.fromCharCode(n)}};function kr(r,e){if(e){for(var a=new T(r.length),n=0;n>1)),v=0,l=function(f){o[v++]=f},n=0;no.length){var h=new T(v+8+(t-n<<1));h.set(o),o=h}var c=r.charCodeAt(n);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|c&63)):c>55295&&c<57344?(c=65536+(c&1047552)|r.charCodeAt(++n)&1023,l(240|c>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|c&63)):(l(224|c>>12),l(128|c>>6&63),l(128|c&63))}return cr(o,0,v)}function Ir(r,e){if(e){for(var a="",n=0;n`,br=``;function xe(r){if(typeof r!="object"||r===null)return!1;const e=r;return!(typeof e.history!="object"||"followupMessages"in e&&typeof e.followupMessages!="object"||"chatOptions"in e&&typeof e.chatOptions!="object"||"serverState"in e&&typeof e.serverState!="object"||"conversationId"in e&&typeof e.conversationId!="string"&&typeof e.conversationId!="object")}function be(){const{restore:r}=Gr(),{isOpen:e,onOpen:a,onClose:n}=Jr(),[t,o]=hr.useState(Dr),v=hr.useRef(null),{getCurrentConversation:l}=Wr(f=>f.primitives),h=()=>{const{chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}=l(),w=Vr({chatOptions:f,history:i,serverState:u,conversationId:x,followupMessages:S}),d=kr(`${Sr}${JSON.stringify(w)}${br}`),m=btoa(Ir(ce(d,{level:9}),!0));navigator.clipboard.writeText(m),o(we),n(),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{o(Dr)},2e3)},c=()=>{n()};return hr.useEffect(()=>{const f=i=>{if(!i.clipboardData)return;const u=i.clipboardData.types;if(!u.includes("text/plain")&&!u.includes("text"))return;const x=i.clipboardData.getData("text/plain")??i.clipboardData.getData("text");try{const S=atob(x);if(!S.startsWith("xÚ"))return;const w=Ir(ue(kr(S,!0)));if(!w.startsWith(Sr)||!w.endsWith(br))return;i.preventDefault(),i.stopPropagation();const d=w.slice(Sr.length,-br.length),m=JSON.parse(d);if(!xe(m))return;r(m.history,m.followupMessages,m.chatOptions,m.serverState,m.conversationId)}catch(S){console.error("Couldn't parse pasted string as valid Ragbits state",S)}};return window.addEventListener("paste",f),()=>{window.removeEventListener("paste",f)}}),I.jsxs(I.Fragment,{children:[I.jsx(qr,{content:"Share conversation",placement:"bottom",children:I.jsx(gr,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Share conversation",onPress:a,children:I.jsx(Yr,{icon:t})})}),I.jsx(Kr,{isOpen:e,onOpenChange:c,children:I.jsx(Lr,{children:f=>I.jsxs(I.Fragment,{children:[I.jsx(Xr,{className:"text-default-900 flex flex-col gap-1",children:"Share conversation"}),I.jsx(Qr,{children:I.jsxs("div",{className:"flex flex-col gap-4",children:[I.jsx("p",{className:"text-medium text-default-500",children:"You are about to copy a code that allows sharing and storing your current app state. Once copied, you can paste this code anywhere on the site to instantly return to this exact setup. It’s a quick way to save your progress or share it with others."}),I.jsxs("div",{className:"flex justify-end gap-4 py-4",children:[I.jsx(gr,{color:"danger",variant:"light",onPress:f,"aria-label":"Close share modal",children:"Cancel"}),I.jsx(gr,{color:"primary",onPress:h,"aria-label":"Copy to clipboard to share the conversation",children:"Copy to clipboard"})]})]})})]})})})]})}export{be as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-B-N1J-sZ.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-B-N1J-sZ.js deleted file mode 100644 index d4b682a605..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-B-N1J-sZ.js +++ /dev/null @@ -1 +0,0 @@ -import{r as B,aX as Ml,aY as ae,t as Ne,k as ie,aK as z,aZ as W,a_ as U,a$ as te,b0 as Tl,aT as _,b1 as Rl,b2 as Vl,A as ze,b3 as ue,b4 as Ol,K as pe,H as Hl,J,M as Ll,b5 as L,af as Ul,b6 as Y,b7 as Z,b8 as le,U as Wl,b9 as Gl,ba as Ce,bb as Yl,l as T,R as M,W as X,Z as K,j as h,v as I,a2 as w,ap as be,au as Fe,a3 as O,w as Zl,y as _l,x as ql,a5 as q,O as Jl,Q as Pe,a0 as Ke,X as Ie,u as Xl,as as De,D as Ql,d as eu,I as tu,m as lu,e as uu,f as nu,bc as ou}from"./index-B3hlerKe.js";import{b as fe,$ as je}from"./useSelectableItem-DK6eABKK.js";import{C as su,u as iu}from"./index-v15bx9Do.js";import{m as ru}from"./chunk-IGSAU2ZA-CsJAveMU.js";function Me(e,t){const l=B.useRef(!0),u=B.useRef(null);B.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]),B.useEffect(()=>{let o=u.current;l.current?l.current=!1:(!o||t.some((n,i)=>!Object.is(n,o[i])))&&e(),u.current=t},t)}function au(e,t){let l=t?.isDisabled,[u,o]=B.useState(!1);return Ml(()=>{if(e?.current&&!l){let n=()=>{if(e.current){let a=ae(e.current,{tabbable:!0});o(!!a.nextNode())}};n();let i=new MutationObserver(n);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),l?!1:u}var Be=Ne({base:"w-px h-px inline-block",variants:{isInline:{true:"inline-block",false:"block"}},defaultVariants:{isInline:!1}}),ke=Ne({slots:{base:"flex flex-col relative gap-4",wrapper:["p-4","z-0","flex","flex-col","relative","justify-between","gap-4","shadow-small","bg-content1","overflow-auto"],table:"min-w-full h-auto",thead:"[&>tr]:first:rounded-lg",tbody:"after:block",tr:["group/tr","outline-hidden",...ie],th:["group/th","px-3","h-10","text-start","align-middle","bg-default-100","whitespace-nowrap","text-foreground-500","text-tiny","font-semibold","first:rounded-s-lg","last:rounded-e-lg","outline-hidden","data-[sortable=true]:cursor-pointer","data-[hover=true]:text-foreground-400",...ie],td:["py-2","px-3","relative","align-middle","whitespace-normal","text-small","font-normal","outline-hidden","[&>*]:z-1","[&>*]:relative",...ie,"before:pointer-events-none","before:content-['']","before:absolute","before:z-0","before:inset-0","before:opacity-0","data-[selected=true]:before:opacity-100","group-data-[disabled=true]/tr:text-foreground-300","group-data-[disabled=true]/tr:cursor-not-allowed"],tfoot:"",sortIcon:["ms-2","mb-px","opacity-0","text-inherit","inline-block","transition-transform-opacity","data-[visible=true]:opacity-100","group-data-[hover=true]/th:opacity-100","data-[direction=ascending]:rotate-180"],emptyWrapper:"text-foreground-400 align-middle text-center h-40",loadingWrapper:"absolute inset-0 flex items-center justify-center"},variants:{color:{default:{td:"before:bg-default/60 data-[selected=true]:text-default-foreground"},primary:{td:"before:bg-primary/20 data-[selected=true]:text-primary"},secondary:{td:"before:bg-secondary/20 data-[selected=true]:text-secondary"},success:{td:"before:bg-success/20 data-[selected=true]:text-success-600 dark:data-[selected=true]:text-success"},warning:{td:"before:bg-warning/20 data-[selected=true]:text-warning-600 dark:data-[selected=true]:text-warning"},danger:{td:"before:bg-danger/20 data-[selected=true]:text-danger dark:data-[selected=true]:text-danger-500"}},layout:{auto:{table:"table-auto"},fixed:{table:"table-fixed"}},shadow:{none:{wrapper:"shadow-none"},sm:{wrapper:"shadow-small"},md:{wrapper:"shadow-medium"},lg:{wrapper:"shadow-large"}},hideHeader:{true:{thead:"hidden"}},isStriped:{true:{td:["group-data-[odd=true]/tr:before:bg-default-100","group-data-[odd=true]/tr:before:opacity-100","group-data-[odd=true]/tr:before:-z-10"]}},isCompact:{true:{td:"py-1"},false:{}},isHeaderSticky:{true:{thead:"sticky top-0 z-20 [&>tr]:first:shadow-small"}},isSelectable:{true:{tr:"cursor-default",td:["group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:bg-default-100","group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:opacity-70"]}},isMultiSelectable:{true:{td:["group-data-[first=true]/tr:first:before:rounded-ss-lg","group-data-[first=true]/tr:last:before:rounded-se-lg","group-data-[middle=true]/tr:before:rounded-none","group-data-[last=true]/tr:first:before:rounded-es-lg","group-data-[last=true]/tr:last:before:rounded-ee-lg"]},false:{td:["first:before:rounded-s-lg","last:before:rounded-e-lg"]}},radius:{none:{wrapper:"rounded-none",th:["first:rounded-s-none","first:before:rounded-s-none","last:rounded-e-none","last:before:rounded-e-none"],td:["first:before:rounded-s-none","last:before:rounded-e-none","group-data-[first=true]/tr:first:before:rounded-ss-none","group-data-[first=true]/tr:last:before:rounded-se-none","group-data-[last=true]/tr:first:before:rounded-es-none","group-data-[last=true]/tr:last:before:rounded-ee-none"]},sm:{wrapper:"rounded-small"},md:{wrapper:"rounded-medium"},lg:{wrapper:"rounded-large"}},fullWidth:{true:{base:"w-full",wrapper:"w-full",table:"w-full"}},align:{start:{th:"text-start",td:"text-start"},center:{th:"text-center",td:"text-center"},end:{th:"text-end",td:"text-end"}}},defaultVariants:{layout:"auto",shadow:"sm",radius:"lg",color:"default",isCompact:!1,hideHeader:!1,isStriped:!1,fullWidth:!0,align:"start"},compoundVariants:[{isStriped:!0,color:"default",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-default/60"}},{isStriped:!0,color:"primary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-primary/20"}},{isStriped:!0,color:"secondary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-secondary/20"}},{isStriped:!0,color:"success",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-success/20"}},{isStriped:!0,color:"warning",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-warning/20"}},{isStriped:!0,color:"danger",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-danger/20"}}]});const he=new WeakMap;function ce(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function cu(e,t){let l=he.get(e);if(!l)throw new Error("Unknown grid");return`${l}-${ce(t)}`}function Te(e,t,l){let u=he.get(e);if(!u)throw new Error("Unknown grid");return`${u}-${ce(t)}-${ce(l)}`}function Re(e,t){return[...e.collection.rowHeaderColumnKeys].map(l=>Te(e,t,l)).join(" ")}var Ve={};Ve={ascending:"تصاعدي",ascendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تصاعدي`,columnSize:e=>`${e.value} بالبكسل`,descending:"تنازلي",descendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب"};var Oe={};Oe={ascending:"възходящ",ascendingSort:e=>`сортирано по колона ${e.columnName} във възходящ ред`,columnSize:e=>`${e.value} пиксела`,descending:"низходящ",descendingSort:e=>`сортирано по колона ${e.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона"};var He={};He={ascending:"vzestupně",ascendingSort:e=>`řazeno vzestupně podle sloupce ${e.columnName}`,columnSize:e=>`${e.value} pixelů`,descending:"sestupně",descendingSort:e=>`řazeno sestupně podle sloupce ${e.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení"};var Le={};Le={ascending:"stigende",ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende rækkefølge`,columnSize:e=>`${e.value} pixels`,descending:"faldende",descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne"};var Ue={};Ue={ascending:"aufsteigend",ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,columnSize:e=>`${e.value} Pixel`,descending:"absteigend",descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte"};var We={};We={ascending:"αύξουσα",ascendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε αύξουσα σειρά`,columnSize:e=>`${e.value} pixel`,descending:"φθίνουσα",descendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής"};var Ge={};Ge={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:"Press Enter to start resizing"};var Ye={};Ye={ascending:"ascendente",ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,columnSize:e=>`${e.value} píxeles`,descending:"descendente",descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable"};var Ze={};Ze={ascending:"tõusev järjestus",ascendingSort:e=>`sorditud veeru järgi ${e.columnName} tõusvas järjestuses`,columnSize:e=>`${e.value} pikslit`,descending:"laskuv järjestus",descendingSort:e=>`sorditud veeru järgi ${e.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg"};var _e={};_e={ascending:"nouseva",ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa järjestyksessä`,columnSize:e=>`${e.value} pikseliä`,descending:"laskeva",descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake"};var qe={};qe={ascending:"croissant",ascendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre croissant`,columnSize:e=>`${e.value} pixels`,descending:"décroissant",descendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable"};var Je={};Je={ascending:"עולה",ascendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר עולה`,columnSize:e=>`${e.value} פיקסלים`,descending:"יורד",descendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין"};var Xe={};Xe={ascending:"rastući",ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastućem redoslijedom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`razvrstano po stupcima ${e.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati"};var Qe={};Qe={ascending:"növekvő",ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, növekvő sorrendben`,columnSize:e=>`${e.value} képpont`,descending:"csökkenő",descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop"};var et={};et={ascending:"crescente",ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,columnSize:e=>`${e.value} pixel`,descending:"decrescente",descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile"};var tt={};tt={ascending:"昇順",ascendingSort:e=>`列 ${e.columnName} を昇順で並べ替え`,columnSize:e=>`${e.value} ピクセル`,descending:"降順",descendingSort:e=>`列 ${e.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列"};var lt={};lt={ascending:"오름차순",ascendingSort:e=>`${e.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:e=>`${e.value} 픽셀`,descending:"내림차순",descendingSort:e=>`${e.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열"};var ut={};ut={ascending:"didėjančia tvarka",ascendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} didėjančia tvarka`,columnSize:e=>`${e.value} piks.`,descending:"mažėjančia tvarka",descendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis"};var nt={};nt={ascending:"augošā secībā",ascendingSort:e=>`kārtots pēc kolonnas ${e.columnName} augošā secībā`,columnSize:e=>`${e.value} pikseļi`,descending:"dilstošā secībā",descendingSort:e=>`kārtots pēc kolonnas ${e.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna"};var ot={};ot={ascending:"stigende",ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkefølge`,columnSize:e=>`${e.value} piksler`,descending:"synkende",descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres"};var st={};st={ascending:"oplopend",ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,columnSize:e=>`${e.value} pixels`,descending:"aflopend",descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom"};var it={};it={ascending:"rosnąco",ascendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku rosnącym`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:"malejąco",descendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania"};var rt={};rt={ascending:"crescente",ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,columnSize:e=>`${e.value} pixels`,descending:"decrescente",descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável"};var at={};at={ascending:"ascendente",ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,columnSize:e=>`${e.value} pixels`,descending:"descendente",descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável"};var ct={};ct={ascending:"crescătoare",ascendingSort:e=>`sortate după coloana ${e.columnName} în ordine crescătoare`,columnSize:e=>`${e.value} pixeli`,descending:"descrescătoare",descendingSort:e=>`sortate după coloana ${e.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă"};var dt={};dt={ascending:"возрастание",ascendingSort:e=>`сортировать столбец ${e.columnName} в порядке возрастания`,columnSize:e=>`${e.value} пикс.`,descending:"убывание",descendingSort:e=>`сортировать столбец ${e.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец"};var mt={};mt={ascending:"vzostupne",ascendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,columnSize:e=>`Počet pixelov: ${e.value}`,descending:"zostupne",descendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec"};var pt={};pt={ascending:"naraščajoče",ascendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v naraščajočem vrstnem redu`,columnSize:e=>`${e.value} slikovnih pik`,descending:"padajoče",descendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec"};var bt={};bt={ascending:"rastući",ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastućim redosledom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`sortirano po kolonama ${e.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati"};var ft={};ft={ascending:"stigande",ascendingSort:e=>`sorterat på kolumn ${e.columnName} i stigande ordning`,columnSize:e=>`${e.value} pixlar`,descending:"fallande",descendingSort:e=>`sorterat på kolumn ${e.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn"};var ht={};ht={ascending:"artan sırada",ascendingSort:e=>`${e.columnName} sütuna göre artan düzende sırala`,columnSize:e=>`${e.value} piksel`,descending:"azalan sırada",descendingSort:e=>`${e.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun"};var vt={};vt={ascending:"висхідний",ascendingSort:e=>`відсортовано за стовпцем ${e.columnName} у висхідному порядку`,columnSize:e=>`${e.value} пікс.`,descending:"низхідний",descendingSort:e=>`відсортовано за стовпцем ${e.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець"};var gt={};gt={ascending:"升序",ascendingSort:e=>`按列 ${e.columnName} 升序排序`,columnSize:e=>`${e.value} 像素`,descending:"降序",descendingSort:e=>`按列 ${e.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列"};var $t={};$t={ascending:"遞增",ascendingSort:e=>`已依據「${e.columnName}」欄遞增排序`,columnSize:e=>`${e.value} 像素`,descending:"遞減",descendingSort:e=>`已依據「${e.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄"};var ne={};ne={"ar-AE":Ve,"bg-BG":Oe,"cs-CZ":He,"da-DK":Le,"de-DE":Ue,"el-GR":We,"en-US":Ge,"es-ES":Ye,"et-EE":Ze,"fi-FI":_e,"fr-FR":qe,"he-IL":Je,"hr-HR":Xe,"hu-HU":Qe,"it-IT":et,"ja-JP":tt,"ko-KR":lt,"lt-LT":ut,"lv-LV":nt,"nb-NO":ot,"nl-NL":st,"pl-PL":it,"pt-BR":rt,"pt-PT":at,"ro-RO":ct,"ru-RU":dt,"sk-SK":mt,"sl-SI":pt,"sr-SP":bt,"sv-SE":ft,"tr-TR":ht,"uk-UA":vt,"zh-CN":gt,"zh-TW":$t};class yt{isCell(t){return t.type==="cell"}isRow(t){return t.type==="row"||t.type==="item"}isDisabled(t){var l;return this.disabledBehavior==="all"&&(((l=t.props)===null||l===void 0?void 0:l.isDisabled)||this.disabledKeys.has(t.key))}findPreviousKey(t,l){let u=t!=null?this.collection.getKeyBefore(t):this.collection.getLastKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;u=this.collection.getKeyBefore(u)}return null}findNextKey(t,l){let u=t!=null?this.collection.getKeyAfter(t):this.collection.getFirstKey();for(;u!=null;){let o=this.collection.getItem(u);if(!o)return null;if(!this.isDisabled(o)&&(!l||l(o)))return u;if(u=this.collection.getKeyAfter(u),u==null)return null}return null}getKeyForItemInRowByIndex(t,l=0){if(l<0)return null;let u=this.collection.getItem(t);if(!u)return null;let o=0;for(let a of z(u,this.collection)){var n;if(a.colSpan&&a.colSpan+o>l)return(n=a.key)!==null&&n!==void 0?n:null;a.colSpan&&(o=o+a.colSpan-1);var i;if(o===l)return(i=a.key)!==null&&i!==void 0?i:null;o++}return null}getKeyBelow(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findNextKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyAbove(t){let l=t,u=this.collection.getItem(l);if(!u)return null;var o;if(this.isCell(u)&&(l=(o=u.parentKey)!==null&&o!==void 0?o:null),l==null)return null;if(l=this.findPreviousKey(l,n=>n.type==="item"),l!=null){if(this.isCell(u)){let n=u.colIndex?u.colIndex:u.index;return this.getKeyForItemInRowByIndex(l,n)}if(this.focusMode==="row")return l}return null}getKeyRightOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let d=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=W(d))===null||u===void 0?void 0:u.key:(o=U(d))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let d=this.collection.getItem(l.parentKey);if(!d)return null;let r=z(d,this.collection);var i;let p=(i=this.direction==="rtl"?te(r,l.index-1):te(r,l.index+1))!==null&&i!==void 0?i:null;var a;if(p)return(a=p.key)!==null&&a!==void 0?a:null;var m;if(this.focusMode==="row")return(m=l.parentKey)!==null&&m!==void 0?m:null;var c;return(c=this.direction==="rtl"?this.getFirstKey(t):this.getLastKey(t))!==null&&c!==void 0?c:null}return null}getKeyLeftOf(t){let l=this.collection.getItem(t);if(!l)return null;if(this.isRow(l)){var u,o;let d=z(l,this.collection);var n;return(n=this.direction==="rtl"?(u=U(d))===null||u===void 0?void 0:u.key:(o=W(d))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(l)&&l.parentKey!=null){let d=this.collection.getItem(l.parentKey);if(!d)return null;let r=z(d,this.collection);var i;let p=(i=this.direction==="rtl"?te(r,l.index+1):te(r,l.index-1))!==null&&i!==void 0?i:null;var a;if(p)return(a=p.key)!==null&&a!==void 0?a:null;var m;if(this.focusMode==="row")return(m=l.parentKey)!==null&&m!==void 0?m:null;var c;return(c=this.direction==="rtl"?this.getLastKey(t):this.getFirstKey(t))!==null&&c!==void 0?c:null}return null}getFirstKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let c=this.collection.getItem(o.parentKey);if(!c)return null;var i;return(i=(n=U(z(c,this.collection)))===null||n===void 0?void 0:n.key)!==null&&i!==void 0?i:null}}if(u=this.findNextKey(void 0,c=>c.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var a;let c=this.collection.getItem(u);if(!c)return null;var m;u=(m=(a=U(z(c,this.collection)))===null||a===void 0?void 0:a.key)!==null&&m!==void 0?m:null}return u}getLastKey(t,l){let u=t??null,o;if(u!=null){if(o=this.collection.getItem(u),!o)return null;if(this.isCell(o)&&!l&&o.parentKey!=null){var n;let c=this.collection.getItem(o.parentKey);if(!c)return null;let d=z(c,this.collection);var i;return(i=(n=W(d))===null||n===void 0?void 0:n.key)!==null&&i!==void 0?i:null}}if(u=this.findPreviousKey(void 0,c=>c.type==="item"),u!=null&&(o&&this.isCell(o)&&l||this.focusMode==="cell")){var a;let c=this.collection.getItem(u);if(!c)return null;let d=z(c,this.collection);var m;u=(m=(a=W(d))===null||a===void 0?void 0:a.key)!==null&&m!==void 0?m:null}return u}getKeyPageAbove(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=Math.max(0,u.y+u.height-this.layoutDelegate.getVisibleRect().height);for(;u&&u.y>o&&l!=null;){var n;if(l=(n=this.getKeyAbove(l))!==null&&n!==void 0?n:null,l==null)break;u=this.layoutDelegate.getItemRect(l)}return l}getKeyPageBelow(t){let l=t,u=this.layoutDelegate.getItemRect(l);if(!u)return null;let o=this.layoutDelegate.getVisibleRect().height,n=Math.min(this.layoutDelegate.getContentSize().height,u.y+o);for(;u&&u.y+u.heightr.type==="item"),u==null&&!a&&(u=this.getFirstKey(),a=!0)}return null}constructor(t){if(this.collection=t.collection,this.disabledKeys=t.disabledKeys,this.disabledBehavior=t.disabledBehavior||"all",this.direction=t.direction,this.collator=t.collator,!t.layout&&!t.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=t.layoutDelegate||(t.layout?new du(t.layout):new Tl(t.ref)),this.focusMode=t.focusMode||"row"}}class du{getContentSize(){return this.layout.getContentSize()}getItemRect(t){var l;return((l=this.layout.getLayoutInfo(t))===null||l===void 0?void 0:l.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}constructor(t){this.layout=t}}const ve=new WeakMap;var xt={};xt={deselectedItem:e=>`${e.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${t.number(e.count)} عنصر محدد`,other:()=>`${t.number(e.count)} عنصر محدد`})}.`,selectedItem:e=>`${e.item} المحدد`};var Ct={};Ct={deselectedItem:e=>`${e.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Няма избрани елементи",one:()=>`${t.number(e.count)} избран елемент`,other:()=>`${t.number(e.count)} избрани елементи`})}.`,selectedItem:e=>`${e.item} избран.`};var Dt={};Dt={deselectedItem:e=>`Položka ${e.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${t.number(e.count)} položka`,other:()=>`Vybráno ${t.number(e.count)} položek`})}.`,selectedItem:e=>`Vybrána položka ${e.item}.`};var Bt={};Bt={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer valgt",one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var kt={};kt={deselectedItem:e=>`${e.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${t.number(e.count)} Element ausgewählt`,other:()=>`${t.number(e.count)} Elemente ausgewählt`})}.`,selectedItem:e=>`${e.item} ausgewählt.`};var Et={};Et={deselectedItem:e=>`Δεν επιλέχθηκε το στοιχείο ${e.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${t.number(e.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${t.number(e.count)} στοιχεία`})}.`,selectedItem:e=>`Επιλέχθηκε το στοιχείο ${e.item}.`};var St={};St={deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var At={};At={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ningún elemento seleccionado",one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var wt={};wt={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Üksusi pole valitud",one:()=>`${t.number(e.count)} üksus valitud`,other:()=>`${t.number(e.count)} üksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var Nt={};Nt={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var zt={};zt={deselectedItem:e=>`${e.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Aucun élément sélectionné",one:()=>`${t.number(e.count)} élément sélectionné`,other:()=>`${t.number(e.count)} éléments sélectionnés`})}.`,selectedItem:e=>`${e.item} sélectionné.`};var Ft={};Ft={deselectedItem:e=>`${e.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${t.number(e.count)} נבחר`,other:()=>`${t.number(e.count)} פריטים נבחרו`})}.`,selectedItem:e=>`${e.item} נבחר.`};var Pt={};Pt={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var Kt={};Kt={deselectedItem:e=>`${e.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${t.number(e.count)} elem kijelölve`,other:()=>`${t.number(e.count)} elem kijelölve`})}.`,selectedItem:e=>`${e.item} kijelölve.`};var It={};It={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nessun elemento selezionato",one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var jt={};jt={deselectedItem:e=>`${e.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"項目が選択されていません",one:()=>`${t.number(e.count)} 項目を選択しました`,other:()=>`${t.number(e.count)} 項目を選択しました`})}。`,selectedItem:e=>`${e.item} を選択しました。`};var Mt={};Mt={deselectedItem:e=>`${e.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"선택된 항목이 없습니다",one:()=>`${t.number(e.count)}개 항목이 선택되었습니다`,other:()=>`${t.number(e.count)}개 항목이 선택되었습니다`})}.`,selectedItem:e=>`${e.item}이(가) 선택되었습니다.`};var Tt={};Tt={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta elementų: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var Rt={};Rt={deselectedItem:e=>`Vienums ${e.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlasīts vienums ${e.item}.`};var Vt={};Vt={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer er valgt",one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var Ot={};Ot={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Geen items geselecteerd",one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var Ht={};Ht={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych elementów`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var Lt={};Lt={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Ut={};Ut={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Wt={};Wt={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Niciun element selectat",one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var Gt={};Gt={deselectedItem:e=>`${e.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Нет выбранных элементов",one:()=>`${t.number(e.count)} элемент выбран`,other:()=>`${t.number(e.count)} элементов выбрано`})}.`,selectedItem:e=>`${e.item} выбрано.`};var Yt={};Yt={deselectedItem:e=>`Nevybraté položky: ${e.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Žiadne vybraté položky",one:()=>`${t.number(e.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybraté položky: ${e.item}.`};var Zt={};Zt={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Noben element ni izbran",one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var _t={};_t={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var qt={};qt={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Inga markerade objekt",one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var Jt={};Jt={deselectedItem:e=>`${e.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${t.number(e.count)} öge seçildi`,other:()=>`${t.number(e.count)} öge seçildi`})}.`,selectedItem:e=>`${e.item} seçildi.`};var Xt={};Xt={deselectedItem:e=>`${e.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Жодних елементів не вибрано",one:()=>`${t.number(e.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} вибрано.`};var Qt={};Qt={deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`};var el={};el={deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未選取任何項目",one:()=>`已選取 ${t.number(e.count)} 個項目`,other:()=>`已選取 ${t.number(e.count)} 個項目`})}。`,selectedItem:e=>`已選取「${e.item}」。`};var oe={};oe={"ar-AE":xt,"bg-BG":Ct,"cs-CZ":Dt,"da-DK":Bt,"de-DE":kt,"el-GR":Et,"en-US":St,"es-ES":At,"et-EE":wt,"fi-FI":Nt,"fr-FR":zt,"he-IL":Ft,"hr-HR":Pt,"hu-HU":Kt,"it-IT":It,"ja-JP":jt,"ko-KR":Mt,"lt-LT":Tt,"lv-LV":Rt,"nb-NO":Vt,"nl-NL":Ot,"pl-PL":Ht,"pt-BR":Lt,"pt-PT":Ut,"ro-RO":Wt,"ru-RU":Gt,"sk-SK":Yt,"sl-SI":Zt,"sr-SP":_t,"sv-SE":qt,"tr-TR":Jt,"uk-UA":Xt,"zh-CN":Qt,"zh-TW":el};const tl=7e3;let V=null;function ll(e,t="assertive",l=tl){V?V.announce(e,t,l):(V=new mu,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?V.announce(e,t,l):setTimeout(()=>{V?.isAttached()&&V?.announce(e,t,l)},100))}class mu{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let l=document.createElement("div");return l.setAttribute("role","log"),l.setAttribute("aria-live",t),l.setAttribute("aria-relevant","additions"),l}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,l="assertive",u=tl){var o,n;if(!this.node)return;let i=document.createElement("div");typeof t=="object"?(i.setAttribute("role","img"),i.setAttribute("aria-labelledby",t["aria-labelledby"])):i.textContent=t,l==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(i):(n=this.politeLog)===null||n===void 0||n.appendChild(i),t!==""&&setTimeout(()=>{i.remove()},u)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function pu(e){return e&&e.__esModule?e.default:e}function bu(e,t){let{getRowText:l=a=>{var m,c,d,r;return(r=(m=(c=t.collection).getTextValue)===null||m===void 0?void 0:m.call(c,a))!==null&&r!==void 0?r:(d=t.collection.getItem(a))===null||d===void 0?void 0:d.textValue}}=e,u=_(pu(oe),"@react-aria/grid"),o=t.selectionManager.rawSelection,n=B.useRef(o),i=Rl(()=>{var a;if(!t.selectionManager.isFocused||o===n.current){n.current=o;return}let m=Ee(o,n.current),c=Ee(n.current,o),d=t.selectionManager.selectionBehavior==="replace",r=[];if(t.selectionManager.selectedKeys.size===1&&d){let p=t.selectionManager.selectedKeys.keys().next().value;if(p!=null&&t.collection.getItem(p)){let s=l(p);s&&r.push(u.format("selectedItem",{item:s}))}}else if(m.size===1&&c.size===0){let p=m.keys().next().value;if(p!=null){let s=l(p);s&&r.push(u.format("selectedItem",{item:s}))}}else if(c.size===1&&m.size===0){let p=c.keys().next().value;if(p!=null&&t.collection.getItem(p)){let s=l(p);s&&r.push(u.format("deselectedItem",{item:s}))}}t.selectionManager.selectionMode==="multiple"&&(r.length===0||o==="all"||o.size>1||n.current==="all"||((a=n.current)===null||a===void 0?void 0:a.size)>1)&&r.push(o==="all"?u.format("selectedAll"):u.format("selectedCount",{count:o.size})),r.length>0&&ll(r.join(" ")),n.current=o});Me(()=>{if(t.selectionManager.isFocused)i();else{let a=requestAnimationFrame(i);return()=>cancelAnimationFrame(a)}},[o,t.selectionManager.isFocused])}function Ee(e,t){let l=new Set;if(e==="all"||t==="all")return l;for(let u of e.keys())t.has(u)||l.add(u);return l}function fu(e){return e&&e.__esModule?e.default:e}function hu(e){let t=_(fu(oe),"@react-aria/grid"),l=Vl(),u=(l==="pointer"||l==="virtual"||l==null)&&typeof window<"u"&&"ontouchstart"in window,o=B.useMemo(()=>{let i=e.selectionManager.selectionMode,a=e.selectionManager.selectionBehavior,m;return u&&(m=t.format("longPressToSelect")),a==="replace"&&i!=="none"&&e.hasItemActions?m:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,u]);return fe(o)}function vu(e,t,l){let{isVirtualized:u,disallowTypeAhead:o,keyboardDelegate:n,focusMode:i,scrollRef:a,getRowText:m,onRowAction:c,onCellAction:d,escapeKeyBehavior:r="clearSelection",shouldSelectOnPressUp:p}=e,{selectionManager:s}=t;!e["aria-label"]&&!e["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let b=ze({usage:"search",sensitivity:"base"}),{direction:v}=ue(),g=t.selectionManager.disabledBehavior,x=B.useMemo(()=>n||new yt({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:g,ref:l,direction:v,collator:b,focusMode:i}),[n,t.collection,t.disabledKeys,g,l,v,b,i]),{collectionProps:D}=Ol({ref:l,selectionManager:s,keyboardDelegate:x,isVirtualized:u,scrollRef:a,disallowTypeAhead:o,escapeKeyBehavior:r}),y=pe(e.id);ve.set(t,{keyboardDelegate:x,actions:{onRowAction:c,onCellAction:d},shouldSelectOnPressUp:p});let $=hu({selectionManager:s,hasItemActions:!!(c||d)}),f=Hl(e,{labelable:!0}),E=B.useCallback(C=>{if(s.isFocused){C.currentTarget.contains(C.target)||s.setFocused(!1);return}C.currentTarget.contains(C.target)&&s.setFocused(!0)},[s]),S=B.useMemo(()=>({onBlur:D.onBlur,onFocus:E}),[E,D.onBlur]),A=au(l,{isDisabled:t.collection.size!==0}),k=J(f,{role:"grid",id:y,"aria-multiselectable":s.selectionMode==="multiple"?"true":void 0},t.isKeyboardNavigationDisabled?S:D,t.collection.size===0&&{tabIndex:A?-1:0}||void 0,$);return u&&(k["aria-rowcount"]=t.collection.size,k["aria-colcount"]=t.collection.columnCount),bu({getRowText:m},t),{gridProps:k}}function gu(){return{rowGroupProps:{role:"rowgroup"}}}function $u(e,t,l){var u,o;let{node:n,isVirtualized:i,shouldSelectOnPressUp:a,onAction:m}=e,{actions:c,shouldSelectOnPressUp:d}=ve.get(t),r=c.onRowAction?()=>{var g;return(g=c.onRowAction)===null||g===void 0?void 0:g.call(c,n.key)}:m,{itemProps:p,...s}=je({selectionManager:t.selectionManager,key:n.key,ref:l,isVirtualized:i,shouldSelectOnPressUp:d||a,onAction:r||!(n==null||(u=n.props)===null||u===void 0)&&u.onAction?Ll(n==null||(o=n.props)===null||o===void 0?void 0:o.onAction,r):void 0,isDisabled:t.collection.size===0}),b=t.selectionManager.isSelected(n.key),v={role:"row","aria-selected":t.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":s.isDisabled||void 0,...p};return i&&(v["aria-rowindex"]=n.index+1),{rowProps:v,...s}}function ul(e,t,l){let{node:u,isVirtualized:o,focusMode:n="child",shouldSelectOnPressUp:i,onAction:a}=e,{direction:m}=ue(),{keyboardDelegate:c,actions:{onCellAction:d}}=ve.get(t),r=B.useRef(null),p=()=>{if(l.current){let y=ae(l.current);if(n==="child"){if(l.current.contains(document.activeElement)&&l.current!==document.activeElement)return;let $=t.selectionManager.childFocusStrategy==="last"?re(y):y.firstChild();if($){L($);return}}(r.current!=null&&u.key!==r.current||!l.current.contains(document.activeElement))&&L(l.current)}},{itemProps:s,isPressed:b}=je({selectionManager:t.selectionManager,key:u.key,ref:l,isVirtualized:o,focus:p,shouldSelectOnPressUp:i,onAction:d?()=>d(u.key):a,isDisabled:t.collection.size===0}),v=y=>{if(!y.currentTarget.contains(y.target)||t.isKeyboardNavigationDisabled||!l.current||!document.activeElement)return;let $=ae(l.current);switch($.currentNode=document.activeElement,y.key){case"ArrowLeft":{let C=m==="rtl"?$.nextNode():$.previousNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var f;if(((f=c.getKeyLeftOf)===null||f===void 0?void 0:f.call(c,u.key))!==u.key){var E;(E=l.current.parentElement)===null||E===void 0||E.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&m==="rtl"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=m==="rtl"?$.firstChild():re($),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowRight":{let C=m==="rtl"?$.previousNode():$.nextNode();if(n==="child"&&C===l.current&&(C=null),y.preventDefault(),y.stopPropagation(),C)L(C),Y(C,{containingElement:Z(l.current)});else{var S;if(((S=c.getKeyRightOf)===null||S===void 0?void 0:S.call(c,u.key))!==u.key){var A;(A=l.current.parentElement)===null||A===void 0||A.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent));break}n==="cell"&&m==="ltr"?(L(l.current),Y(l.current,{containingElement:Z(l.current)})):($.currentNode=l.current,C=m==="rtl"?re($):$.firstChild(),C&&(L(C),Y(C,{containingElement:Z(l.current)})))}break}case"ArrowUp":case"ArrowDown":if(!y.altKey&&l.current.contains(y.target)){var k;y.stopPropagation(),y.preventDefault(),(k=l.current.parentElement)===null||k===void 0||k.dispatchEvent(new KeyboardEvent(y.nativeEvent.type,y.nativeEvent))}break}},g=y=>{if(r.current=u.key,y.target!==l.current){Ul()||t.selectionManager.setFocusedKey(u.key);return}requestAnimationFrame(()=>{n==="child"&&document.activeElement===l.current&&p()})},x=J(s,{role:"gridcell",onKeyDownCapture:v,"aria-colspan":u.colSpan,"aria-colindex":u.colIndex!=null?u.colIndex+1:void 0,colSpan:o?void 0:u.colSpan,onFocus:g});var D;return o&&(x["aria-colindex"]=((D=u.colIndex)!==null&&D!==void 0?D:u.index)+1),i&&x.tabIndex!=null&&x.onPointerDown==null&&(x.onPointerDown=y=>{let $=y.currentTarget,f=$.getAttribute("tabindex");$.removeAttribute("tabindex"),requestAnimationFrame(()=>{f!=null&&$.setAttribute("tabindex",f)})}),{gridCellProps:x,isPressed:b}}function re(e){let t=null,l=null;do l=e.lastChild(),l&&(t=l);while(l);return t}function yu(e){return e&&e.__esModule?e.default:e}function xu(e,t){let{key:l}=e,u=t.selectionManager,o=pe(),n=!t.selectionManager.canSelectItem(l),i=t.selectionManager.isSelected(l),a=()=>u.toggleSelection(l);const m=_(yu(oe),"@react-aria/grid");return{checkboxProps:{id:o,"aria-label":m.format("select"),isSelected:i,isDisabled:n,onChange:a}}}class Cu extends yt{isCell(t){return t.type==="cell"||t.type==="rowheader"||t.type==="column"}getKeyBelow(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let u=U(z(l,this.collection));if(u)return u.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,l.index)}return super.getKeyBelow(t)}getKeyAbove(t){let l=this.collection.getItem(t);if(!l)return null;if(l.type==="column"){let n=l.parentKey!=null?this.collection.getItem(l.parentKey):null;return n&&n.type==="column"?n.key:null}let u=super.getKeyAbove(t),o=u!=null?this.collection.getItem(u):null;return o&&o.type!=="headerrow"?u:this.isCell(l)?this.collection.columns[l.index].key:this.collection.columns[0].key}findNextColumnKey(t){let l=this.findNextKey(t.key,o=>o.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level];for(let o of z(u,this.collection))if(o.type==="column")return o.key;return null}findPreviousColumnKey(t){let l=this.findPreviousKey(t.key,n=>n.type==="column");if(l!=null)return l;let u=this.collection.headerRows[t.level],o=[...z(u,this.collection)];for(let n=o.length-1;n>=0;n--){let i=o[n];if(i.type==="column")return i.key}return null}getKeyRightOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(l):this.findNextColumnKey(l):super.getKeyRightOf(t):null}getKeyLeftOf(t){let l=this.collection.getItem(t);return l?l.type==="column"?this.direction==="rtl"?this.findNextColumnKey(l):this.findPreviousColumnKey(l):super.getKeyLeftOf(t):null}getKeyForSearch(t,l){if(!this.collator)return null;let u=this.collection,o=l??this.getFirstKey();if(o==null)return null;let n=u.getItem(o);var i;n?.type==="cell"&&(o=(i=n.parentKey)!==null&&i!==void 0?i:null);let a=!1;for(;o!=null;){let m=u.getItem(o);if(!m)return null;if(m.textValue){let c=m.textValue.slice(0,t.length);if(this.collator.compare(c,t)===0)return m.key}for(let c of z(m,this.collection)){let d=u.columns[c.index];if(u.rowHeaderColumnKeys.has(d.key)&&c.textValue){let r=c.textValue.slice(0,t.length);if(this.collator.compare(r,t)===0){let p=l!=null?u.getItem(l):n;return p?.type==="cell"?c.key:m.key}}}o=this.getKeyBelow(o),o==null&&!a&&(o=this.getFirstKey(),a=!0)}return null}}function Du(e){return e&&e.__esModule?e.default:e}function Bu(e,t,l){let{keyboardDelegate:u,isVirtualized:o,layoutDelegate:n,layout:i}=e,a=ze({usage:"search",sensitivity:"base"}),{direction:m}=ue(),c=t.selectionManager.disabledBehavior,d=B.useMemo(()=>u||new Cu({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:c,ref:l,direction:m,collator:a,layoutDelegate:n,layout:i}),[u,t.collection,t.disabledKeys,c,l,m,a,n,i]),r=pe(e.id);he.set(t,r);let{gridProps:p}=vu({...e,id:r,keyboardDelegate:d},t,l);o&&(p["aria-rowcount"]=t.collection.size+t.collection.headerRows.length),le()&&"expandedKeys"in t&&(p.role="treegrid");let{column:s,direction:b}=t.sortDescriptor||{},v=_(Du(ne),"@react-aria/table"),g=B.useMemo(()=>{var D,y;let $=(y=(D=t.collection.columns.find(f=>f.key===s))===null||D===void 0?void 0:D.textValue)!==null&&y!==void 0?y:"";return b&&s?v.format(`${b}Sort`,{columnName:$}):void 0},[b,s,t.collection.columns]),x=fe(g);return Me(()=>{g&&ll(g,"assertive",500)},[g]),{gridProps:J(p,x,{"aria-describedby":[x["aria-describedby"],p["aria-describedby"]].filter(Boolean).join(" ")})}}function ku(e){return e&&e.__esModule?e.default:e}function nl(e,t,l){var u,o;let{node:n}=e,i=n.props.allowsSorting,{gridCellProps:a}=ul({...e,focusMode:"child"},t,l),m=n.props.isSelectionCell&&t.selectionManager.selectionMode==="single",{pressProps:c}=Wl({isDisabled:!i||m,onPress(){t.sort(n.key)},ref:l}),{focusableProps:d}=Gl({},l),r,p=((u=t.sortDescriptor)===null||u===void 0?void 0:u.column)===n.key,s=(o=t.sortDescriptor)===null||o===void 0?void 0:o.direction;n.props.allowsSorting&&!Ce()&&(r=p?s:"none");let b=_(ku(ne),"@react-aria/table"),v;i&&(v=`${b.format("sortable")}`,p&&s&&Ce()&&(v=`${v}, ${b.format(s)}`));let g=fe(v),x=t.collection.size===0;return B.useEffect(()=>{x&&t.selectionManager.focusedKey===n.key&&t.selectionManager.setFocusedKey(null)},[x,t.selectionManager,n.key]),{columnHeaderProps:{...J(d,a,c,g,x?{tabIndex:-1}:null),role:"columnheader",id:cu(t,n.key),"aria-colspan":n.colSpan&&n.colSpan>1?n.colSpan:void 0,"aria-sort":r}}}const Se={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Eu(e,t,l){let{node:u,isVirtualized:o}=e,{rowProps:n,...i}=$u(e,t,l),{direction:a}=ue();o&&!(le()&&"expandedKeys"in t)?n["aria-rowindex"]=u.index+1+t.collection.headerRows.length:delete n["aria-rowindex"];let m={};if(le()&&"expandedKeys"in t){let f=t.keyMap.get(u.key);if(f!=null){var c,d,r,p,s,b;let E=((c=f.props)===null||c===void 0?void 0:c.UNSTABLE_childItems)||((r=f.props)===null||r===void 0||(d=r.children)===null||d===void 0?void 0:d.length)>t.userColumnCount;var v,g,x,D;m={onKeyDown:S=>{(S.key===Se.expand[a]&&t.selectionManager.focusedKey===f.key&&E&&t.expandedKeys!=="all"&&!t.expandedKeys.has(f.key)||S.key===Se.collapse[a]&&t.selectionManager.focusedKey===f.key&&E&&(t.expandedKeys==="all"||t.expandedKeys.has(f.key)))&&(t.toggleKey(f.key),S.stopPropagation())},"aria-expanded":E?t.expandedKeys==="all"||t.expandedKeys.has(u.key):void 0,"aria-level":f.level,"aria-posinset":((v=f.indexOfType)!==null&&v!==void 0?v:0)+1,"aria-setsize":f.level>1?((x=(p=W((g=(s=t.keyMap.get(f.parentKey))===null||s===void 0?void 0:s.childNodes)!==null&&g!==void 0?g:[]))===null||p===void 0?void 0:p.indexOfType)!==null&&x!==void 0?x:0)+1:((D=(b=W(t.collection.body.childNodes))===null||b===void 0?void 0:b.indexOfType)!==null&&D!==void 0?D:0)+1}}}let y=Yl(u.props),$=i.hasAction?y:{};return{rowProps:{...J(n,m,$),"aria-labelledby":Re(t,u.key)},...i}}function Su(e,t,l){let{node:u,isVirtualized:o}=e,n={role:"row"};return o&&!(le()&&"expandedKeys"in t)&&(n["aria-rowindex"]=u.index+1),{rowProps:n}}function ol(e,t,l){var u;let{gridCellProps:o,isPressed:n}=ul(e,t,l),i=(u=e.node.column)===null||u===void 0?void 0:u.key;return i!=null&&t.collection.rowHeaderColumnKeys.has(i)&&(o.role="rowheader",o.id=Te(t,e.node.parentKey,i)),{gridCellProps:o,isPressed:n}}function Au(e){return e&&e.__esModule?e.default:e}function wu(e,t){let{key:l}=e;const{checkboxProps:u}=xu(e,t);return{checkboxProps:{...u,"aria-labelledby":`${u.id} ${Re(t,l)}`}}}function Nu(e){let{isEmpty:t,isSelectAll:l,selectionMode:u}=e.selectionManager;return{checkboxProps:{"aria-label":_(Au(ne),"@react-aria/table").format(u==="single"?"select":"selectAll"),isSelected:l,isDisabled:u!=="multiple"||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type==="loader",isIndeterminate:!t&&!l,onChange:()=>e.selectionManager.toggleSelectAll()}}}function ge(){return gu()}var sl=T((e,t)=>{var l,u;const{as:o,className:n,node:i,slots:a,state:m,selectionMode:c,color:d,checkboxesProps:r,disableAnimation:p,classNames:s,...b}=e,v=o||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:i},m,x),{isFocusVisible:y,focusProps:$}=X(),{checkboxProps:f}=Nu(m),E=K(s?.th,n,(l=i.props)==null?void 0:l.className),S=c==="single",{onChange:A,...k}=f;return h.jsx(v,{ref:x,"data-focus-visible":w(y),...I(D,$,O(i.props,{enabled:g}),O(b,{enabled:g})),className:(u=a.th)==null?void 0:u.call(a,{class:E}),children:S?h.jsx(be,{children:f["aria-label"]}):h.jsx(Fe,{color:d,disableAnimation:p,onValueChange:A,...I(r,k)})})});sl.displayName="HeroUI.TableSelectAllCheckbox";var il=sl;function zu(e){let{collection:t,focusMode:l}=e,u=e.UNSAFE_selectionState||Zl(e),o=B.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),n=u.setFocusedKey;u.setFocusedKey=(m,c)=>{if(l==="cell"&&m!=null){let b=t.getItem(m);if(b?.type==="item"){var d,r;let v=z(b,t);var p,s;c==="last"?m=(p=(d=W(v))===null||d===void 0?void 0:d.key)!==null&&p!==void 0?p:null:m=(s=(r=U(v))===null||r===void 0?void 0:r.key)!==null&&s!==void 0?s:null}}n(m,c)};let i=B.useMemo(()=>new _l(t,u),[t,u]);const a=B.useRef(null);return B.useEffect(()=>{if(u.focusedKey!=null&&a.current&&!t.getItem(u.focusedKey)){const m=a.current.getItem(u.focusedKey),c=m?.parentKey!=null&&(m.type==="cell"||m.type==="rowheader"||m.type==="column")?a.current.getItem(m.parentKey):m;if(!c){u.setFocusedKey(null);return}const d=a.current.rows,r=t.rows,p=d.length-r.length;let s=Math.min(p>1?Math.max(c.index-p+1,0):c.index,r.length-1),b=null;for(;s>=0;){if(!i.isDisabled(r[s].key)&&r[s].type!=="headerrow"){b=r[s];break}sc.index&&(s=c.index),s--)}if(b){const v=b.hasChildNodes?[...z(b,t)]:[],g=b.hasChildNodes&&c!==m&&m&&m.index{let p=this.keyMap.get(r.key);t.visitNode&&(r=t.visitNode(r)),this.keyMap.set(r.key,r);let s=new Set,b=null,v=!1;if(r.type==="item"){var g;for(let f of r.childNodes)if(((g=f.props)===null||g===void 0?void 0:g.colSpan)!==void 0){v=!0;break}}for(let f of r.childNodes){if(f.type==="cell"&&v){var x,D;f.colspan=(x=f.props)===null||x===void 0?void 0:x.colSpan,f.colSpan=(D=f.props)===null||D===void 0?void 0:D.colSpan;var y,$;f.colIndex=b?((y=b.colIndex)!==null&&y!==void 0?y:b.index)+(($=b.colSpan)!==null&&$!==void 0?$:1):f.index}f.type==="cell"&&f.parentKey==null&&(f.parentKey=r.key),s.add(f.key),b?(b.nextKey=f.key,f.prevKey=b.key):f.prevKey=null,l(f),b=f}if(b&&(b.nextKey=null),p)for(let f of p.childNodes)s.has(f.key)||u(f)},u=r=>{this.keyMap.delete(r.key);for(let p of r.childNodes)this.keyMap.get(p.key)===p&&u(p)},o=null;for(let[r,p]of t.items.entries()){var n,i,a,m,c,d;let s={...p,level:(n=p.level)!==null&&n!==void 0?n:0,key:(i=p.key)!==null&&i!==void 0?i:"row-"+r,type:(a=p.type)!==null&&a!==void 0?a:"row",value:(m=p.value)!==null&&m!==void 0?m:null,hasChildNodes:!0,childNodes:[...p.childNodes],rendered:p.rendered,textValue:(c=p.textValue)!==null&&c!==void 0?c:"",index:(d=p.index)!==null&&d!==void 0?d:r};o?(o.nextKey=s.key,s.prevKey=o.key):s.prevKey=null,this.rows.push(s),l(s),o=s}o&&(o.nextKey=null)}}const rl="row-header-column-"+Math.random().toString(36).slice(2);let de="row-header-column-"+Math.random().toString(36).slice(2);for(;rl===de;)de="row-header-column-"+Math.random().toString(36).slice(2);function Pu(e,t){if(t.length===0)return[];let l=[],u=new Map;for(let d of t){let r=d.parentKey,p=[d];for(;r;){let s=e.get(r);if(!s)break;if(u.has(s)){var o,n;(n=(o=s).colSpan)!==null&&n!==void 0||(o.colSpan=0),s.colSpan++,s.colspan=s.colSpan;let{column:b,index:v}=u.get(s);if(v>p.length)break;for(let g=v;gd.length)),a=Array(i).fill(0).map(()=>[]),m=0;for(let d of l){let r=i-1;for(let p of d){if(p){let s=a[r],b=s.reduce((v,g)=>{var x;return v+((x=g.colSpan)!==null&&x!==void 0?x:1)},0);if(b0&&(s[s.length-1].nextKey=v.key,v.prevKey=s[s.length-1].key),s.push(v)}s.length>0&&(s[s.length-1].nextKey=p.key,p.prevKey=s[s.length-1].key),p.level=r,p.colIndex=m,s.push(p)}r--}m++}let c=0;for(let d of a){let r=d.reduce((p,s)=>{var b;return p+((b=s.colSpan)!==null&&b!==void 0?b:1)},0);if(r({type:"headerrow",key:"headerrow-"+r,index:r,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:d,textValue:""}))}class Ku extends Fu{*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let l=this.keyMap.get(t);var u;return(u=l?.prevKey)!==null&&u!==void 0?u:null}getKeyAfter(t){let l=this.keyMap.get(t);var u;return(u=l?.nextKey)!==null&&u!==void 0?u:null}getFirstKey(){var t,l;return(l=(t=U(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getLastKey(){var t,l;return(l=(t=W(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&l!==void 0?l:null}getItem(t){var l;return(l=this.keyMap.get(t))!==null&&l!==void 0?l:null}at(t){const l=[...this.getKeys()];return this.getItem(l[t])}getChildren(t){return t===this.body.key?this.body.childNodes:super.getChildren(t)}getTextValue(t){let l=this.getItem(t);if(!l)return"";if(l.textValue)return l.textValue;let u=this.rowHeaderColumnKeys;if(u){let o=[];for(let n of l.childNodes){let i=this.columns[n.index];if(u.has(i.key)&&n.textValue&&o.push(n.textValue),o.length===u.size)break}return o.join(" ")}return""}constructor(t,l,u){let o=new Set,n=null,i=[];if(u?.showSelectionCheckboxes){let r={type:"column",key:rl,value:null,textValue:"",level:0,index:u?.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};i.unshift(r)}if(u?.showDragButtons){let r={type:"column",key:de,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};i.unshift(r)}let a=[],m=new Map,c=r=>{switch(r.type){case"body":n=r;break;case"column":m.set(r.key,r),r.hasChildNodes||(i.push(r),r.props.isRowHeader&&o.add(r.key));break;case"item":a.push(r);return}for(let p of r.childNodes)c(p)};for(let r of t)c(r);let d=Pu(m,i);if(d.forEach((r,p)=>a.splice(p,0,r)),super({columnCount:i.length,items:a,visitNode:r=>(r.column=i[r.index],r)}),this._size=0,this.columns=i,this.rowHeaderColumnKeys=o,this.body=n,this.headerRows=d,this._size=[...n.childNodes].length,this.rowHeaderColumnKeys.size===0){let r=this.columns.find(p=>{var s,b;return!(!((s=p.props)===null||s===void 0)&&s.isDragButtonCell)&&!(!((b=p.props)===null||b===void 0)&&b.isSelectionCell)});r&&this.rowHeaderColumnKeys.add(r.key)}}}const Iu={ascending:"descending",descending:"ascending"};function ju(e){let[t,l]=B.useState(!1),{selectionMode:u="none",showSelectionCheckboxes:o,showDragButtons:n}=e,i=B.useMemo(()=>({showSelectionCheckboxes:o&&u!=="none",showDragButtons:n,selectionMode:u,columns:[]}),[e.children,o,u,n]),a=ql(e,B.useCallback(r=>new Ku(r,null,i),[i]),i),{disabledKeys:m,selectionManager:c}=zu({...e,collection:a,disabledBehavior:e.disabledBehavior||"selection"});var d;return{collection:a,disabledKeys:m,selectionManager:c,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:(d=e.sortDescriptor)!==null&&d!==void 0?d:null,isKeyboardNavigationDisabled:a.size===0||t,setKeyboardNavigationDisabled:l,sort(r,p){var s,b;(b=e.onSortChange)===null||b===void 0||b.call(e,{column:r,direction:p??(((s=e.sortDescriptor)===null||s===void 0?void 0:s.column)===r?Iu[e.sortDescriptor.direction]:"ascending")})}}}function al(e){return null}al.getCollectionNode=function*(t,l){let{children:u,columns:o}=t;if(l.columns=[],typeof u=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let n of o)yield{type:"column",value:n,renderer:u}}else{let n=[];q.Children.forEach(u,i=>{n.push({type:"column",element:i})}),yield*n}};let Mu=al;function cl(e){return null}cl.getCollectionNode=function*(t){let{children:l,items:u}=t;yield{type:"body",hasChildNodes:!0,props:t,*childNodes(){if(typeof l=="function"){if(!u)throw new Error("props.children was a function but props.items is missing");for(let o of u)yield{type:"item",value:o,renderer:l}}else{let o=[];q.Children.forEach(l,n=>{o.push({type:"item",element:n})}),yield*o}}}};let Tu=cl;function dl(e){return null}dl.getCollectionNode=function*(t,l){let{title:u,children:o,childColumns:n}=t,i=u||o,a=t.textValue||(typeof i=="string"?i:"")||t["aria-label"],m=yield{type:"column",hasChildNodes:!!n||!!u&&q.Children.count(o)>0,rendered:i,textValue:a,props:t,*childNodes(){if(n)for(let d of n)yield{type:"column",value:d};else if(u){let d=[];q.Children.forEach(o,r=>{d.push({type:"column",element:r})}),yield*d}},shouldInvalidate(d){return c(d),!1}},c=d=>{for(let r of m)r.hasChildNodes||d.columns.push(r)};c(l)};let Ru=dl;function me(e){return null}me.getCollectionNode=function*(t,l){let{children:u,textValue:o,UNSTABLE_childItems:n}=t;yield{type:"item",props:t,textValue:o,"aria-label":t["aria-label"],hasChildNodes:!0,*childNodes(){if(l.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),l.showSelectionCheckboxes&&l.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof u=="function"){for(let i of l.columns)yield{type:"cell",element:u(i.key),key:i.key};if(n)for(let i of n)yield{type:"item",value:i}}else{let i=[],a=[],m=0;if(q.Children.forEach(u,c=>{if(c.type===me){if(i.lengtha.key!==l.columns[m].key)||i.showSelectionCheckboxes!==l.showSelectionCheckboxes||i.showDragButtons!==l.showDragButtons||i.selectionMode!==l.selectionMode}}};let Vu=me;function ml(e){return null}ml.getCollectionNode=function*(t){let{children:l}=t,u=t.textValue||(typeof l=="string"?l:"")||t["aria-label"]||"";yield{type:"cell",props:t,rendered:l,textValue:u,"aria-label":t["aria-label"],hasChildNodes:!1}};let Ou=ml;function pl(e){var t;const l=Jl(),[u,o]=Pe(e,ke.variantKeys),{ref:n,as:i,baseRef:a,children:m,className:c,classNames:d,removeWrapper:r=!1,disableAnimation:p=(t=l?.disableAnimation)!=null?t:!1,isKeyboardNavigationDisabled:s=!1,selectionMode:b="none",topContentPlacement:v="inside",bottomContentPlacement:g="inside",selectionBehavior:x=b==="none"?null:"toggle",disabledBehavior:D="selection",showSelectionCheckboxes:y=b==="multiple"&&x!=="replace",BaseComponent:$="div",checkboxesProps:f,topContent:E,bottomContent:S,sortIcon:A,onRowAction:k,onCellAction:C,...N}=u,j=i||"table",F=typeof j=="string",R=M(n),Q=M(a),G=ju({...e,children:m,showSelectionCheckboxes:y});s&&!G.isKeyboardNavigationDisabled&&G.setKeyboardNavigationDisabled(!0);const{collection:se}=G,{layout:sn,...Fl}=e,{gridProps:$e}=Bu({...Fl},G,R),ee=b!=="none",ye=b==="multiple",H=B.useMemo(()=>ke({...o,isSelectable:ee,isMultiSelectable:ye}),[Ke(o),ee,ye]),xe=K(d?.base,c),Pl=B.useMemo(()=>{var P;return{state:G,slots:H,isSelectable:ee,collection:se,classNames:d,color:e?.color,disableAnimation:p,checkboxesProps:f,isHeaderSticky:(P=e?.isHeaderSticky)!=null?P:!1,selectionMode:b,selectionBehavior:x,disabledBehavior:D,showSelectionCheckboxes:y,onRowAction:k,onCellAction:C}},[H,G,se,ee,d,b,x,f,D,p,y,e?.color,e?.isHeaderSticky,k,C]),Kl=B.useCallback(P=>({...P,ref:Q,className:H.base({class:K(xe,P?.className)})}),[xe,H]),Il=B.useCallback(P=>({...P,ref:Q,className:H.wrapper({class:K(d?.wrapper,P?.className)})}),[d?.wrapper,H]),jl=B.useCallback(P=>({...I($e,O(N,{enabled:F}),P),onKeyDownCapture:void 0,ref:R,className:H.table({class:K(d?.table,P?.className)})}),[d?.table,F,H,$e,N]);return{BaseComponent:$,Component:j,children:m,state:G,collection:se,values:Pl,topContent:E,bottomContent:S,removeWrapper:r,topContentPlacement:v,bottomContentPlacement:g,sortIcon:A,getBaseProps:Kl,getWrapperProps:Il,getTableProps:jl}}var bl=T((e,t)=>{var l,u,o;const{as:n,className:i,node:a,rowKey:m,slots:c,state:d,classNames:r,...p}=e,s=n||"td",b=typeof s=="string",v=M(t),{gridCellProps:g}=ol({node:a},d,v),x=K(r?.td,i,(l=a.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=d.selectionManager.isSelected(m),f=B.useMemo(()=>{const S=typeof a.rendered;return S!=="object"&&S!=="function"?h.jsx("span",{children:a.rendered}):a.rendered},[a.rendered]),E=((u=a.column)==null?void 0:u.props)||{};return h.jsx(s,{ref:v,"data-focus-visible":w(D),"data-selected":w($),...I(g,y,O(a.props,{enabled:b}),p),className:(o=c.td)==null?void 0:o.call(c,{align:E.align,class:x}),children:f})});bl.displayName="HeroUI.TableCell";var fl=bl,hl=T((e,t)=>{var l,u;const{as:o,className:n,node:i,rowKey:a,slots:m,state:c,color:d,disableAnimation:r,checkboxesProps:p,selectionMode:s,classNames:b,...v}=e,g=o||"td",x=typeof g=="string",D=M(t),{gridCellProps:y}=ol({node:i},c,D),{isFocusVisible:$,focusProps:f}=X(),{checkboxProps:E}=wu({key:i?.parentKey||i.key},c),S=K(b?.td,n,(l=i.props)==null?void 0:l.className),A=s==="single",{onChange:k,...C}=E,N=c.selectionManager.isSelected(a);return h.jsx(g,{ref:D,"data-focus-visible":w($),"data-selected":w(N),...I(y,f,O(i.props,{enabled:x}),v),className:(u=m.td)==null?void 0:u.call(m,{class:S}),children:A?h.jsx(be,{children:E["aria-label"]}):h.jsx(Fe,{color:d,disableAnimation:r,onValueChange:k,...I(p,C)})})});hl.displayName="HeroUI.TableCheckboxCell";var vl=hl,gl=T((e,t)=>{var l,u;const{as:o,className:n,children:i,node:a,slots:m,state:c,isSelectable:d,classNames:r,...p}=e,s=o||(e?.href?"a":"tr"),b=typeof s=="string",v=M(t),{rowProps:g}=Eu({node:a},c,v),x=K(r?.tr,n,(l=a.props)==null?void 0:l.className),{isFocusVisible:D,focusProps:y}=X(),$=c.disabledKeys.has(a.key),f=c.selectionManager.isSelected(a.key),{isHovered:E,hoverProps:S}=Ie({isDisabled:$}),{isFirst:A,isLast:k,isMiddle:C,isOdd:N}=B.useMemo(()=>{const j=a.key===c.collection.getFirstKey(),F=a.key===c.collection.getLastKey(),R=!j&&!F,Q=a?.index?(a.index+1)%2===0:!1;return{isFirst:j,isLast:F,isMiddle:R,isOdd:Q}},[a,c.collection]);return h.jsx(s,{ref:v,"data-disabled":w($),"data-first":w(A),"data-focus-visible":w(D),"data-hover":w(E),"data-last":w(k),"data-middle":w(C),"data-odd":w(N),"data-selected":w(f),...I(g,y,d?S:{},O(a.props,{enabled:b}),p),className:(u=m.tr)==null?void 0:u.call(m,{class:x}),children:i})});gl.displayName="HeroUI.TableRow";var $l=gl,yl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:i,collection:a,isSelectable:m,color:c,disableAnimation:d,checkboxesProps:r,selectionMode:p,classNames:s,rowVirtualizer:b,...v}=e,g=u||"tbody",x=typeof g=="string",D=M(t),{rowGroupProps:y}=ge(),$=K(s?.tbody,o),f=a?.body.props,E=f?.isLoading||f?.loadingState==="loading"||f?.loadingState==="loadingMore",S=[...a.body.childNodes],A=b.getVirtualItems();let k,C;return a.size===0&&f.emptyContent&&(k=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper}),colSpan:a.columnCount,role:"gridcell",children:!E&&f.emptyContent})})),E&&f.loadingContent&&(C=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:s?.loadingWrapper}),colSpan:a.columnCount,role:"gridcell",children:f.loadingContent}),!k&&a.size===0?h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper})}):null]})),h.jsxs(g,{ref:D,...I(y,O(f,{enabled:x}),v),className:(l=n.tbody)==null?void 0:l.call(n,{class:$}),"data-empty":w(a.size===0),"data-loading":w(E),children:[A.map((N,j)=>{const F=S[N.index];return F?h.jsx($l,{classNames:s,isSelectable:m,node:F,slots:n,state:i,style:{transform:`translateY(${N.start-j*N.size}px)`,height:`${N.size}px`},children:[...F.childNodes].map(R=>R.props.isSelectionCell?h.jsx(vl,{checkboxesProps:r,classNames:s,color:c,disableAnimation:d,node:R,rowKey:F.key,selectionMode:p,slots:n,state:i},String(R.key)):h.jsx(fl,{classNames:s,node:R,rowKey:F.key,slots:n,state:i},String(R.key)))},String(F.key)):null}),C,k]})});yl.displayName="HeroUI.VirtualizedTableBody";var Hu=yl,xl=T((e,t)=>{var l,u,o,n,i;const{as:a,className:m,state:c,node:d,slots:r,classNames:p,sortIcon:s,...b}=e,v=a||"th",g=typeof v=="string",x=M(t),{columnHeaderProps:D}=nl({node:d},c,x),y=K(p?.th,m,(l=d.props)==null?void 0:l.className),{isFocusVisible:$,focusProps:f}=X(),{isHovered:E,hoverProps:S}=Ie({}),{hideHeader:A,align:k,...C}=d.props,N=C.allowsSorting,j={"aria-hidden":!0,"data-direction":(u=c.sortDescriptor)==null?void 0:u.direction,"data-visible":w(((o=c.sortDescriptor)==null?void 0:o.column)===d.key),className:(n=r.sortIcon)==null?void 0:n.call(r,{class:p?.sortIcon})},F=typeof s=="function"?s(j):B.isValidElement(s)&&B.cloneElement(s,j);return h.jsxs(v,{ref:x,colSpan:d.colspan,"data-focus-visible":w($),"data-hover":w(E),"data-sortable":w(N),...I(D,f,O(C,{enabled:g}),N?S:{},b),className:(i=r.th)==null?void 0:i.call(r,{align:k,class:y}),children:[A?h.jsx(be,{children:d.rendered}):d.rendered,N&&(F||h.jsx(su,{strokeWidth:3,...j}))]})});xl.displayName="HeroUI.TableColumnHeader";var Cl=xl,Dl=T((e,t)=>{var l,u;const{as:o,className:n,children:i,node:a,slots:m,classNames:c,state:d,...r}=e,p=o||"tr",s=typeof p=="string",b=M(t),{rowProps:v}=Su({node:a},d),g=K(c?.tr,n,(l=a.props)==null?void 0:l.className);return h.jsx(p,{ref:b,...I(v,O(a.props,{enabled:s}),r),className:(u=m.tr)==null?void 0:u.call(m,{class:g}),children:i})});Dl.displayName="HeroUI.TableHeaderRow";var Bl=Dl,kl=B.forwardRef((e,t)=>{var l;const{as:u,className:o,children:n,slots:i,classNames:a,...m}=e,c=u||"thead",d=M(t),{rowGroupProps:r}=ge(),p=K(a?.thead,o);return h.jsx(c,{ref:d,className:(l=i.thead)==null?void 0:l.call(i,{class:p}),...I(r,m),children:n})});kl.displayName="HeroUI.TableRowGroup";var El=kl,Lu={px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Ae=e=>{var t;return(t=Lu[e])!=null?t:e};function Uu(e){const[t,l]=Pe(e,Be.variantKeys),{as:u,className:o,x:n=1,y:i=1,...a}=t,m=u||"span",c=B.useMemo(()=>Be({...l,className:o}),[Ke(l),o]),d=Ae(n),r=Ae(i);return{Component:m,getSpacerProps:(s={})=>({...s,...a,"aria-hidden":w(!0),className:K(c,s.className),style:{...s.style,...a.style,marginLeft:d,marginTop:r}})}}var Sl=T((e,t)=>{const{Component:l,getSpacerProps:u}=Uu({...e});return h.jsx(l,{ref:t,...u()})});Sl.displayName="HeroUI.Spacer";var Al=Sl,wl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:i,topContentPlacement:a,bottomContentPlacement:m,bottomContent:c,getBaseProps:d,getWrapperProps:r,getTableProps:p}=pl({...e,ref:t}),{rowHeight:s=40,maxTableHeight:b=600}=e,v=B.useCallback(({children:A})=>h.jsx(l,{...r(),ref:D,style:{height:b,display:"block"},children:A}),[r,b]),x=[...o.body.childNodes].length,D=B.useRef(null),[y,$]=B.useState(0),f=B.useRef(null);B.useLayoutEffect(()=>{f.current&&$(f.current.getBoundingClientRect().height)},[f]);const E=iu({count:x,getScrollElement:()=>D.current,estimateSize:()=>s,overscan:5}),S=p();return h.jsxs("div",{...d(),children:[a==="outside"&&i,h.jsx(v,{children:h.jsxs(h.Fragment,{children:[a==="inside"&&i,h.jsxs(u,{...S,style:{height:`calc(${E.getTotalSize()+y}px)`,...S.style},children:[h.jsxs(El,{ref:f,classNames:n.classNames,slots:n.slots,children:[o.headerRows.map(A=>h.jsx(Bl,{classNames:n.classNames,node:A,slots:n.slots,state:n.state,children:[...A.childNodes].map(k=>{var C;return(C=k?.props)!=null&&C.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:k,selectionMode:n.selectionMode,slots:n.slots,state:n.state},k?.key):h.jsx(Cl,{classNames:n.classNames,node:k,slots:n.slots,state:n.state},k?.key)})},A?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Hu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,rowVirtualizer:E,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),m==="inside"&&c]})}),m==="outside"&&c]})});wl.displayName="HeroUI.VirtualizedTable";var Wu=wl,Nl=T((e,t)=>{var l;const{as:u,className:o,slots:n,state:i,collection:a,isSelectable:m,color:c,disableAnimation:d,checkboxesProps:r,selectionMode:p,classNames:s,...b}=e,v=u||"tbody",g=typeof v=="string",x=M(t),{rowGroupProps:D}=ge(),y=K(s?.tbody,o),$=a?.body.props,f=$?.isLoading||$?.loadingState==="loading"||$?.loadingState==="loadingMore",E=B.useMemo(()=>[...a.body.childNodes].map(k=>h.jsx($l,{classNames:s,isSelectable:m,node:k,slots:n,state:i,children:[...k.childNodes].map(C=>C.props.isSelectionCell?h.jsx(vl,{checkboxesProps:r,classNames:s,color:c,disableAnimation:d,node:C,rowKey:k.key,selectionMode:p,slots:n,state:i},C.key):h.jsx(fl,{classNames:s,node:C,rowKey:k.key,slots:n,state:i},C.key))},k.key)),[a.body.childNodes,s,m,n,i]);let S,A;return a.size===0&&$.emptyContent&&(S=h.jsx("tr",{role:"row",children:h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper}),colSpan:a.columnCount,role:"gridcell",children:!f&&$.emptyContent})})),f&&$.loadingContent&&(A=h.jsxs("tr",{role:"row",children:[h.jsx("td",{className:n?.loadingWrapper({class:s?.loadingWrapper}),colSpan:a.columnCount,role:"gridcell",children:$.loadingContent}),!S&&a.size===0?h.jsx("td",{className:n?.emptyWrapper({class:s?.emptyWrapper})}):null]})),h.jsxs(v,{ref:x,...I(D,O($,{enabled:g}),b),className:(l=n.tbody)==null?void 0:l.call(n,{class:y}),"data-empty":w(a.size===0),"data-loading":w(f),children:[E,A,S]})});Nl.displayName="HeroUI.TableBody";var Gu=Nl,zl=T((e,t)=>{const{BaseComponent:l,Component:u,collection:o,values:n,topContent:i,topContentPlacement:a,bottomContentPlacement:m,bottomContent:c,removeWrapper:d,sortIcon:r,getBaseProps:p,getWrapperProps:s,getTableProps:b}=pl({...e,ref:t}),{isVirtualized:v,rowHeight:g=40,maxTableHeight:x=600}=e,D=v,y=B.useCallback(({children:$})=>d?$:h.jsx(l,{...s(),children:$}),[d,s]);return D?h.jsx(Wu,{...e,ref:t,maxTableHeight:x,rowHeight:g}):h.jsxs("div",{...p(),children:[a==="outside"&&i,h.jsx(y,{children:h.jsxs(h.Fragment,{children:[a==="inside"&&i,h.jsxs(u,{...b(),children:[h.jsxs(El,{classNames:n.classNames,slots:n.slots,children:[o.headerRows.map($=>h.jsx(Bl,{classNames:n.classNames,node:$,slots:n.slots,state:n.state,children:[...$.childNodes].map(f=>{var E;return(E=f?.props)!=null&&E.isSelectionCell?h.jsx(il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:f,selectionMode:n.selectionMode,slots:n.slots,state:n.state},f?.key):h.jsx(Cl,{classNames:n.classNames,node:f,slots:n.slots,sortIcon:r,state:n.state},f?.key)})},$?.key)),h.jsx(Al,{as:"tr",tabIndex:-1,y:1})]}),h.jsx(Gu,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),m==="inside"&&c]})}),m==="outside"&&c]})});zl.displayName="HeroUI.Table";var Yu=zl,Zu=Ru,_u=Zu,qu=Mu,Ju=qu,Xu=Vu,Qu=Xu,en=Tu,tn=en,ln=Ou,un=ln;const nn={n_requests:"Number Of Requests",estimated_cost:"Estimated Cost ($)"},we=["model","n_requests","prompt_tokens","completion_tokens","total_tokens","estimated_cost"];function on(e){return e.replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,function(t,l,u,o,n){return n<0?l+"0."+Array(1-n-u.length).join("0")+o+u:l+u+o+Array(n-o.length+1).join("0")})}function mn({usage:e}){const t=Object.keys(e),{isOpen:l,onOpen:u,onClose:o}=Xl(),n=()=>{o()},i=Object.keys(e[t[0]]),a=[...we.filter(s=>s==="model"||i.includes(s)),...i.filter(s=>!we.includes(s))],m=i.reduce((s,b)=>({...s,[b]:0}),{}),c=t.reduce((s,b)=>(a.reduce((v,g)=>(g==="model"||(v[g]+=e[b][g]),v),s),s),m),d=[...a.map(s=>({key:s,label:nn[s]??De.words(s).map(De.upperFirst).join(" ")}))],r=[...t.map(s=>({model:s,...e[s]})),{model:"Total",...c}],p=h.jsxs("div",{className:"p-2",children:[h.jsxs("div",{className:"flex flex-col gap-2",children:[c.prompt_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Prompt tokens"}),h.jsx("span",{children:c.prompt_tokens})]}),c.completion_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Completion tokens"}),h.jsx("span",{children:c.completion_tokens})]}),c.total_tokens!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Total tokens"}),h.jsx("span",{children:c.total_tokens})]}),c.estimated_cost!==void 0&&h.jsxs("div",{className:"flex justify-between gap-2",children:[h.jsx("span",{className:"font-semibold",children:"Estimated cost"}),h.jsxs("span",{children:[on(c.estimated_cost.toString()),"$"]})]})]}),h.jsx("p",{className:"m-auto mt-2 text-center",children:"Show detailed usage breakdown by model."})]});return h.jsxs(h.Fragment,{children:[h.jsx(Ql,{content:p,placement:"bottom",children:h.jsx(eu,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open usage details",onPress:u,children:h.jsx(tu,{icon:"heroicons:information-circle"})})}),h.jsx(lu,{isOpen:l,onOpenChange:n,size:"4xl",children:h.jsx(uu,{children:h.jsxs(h.Fragment,{children:[h.jsx(ru,{className:"text-default-900 flex flex-col gap-1",children:"Usage details"}),h.jsx(nu,{children:h.jsxs(Yu,{"aria-label":"Table with detailed usage statistics for each model used to generate the message.",fullWidth:!0,children:[h.jsx(Ju,{columns:d,children:s=>h.jsx(_u,{children:s.label},s.key)}),h.jsx(tn,{items:r,children:s=>h.jsx(Qu,{className:s.model==="Total"?"border-default-200 border-t-1":"",children:b=>h.jsx(un,{children:ou(s,b)})},s.model)})]})})]})})})]})}export{mn as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-B_0OnLGP.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-B_0OnLGP.js new file mode 100644 index 0000000000..ac939e7ae5 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/UsageButton-B_0OnLGP.js @@ -0,0 +1 @@ +import{E as e,a7 as N,a8 as k,a9 as g,aa as y,ab as v,bw as w}from"./useThemeContext-DkrqKvLn.js";import{u as E,l as x,D as O}from"./main-BJLJjzL4.js";import{t as R,a as D,b as C,c as F,d as S,e as T}from"./chunk-F3UDT23P-C4MzBAmg.js";import{m as q}from"./chunk-IGSAU2ZA-CRWCDn7K.js";import"./useSelectableItem-BR0VPP-3.js";import"./index-B9NaYZAN.js";const I={n_requests:"Number Of Requests",estimated_cost:"Estimated Cost ($)"},f=["model","n_requests","prompt_tokens","completion_tokens","total_tokens","estimated_cost"];function U(a){return a.replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,function(i,r,l,o,n){return n<0?r+"0."+Array(1-n-l.length).join("0")+o+l:r+l+o+Array(n-o.length+1).join("0")})}function M({usage:a}){const i=Object.keys(a),{isOpen:r,onOpen:l,onClose:o}=E(),n=()=>{o()},c=Object.keys(a[i[0]]),p=[...f.filter(s=>s==="model"||c.includes(s)),...c.filter(s=>!f.includes(s))],h=c.reduce((s,d)=>({...s,[d]:0}),{}),t=i.reduce((s,d)=>(p.reduce((m,u)=>(u==="model"||(m[u]+=a[d][u]),m),s),s),h),j=[...p.map(s=>({key:s,label:I[s]??x.words(s).map(x.upperFirst).join(" ")}))],_=[...i.map(s=>({model:s,...a[s]})),{model:"Total",...t}],b=e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[t.prompt_tokens!==void 0&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"font-semibold",children:"Prompt tokens"}),e.jsx("span",{children:t.prompt_tokens})]}),t.completion_tokens!==void 0&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"font-semibold",children:"Completion tokens"}),e.jsx("span",{children:t.completion_tokens})]}),t.total_tokens!==void 0&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"font-semibold",children:"Total tokens"}),e.jsx("span",{children:t.total_tokens})]}),t.estimated_cost!==void 0&&e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"font-semibold",children:"Estimated cost"}),e.jsxs("span",{children:[U(t.estimated_cost.toString()),"$"]})]})]}),e.jsx("p",{className:"m-auto mt-2 text-center",children:"Show detailed usage breakdown by model."})]});return e.jsxs(e.Fragment,{children:[e.jsx(O,{content:b,placement:"bottom",children:e.jsx(N,{isIconOnly:!0,variant:"ghost",className:"p-0","aria-label":"Open usage details",onPress:l,children:e.jsx(k,{icon:"heroicons:information-circle"})})}),e.jsx(g,{isOpen:r,onOpenChange:n,size:"4xl",children:e.jsx(y,{children:e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"text-default-900 flex flex-col gap-1",children:"Usage details"}),e.jsx(v,{children:e.jsxs(R,{"aria-label":"Table with detailed usage statistics for each model used to generate the message.",fullWidth:!0,children:[e.jsx(D,{columns:j,children:s=>e.jsx(C,{children:s.label},s.key)}),e.jsx(F,{items:_,children:s=>e.jsx(S,{className:s.model==="Total"?"border-default-200 border-t-1":"",children:d=>e.jsx(T,{children:w(s,d)})},s.model)})]})})]})})})]})}export{M as default}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BZmq_GrX.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BZmq_GrX.js new file mode 100644 index 0000000000..9a6f391f1d --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-BZmq_GrX.js @@ -0,0 +1 @@ +import{k as u}from"./main-BJLJjzL4.js";import{a5 as l,a3 as p}from"./useThemeContext-DkrqKvLn.js";const c=e=>({user_id:e.user_id,email:e.email}),d=l(u(p((e,i)=>({user:null,token:null,isAuthenticated:!1,tokenExpiration:null,hasHydrated:!1,onRehydrated:()=>{const{token:t,tokenExpiration:o,logout:n}=i(),a=Date.now(),s=(o??0)-a;!t||s<=0?n():e(r=>{r.isAuthenticated=!0}),e(r=>{r.hasHydrated=!0})},login:(t,o)=>e(n=>{n.user=t,n.token=o,n.tokenExpiration=Date.now()+o.expires_in*1e3,n.isAuthenticated=!0}),logout:()=>e(t=>{t.user=null,t.token=null,t.isAuthenticated=!1})})),{name:"ragbits-auth",partialize:e=>({token:e.token,tokenExpiration:e.tokenExpiration,user:e.user?c(e.user):null}),merge:(e,i)=>({...i,...e,isAuthenticated:!1}),onRehydrateStorage:e=>()=>{e.onRehydrated()}}));export{d as a}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DATNN-ps.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DATNN-ps.js deleted file mode 100644 index 2fbcf2a039..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/authStore-DATNN-ps.js +++ /dev/null @@ -1 +0,0 @@ -import{bu as u,bv as l,bw as c}from"./index-B3hlerKe.js";const h=e=>({user_id:e.user_id,email:e.email}),d=u(l(c((e,i)=>({user:null,token:null,isAuthenticated:!1,tokenExpiration:null,hasHydrated:!1,onRehydrated:()=>{const{token:t,tokenExpiration:o,logout:n}=i(),a=Date.now(),s=(o??0)-a;!t||s<=0?n():e(r=>{r.isAuthenticated=!0}),e(r=>{r.hasHydrated=!0})},login:(t,o)=>e(n=>{n.user=t,n.token=o,n.tokenExpiration=Date.now()+o.expires_in*1e3,n.isAuthenticated=!0}),logout:()=>e(t=>{t.user=null,t.token=null,t.isAuthenticated=!1})})),{name:"ragbits-auth",partialize:e=>({token:e.token,tokenExpiration:e.tokenExpiration,user:e.user?h(e.user):null}),merge:(e,i)=>({...i,...e,isAuthenticated:!1}),onRehydrateStorage:e=>()=>{e.onRehydrated()}}));export{d as a}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-F3UDT23P-C4MzBAmg.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-F3UDT23P-C4MzBAmg.js new file mode 100644 index 0000000000..2537b58970 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-F3UDT23P-C4MzBAmg.js @@ -0,0 +1 @@ +import{r as B,bx as Iu,by as ae,e as Ae,f as ie,bk as z,bz as W,bA as U,bB as te,bC as Mu,bt as q,bD as ju,bE as Tu,aV as we,$ as le,aF as Ru,aG as me,n as Vu,m as X,Z as Hu,o as L,b8 as Ou,bF as Y,bG as Z,bH as ue,j as Lu,k as Uu,bI as Ce,bJ as Wu,F as T,s as j,v as Q,y as K,E as y,z as I,A as w,be,ad as Ne,B as H,aR as Gu,aT as Yu,aS as Zu,R as J,q as qu,U as ze,x as Pe,w as Fe}from"./useThemeContext-DkrqKvLn.js";import{b as fe,$ as Ke}from"./useSelectableItem-BR0VPP-3.js";import{C as Ju,u as Xu}from"./index-B9NaYZAN.js";function Ie(e,t){const u=B.useRef(!0),l=B.useRef(null);B.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]),B.useEffect(()=>{let o=l.current;u.current?u.current=!1:(!o||t.some((n,s)=>!Object.is(n,o[s])))&&e(),l.current=t},t)}function Qu(e,t){let u=t?.isDisabled,[l,o]=B.useState(!1);return Iu(()=>{if(e?.current&&!u){let n=()=>{if(e.current){let r=ae(e.current,{tabbable:!0});o(!!r.nextNode())}};n();let s=new MutationObserver(n);return s.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{s.disconnect()}}}),u?!1:l}var De=Ae({base:"w-px h-px inline-block",variants:{isInline:{true:"inline-block",false:"block"}},defaultVariants:{isInline:!1}}),Be=Ae({slots:{base:"flex flex-col relative gap-4",wrapper:["p-4","z-0","flex","flex-col","relative","justify-between","gap-4","shadow-small","bg-content1","overflow-auto"],table:"min-w-full h-auto",thead:"[&>tr]:first:rounded-lg",tbody:"after:block",tr:["group/tr","outline-hidden",...ie],th:["group/th","px-3","h-10","text-start","align-middle","bg-default-100","whitespace-nowrap","text-foreground-500","text-tiny","font-semibold","first:rounded-s-lg","last:rounded-e-lg","outline-hidden","data-[sortable=true]:cursor-pointer","data-[hover=true]:text-foreground-400",...ie],td:["py-2","px-3","relative","align-middle","whitespace-normal","text-small","font-normal","outline-hidden","[&>*]:z-1","[&>*]:relative",...ie,"before:pointer-events-none","before:content-['']","before:absolute","before:z-0","before:inset-0","before:opacity-0","data-[selected=true]:before:opacity-100","group-data-[disabled=true]/tr:text-foreground-300","group-data-[disabled=true]/tr:cursor-not-allowed"],tfoot:"",sortIcon:["ms-2","mb-px","opacity-0","text-inherit","inline-block","transition-transform-opacity","data-[visible=true]:opacity-100","group-data-[hover=true]/th:opacity-100","data-[direction=ascending]:rotate-180"],emptyWrapper:"text-foreground-400 align-middle text-center h-40",loadingWrapper:"absolute inset-0 flex items-center justify-center"},variants:{color:{default:{td:"before:bg-default/60 data-[selected=true]:text-default-foreground"},primary:{td:"before:bg-primary/20 data-[selected=true]:text-primary"},secondary:{td:"before:bg-secondary/20 data-[selected=true]:text-secondary"},success:{td:"before:bg-success/20 data-[selected=true]:text-success-600 dark:data-[selected=true]:text-success"},warning:{td:"before:bg-warning/20 data-[selected=true]:text-warning-600 dark:data-[selected=true]:text-warning"},danger:{td:"before:bg-danger/20 data-[selected=true]:text-danger dark:data-[selected=true]:text-danger-500"}},layout:{auto:{table:"table-auto"},fixed:{table:"table-fixed"}},shadow:{none:{wrapper:"shadow-none"},sm:{wrapper:"shadow-small"},md:{wrapper:"shadow-medium"},lg:{wrapper:"shadow-large"}},hideHeader:{true:{thead:"hidden"}},isStriped:{true:{td:["group-data-[odd=true]/tr:before:bg-default-100","group-data-[odd=true]/tr:before:opacity-100","group-data-[odd=true]/tr:before:-z-10"]}},isCompact:{true:{td:"py-1"},false:{}},isHeaderSticky:{true:{thead:"sticky top-0 z-20 [&>tr]:first:shadow-small"}},isSelectable:{true:{tr:"cursor-default",td:["group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:bg-default-100","group-aria-[selected=false]/tr:group-data-[hover=true]/tr:before:opacity-70"]}},isMultiSelectable:{true:{td:["group-data-[first=true]/tr:first:before:rounded-ss-lg","group-data-[first=true]/tr:last:before:rounded-se-lg","group-data-[middle=true]/tr:before:rounded-none","group-data-[last=true]/tr:first:before:rounded-es-lg","group-data-[last=true]/tr:last:before:rounded-ee-lg"]},false:{td:["first:before:rounded-s-lg","last:before:rounded-e-lg"]}},radius:{none:{wrapper:"rounded-none",th:["first:rounded-s-none","first:before:rounded-s-none","last:rounded-e-none","last:before:rounded-e-none"],td:["first:before:rounded-s-none","last:before:rounded-e-none","group-data-[first=true]/tr:first:before:rounded-ss-none","group-data-[first=true]/tr:last:before:rounded-se-none","group-data-[last=true]/tr:first:before:rounded-es-none","group-data-[last=true]/tr:last:before:rounded-ee-none"]},sm:{wrapper:"rounded-small"},md:{wrapper:"rounded-medium"},lg:{wrapper:"rounded-large"}},fullWidth:{true:{base:"w-full",wrapper:"w-full",table:"w-full"}},align:{start:{th:"text-start",td:"text-start"},center:{th:"text-center",td:"text-center"},end:{th:"text-end",td:"text-end"}}},defaultVariants:{layout:"auto",shadow:"sm",radius:"lg",color:"default",isCompact:!1,hideHeader:!1,isStriped:!1,fullWidth:!0,align:"start"},compoundVariants:[{isStriped:!0,color:"default",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-default/60"}},{isStriped:!0,color:"primary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-primary/20"}},{isStriped:!0,color:"secondary",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-secondary/20"}},{isStriped:!0,color:"success",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-success/20"}},{isStriped:!0,color:"warning",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-warning/20"}},{isStriped:!0,color:"danger",class:{td:"group-data-[odd=true]/tr:data-[selected=true]/tr:before:bg-danger/20"}}]});const ve=new WeakMap;function ce(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function _u(e,t){let u=ve.get(e);if(!u)throw new Error("Unknown grid");return`${u}-${ce(t)}`}function Me(e,t,u){let l=ve.get(e);if(!l)throw new Error("Unknown grid");return`${l}-${ce(t)}-${ce(u)}`}function je(e,t){return[...e.collection.rowHeaderColumnKeys].map(u=>Me(e,t,u)).join(" ")}var Te={};Te={ascending:"تصاعدي",ascendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تصاعدي`,columnSize:e=>`${e.value} بالبكسل`,descending:"تنازلي",descendingSort:e=>`ترتيب حسب العمود ${e.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب"};var Re={};Re={ascending:"възходящ",ascendingSort:e=>`сортирано по колона ${e.columnName} във възходящ ред`,columnSize:e=>`${e.value} пиксела`,descending:"низходящ",descendingSort:e=>`сортирано по колона ${e.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона"};var Ve={};Ve={ascending:"vzestupně",ascendingSort:e=>`řazeno vzestupně podle sloupce ${e.columnName}`,columnSize:e=>`${e.value} pixelů`,descending:"sestupně",descendingSort:e=>`řazeno sestupně podle sloupce ${e.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení"};var He={};He={ascending:"stigende",ascendingSort:e=>`sorteret efter kolonne ${e.columnName} i stigende rækkefølge`,columnSize:e=>`${e.value} pixels`,descending:"faldende",descendingSort:e=>`sorteret efter kolonne ${e.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne"};var Oe={};Oe={ascending:"aufsteigend",ascendingSort:e=>`sortiert nach Spalte ${e.columnName} in aufsteigender Reihenfolge`,columnSize:e=>`${e.value} Pixel`,descending:"absteigend",descendingSort:e=>`sortiert nach Spalte ${e.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte"};var Le={};Le={ascending:"αύξουσα",ascendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε αύξουσα σειρά`,columnSize:e=>`${e.value} pixel`,descending:"φθίνουσα",descendingSort:e=>`διαλογή ανά στήλη ${e.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής"};var Ue={};Ue={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:e=>`sorted by column ${e.columnName} in ascending order`,descendingSort:e=>`sorted by column ${e.columnName} in descending order`,columnSize:e=>`${e.value} pixels`,resizerDescription:"Press Enter to start resizing"};var We={};We={ascending:"ascendente",ascendingSort:e=>`ordenado por columna ${e.columnName} en sentido ascendente`,columnSize:e=>`${e.value} píxeles`,descending:"descendente",descendingSort:e=>`ordenado por columna ${e.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable"};var Ge={};Ge={ascending:"tõusev järjestus",ascendingSort:e=>`sorditud veeru järgi ${e.columnName} tõusvas järjestuses`,columnSize:e=>`${e.value} pikslit`,descending:"laskuv järjestus",descendingSort:e=>`sorditud veeru järgi ${e.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg"};var Ye={};Ye={ascending:"nouseva",ascendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan nousevassa järjestyksessä`,columnSize:e=>`${e.value} pikseliä`,descending:"laskeva",descendingSort:e=>`lajiteltu sarakkeen ${e.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake"};var Ze={};Ze={ascending:"croissant",ascendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre croissant`,columnSize:e=>`${e.value} pixels`,descending:"décroissant",descendingSort:e=>`trié en fonction de la colonne ${e.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable"};var qe={};qe={ascending:"עולה",ascendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר עולה`,columnSize:e=>`${e.value} פיקסלים`,descending:"יורד",descendingSort:e=>`מוין לפי עמודה ${e.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין"};var Je={};Je={ascending:"rastući",ascendingSort:e=>`razvrstano po stupcima ${e.columnName} rastućem redoslijedom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`razvrstano po stupcima ${e.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati"};var Xe={};Xe={ascending:"növekvő",ascendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, növekvő sorrendben`,columnSize:e=>`${e.value} képpont`,descending:"csökkenő",descendingSort:e=>`rendezve a(z) ${e.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop"};var Qe={};Qe={ascending:"crescente",ascendingSort:e=>`in ordine crescente in base alla colonna ${e.columnName}`,columnSize:e=>`${e.value} pixel`,descending:"decrescente",descendingSort:e=>`in ordine decrescente in base alla colonna ${e.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile"};var _e={};_e={ascending:"昇順",ascendingSort:e=>`列 ${e.columnName} を昇順で並べ替え`,columnSize:e=>`${e.value} ピクセル`,descending:"降順",descendingSort:e=>`列 ${e.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列"};var et={};et={ascending:"오름차순",ascendingSort:e=>`${e.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:e=>`${e.value} 픽셀`,descending:"내림차순",descendingSort:e=>`${e.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열"};var tt={};tt={ascending:"didėjančia tvarka",ascendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} didėjančia tvarka`,columnSize:e=>`${e.value} piks.`,descending:"mažėjančia tvarka",descendingSort:e=>`surikiuota pagal stulpelį ${e.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis"};var ut={};ut={ascending:"augošā secībā",ascendingSort:e=>`kārtots pēc kolonnas ${e.columnName} augošā secībā`,columnSize:e=>`${e.value} pikseļi`,descending:"dilstošā secībā",descendingSort:e=>`kārtots pēc kolonnas ${e.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna"};var lt={};lt={ascending:"stigende",ascendingSort:e=>`sortert etter kolonne ${e.columnName} i stigende rekkefølge`,columnSize:e=>`${e.value} piksler`,descending:"synkende",descendingSort:e=>`sortert etter kolonne ${e.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres"};var nt={};nt={ascending:"oplopend",ascendingSort:e=>`gesorteerd in oplopende volgorde in kolom ${e.columnName}`,columnSize:e=>`${e.value} pixels`,descending:"aflopend",descendingSort:e=>`gesorteerd in aflopende volgorde in kolom ${e.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom"};var ot={};ot={ascending:"rosnąco",ascendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku rosnącym`,columnSize:e=>`Liczba pikseli: ${e.value}`,descending:"malejąco",descendingSort:e=>`posortowano według kolumny ${e.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania"};var st={};st={ascending:"crescente",ascendingSort:e=>`classificado pela coluna ${e.columnName} em ordem crescente`,columnSize:e=>`${e.value} pixels`,descending:"decrescente",descendingSort:e=>`classificado pela coluna ${e.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável"};var it={};it={ascending:"ascendente",ascendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem ascendente`,columnSize:e=>`${e.value} pixels`,descending:"descendente",descendingSort:e=>`Ordenar por coluna ${e.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável"};var rt={};rt={ascending:"crescătoare",ascendingSort:e=>`sortate după coloana ${e.columnName} în ordine crescătoare`,columnSize:e=>`${e.value} pixeli`,descending:"descrescătoare",descendingSort:e=>`sortate după coloana ${e.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă"};var at={};at={ascending:"возрастание",ascendingSort:e=>`сортировать столбец ${e.columnName} в порядке возрастания`,columnSize:e=>`${e.value} пикс.`,descending:"убывание",descendingSort:e=>`сортировать столбец ${e.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец"};var ct={};ct={ascending:"vzostupne",ascendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,columnSize:e=>`Počet pixelov: ${e.value}`,descending:"zostupne",descendingSort:e=>`zoradené zostupne podľa stĺpca ${e.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec"};var dt={};dt={ascending:"naraščajoče",ascendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v naraščajočem vrstnem redu`,columnSize:e=>`${e.value} slikovnih pik`,descending:"padajoče",descendingSort:e=>`razvrščeno po stolpcu ${e.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec"};var pt={};pt={ascending:"rastući",ascendingSort:e=>`sortirano po kolonama ${e.columnName} rastućim redosledom`,columnSize:e=>`${e.value} piksela`,descending:"padajući",descendingSort:e=>`sortirano po kolonama ${e.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati"};var mt={};mt={ascending:"stigande",ascendingSort:e=>`sorterat på kolumn ${e.columnName} i stigande ordning`,columnSize:e=>`${e.value} pixlar`,descending:"fallande",descendingSort:e=>`sorterat på kolumn ${e.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn"};var bt={};bt={ascending:"artan sırada",ascendingSort:e=>`${e.columnName} sütuna göre artan düzende sırala`,columnSize:e=>`${e.value} piksel`,descending:"azalan sırada",descendingSort:e=>`${e.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun"};var ft={};ft={ascending:"висхідний",ascendingSort:e=>`відсортовано за стовпцем ${e.columnName} у висхідному порядку`,columnSize:e=>`${e.value} пікс.`,descending:"низхідний",descendingSort:e=>`відсортовано за стовпцем ${e.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець"};var vt={};vt={ascending:"升序",ascendingSort:e=>`按列 ${e.columnName} 升序排序`,columnSize:e=>`${e.value} 像素`,descending:"降序",descendingSort:e=>`按列 ${e.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列"};var ht={};ht={ascending:"遞增",ascendingSort:e=>`已依據「${e.columnName}」欄遞增排序`,columnSize:e=>`${e.value} 像素`,descending:"遞減",descendingSort:e=>`已依據「${e.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄"};var ne={};ne={"ar-AE":Te,"bg-BG":Re,"cs-CZ":Ve,"da-DK":He,"de-DE":Oe,"el-GR":Le,"en-US":Ue,"es-ES":We,"et-EE":Ge,"fi-FI":Ye,"fr-FR":Ze,"he-IL":qe,"hr-HR":Je,"hu-HU":Xe,"it-IT":Qe,"ja-JP":_e,"ko-KR":et,"lt-LT":tt,"lv-LV":ut,"nb-NO":lt,"nl-NL":nt,"pl-PL":ot,"pt-BR":st,"pt-PT":it,"ro-RO":rt,"ru-RU":at,"sk-SK":ct,"sl-SI":dt,"sr-SP":pt,"sv-SE":mt,"tr-TR":bt,"uk-UA":ft,"zh-CN":vt,"zh-TW":ht};class gt{isCell(t){return t.type==="cell"}isRow(t){return t.type==="row"||t.type==="item"}isDisabled(t){var u;return this.disabledBehavior==="all"&&(((u=t.props)===null||u===void 0?void 0:u.isDisabled)||this.disabledKeys.has(t.key))}findPreviousKey(t,u){let l=t!=null?this.collection.getKeyBefore(t):this.collection.getLastKey();for(;l!=null;){let o=this.collection.getItem(l);if(!o)return null;if(!this.isDisabled(o)&&(!u||u(o)))return l;l=this.collection.getKeyBefore(l)}return null}findNextKey(t,u){let l=t!=null?this.collection.getKeyAfter(t):this.collection.getFirstKey();for(;l!=null;){let o=this.collection.getItem(l);if(!o)return null;if(!this.isDisabled(o)&&(!u||u(o)))return l;if(l=this.collection.getKeyAfter(l),l==null)return null}return null}getKeyForItemInRowByIndex(t,u=0){if(u<0)return null;let l=this.collection.getItem(t);if(!l)return null;let o=0;for(let r of z(l,this.collection)){var n;if(r.colSpan&&r.colSpan+o>u)return(n=r.key)!==null&&n!==void 0?n:null;r.colSpan&&(o=o+r.colSpan-1);var s;if(o===u)return(s=r.key)!==null&&s!==void 0?s:null;o++}return null}getKeyBelow(t){let u=t,l=this.collection.getItem(u);if(!l)return null;var o;if(this.isCell(l)&&(u=(o=l.parentKey)!==null&&o!==void 0?o:null),u==null)return null;if(u=this.findNextKey(u,n=>n.type==="item"),u!=null){if(this.isCell(l)){let n=l.colIndex?l.colIndex:l.index;return this.getKeyForItemInRowByIndex(u,n)}if(this.focusMode==="row")return u}return null}getKeyAbove(t){let u=t,l=this.collection.getItem(u);if(!l)return null;var o;if(this.isCell(l)&&(u=(o=l.parentKey)!==null&&o!==void 0?o:null),u==null)return null;if(u=this.findPreviousKey(u,n=>n.type==="item"),u!=null){if(this.isCell(l)){let n=l.colIndex?l.colIndex:l.index;return this.getKeyForItemInRowByIndex(u,n)}if(this.focusMode==="row")return u}return null}getKeyRightOf(t){let u=this.collection.getItem(t);if(!u)return null;if(this.isRow(u)){var l,o;let c=z(u,this.collection);var n;return(n=this.direction==="rtl"?(l=W(c))===null||l===void 0?void 0:l.key:(o=U(c))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(u)&&u.parentKey!=null){let c=this.collection.getItem(u.parentKey);if(!c)return null;let i=z(c,this.collection);var s;let m=(s=this.direction==="rtl"?te(i,u.index-1):te(i,u.index+1))!==null&&s!==void 0?s:null;var r;if(m)return(r=m.key)!==null&&r!==void 0?r:null;var d;if(this.focusMode==="row")return(d=u.parentKey)!==null&&d!==void 0?d:null;var p;return(p=this.direction==="rtl"?this.getFirstKey(t):this.getLastKey(t))!==null&&p!==void 0?p:null}return null}getKeyLeftOf(t){let u=this.collection.getItem(t);if(!u)return null;if(this.isRow(u)){var l,o;let c=z(u,this.collection);var n;return(n=this.direction==="rtl"?(l=U(c))===null||l===void 0?void 0:l.key:(o=W(c))===null||o===void 0?void 0:o.key)!==null&&n!==void 0?n:null}if(this.isCell(u)&&u.parentKey!=null){let c=this.collection.getItem(u.parentKey);if(!c)return null;let i=z(c,this.collection);var s;let m=(s=this.direction==="rtl"?te(i,u.index+1):te(i,u.index-1))!==null&&s!==void 0?s:null;var r;if(m)return(r=m.key)!==null&&r!==void 0?r:null;var d;if(this.focusMode==="row")return(d=u.parentKey)!==null&&d!==void 0?d:null;var p;return(p=this.direction==="rtl"?this.getLastKey(t):this.getFirstKey(t))!==null&&p!==void 0?p:null}return null}getFirstKey(t,u){let l=t??null,o;if(l!=null){if(o=this.collection.getItem(l),!o)return null;if(this.isCell(o)&&!u&&o.parentKey!=null){var n;let p=this.collection.getItem(o.parentKey);if(!p)return null;var s;return(s=(n=U(z(p,this.collection)))===null||n===void 0?void 0:n.key)!==null&&s!==void 0?s:null}}if(l=this.findNextKey(void 0,p=>p.type==="item"),l!=null&&(o&&this.isCell(o)&&u||this.focusMode==="cell")){var r;let p=this.collection.getItem(l);if(!p)return null;var d;l=(d=(r=U(z(p,this.collection)))===null||r===void 0?void 0:r.key)!==null&&d!==void 0?d:null}return l}getLastKey(t,u){let l=t??null,o;if(l!=null){if(o=this.collection.getItem(l),!o)return null;if(this.isCell(o)&&!u&&o.parentKey!=null){var n;let p=this.collection.getItem(o.parentKey);if(!p)return null;let c=z(p,this.collection);var s;return(s=(n=W(c))===null||n===void 0?void 0:n.key)!==null&&s!==void 0?s:null}}if(l=this.findPreviousKey(void 0,p=>p.type==="item"),l!=null&&(o&&this.isCell(o)&&u||this.focusMode==="cell")){var r;let p=this.collection.getItem(l);if(!p)return null;let c=z(p,this.collection);var d;l=(d=(r=W(c))===null||r===void 0?void 0:r.key)!==null&&d!==void 0?d:null}return l}getKeyPageAbove(t){let u=t,l=this.layoutDelegate.getItemRect(u);if(!l)return null;let o=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>o&&u!=null;){var n;if(u=(n=this.getKeyAbove(u))!==null&&n!==void 0?n:null,u==null)break;l=this.layoutDelegate.getItemRect(u)}return u}getKeyPageBelow(t){let u=t,l=this.layoutDelegate.getItemRect(u);if(!l)return null;let o=this.layoutDelegate.getVisibleRect().height,n=Math.min(this.layoutDelegate.getContentSize().height,l.y+o);for(;l&&l.y+l.heighti.type==="item"),l==null&&!r&&(l=this.getFirstKey(),r=!0)}return null}constructor(t){if(this.collection=t.collection,this.disabledKeys=t.disabledKeys,this.disabledBehavior=t.disabledBehavior||"all",this.direction=t.direction,this.collator=t.collator,!t.layout&&!t.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=t.layoutDelegate||(t.layout?new el(t.layout):new Mu(t.ref)),this.focusMode=t.focusMode||"row"}}class el{getContentSize(){return this.layout.getContentSize()}getItemRect(t){var u;return((u=this.layout.getLayoutInfo(t))===null||u===void 0?void 0:u.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}constructor(t){this.layout=t}}const he=new WeakMap;var $t={};$t={deselectedItem:e=>`${e.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${t.number(e.count)} عنصر محدد`,other:()=>`${t.number(e.count)} عنصر محدد`})}.`,selectedItem:e=>`${e.item} المحدد`};var yt={};yt={deselectedItem:e=>`${e.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Няма избрани елементи",one:()=>`${t.number(e.count)} избран елемент`,other:()=>`${t.number(e.count)} избрани елементи`})}.`,selectedItem:e=>`${e.item} избран.`};var xt={};xt={deselectedItem:e=>`Položka ${e.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${t.number(e.count)} položka`,other:()=>`Vybráno ${t.number(e.count)} položek`})}.`,selectedItem:e=>`Vybrána položka ${e.item}.`};var Ct={};Ct={deselectedItem:e=>`${e.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer valgt",one:()=>`${t.number(e.count)} element valgt`,other:()=>`${t.number(e.count)} elementer valgt`})}.`,selectedItem:e=>`${e.item} valgt.`};var Dt={};Dt={deselectedItem:e=>`${e.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${t.number(e.count)} Element ausgewählt`,other:()=>`${t.number(e.count)} Elemente ausgewählt`})}.`,selectedItem:e=>`${e.item} ausgewählt.`};var Bt={};Bt={deselectedItem:e=>`Δεν επιλέχθηκε το στοιχείο ${e.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${t.number(e.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${t.number(e.count)} στοιχεία`})}.`,selectedItem:e=>`Επιλέχθηκε το στοιχείο ${e.item}.`};var kt={};kt={deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var Et={};Et={deselectedItem:e=>`${e.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ningún elemento seleccionado",one:()=>`${t.number(e.count)} elemento seleccionado`,other:()=>`${t.number(e.count)} elementos seleccionados`})}.`,selectedItem:e=>`${e.item} seleccionado.`};var St={};St={deselectedItem:e=>`${e.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Üksusi pole valitud",one:()=>`${t.number(e.count)} üksus valitud`,other:()=>`${t.number(e.count)} üksust valitud`})}.`,selectedItem:e=>`${e.item} valitud.`};var At={};At={deselectedItem:e=>`Kohdetta ${e.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${t.number(e.count)} kohde valittu`,other:()=>`${t.number(e.count)} kohdetta valittu`})}.`,selectedItem:e=>`${e.item} valittu.`};var wt={};wt={deselectedItem:e=>`${e.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Aucun élément sélectionné",one:()=>`${t.number(e.count)} élément sélectionné`,other:()=>`${t.number(e.count)} éléments sélectionnés`})}.`,selectedItem:e=>`${e.item} sélectionné.`};var Nt={};Nt={deselectedItem:e=>`${e.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${t.number(e.count)} נבחר`,other:()=>`${t.number(e.count)} פריטים נבחרו`})}.`,selectedItem:e=>`${e.item} נבחר.`};var zt={};zt={deselectedItem:e=>`Stavka ${e.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${t.number(e.count)} stavka`,other:()=>`Odabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`Stavka ${e.item} je odabrana.`};var Pt={};Pt={deselectedItem:e=>`${e.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${t.number(e.count)} elem kijelölve`,other:()=>`${t.number(e.count)} elem kijelölve`})}.`,selectedItem:e=>`${e.item} kijelölve.`};var Ft={};Ft={deselectedItem:e=>`${e.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nessun elemento selezionato",one:()=>`${t.number(e.count)} elemento selezionato`,other:()=>`${t.number(e.count)} elementi selezionati`})}.`,selectedItem:e=>`${e.item} selezionato.`};var Kt={};Kt={deselectedItem:e=>`${e.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"項目が選択されていません",one:()=>`${t.number(e.count)} 項目を選択しました`,other:()=>`${t.number(e.count)} 項目を選択しました`})}。`,selectedItem:e=>`${e.item} を選択しました。`};var It={};It={deselectedItem:e=>`${e.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"선택된 항목이 없습니다",one:()=>`${t.number(e.count)}개 항목이 선택되었습니다`,other:()=>`${t.number(e.count)}개 항목이 선택되었습니다`})}.`,selectedItem:e=>`${e.item}이(가) 선택되었습니다.`};var Mt={};Mt={deselectedItem:e=>`${e.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${t.number(e.count)} elementas`,other:()=>`Pasirinkta elementų: ${t.number(e.count)}`})}.`,selectedItem:e=>`Pasirinkta: ${e.item}.`};var jt={};jt={deselectedItem:e=>`Vienums ${e.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`,other:()=>`Atlasīto vienumu skaits: ${t.number(e.count)}`})}.`,selectedItem:e=>`Atlasīts vienums ${e.item}.`};var Tt={};Tt={deselectedItem:e=>`${e.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Ingen elementer er valgt",one:()=>`${t.number(e.count)} element er valgt`,other:()=>`${t.number(e.count)} elementer er valgt`})}.`,selectedItem:e=>`${e.item} er valgt.`};var Rt={};Rt={deselectedItem:e=>`${e.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Geen items geselecteerd",one:()=>`${t.number(e.count)} item geselecteerd`,other:()=>`${t.number(e.count)} items geselecteerd`})}.`,selectedItem:e=>`${e.item} geselecteerd.`};var Vt={};Vt={deselectedItem:e=>`Nie zaznaczono ${e.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${t.number(e.count)} zaznaczony element`,other:()=>`${t.number(e.count)} zaznaczonych elementów`})}.`,selectedItem:e=>`Zaznaczono ${e.item}.`};var Ht={};Ht={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Ot={};Ot={deselectedItem:e=>`${e.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nenhum item selecionado",one:()=>`${t.number(e.count)} item selecionado`,other:()=>`${t.number(e.count)} itens selecionados`})}.`,selectedItem:e=>`${e.item} selecionado.`};var Lt={};Lt={deselectedItem:e=>`${e.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Niciun element selectat",one:()=>`${t.number(e.count)} element selectat`,other:()=>`${t.number(e.count)} elemente selectate`})}.`,selectedItem:e=>`${e.item} selectat.`};var Ut={};Ut={deselectedItem:e=>`${e.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Нет выбранных элементов",one:()=>`${t.number(e.count)} элемент выбран`,other:()=>`${t.number(e.count)} элементов выбрано`})}.`,selectedItem:e=>`${e.item} выбрано.`};var Wt={};Wt={deselectedItem:e=>`Nevybraté položky: ${e.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Žiadne vybraté položky",one:()=>`${t.number(e.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${t.number(e.count)}`})}.`,selectedItem:e=>`Vybraté položky: ${e.item}.`};var Gt={};Gt={deselectedItem:e=>`Element ${e.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Noben element ni izbran",one:()=>`${t.number(e.count)} element je izbran`,other:()=>`${t.number(e.count)} elementov je izbranih`})}.`,selectedItem:e=>`Element ${e.item} je izbran.`};var Yt={};Yt={deselectedItem:e=>`${e.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${t.number(e.count)} stavka`,other:()=>`Izabrano je ${t.number(e.count)} stavki`})}.`,selectedItem:e=>`${e.item} je izabrano.`};var Zt={};Zt={deselectedItem:e=>`${e.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Inga markerade objekt",one:()=>`${t.number(e.count)} markerat objekt`,other:()=>`${t.number(e.count)} markerade objekt`})}.`,selectedItem:e=>`${e.item} markerat.`};var qt={};qt={deselectedItem:e=>`${e.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${t.number(e.count)} öge seçildi`,other:()=>`${t.number(e.count)} öge seçildi`})}.`,selectedItem:e=>`${e.item} seçildi.`};var Jt={};Jt={deselectedItem:e=>`${e.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"Жодних елементів не вибрано",one:()=>`${t.number(e.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${t.number(e.count)}`})}.`,selectedItem:e=>`${e.item} вибрано.`};var Xt={};Xt={deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`};var Qt={};Qt={deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未選取任何項目",one:()=>`已選取 ${t.number(e.count)} 個項目`,other:()=>`已選取 ${t.number(e.count)} 個項目`})}。`,selectedItem:e=>`已選取「${e.item}」。`};var oe={};oe={"ar-AE":$t,"bg-BG":yt,"cs-CZ":xt,"da-DK":Ct,"de-DE":Dt,"el-GR":Bt,"en-US":kt,"es-ES":Et,"et-EE":St,"fi-FI":At,"fr-FR":wt,"he-IL":Nt,"hr-HR":zt,"hu-HU":Pt,"it-IT":Ft,"ja-JP":Kt,"ko-KR":It,"lt-LT":Mt,"lv-LV":jt,"nb-NO":Tt,"nl-NL":Rt,"pl-PL":Vt,"pt-BR":Ht,"pt-PT":Ot,"ro-RO":Lt,"ru-RU":Ut,"sk-SK":Wt,"sl-SI":Gt,"sr-SP":Yt,"sv-SE":Zt,"tr-TR":qt,"uk-UA":Jt,"zh-CN":Xt,"zh-TW":Qt};const _t=7e3;let V=null;function eu(e,t="assertive",u=_t){V?V.announce(e,t,u):(V=new tl,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?V.announce(e,t,u):setTimeout(()=>{V?.isAttached()&&V?.announce(e,t,u)},100))}class tl{isAttached(){var t;return(t=this.node)===null||t===void 0?void 0:t.isConnected}createLog(t){let u=document.createElement("div");return u.setAttribute("role","log"),u.setAttribute("aria-live",t),u.setAttribute("aria-relevant","additions"),u}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(t,u="assertive",l=_t){var o,n;if(!this.node)return;let s=document.createElement("div");typeof t=="object"?(s.setAttribute("role","img"),s.setAttribute("aria-labelledby",t["aria-labelledby"])):s.textContent=t,u==="assertive"?(o=this.assertiveLog)===null||o===void 0||o.appendChild(s):(n=this.politeLog)===null||n===void 0||n.appendChild(s),t!==""&&setTimeout(()=>{s.remove()},l)}clear(t){this.node&&((!t||t==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!t||t==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function ul(e){return e&&e.__esModule?e.default:e}function ll(e,t){let{getRowText:u=r=>{var d,p,c,i;return(i=(d=(p=t.collection).getTextValue)===null||d===void 0?void 0:d.call(p,r))!==null&&i!==void 0?i:(c=t.collection.getItem(r))===null||c===void 0?void 0:c.textValue}}=e,l=q(ul(oe),"@react-aria/grid"),o=t.selectionManager.rawSelection,n=B.useRef(o),s=ju(()=>{var r;if(!t.selectionManager.isFocused||o===n.current){n.current=o;return}let d=ke(o,n.current),p=ke(n.current,o),c=t.selectionManager.selectionBehavior==="replace",i=[];if(t.selectionManager.selectedKeys.size===1&&c){let m=t.selectionManager.selectedKeys.keys().next().value;if(m!=null&&t.collection.getItem(m)){let a=u(m);a&&i.push(l.format("selectedItem",{item:a}))}}else if(d.size===1&&p.size===0){let m=d.keys().next().value;if(m!=null){let a=u(m);a&&i.push(l.format("selectedItem",{item:a}))}}else if(p.size===1&&d.size===0){let m=p.keys().next().value;if(m!=null&&t.collection.getItem(m)){let a=u(m);a&&i.push(l.format("deselectedItem",{item:a}))}}t.selectionManager.selectionMode==="multiple"&&(i.length===0||o==="all"||o.size>1||n.current==="all"||((r=n.current)===null||r===void 0?void 0:r.size)>1)&&i.push(o==="all"?l.format("selectedAll"):l.format("selectedCount",{count:o.size})),i.length>0&&eu(i.join(" ")),n.current=o});Ie(()=>{if(t.selectionManager.isFocused)s();else{let r=requestAnimationFrame(s);return()=>cancelAnimationFrame(r)}},[o,t.selectionManager.isFocused])}function ke(e,t){let u=new Set;if(e==="all"||t==="all")return u;for(let l of e.keys())t.has(l)||u.add(l);return u}function nl(e){return e&&e.__esModule?e.default:e}function ol(e){let t=q(nl(oe),"@react-aria/grid"),u=Tu(),l=(u==="pointer"||u==="virtual"||u==null)&&typeof window<"u"&&"ontouchstart"in window,o=B.useMemo(()=>{let s=e.selectionManager.selectionMode,r=e.selectionManager.selectionBehavior,d;return l&&(d=t.format("longPressToSelect")),r==="replace"&&s!=="none"&&e.hasItemActions?d:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,l]);return fe(o)}function sl(e,t,u){let{isVirtualized:l,disallowTypeAhead:o,keyboardDelegate:n,focusMode:s,scrollRef:r,getRowText:d,onRowAction:p,onCellAction:c,escapeKeyBehavior:i="clearSelection",shouldSelectOnPressUp:m}=e,{selectionManager:a}=t;!e["aria-label"]&&!e["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let b=we({usage:"search",sensitivity:"base"}),{direction:h}=le(),g=t.selectionManager.disabledBehavior,x=B.useMemo(()=>n||new gt({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:g,ref:u,direction:h,collator:b,focusMode:s}),[n,t.collection,t.disabledKeys,g,u,h,b,s]),{collectionProps:D}=Ru({ref:u,selectionManager:a,keyboardDelegate:x,isVirtualized:l,scrollRef:r,disallowTypeAhead:o,escapeKeyBehavior:i}),$=me(e.id);he.set(t,{keyboardDelegate:x,actions:{onRowAction:p,onCellAction:c},shouldSelectOnPressUp:m});let v=ol({selectionManager:a,hasItemActions:!!(p||c)}),f=Vu(e,{labelable:!0}),E=B.useCallback(C=>{if(a.isFocused){C.currentTarget.contains(C.target)||a.setFocused(!1);return}C.currentTarget.contains(C.target)&&a.setFocused(!0)},[a]),S=B.useMemo(()=>({onBlur:D.onBlur,onFocus:E}),[E,D.onBlur]),A=Qu(u,{isDisabled:t.collection.size!==0}),k=X(f,{role:"grid",id:$,"aria-multiselectable":a.selectionMode==="multiple"?"true":void 0},t.isKeyboardNavigationDisabled?S:D,t.collection.size===0&&{tabIndex:A?-1:0}||void 0,v);return l&&(k["aria-rowcount"]=t.collection.size,k["aria-colcount"]=t.collection.columnCount),ll({getRowText:d},t),{gridProps:k}}function il(){return{rowGroupProps:{role:"rowgroup"}}}function rl(e,t,u){var l,o;let{node:n,isVirtualized:s,shouldSelectOnPressUp:r,onAction:d}=e,{actions:p,shouldSelectOnPressUp:c}=he.get(t),i=p.onRowAction?()=>{var g;return(g=p.onRowAction)===null||g===void 0?void 0:g.call(p,n.key)}:d,{itemProps:m,...a}=Ke({selectionManager:t.selectionManager,key:n.key,ref:u,isVirtualized:s,shouldSelectOnPressUp:c||r,onAction:i||!(n==null||(l=n.props)===null||l===void 0)&&l.onAction?Hu(n==null||(o=n.props)===null||o===void 0?void 0:o.onAction,i):void 0,isDisabled:t.collection.size===0}),b=t.selectionManager.isSelected(n.key),h={role:"row","aria-selected":t.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":a.isDisabled||void 0,...m};return s&&(h["aria-rowindex"]=n.index+1),{rowProps:h,...a}}function tu(e,t,u){let{node:l,isVirtualized:o,focusMode:n="child",shouldSelectOnPressUp:s,onAction:r}=e,{direction:d}=le(),{keyboardDelegate:p,actions:{onCellAction:c}}=he.get(t),i=B.useRef(null),m=()=>{if(u.current){let $=ae(u.current);if(n==="child"){if(u.current.contains(document.activeElement)&&u.current!==document.activeElement)return;let v=t.selectionManager.childFocusStrategy==="last"?re($):$.firstChild();if(v){L(v);return}}(i.current!=null&&l.key!==i.current||!u.current.contains(document.activeElement))&&L(u.current)}},{itemProps:a,isPressed:b}=Ke({selectionManager:t.selectionManager,key:l.key,ref:u,isVirtualized:o,focus:m,shouldSelectOnPressUp:s,onAction:c?()=>c(l.key):r,isDisabled:t.collection.size===0}),h=$=>{if(!$.currentTarget.contains($.target)||t.isKeyboardNavigationDisabled||!u.current||!document.activeElement)return;let v=ae(u.current);switch(v.currentNode=document.activeElement,$.key){case"ArrowLeft":{let C=d==="rtl"?v.nextNode():v.previousNode();if(n==="child"&&C===u.current&&(C=null),$.preventDefault(),$.stopPropagation(),C)L(C),Y(C,{containingElement:Z(u.current)});else{var f;if(((f=p.getKeyLeftOf)===null||f===void 0?void 0:f.call(p,l.key))!==l.key){var E;(E=u.current.parentElement)===null||E===void 0||E.dispatchEvent(new KeyboardEvent($.nativeEvent.type,$.nativeEvent));break}n==="cell"&&d==="rtl"?(L(u.current),Y(u.current,{containingElement:Z(u.current)})):(v.currentNode=u.current,C=d==="rtl"?v.firstChild():re(v),C&&(L(C),Y(C,{containingElement:Z(u.current)})))}break}case"ArrowRight":{let C=d==="rtl"?v.previousNode():v.nextNode();if(n==="child"&&C===u.current&&(C=null),$.preventDefault(),$.stopPropagation(),C)L(C),Y(C,{containingElement:Z(u.current)});else{var S;if(((S=p.getKeyRightOf)===null||S===void 0?void 0:S.call(p,l.key))!==l.key){var A;(A=u.current.parentElement)===null||A===void 0||A.dispatchEvent(new KeyboardEvent($.nativeEvent.type,$.nativeEvent));break}n==="cell"&&d==="ltr"?(L(u.current),Y(u.current,{containingElement:Z(u.current)})):(v.currentNode=u.current,C=d==="rtl"?re(v):v.firstChild(),C&&(L(C),Y(C,{containingElement:Z(u.current)})))}break}case"ArrowUp":case"ArrowDown":if(!$.altKey&&u.current.contains($.target)){var k;$.stopPropagation(),$.preventDefault(),(k=u.current.parentElement)===null||k===void 0||k.dispatchEvent(new KeyboardEvent($.nativeEvent.type,$.nativeEvent))}break}},g=$=>{if(i.current=l.key,$.target!==u.current){Ou()||t.selectionManager.setFocusedKey(l.key);return}requestAnimationFrame(()=>{n==="child"&&document.activeElement===u.current&&m()})},x=X(a,{role:"gridcell",onKeyDownCapture:h,"aria-colspan":l.colSpan,"aria-colindex":l.colIndex!=null?l.colIndex+1:void 0,colSpan:o?void 0:l.colSpan,onFocus:g});var D;return o&&(x["aria-colindex"]=((D=l.colIndex)!==null&&D!==void 0?D:l.index)+1),s&&x.tabIndex!=null&&x.onPointerDown==null&&(x.onPointerDown=$=>{let v=$.currentTarget,f=v.getAttribute("tabindex");v.removeAttribute("tabindex"),requestAnimationFrame(()=>{f!=null&&v.setAttribute("tabindex",f)})}),{gridCellProps:x,isPressed:b}}function re(e){let t=null,u=null;do u=e.lastChild(),u&&(t=u);while(u);return t}function al(e){return e&&e.__esModule?e.default:e}function cl(e,t){let{key:u}=e,l=t.selectionManager,o=me(),n=!t.selectionManager.canSelectItem(u),s=t.selectionManager.isSelected(u),r=()=>l.toggleSelection(u);const d=q(al(oe),"@react-aria/grid");return{checkboxProps:{id:o,"aria-label":d.format("select"),isSelected:s,isDisabled:n,onChange:r}}}class dl extends gt{isCell(t){return t.type==="cell"||t.type==="rowheader"||t.type==="column"}getKeyBelow(t){let u=this.collection.getItem(t);if(!u)return null;if(u.type==="column"){let l=U(z(u,this.collection));if(l)return l.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,u.index)}return super.getKeyBelow(t)}getKeyAbove(t){let u=this.collection.getItem(t);if(!u)return null;if(u.type==="column"){let n=u.parentKey!=null?this.collection.getItem(u.parentKey):null;return n&&n.type==="column"?n.key:null}let l=super.getKeyAbove(t),o=l!=null?this.collection.getItem(l):null;return o&&o.type!=="headerrow"?l:this.isCell(u)?this.collection.columns[u.index].key:this.collection.columns[0].key}findNextColumnKey(t){let u=this.findNextKey(t.key,o=>o.type==="column");if(u!=null)return u;let l=this.collection.headerRows[t.level];for(let o of z(l,this.collection))if(o.type==="column")return o.key;return null}findPreviousColumnKey(t){let u=this.findPreviousKey(t.key,n=>n.type==="column");if(u!=null)return u;let l=this.collection.headerRows[t.level],o=[...z(l,this.collection)];for(let n=o.length-1;n>=0;n--){let s=o[n];if(s.type==="column")return s.key}return null}getKeyRightOf(t){let u=this.collection.getItem(t);return u?u.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(u):this.findNextColumnKey(u):super.getKeyRightOf(t):null}getKeyLeftOf(t){let u=this.collection.getItem(t);return u?u.type==="column"?this.direction==="rtl"?this.findNextColumnKey(u):this.findPreviousColumnKey(u):super.getKeyLeftOf(t):null}getKeyForSearch(t,u){if(!this.collator)return null;let l=this.collection,o=u??this.getFirstKey();if(o==null)return null;let n=l.getItem(o);var s;n?.type==="cell"&&(o=(s=n.parentKey)!==null&&s!==void 0?s:null);let r=!1;for(;o!=null;){let d=l.getItem(o);if(!d)return null;if(d.textValue){let p=d.textValue.slice(0,t.length);if(this.collator.compare(p,t)===0)return d.key}for(let p of z(d,this.collection)){let c=l.columns[p.index];if(l.rowHeaderColumnKeys.has(c.key)&&p.textValue){let i=p.textValue.slice(0,t.length);if(this.collator.compare(i,t)===0){let m=u!=null?l.getItem(u):n;return m?.type==="cell"?p.key:d.key}}}o=this.getKeyBelow(o),o==null&&!r&&(o=this.getFirstKey(),r=!0)}return null}}function pl(e){return e&&e.__esModule?e.default:e}function ml(e,t,u){let{keyboardDelegate:l,isVirtualized:o,layoutDelegate:n,layout:s}=e,r=we({usage:"search",sensitivity:"base"}),{direction:d}=le(),p=t.selectionManager.disabledBehavior,c=B.useMemo(()=>l||new dl({collection:t.collection,disabledKeys:t.disabledKeys,disabledBehavior:p,ref:u,direction:d,collator:r,layoutDelegate:n,layout:s}),[l,t.collection,t.disabledKeys,p,u,d,r,n,s]),i=me(e.id);ve.set(t,i);let{gridProps:m}=sl({...e,id:i,keyboardDelegate:c},t,u);o&&(m["aria-rowcount"]=t.collection.size+t.collection.headerRows.length),ue()&&"expandedKeys"in t&&(m.role="treegrid");let{column:a,direction:b}=t.sortDescriptor||{},h=q(pl(ne),"@react-aria/table"),g=B.useMemo(()=>{var D,$;let v=($=(D=t.collection.columns.find(f=>f.key===a))===null||D===void 0?void 0:D.textValue)!==null&&$!==void 0?$:"";return b&&a?h.format(`${b}Sort`,{columnName:v}):void 0},[b,a,t.collection.columns]),x=fe(g);return Ie(()=>{g&&eu(g,"assertive",500)},[g]),{gridProps:X(m,x,{"aria-describedby":[x["aria-describedby"],m["aria-describedby"]].filter(Boolean).join(" ")})}}function bl(e){return e&&e.__esModule?e.default:e}function uu(e,t,u){var l,o;let{node:n}=e,s=n.props.allowsSorting,{gridCellProps:r}=tu({...e,focusMode:"child"},t,u),d=n.props.isSelectionCell&&t.selectionManager.selectionMode==="single",{pressProps:p}=Lu({isDisabled:!s||d,onPress(){t.sort(n.key)},ref:u}),{focusableProps:c}=Uu({},u),i,m=((l=t.sortDescriptor)===null||l===void 0?void 0:l.column)===n.key,a=(o=t.sortDescriptor)===null||o===void 0?void 0:o.direction;n.props.allowsSorting&&!Ce()&&(i=m?a:"none");let b=q(bl(ne),"@react-aria/table"),h;s&&(h=`${b.format("sortable")}`,m&&a&&Ce()&&(h=`${h}, ${b.format(a)}`));let g=fe(h),x=t.collection.size===0;return B.useEffect(()=>{x&&t.selectionManager.focusedKey===n.key&&t.selectionManager.setFocusedKey(null)},[x,t.selectionManager,n.key]),{columnHeaderProps:{...X(c,r,p,g,x?{tabIndex:-1}:null),role:"columnheader",id:_u(t,n.key),"aria-colspan":n.colSpan&&n.colSpan>1?n.colSpan:void 0,"aria-sort":i}}}const Ee={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function fl(e,t,u){let{node:l,isVirtualized:o}=e,{rowProps:n,...s}=rl(e,t,u),{direction:r}=le();o&&!(ue()&&"expandedKeys"in t)?n["aria-rowindex"]=l.index+1+t.collection.headerRows.length:delete n["aria-rowindex"];let d={};if(ue()&&"expandedKeys"in t){let f=t.keyMap.get(l.key);if(f!=null){var p,c,i,m,a,b;let E=((p=f.props)===null||p===void 0?void 0:p.UNSTABLE_childItems)||((i=f.props)===null||i===void 0||(c=i.children)===null||c===void 0?void 0:c.length)>t.userColumnCount;var h,g,x,D;d={onKeyDown:S=>{(S.key===Ee.expand[r]&&t.selectionManager.focusedKey===f.key&&E&&t.expandedKeys!=="all"&&!t.expandedKeys.has(f.key)||S.key===Ee.collapse[r]&&t.selectionManager.focusedKey===f.key&&E&&(t.expandedKeys==="all"||t.expandedKeys.has(f.key)))&&(t.toggleKey(f.key),S.stopPropagation())},"aria-expanded":E?t.expandedKeys==="all"||t.expandedKeys.has(l.key):void 0,"aria-level":f.level,"aria-posinset":((h=f.indexOfType)!==null&&h!==void 0?h:0)+1,"aria-setsize":f.level>1?((x=(m=W((g=(a=t.keyMap.get(f.parentKey))===null||a===void 0?void 0:a.childNodes)!==null&&g!==void 0?g:[]))===null||m===void 0?void 0:m.indexOfType)!==null&&x!==void 0?x:0)+1:((D=(b=W(t.collection.body.childNodes))===null||b===void 0?void 0:b.indexOfType)!==null&&D!==void 0?D:0)+1}}}let $=Wu(l.props),v=s.hasAction?$:{};return{rowProps:{...X(n,d,v),"aria-labelledby":je(t,l.key)},...s}}function vl(e,t,u){let{node:l,isVirtualized:o}=e,n={role:"row"};return o&&!(ue()&&"expandedKeys"in t)&&(n["aria-rowindex"]=l.index+1),{rowProps:n}}function lu(e,t,u){var l;let{gridCellProps:o,isPressed:n}=tu(e,t,u),s=(l=e.node.column)===null||l===void 0?void 0:l.key;return s!=null&&t.collection.rowHeaderColumnKeys.has(s)&&(o.role="rowheader",o.id=Me(t,e.node.parentKey,s)),{gridCellProps:o,isPressed:n}}function hl(e){return e&&e.__esModule?e.default:e}function gl(e,t){let{key:u}=e;const{checkboxProps:l}=cl(e,t);return{checkboxProps:{...l,"aria-labelledby":`${l.id} ${je(t,u)}`}}}function $l(e){let{isEmpty:t,isSelectAll:u,selectionMode:l}=e.selectionManager;return{checkboxProps:{"aria-label":q(hl(ne),"@react-aria/table").format(l==="single"?"select":"selectAll"),isSelected:u,isDisabled:l!=="multiple"||e.collection.size===0||e.collection.rows.length===1&&e.collection.rows[0].type==="loader",isIndeterminate:!t&&!u,onChange:()=>e.selectionManager.toggleSelectAll()}}}function ge(){return il()}var nu=T((e,t)=>{var u,l;const{as:o,className:n,node:s,slots:r,state:d,selectionMode:p,color:c,checkboxesProps:i,disableAnimation:m,classNames:a,...b}=e,h=o||"th",g=typeof h=="string",x=j(t),{columnHeaderProps:D}=uu({node:s},d,x),{isFocusVisible:$,focusProps:v}=Q(),{checkboxProps:f}=$l(d),E=K(a?.th,n,(u=s.props)==null?void 0:u.className),S=p==="single",{onChange:A,...k}=f;return y.jsx(h,{ref:x,"data-focus-visible":w($),...I(D,v,H(s.props,{enabled:g}),H(b,{enabled:g})),className:(l=r.th)==null?void 0:l.call(r,{class:E}),children:S?y.jsx(be,{children:f["aria-label"]}):y.jsx(Ne,{color:c,disableAnimation:m,onValueChange:A,...I(i,k)})})});nu.displayName="HeroUI.TableSelectAllCheckbox";var ou=nu;function yl(e){let{collection:t,focusMode:u}=e,l=e.UNSAFE_selectionState||Gu(e),o=B.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),n=l.setFocusedKey;l.setFocusedKey=(d,p)=>{if(u==="cell"&&d!=null){let b=t.getItem(d);if(b?.type==="item"){var c,i;let h=z(b,t);var m,a;p==="last"?d=(m=(c=W(h))===null||c===void 0?void 0:c.key)!==null&&m!==void 0?m:null:d=(a=(i=U(h))===null||i===void 0?void 0:i.key)!==null&&a!==void 0?a:null}}n(d,p)};let s=B.useMemo(()=>new Yu(t,l),[t,l]);const r=B.useRef(null);return B.useEffect(()=>{if(l.focusedKey!=null&&r.current&&!t.getItem(l.focusedKey)){const d=r.current.getItem(l.focusedKey),p=d?.parentKey!=null&&(d.type==="cell"||d.type==="rowheader"||d.type==="column")?r.current.getItem(d.parentKey):d;if(!p){l.setFocusedKey(null);return}const c=r.current.rows,i=t.rows,m=c.length-i.length;let a=Math.min(m>1?Math.max(p.index-m+1,0):p.index,i.length-1),b=null;for(;a>=0;){if(!s.isDisabled(i[a].key)&&i[a].type!=="headerrow"){b=i[a];break}ap.index&&(a=p.index),a--)}if(b){const h=b.hasChildNodes?[...z(b,t)]:[],g=b.hasChildNodes&&p!==d&&d&&d.index{let m=this.keyMap.get(i.key);t.visitNode&&(i=t.visitNode(i)),this.keyMap.set(i.key,i);let a=new Set,b=null,h=!1;if(i.type==="item"){var g;for(let f of i.childNodes)if(((g=f.props)===null||g===void 0?void 0:g.colSpan)!==void 0){h=!0;break}}for(let f of i.childNodes){if(f.type==="cell"&&h){var x,D;f.colspan=(x=f.props)===null||x===void 0?void 0:x.colSpan,f.colSpan=(D=f.props)===null||D===void 0?void 0:D.colSpan;var $,v;f.colIndex=b?(($=b.colIndex)!==null&&$!==void 0?$:b.index)+((v=b.colSpan)!==null&&v!==void 0?v:1):f.index}f.type==="cell"&&f.parentKey==null&&(f.parentKey=i.key),a.add(f.key),b?(b.nextKey=f.key,f.prevKey=b.key):f.prevKey=null,u(f),b=f}if(b&&(b.nextKey=null),m)for(let f of m.childNodes)a.has(f.key)||l(f)},l=i=>{this.keyMap.delete(i.key);for(let m of i.childNodes)this.keyMap.get(m.key)===m&&l(m)},o=null;for(let[i,m]of t.items.entries()){var n,s,r,d,p,c;let a={...m,level:(n=m.level)!==null&&n!==void 0?n:0,key:(s=m.key)!==null&&s!==void 0?s:"row-"+i,type:(r=m.type)!==null&&r!==void 0?r:"row",value:(d=m.value)!==null&&d!==void 0?d:null,hasChildNodes:!0,childNodes:[...m.childNodes],rendered:m.rendered,textValue:(p=m.textValue)!==null&&p!==void 0?p:"",index:(c=m.index)!==null&&c!==void 0?c:i};o?(o.nextKey=a.key,a.prevKey=o.key):a.prevKey=null,this.rows.push(a),u(a),o=a}o&&(o.nextKey=null)}}const su="row-header-column-"+Math.random().toString(36).slice(2);let de="row-header-column-"+Math.random().toString(36).slice(2);for(;su===de;)de="row-header-column-"+Math.random().toString(36).slice(2);function Cl(e,t){if(t.length===0)return[];let u=[],l=new Map;for(let c of t){let i=c.parentKey,m=[c];for(;i;){let a=e.get(i);if(!a)break;if(l.has(a)){var o,n;(n=(o=a).colSpan)!==null&&n!==void 0||(o.colSpan=0),a.colSpan++,a.colspan=a.colSpan;let{column:b,index:h}=l.get(a);if(h>m.length)break;for(let g=h;gc.length)),r=Array(s).fill(0).map(()=>[]),d=0;for(let c of u){let i=s-1;for(let m of c){if(m){let a=r[i],b=a.reduce((h,g)=>{var x;return h+((x=g.colSpan)!==null&&x!==void 0?x:1)},0);if(b0&&(a[a.length-1].nextKey=h.key,h.prevKey=a[a.length-1].key),a.push(h)}a.length>0&&(a[a.length-1].nextKey=m.key,m.prevKey=a[a.length-1].key),m.level=i,m.colIndex=d,a.push(m)}i--}d++}let p=0;for(let c of r){let i=c.reduce((m,a)=>{var b;return m+((b=a.colSpan)!==null&&b!==void 0?b:1)},0);if(i({type:"headerrow",key:"headerrow-"+i,index:i,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:c,textValue:""}))}class Dl extends xl{*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let u=this.keyMap.get(t);var l;return(l=u?.prevKey)!==null&&l!==void 0?l:null}getKeyAfter(t){let u=this.keyMap.get(t);var l;return(l=u?.nextKey)!==null&&l!==void 0?l:null}getFirstKey(){var t,u;return(u=(t=U(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&u!==void 0?u:null}getLastKey(){var t,u;return(u=(t=W(this.body.childNodes))===null||t===void 0?void 0:t.key)!==null&&u!==void 0?u:null}getItem(t){var u;return(u=this.keyMap.get(t))!==null&&u!==void 0?u:null}at(t){const u=[...this.getKeys()];return this.getItem(u[t])}getChildren(t){return t===this.body.key?this.body.childNodes:super.getChildren(t)}getTextValue(t){let u=this.getItem(t);if(!u)return"";if(u.textValue)return u.textValue;let l=this.rowHeaderColumnKeys;if(l){let o=[];for(let n of u.childNodes){let s=this.columns[n.index];if(l.has(s.key)&&n.textValue&&o.push(n.textValue),o.length===l.size)break}return o.join(" ")}return""}constructor(t,u,l){let o=new Set,n=null,s=[];if(l?.showSelectionCheckboxes){let i={type:"column",key:su,value:null,textValue:"",level:0,index:l?.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};s.unshift(i)}if(l?.showDragButtons){let i={type:"column",key:de,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};s.unshift(i)}let r=[],d=new Map,p=i=>{switch(i.type){case"body":n=i;break;case"column":d.set(i.key,i),i.hasChildNodes||(s.push(i),i.props.isRowHeader&&o.add(i.key));break;case"item":r.push(i);return}for(let m of i.childNodes)p(m)};for(let i of t)p(i);let c=Cl(d,s);if(c.forEach((i,m)=>r.splice(m,0,i)),super({columnCount:s.length,items:r,visitNode:i=>(i.column=s[i.index],i)}),this._size=0,this.columns=s,this.rowHeaderColumnKeys=o,this.body=n,this.headerRows=c,this._size=[...n.childNodes].length,this.rowHeaderColumnKeys.size===0){let i=this.columns.find(m=>{var a,b;return!(!((a=m.props)===null||a===void 0)&&a.isDragButtonCell)&&!(!((b=m.props)===null||b===void 0)&&b.isSelectionCell)});i&&this.rowHeaderColumnKeys.add(i.key)}}}const Bl={ascending:"descending",descending:"ascending"};function kl(e){let[t,u]=B.useState(!1),{selectionMode:l="none",showSelectionCheckboxes:o,showDragButtons:n}=e,s=B.useMemo(()=>({showSelectionCheckboxes:o&&l!=="none",showDragButtons:n,selectionMode:l,columns:[]}),[e.children,o,l,n]),r=Zu(e,B.useCallback(i=>new Dl(i,null,s),[s]),s),{disabledKeys:d,selectionManager:p}=yl({...e,collection:r,disabledBehavior:e.disabledBehavior||"selection"});var c;return{collection:r,disabledKeys:d,selectionManager:p,showSelectionCheckboxes:e.showSelectionCheckboxes||!1,sortDescriptor:(c=e.sortDescriptor)!==null&&c!==void 0?c:null,isKeyboardNavigationDisabled:r.size===0||t,setKeyboardNavigationDisabled:u,sort(i,m){var a,b;(b=e.onSortChange)===null||b===void 0||b.call(e,{column:i,direction:m??(((a=e.sortDescriptor)===null||a===void 0?void 0:a.column)===i?Bl[e.sortDescriptor.direction]:"ascending")})}}}function iu(e){return null}iu.getCollectionNode=function*(t,u){let{children:l,columns:o}=t;if(u.columns=[],typeof l=="function"){if(!o)throw new Error("props.children was a function but props.columns is missing");for(let n of o)yield{type:"column",value:n,renderer:l}}else{let n=[];J.Children.forEach(l,s=>{n.push({type:"column",element:s})}),yield*n}};let El=iu;function ru(e){return null}ru.getCollectionNode=function*(t){let{children:u,items:l}=t;yield{type:"body",hasChildNodes:!0,props:t,*childNodes(){if(typeof u=="function"){if(!l)throw new Error("props.children was a function but props.items is missing");for(let o of l)yield{type:"item",value:o,renderer:u}}else{let o=[];J.Children.forEach(u,n=>{o.push({type:"item",element:n})}),yield*o}}}};let Sl=ru;function au(e){return null}au.getCollectionNode=function*(t,u){let{title:l,children:o,childColumns:n}=t,s=l||o,r=t.textValue||(typeof s=="string"?s:"")||t["aria-label"],d=yield{type:"column",hasChildNodes:!!n||!!l&&J.Children.count(o)>0,rendered:s,textValue:r,props:t,*childNodes(){if(n)for(let c of n)yield{type:"column",value:c};else if(l){let c=[];J.Children.forEach(o,i=>{c.push({type:"column",element:i})}),yield*c}},shouldInvalidate(c){return p(c),!1}},p=c=>{for(let i of d)i.hasChildNodes||c.columns.push(i)};p(u)};let Al=au;function pe(e){return null}pe.getCollectionNode=function*(t,u){let{children:l,textValue:o,UNSTABLE_childItems:n}=t;yield{type:"item",props:t,textValue:o,"aria-label":t["aria-label"],hasChildNodes:!0,*childNodes(){if(u.showDragButtons&&(yield{type:"cell",key:"header-drag",props:{isDragButtonCell:!0}}),u.showSelectionCheckboxes&&u.selectionMode!=="none"&&(yield{type:"cell",key:"header",props:{isSelectionCell:!0}}),typeof l=="function"){for(let s of u.columns)yield{type:"cell",element:l(s.key),key:s.key};if(n)for(let s of n)yield{type:"item",value:s}}else{let s=[],r=[],d=0;if(J.Children.forEach(l,p=>{if(p.type===pe){if(s.lengthr.key!==u.columns[d].key)||s.showSelectionCheckboxes!==u.showSelectionCheckboxes||s.showDragButtons!==u.showDragButtons||s.selectionMode!==u.selectionMode}}};let wl=pe;function cu(e){return null}cu.getCollectionNode=function*(t){let{children:u}=t,l=t.textValue||(typeof u=="string"?u:"")||t["aria-label"]||"";yield{type:"cell",props:t,rendered:u,textValue:l,"aria-label":t["aria-label"],hasChildNodes:!1}};let Nl=cu;function du(e){var t;const u=qu(),[l,o]=ze(e,Be.variantKeys),{ref:n,as:s,baseRef:r,children:d,className:p,classNames:c,removeWrapper:i=!1,disableAnimation:m=(t=u?.disableAnimation)!=null?t:!1,isKeyboardNavigationDisabled:a=!1,selectionMode:b="none",topContentPlacement:h="inside",bottomContentPlacement:g="inside",selectionBehavior:x=b==="none"?null:"toggle",disabledBehavior:D="selection",showSelectionCheckboxes:$=b==="multiple"&&x!=="replace",BaseComponent:v="div",checkboxesProps:f,topContent:E,bottomContent:S,sortIcon:A,onRowAction:k,onCellAction:C,...N}=l,M=s||"table",P=typeof M=="string",R=j(n),_=j(r),G=kl({...e,children:d,showSelectionCheckboxes:$});a&&!G.isKeyboardNavigationDisabled&&G.setKeyboardNavigationDisabled(!0);const{collection:se}=G,{layout:Hl,...Nu}=e,{gridProps:$e}=ml({...Nu},G,R),ee=b!=="none",ye=b==="multiple",O=B.useMemo(()=>Be({...o,isSelectable:ee,isMultiSelectable:ye}),[Pe(o),ee,ye]),xe=K(c?.base,p),zu=B.useMemo(()=>{var F;return{state:G,slots:O,isSelectable:ee,collection:se,classNames:c,color:e?.color,disableAnimation:m,checkboxesProps:f,isHeaderSticky:(F=e?.isHeaderSticky)!=null?F:!1,selectionMode:b,selectionBehavior:x,disabledBehavior:D,showSelectionCheckboxes:$,onRowAction:k,onCellAction:C}},[O,G,se,ee,c,b,x,f,D,m,$,e?.color,e?.isHeaderSticky,k,C]),Pu=B.useCallback(F=>({...F,ref:_,className:O.base({class:K(xe,F?.className)})}),[xe,O]),Fu=B.useCallback(F=>({...F,ref:_,className:O.wrapper({class:K(c?.wrapper,F?.className)})}),[c?.wrapper,O]),Ku=B.useCallback(F=>({...I($e,H(N,{enabled:P}),F),onKeyDownCapture:void 0,ref:R,className:O.table({class:K(c?.table,F?.className)})}),[c?.table,P,O,$e,N]);return{BaseComponent:v,Component:M,children:d,state:G,collection:se,values:zu,topContent:E,bottomContent:S,removeWrapper:i,topContentPlacement:h,bottomContentPlacement:g,sortIcon:A,getBaseProps:Pu,getWrapperProps:Fu,getTableProps:Ku}}var pu=T((e,t)=>{var u,l,o;const{as:n,className:s,node:r,rowKey:d,slots:p,state:c,classNames:i,...m}=e,a=n||"td",b=typeof a=="string",h=j(t),{gridCellProps:g}=lu({node:r},c,h),x=K(i?.td,s,(u=r.props)==null?void 0:u.className),{isFocusVisible:D,focusProps:$}=Q(),v=c.selectionManager.isSelected(d),f=B.useMemo(()=>{const S=typeof r.rendered;return S!=="object"&&S!=="function"?y.jsx("span",{children:r.rendered}):r.rendered},[r.rendered]),E=((l=r.column)==null?void 0:l.props)||{};return y.jsx(a,{ref:h,"data-focus-visible":w(D),"data-selected":w(v),...I(g,$,H(r.props,{enabled:b}),m),className:(o=p.td)==null?void 0:o.call(p,{align:E.align,class:x}),children:f})});pu.displayName="HeroUI.TableCell";var mu=pu,bu=T((e,t)=>{var u,l;const{as:o,className:n,node:s,rowKey:r,slots:d,state:p,color:c,disableAnimation:i,checkboxesProps:m,selectionMode:a,classNames:b,...h}=e,g=o||"td",x=typeof g=="string",D=j(t),{gridCellProps:$}=lu({node:s},p,D),{isFocusVisible:v,focusProps:f}=Q(),{checkboxProps:E}=gl({key:s?.parentKey||s.key},p),S=K(b?.td,n,(u=s.props)==null?void 0:u.className),A=a==="single",{onChange:k,...C}=E,N=p.selectionManager.isSelected(r);return y.jsx(g,{ref:D,"data-focus-visible":w(v),"data-selected":w(N),...I($,f,H(s.props,{enabled:x}),h),className:(l=d.td)==null?void 0:l.call(d,{class:S}),children:A?y.jsx(be,{children:E["aria-label"]}):y.jsx(Ne,{color:c,disableAnimation:i,onValueChange:k,...I(m,C)})})});bu.displayName="HeroUI.TableCheckboxCell";var fu=bu,vu=T((e,t)=>{var u,l;const{as:o,className:n,children:s,node:r,slots:d,state:p,isSelectable:c,classNames:i,...m}=e,a=o||(e?.href?"a":"tr"),b=typeof a=="string",h=j(t),{rowProps:g}=fl({node:r},p,h),x=K(i?.tr,n,(u=r.props)==null?void 0:u.className),{isFocusVisible:D,focusProps:$}=Q(),v=p.disabledKeys.has(r.key),f=p.selectionManager.isSelected(r.key),{isHovered:E,hoverProps:S}=Fe({isDisabled:v}),{isFirst:A,isLast:k,isMiddle:C,isOdd:N}=B.useMemo(()=>{const M=r.key===p.collection.getFirstKey(),P=r.key===p.collection.getLastKey(),R=!M&&!P,_=r?.index?(r.index+1)%2===0:!1;return{isFirst:M,isLast:P,isMiddle:R,isOdd:_}},[r,p.collection]);return y.jsx(a,{ref:h,"data-disabled":w(v),"data-first":w(A),"data-focus-visible":w(D),"data-hover":w(E),"data-last":w(k),"data-middle":w(C),"data-odd":w(N),"data-selected":w(f),...I(g,$,c?S:{},H(r.props,{enabled:b}),m),className:(l=d.tr)==null?void 0:l.call(d,{class:x}),children:s})});vu.displayName="HeroUI.TableRow";var hu=vu,gu=T((e,t)=>{var u;const{as:l,className:o,slots:n,state:s,collection:r,isSelectable:d,color:p,disableAnimation:c,checkboxesProps:i,selectionMode:m,classNames:a,rowVirtualizer:b,...h}=e,g=l||"tbody",x=typeof g=="string",D=j(t),{rowGroupProps:$}=ge(),v=K(a?.tbody,o),f=r?.body.props,E=f?.isLoading||f?.loadingState==="loading"||f?.loadingState==="loadingMore",S=[...r.body.childNodes],A=b.getVirtualItems();let k,C;return r.size===0&&f.emptyContent&&(k=y.jsx("tr",{role:"row",children:y.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper}),colSpan:r.columnCount,role:"gridcell",children:!E&&f.emptyContent})})),E&&f.loadingContent&&(C=y.jsxs("tr",{role:"row",children:[y.jsx("td",{className:n?.loadingWrapper({class:a?.loadingWrapper}),colSpan:r.columnCount,role:"gridcell",children:f.loadingContent}),!k&&r.size===0?y.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper})}):null]})),y.jsxs(g,{ref:D,...I($,H(f,{enabled:x}),h),className:(u=n.tbody)==null?void 0:u.call(n,{class:v}),"data-empty":w(r.size===0),"data-loading":w(E),children:[A.map((N,M)=>{const P=S[N.index];return P?y.jsx(hu,{classNames:a,isSelectable:d,node:P,slots:n,state:s,style:{transform:`translateY(${N.start-M*N.size}px)`,height:`${N.size}px`},children:[...P.childNodes].map(R=>R.props.isSelectionCell?y.jsx(fu,{checkboxesProps:i,classNames:a,color:p,disableAnimation:c,node:R,rowKey:P.key,selectionMode:m,slots:n,state:s},String(R.key)):y.jsx(mu,{classNames:a,node:R,rowKey:P.key,slots:n,state:s},String(R.key)))},String(P.key)):null}),C,k]})});gu.displayName="HeroUI.VirtualizedTableBody";var zl=gu,$u=T((e,t)=>{var u,l,o,n,s;const{as:r,className:d,state:p,node:c,slots:i,classNames:m,sortIcon:a,...b}=e,h=r||"th",g=typeof h=="string",x=j(t),{columnHeaderProps:D}=uu({node:c},p,x),$=K(m?.th,d,(u=c.props)==null?void 0:u.className),{isFocusVisible:v,focusProps:f}=Q(),{isHovered:E,hoverProps:S}=Fe({}),{hideHeader:A,align:k,...C}=c.props,N=C.allowsSorting,M={"aria-hidden":!0,"data-direction":(l=p.sortDescriptor)==null?void 0:l.direction,"data-visible":w(((o=p.sortDescriptor)==null?void 0:o.column)===c.key),className:(n=i.sortIcon)==null?void 0:n.call(i,{class:m?.sortIcon})},P=typeof a=="function"?a(M):B.isValidElement(a)&&B.cloneElement(a,M);return y.jsxs(h,{ref:x,colSpan:c.colspan,"data-focus-visible":w(v),"data-hover":w(E),"data-sortable":w(N),...I(D,f,H(C,{enabled:g}),N?S:{},b),className:(s=i.th)==null?void 0:s.call(i,{align:k,class:$}),children:[A?y.jsx(be,{children:c.rendered}):c.rendered,N&&(P||y.jsx(Ju,{strokeWidth:3,...M}))]})});$u.displayName="HeroUI.TableColumnHeader";var yu=$u,xu=T((e,t)=>{var u,l;const{as:o,className:n,children:s,node:r,slots:d,classNames:p,state:c,...i}=e,m=o||"tr",a=typeof m=="string",b=j(t),{rowProps:h}=vl({node:r},c),g=K(p?.tr,n,(u=r.props)==null?void 0:u.className);return y.jsx(m,{ref:b,...I(h,H(r.props,{enabled:a}),i),className:(l=d.tr)==null?void 0:l.call(d,{class:g}),children:s})});xu.displayName="HeroUI.TableHeaderRow";var Cu=xu,Du=B.forwardRef((e,t)=>{var u;const{as:l,className:o,children:n,slots:s,classNames:r,...d}=e,p=l||"thead",c=j(t),{rowGroupProps:i}=ge(),m=K(r?.thead,o);return y.jsx(p,{ref:c,className:(u=s.thead)==null?void 0:u.call(s,{class:m}),...I(i,d),children:n})});Du.displayName="HeroUI.TableRowGroup";var Bu=Du,Pl={px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Se=e=>{var t;return(t=Pl[e])!=null?t:e};function Fl(e){const[t,u]=ze(e,De.variantKeys),{as:l,className:o,x:n=1,y:s=1,...r}=t,d=l||"span",p=B.useMemo(()=>De({...u,className:o}),[Pe(u),o]),c=Se(n),i=Se(s);return{Component:d,getSpacerProps:(a={})=>({...a,...r,"aria-hidden":w(!0),className:K(p,a.className),style:{...a.style,...r.style,marginLeft:c,marginTop:i}})}}var ku=T((e,t)=>{const{Component:u,getSpacerProps:l}=Fl({...e});return y.jsx(u,{ref:t,...l()})});ku.displayName="HeroUI.Spacer";var Eu=ku,Su=T((e,t)=>{const{BaseComponent:u,Component:l,collection:o,values:n,topContent:s,topContentPlacement:r,bottomContentPlacement:d,bottomContent:p,getBaseProps:c,getWrapperProps:i,getTableProps:m}=du({...e,ref:t}),{rowHeight:a=40,maxTableHeight:b=600}=e,h=B.useCallback(({children:A})=>y.jsx(u,{...i(),ref:D,style:{height:b,display:"block"},children:A}),[i,b]),x=[...o.body.childNodes].length,D=B.useRef(null),[$,v]=B.useState(0),f=B.useRef(null);B.useLayoutEffect(()=>{f.current&&v(f.current.getBoundingClientRect().height)},[f]);const E=Xu({count:x,getScrollElement:()=>D.current,estimateSize:()=>a,overscan:5}),S=m();return y.jsxs("div",{...c(),children:[r==="outside"&&s,y.jsx(h,{children:y.jsxs(y.Fragment,{children:[r==="inside"&&s,y.jsxs(l,{...S,style:{height:`calc(${E.getTotalSize()+$}px)`,...S.style},children:[y.jsxs(Bu,{ref:f,classNames:n.classNames,slots:n.slots,children:[o.headerRows.map(A=>y.jsx(Cu,{classNames:n.classNames,node:A,slots:n.slots,state:n.state,children:[...A.childNodes].map(k=>{var C;return(C=k?.props)!=null&&C.isSelectionCell?y.jsx(ou,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:k,selectionMode:n.selectionMode,slots:n.slots,state:n.state},k?.key):y.jsx(yu,{classNames:n.classNames,node:k,slots:n.slots,state:n.state},k?.key)})},A?.key)),y.jsx(Eu,{as:"tr",tabIndex:-1,y:1})]}),y.jsx(zl,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,rowVirtualizer:E,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),d==="inside"&&p]})}),d==="outside"&&p]})});Su.displayName="HeroUI.VirtualizedTable";var Kl=Su,Au=T((e,t)=>{var u;const{as:l,className:o,slots:n,state:s,collection:r,isSelectable:d,color:p,disableAnimation:c,checkboxesProps:i,selectionMode:m,classNames:a,...b}=e,h=l||"tbody",g=typeof h=="string",x=j(t),{rowGroupProps:D}=ge(),$=K(a?.tbody,o),v=r?.body.props,f=v?.isLoading||v?.loadingState==="loading"||v?.loadingState==="loadingMore",E=B.useMemo(()=>[...r.body.childNodes].map(k=>y.jsx(hu,{classNames:a,isSelectable:d,node:k,slots:n,state:s,children:[...k.childNodes].map(C=>C.props.isSelectionCell?y.jsx(fu,{checkboxesProps:i,classNames:a,color:p,disableAnimation:c,node:C,rowKey:k.key,selectionMode:m,slots:n,state:s},C.key):y.jsx(mu,{classNames:a,node:C,rowKey:k.key,slots:n,state:s},C.key))},k.key)),[r.body.childNodes,a,d,n,s]);let S,A;return r.size===0&&v.emptyContent&&(S=y.jsx("tr",{role:"row",children:y.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper}),colSpan:r.columnCount,role:"gridcell",children:!f&&v.emptyContent})})),f&&v.loadingContent&&(A=y.jsxs("tr",{role:"row",children:[y.jsx("td",{className:n?.loadingWrapper({class:a?.loadingWrapper}),colSpan:r.columnCount,role:"gridcell",children:v.loadingContent}),!S&&r.size===0?y.jsx("td",{className:n?.emptyWrapper({class:a?.emptyWrapper})}):null]})),y.jsxs(h,{ref:x,...I(D,H(v,{enabled:g}),b),className:(u=n.tbody)==null?void 0:u.call(n,{class:$}),"data-empty":w(r.size===0),"data-loading":w(f),children:[E,A,S]})});Au.displayName="HeroUI.TableBody";var Il=Au,wu=T((e,t)=>{const{BaseComponent:u,Component:l,collection:o,values:n,topContent:s,topContentPlacement:r,bottomContentPlacement:d,bottomContent:p,removeWrapper:c,sortIcon:i,getBaseProps:m,getWrapperProps:a,getTableProps:b}=du({...e,ref:t}),{isVirtualized:h,rowHeight:g=40,maxTableHeight:x=600}=e,D=h,$=B.useCallback(({children:v})=>c?v:y.jsx(u,{...a(),children:v}),[c,a]);return D?y.jsx(Kl,{...e,ref:t,maxTableHeight:x,rowHeight:g}):y.jsxs("div",{...m(),children:[r==="outside"&&s,y.jsx($,{children:y.jsxs(y.Fragment,{children:[r==="inside"&&s,y.jsxs(l,{...b(),children:[y.jsxs(Bu,{classNames:n.classNames,slots:n.slots,children:[o.headerRows.map(v=>y.jsx(Cu,{classNames:n.classNames,node:v,slots:n.slots,state:n.state,children:[...v.childNodes].map(f=>{var E;return(E=f?.props)!=null&&E.isSelectionCell?y.jsx(ou,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,color:n.color,disableAnimation:n.disableAnimation,node:f,selectionMode:n.selectionMode,slots:n.slots,state:n.state},f?.key):y.jsx(yu,{classNames:n.classNames,node:f,slots:n.slots,sortIcon:i,state:n.state},f?.key)})},v?.key)),y.jsx(Eu,{as:"tr",tabIndex:-1,y:1})]}),y.jsx(Il,{checkboxesProps:n.checkboxesProps,classNames:n.classNames,collection:n.collection,color:n.color,disableAnimation:n.disableAnimation,isSelectable:n.isSelectable,selectionMode:n.selectionMode,slots:n.slots,state:n.state})]}),d==="inside"&&p]})}),d==="outside"&&p]})});wu.displayName="HeroUI.Table";var Wl=wu,Ml=Al,Gl=Ml,jl=El,Yl=jl,Tl=wl,Zl=Tl,Rl=Sl,ql=Rl,Vl=Nl,Jl=Vl;export{Qu as $,Yl as a,Gl as b,ql as c,Zl as d,Jl as e,Wl as t}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-CRWCDn7K.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-CRWCDn7K.js new file mode 100644 index 0000000000..88ca3b649b --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-CRWCDn7K.js @@ -0,0 +1 @@ +import{F as h,bL as p,s as x,r as i,E as M,y as E}from"./useThemeContext-DkrqKvLn.js";var a=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:s,headerId:m,setHeaderMounted:e}=p(),f=x(o),u=t||"header";return i.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:E(s?.header,l)}),id:m,...n,children:d})});a.displayName="HeroUI.ModalHeader";var N=a;export{N as m}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-CsJAveMU.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-CsJAveMU.js deleted file mode 100644 index 98d9f6903b..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-IGSAU2ZA-CsJAveMU.js +++ /dev/null @@ -1 +0,0 @@ -import{l as h,be as p,R as x,r as i,j as M,Z as R}from"./index-B3hlerKe.js";var s=h((r,o)=>{const{as:t,children:d,className:l,...n}=r,{slots:c,classNames:a,headerId:m,setHeaderMounted:e}=p(),f=x(o),u=t||"header";return i.useEffect(()=>(e(!0),()=>e(!1)),[e]),M.jsx(u,{ref:f,className:c.header({class:R(a?.header,l)}),id:m,...n,children:d})});s.displayName="HeroUI.ModalHeader";var N=s;export{N as m}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-BJI2Gxdq.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-BJI2Gxdq.js deleted file mode 100644 index 592c341482..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-BJI2Gxdq.js +++ /dev/null @@ -1 +0,0 @@ -import{l as y,bo as D,j as e,r as t,am as N}from"./index-B3hlerKe.js";var E=y((B,H)=>{const{Component:L,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:O,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:w,getLabelProps:F,getInputProps:v,getInnerWrapperProps:b,getInputWrapperProps:o,getMainWrapperProps:C,getHelperWrapperProps:I,getDescriptionProps:l,getErrorMessageProps:i,getClearButtonProps:f}=D({...B,ref:H}),n=u?e.jsx("label",{...F(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(N,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...I(),children:W?e.jsx("div",{...i(),children:s}):e.jsx("div",{...l(),children:r})})},[x,P,s,r,I,i,l]),a=t.useMemo(()=>e.jsxs("div",{...b(),children:[c,e.jsx("input",{...v()}),M]}),[c,M,v,b]),R=t.useMemo(()=>m?e.jsxs("div",{...C(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[O,p,m,n,a,s,r,C,o,i,l]);return e.jsxs(L,{...w(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var U=E;export{U as i}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-BswVq7lY.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-BswVq7lY.js new file mode 100644 index 0000000000..9f3056d224 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-SSA7SXE4-BswVq7lY.js @@ -0,0 +1 @@ +import{F as T,bT as y,E as e,r as t,bd as D}from"./useThemeContext-DkrqKvLn.js";var E=T((B,F)=>{const{Component:H,label:u,description:r,isClearable:d,startContent:c,endContent:h,labelPlacement:L,hasHelper:x,isOutsideLeft:j,isOutsideTop:g,shouldLabelBeOutside:m,errorMessage:s,isInvalid:P,getBaseProps:O,getLabelProps:w,getInputProps:b,getInnerWrapperProps:v,getInputWrapperProps:o,getMainWrapperProps:C,getHelperWrapperProps:I,getDescriptionProps:l,getErrorMessageProps:i,getClearButtonProps:f}=y({...B,ref:F}),n=u?e.jsx("label",{...w(),children:u}):null,M=t.useMemo(()=>d?e.jsx("button",{...f(),children:h||e.jsx(D,{})}):h,[d,f]),p=t.useMemo(()=>{const W=P&&s;return!x||!(W||r)?null:e.jsx("div",{...I(),children:W?e.jsx("div",{...i(),children:s}):e.jsx("div",{...l(),children:r})})},[x,P,s,r,I,i,l]),a=t.useMemo(()=>e.jsxs("div",{...v(),children:[c,e.jsx("input",{...b()}),M]}),[c,M,b,v]),R=t.useMemo(()=>m?e.jsxs("div",{...C(),children:[e.jsxs("div",{...o(),children:[!j&&!g?n:null,a]}),p]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{...o(),children:[n,a]}),p]}),[L,p,m,n,a,s,r,C,o,i,l]);return e.jsxs(H,{...O(),children:[j||g?n:null,R]})});E.displayName="HeroUI.Input";var U=E;export{U as i}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-XHRYXXZA-eia5gCmD.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-XHRYXXZA-eia5gCmD.js new file mode 100644 index 0000000000..75869b2dfe --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-XHRYXXZA-eia5gCmD.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BN_skI-f.js","assets/features-animation-Dc-yT_Yb.js","assets/useThemeContext-DkrqKvLn.js","assets/useThemeContext-BnwPFgTI.css"])))=>i.map(i=>d[i]); +import{r as C,e as re,f as Ve,y as W,az as Pe,aN as Be,E as s,aP as fe,L as be,_ as Le,G as ge,T as he,aQ as ze,z as U,aB as We,a7 as Ge,F as te,H as qe,aO as Je,n as ye,p as Qe,m as Ce,bf as Xe,b5 as ce,j as Ye,w as we,b8 as ue,bg as Ze,bh as eo,aD as oo,aG as ro,q as pe,U as to,v as ao,x as so,b9 as no,A as K,B as $e,J as lo,s as io,I as co,N as uo,bi as po,aI as vo,R as fo}from"./useThemeContext-DkrqKvLn.js";import{u as bo,b as go,c as me,d as ho,e as mo,m as xo,$ as Po,a as yo}from"./useMenuTriggerState-DfYBgrZh.js";import{$ as Co}from"./useSelectableItem-BR0VPP-3.js";var wo=(e,o)=>{var a;let t=[];const r=(a=C.Children.map(e,l=>C.isValidElement(l)&&l.type===o?(t.push(l),null):l))==null?void 0:a.filter(Boolean),d=t.length>=0?t:void 0;return[r,d]},$o=re({base:["w-full","p-1","min-w-[200px]"]});re({slots:{base:["flex","group","gap-2","items-center","justify-between","relative","px-2","py-1.5","w-full","h-full","box-border","rounded-small","outline-hidden","cursor-pointer","tap-highlight-transparent","data-[pressed=true]:opacity-70",...Ve,"data-[focus-visible=true]:dark:ring-offset-background-content1"],wrapper:"w-full flex flex-col items-start justify-center",title:"flex-1 text-small font-normal truncate",description:["w-full","text-tiny","text-foreground-500","group-hover:text-current"],selectedIcon:["text-inherit","w-3","h-3","shrink-0"],shortcut:["px-1","py-0.5","rounded-sm","font-sans","text-foreground-500","text-tiny","border-small","border-default-300","group-hover:border-current"]},variants:{variant:{solid:{base:""},bordered:{base:"border-medium border-transparent bg-transparent"},light:{base:"bg-transparent"},faded:{base:"border-small border-transparent hover:border-default data-[hover=true]:bg-default-100"},flat:{base:""},shadow:{base:"data-[hover=true]:shadow-lg"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{},false:{}}},defaultVariants:{variant:"solid",color:"default"},compoundVariants:[{variant:"solid",color:"default",class:{base:"data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"solid",color:"primary",class:{base:"data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"solid",color:"secondary",class:{base:"data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"solid",color:"success",class:{base:"data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"solid",color:"warning",class:{base:"data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"solid",color:"danger",class:{base:"data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"shadow",color:"default",class:{base:"data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground"}},{variant:"shadow",color:"primary",class:{base:"data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground"}},{variant:"shadow",color:"secondary",class:{base:"data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground"}},{variant:"shadow",color:"success",class:{base:"data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground"}},{variant:"shadow",color:"warning",class:{base:"data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground"}},{variant:"shadow",color:"danger",class:{base:"data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground"}},{variant:"bordered",color:"default",class:{base:"data-[hover=true]:border-default"}},{variant:"bordered",color:"primary",class:{base:"data-[hover=true]:border-primary data-[hover=true]:text-primary"}},{variant:"bordered",color:"secondary",class:{base:"data-[hover=true]:border-secondary data-[hover=true]:text-secondary"}},{variant:"bordered",color:"success",class:{base:"data-[hover=true]:border-success data-[hover=true]:text-success"}},{variant:"bordered",color:"warning",class:{base:"data-[hover=true]:border-warning data-[hover=true]:text-warning"}},{variant:"bordered",color:"danger",class:{base:"data-[hover=true]:border-danger data-[hover=true]:text-danger"}},{variant:"flat",color:"default",class:{base:"data-[hover=true]:bg-default/40 data-[hover=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{base:"data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary"}},{variant:"flat",color:"secondary",class:{base:"data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary"}},{variant:"flat",color:"success",class:{base:"data-[hover=true]:bg-success/20 data-[hover=true]:text-success "}},{variant:"flat",color:"warning",class:{base:"data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning"}},{variant:"flat",color:"danger",class:{base:"data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger"}},{variant:"faded",color:"default",class:{base:"data-[hover=true]:text-default-foreground"}},{variant:"faded",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"faded",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"faded",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"faded",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"faded",color:"danger",class:{base:"data-[hover=true]:text-danger"}},{variant:"light",color:"default",class:{base:"data-[hover=true]:text-default-500"}},{variant:"light",color:"primary",class:{base:"data-[hover=true]:text-primary"}},{variant:"light",color:"secondary",class:{base:"data-[hover=true]:text-secondary"}},{variant:"light",color:"success",class:{base:"data-[hover=true]:text-success"}},{variant:"light",color:"warning",class:{base:"data-[hover=true]:text-warning"}},{variant:"light",color:"danger",class:{base:"data-[hover=true]:text-danger"}}]});re({slots:{base:"relative mb-2",heading:"pl-1 text-tiny text-foreground-500",group:"data-[has-title=true]:pt-1",divider:"mt-2"}});re({base:"w-full flex flex-col gap-0.5 p-1"});var So=(e,o)=>{if(!e&&!o)return{};const a=new Set([...Object.keys(e||{}),...Object.keys(o||{})]);return Array.from(a).reduce((t,r)=>({...t,[r]:W(e?.[r],o?.[r])}),{})},[Mo,Se]=Pe({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),xe=()=>Le(()=>import("./index-BN_skI-f.js"),__vite__mapDeps([0,1,2,3])).then(e=>e.default),Me=e=>{const{as:o,children:a,className:t,...r}=e,{Component:d,placement:l,backdrop:b,motionProps:c,disableAnimation:i,getPopoverProps:u,getDialogProps:w,getBackdropProps:g,getContentProps:y,isNonModal:D,onClose:M}=Se(),p=C.useRef(null),{dialogProps:j,titleProps:$}=Be({},p),h=w({ref:p,...j,...r}),S=o||d||"div",n=s.jsxs(s.Fragment,{children:[!D&&s.jsx(fe,{onDismiss:M}),s.jsx(S,{...h,children:s.jsx("div",{...y({className:t}),children:typeof a=="function"?a($):a})}),s.jsx(fe,{onDismiss:M})]}),v=C.useMemo(()=>b==="transparent"?null:i?s.jsx("div",{...g()}):s.jsx(be,{features:xe,children:s.jsx(ge.div,{animate:"enter",exit:"exit",initial:"exit",variants:he.fade,...g()})}),[b,i,g]),_=l?ze(l==="center"?"top":l):void 0,x=s.jsx(s.Fragment,{children:i?n:s.jsx(be,{features:xe,children:s.jsx(ge.div,{animate:"enter",exit:"exit",initial:"initial",style:_,variants:he.scaleSpringOpacity,...c,children:n})})});return s.jsxs("div",{...u(),children:[v,x]})};Me.displayName="HeroUI.PopoverContent";var Do=Me,De=e=>{var o;const{triggerRef:a,getTriggerProps:t}=Se(),{children:r,...d}=e,l=C.useMemo(()=>typeof r=="string"?s.jsx("p",{children:r}):C.Children.only(r),[r]),b=(o=l.props.ref)!=null?o:l.ref,{onPress:c,isDisabled:i,...u}=C.useMemo(()=>t(U(d,l.props),b),[t,l.props,d,b]),[,w]=wo(r,Ge),{buttonProps:g}=We({onPress:c,isDisabled:i},a),y=C.useMemo(()=>w?.[0]!==void 0,[w]);return y||delete u.preventFocusOnPress,C.cloneElement(l,U(u,y?{onPress:c,isDisabled:i}:g))};De.displayName="HeroUI.PopoverTrigger";var jo=De,je=te((e,o)=>{const{children:a,...t}=e,r=bo({...t,ref:o}),[d,l]=C.Children.toArray(a),b=s.jsx(Je,{portalContainer:r.portalContainer,children:l});return s.jsxs(Mo,{value:r,children:[d,r.disableAnimation&&r.isOpen?b:s.jsx(qe,{children:r.isOpen?b:null})]})});je.displayName="HeroUI.Popover";var Io=je,[ko,Ie]=Pe({name:"DropdownContext",errorMessage:"useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"});function _o(e){const{isSelected:o,disableAnimation:a,...t}=e;return s.jsx("svg",{"aria-hidden":"true","data-selected":o,role:"presentation",viewBox:"0 0 17 18",...t,children:s.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:a?{}:{transition:"stroke-dashoffset 200ms ease"}})})}const ke=new WeakMap;function Ao(e,o,a){let{shouldFocusWrap:t=!0,onKeyDown:r,onKeyUp:d,...l}=e;!e["aria-label"]&&e["aria-labelledby"];let b=ye(e,{labelable:!0}),{listProps:c}=Qe({...l,ref:a,selectionManager:o.selectionManager,collection:o.collection,disabledKeys:o.disabledKeys,shouldFocusWrap:t,linkBehavior:"override"});return ke.set(o,{onClose:e.onClose,onAction:e.onAction,shouldUseVirtualFocus:e.shouldUseVirtualFocus}),{menuProps:Ce(b,{onKeyDown:r,onKeyUp:d},{role:"menu",...c,onKeyDown:i=>{var u;(i.key!=="Escape"||e.shouldUseVirtualFocus)&&((u=c.onKeyDown)===null||u===void 0||u.call(c,i))}})}}function No(e,o,a){let{id:t,key:r,closeOnSelect:d,isVirtualized:l,"aria-haspopup":b,onPressStart:c,onPressUp:i,onPress:u,onPressChange:w,onPressEnd:g,onHoverStart:y,onHoverChange:D,onHoverEnd:M,onKeyDown:p,onKeyUp:j,onFocus:$,onFocusChange:h,onBlur:S,selectionManager:n=o.selectionManager}=e,v=!!b,_=v&&e["aria-expanded"]==="true";var x;let A=(x=e.isDisabled)!==null&&x!==void 0?x:n.isDisabled(r);var T;let N=(T=e.isSelected)!==null&&T!==void 0?T:n.isSelected(r),F=ke.get(o),m=o.collection.getItem(r),R=e.onClose||F.onClose,V=Xe(),P=f=>{var J;if(!v){if(!(m==null||(J=m.props)===null||J===void 0)&&J.onAction?m.props.onAction():e.onAction&&e.onAction(r),F.onAction){let ie=F.onAction;ie(r)}f.target instanceof HTMLAnchorElement&&m&&V.open(f.target,f,m.props.href,m.props.routerOptions)}},O="menuitem";v||(n.selectionMode==="single"?O="menuitemradio":n.selectionMode==="multiple"&&(O="menuitemcheckbox"));let I=ce(),E=ce(),G=ce(),B={id:t,"aria-disabled":A||void 0,role:O,"aria-label":e["aria-label"],"aria-labelledby":I,"aria-describedby":[E,G].filter(Boolean).join(" ")||void 0,"aria-controls":e["aria-controls"],"aria-haspopup":b,"aria-expanded":e["aria-expanded"]};n.selectionMode!=="none"&&!v&&(B["aria-checked"]=N),l&&(B["aria-posinset"]=m?.index,B["aria-setsize"]=go(o.collection));let q=f=>{f.pointerType==="keyboard"&&P(f),c?.(f)},Q=()=>{!v&&R&&(d??(n.selectionMode!=="multiple"||n.isLink(r)))&&R()},X=f=>{f.pointerType==="mouse"&&(P(f),Q()),i?.(f)},ae=f=>{f.pointerType!=="keyboard"&&f.pointerType!=="mouse"&&(P(f),Q()),u?.(f)},{itemProps:L,isFocused:Y}=Co({id:t,selectionManager:n,key:r,ref:a,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:F.shouldUseVirtualFocus}),{pressProps:se,isPressed:Z}=Ye({onPressStart:q,onPress:ae,onPressUp:X,onPressChange:w,onPressEnd:g,isDisabled:A}),{hoverProps:ne}=we({isDisabled:A,onHoverStart(f){!ue()&&!(_&&b)&&(n.setFocused(!0),n.setFocusedKey(r)),y?.(f)},onHoverChange:D,onHoverEnd:M}),{keyboardProps:ee}=Ze({onKeyDown:f=>{if(f.repeat){f.continuePropagation();return}switch(f.key){case" ":!A&&n.selectionMode==="none"&&!v&&d!==!1&&R&&R();break;case"Enter":!A&&d!==!1&&!v&&R&&R();break;default:v||f.continuePropagation(),p?.(f);break}},onKeyUp:j}),{focusProps:H}=eo({onBlur:S,onFocus:$,onFocusChange:h}),oe=ye(m?.props);delete oe.id;let le=oo(m?.props);return{menuItemProps:{...B,...Ce(oe,le,v?{onFocus:L.onFocus,"data-collection":L["data-collection"],"data-key":L["data-key"]}:L,se,ne,ee,H,F.shouldUseVirtualFocus||v?{onMouseDown:f=>f.preventDefault()}:void 0),tabIndex:L.tabIndex!=null&&_&&!F.shouldUseVirtualFocus?-1:L.tabIndex},labelProps:{id:I},descriptionProps:{id:E},keyboardShortcutProps:{id:G},isFocused:Y,isFocusVisible:Y&&n.isFocused&&ue()&&!_,isSelected:N,isPressed:Z,isDisabled:A}}function Fo(e){let{heading:o,"aria-label":a}=e,t=ro();return{itemProps:{role:"presentation"},headingProps:o?{id:t,role:"presentation"}:{},groupProps:{role:"group","aria-label":a,"aria-labelledby":o?t:void 0}}}function Oo(e){var o,a;const t=pe(),[r,d]=to(e,me.variantKeys),{as:l,item:b,state:c,shortcut:i,description:u,startContent:w,endContent:g,isVirtualized:y,selectedIcon:D,className:M,classNames:p,onAction:j,autoFocus:$,onPress:h,onPressStart:S,onPressUp:n,onPressEnd:v,onPressChange:_,onHoverStart:x,onHoverChange:A,onHoverEnd:T,hideSelectedIcon:N=!1,isReadOnly:F=!1,closeOnSelect:m,onClose:R,onClick:V,...P}=r,O=(a=(o=e.disableAnimation)!=null?o:t?.disableAnimation)!=null?a:!1,I=C.useRef(null),E=l||(P?.href?"a":"li"),G=typeof E=="string",{rendered:B,key:q}=b,Q=c.disabledKeys.has(q)||e.isDisabled,X=c.selectionManager.selectionMode!=="none",ae=ho(),{isFocusVisible:L,focusProps:Y}=ao({autoFocus:$}),se=C.useCallback(k=>{V?.(k),h?.(k)},[V,h]),{isPressed:Z,isFocused:ne,isSelected:ee,isDisabled:H,menuItemProps:oe,labelProps:le,descriptionProps:f,keyboardShortcutProps:J}=No({key:q,onClose:R,isDisabled:Q,onPress:se,onPressStart:S,onPressUp:n,onPressEnd:v,onPressChange:_,"aria-label":r["aria-label"],closeOnSelect:m,isVirtualized:y,onAction:j},c,I);let{hoverProps:ie,isHovered:ve}=we({isDisabled:H,onHoverStart(k){ue()||(c.selectionManager.setFocused(!0),c.selectionManager.setFocusedKey(q)),x?.(k)},onHoverChange:A,onHoverEnd:T}),de=oe;const z=C.useMemo(()=>me({...d,isDisabled:H,disableAnimation:O,hasTitleTextChild:typeof B=="string",hasDescriptionTextChild:typeof u=="string"}),[so(d),H,O,B,u]),Te=W(p?.base,M);F&&(de=no(de));const Re=(k={})=>({ref:I,...U(F?{}:Y,$e(P,{enabled:G}),de,ie,k),"data-focus":K(ne),"data-selectable":K(X),"data-hover":K(ae?ve||Z:ve),"data-disabled":K(H),"data-selected":K(ee),"data-pressed":K(Z),"data-focus-visible":K(L),className:z.base({class:W(Te,k.className)})}),Ue=(k={})=>({...U(le,k),className:z.title({class:p?.title})}),Ee=(k={})=>({...U(f,k),className:z.description({class:p?.description})}),He=(k={})=>({...U(J,k),className:z.shortcut({class:p?.shortcut})}),Ke=C.useCallback((k={})=>({"aria-hidden":K(!0),"data-disabled":K(H),className:z.selectedIcon({class:p?.selectedIcon}),...k}),[H,z,p]);return{Component:E,domRef:I,slots:z,classNames:p,isSelectable:X,isSelected:ee,isDisabled:H,rendered:B,shortcut:i,description:u,startContent:w,endContent:g,selectedIcon:D,disableAnimation:O,getItemProps:Re,getLabelProps:Ue,hideSelectedIcon:N,getDescriptionProps:Ee,getKeyboardShortcutProps:He,getSelectedIconProps:Ke}}var _e=e=>{const{Component:o,slots:a,classNames:t,rendered:r,shortcut:d,description:l,isSelectable:b,isSelected:c,isDisabled:i,selectedIcon:u,startContent:w,endContent:g,disableAnimation:y,hideSelectedIcon:D,getItemProps:M,getLabelProps:p,getDescriptionProps:j,getKeyboardShortcutProps:$,getSelectedIconProps:h}=Oo(e),S=C.useMemo(()=>{const n=s.jsx(_o,{disableAnimation:y,isSelected:c});return typeof u=="function"?u({icon:n,isSelected:c,isDisabled:i}):u||n},[u,c,i,y]);return s.jsxs(o,{...M(),children:[w,l?s.jsxs("div",{className:a.wrapper({class:t?.wrapper}),children:[s.jsx("span",{...p(),children:r}),s.jsx("span",{...j(),children:l})]}):s.jsx("span",{...p(),children:r}),d&&s.jsx("kbd",{...$(),children:d}),b&&!D&&s.jsx("span",{...h(),children:S}),g]})};_e.displayName="HeroUI.MenuItem";var Ae=_e,Ne=te(({item:e,state:o,as:a,variant:t,color:r,disableAnimation:d,onAction:l,closeOnSelect:b,className:c,classNames:i,showDivider:u=!1,hideSelectedIcon:w,dividerProps:g={},itemClasses:y,title:D,...M},p)=>{const j=a||"li",$=C.useMemo(()=>mo(),[]),h=W(i?.base,c),S=W(i?.divider,g?.className),{itemProps:n,headingProps:v,groupProps:_}=Fo({heading:e.rendered,"aria-label":e["aria-label"]});return s.jsxs(j,{"data-slot":"base",...U(n,M),className:$.base({class:h}),children:[e.rendered&&s.jsx("span",{...v,className:$.heading({class:i?.heading}),"data-slot":"heading",children:e.rendered}),s.jsxs("ul",{..._,className:$.group({class:i?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map(x=>{const{key:A,props:T}=x;let N=s.jsx(Ae,{classNames:y,closeOnSelect:b,color:r,disableAnimation:d,hideSelectedIcon:w,item:x,state:o,variant:t,onAction:l,...T},A);return x.wrapper&&(N=x.wrapper(N)),N}),u&&s.jsx(lo,{as:"li",className:$.divider({class:S}),...g})]})]})});Ne.displayName="HeroUI.MenuSection";var To=Ne;function Ro(e){var o;const a=pe(),{as:t,ref:r,variant:d,color:l,children:b,disableAnimation:c=(o=a?.disableAnimation)!=null?o:!1,onAction:i,closeOnSelect:u,itemClasses:w,className:g,state:y,topContent:D,bottomContent:M,hideEmptyContent:p=!1,hideSelectedIcon:j=!1,emptyContent:$="No items.",menuProps:h,onClose:S,classNames:n,...v}=e,_=t||"ul",x=io(r),A=typeof _=="string",T=co({...v,...h,children:b}),N=y||T,{menuProps:F}=Ao({...v,...h,onAction:i},N,x),m=C.useMemo(()=>xo({className:g}),[g]),R=W(n?.base,g);return{Component:_,state:N,variant:d,color:l,disableAnimation:c,onClose:S,topContent:D,bottomContent:M,closeOnSelect:u,className:g,itemClasses:w,getBaseProps:(I={})=>({ref:x,"data-slot":"base",className:m.base({class:R}),...$e(v,{enabled:A}),...I}),getListProps:(I={})=>({"data-slot":"list",className:m.list({class:n?.list}),...F,...I}),hideEmptyContent:p,hideSelectedIcon:j,getEmptyContentProps:(I={})=>({children:$,className:m.emptyContent({class:n?.emptyContent}),...I})}}var Uo=te(function(o,a){const{Component:t,state:r,closeOnSelect:d,color:l,disableAnimation:b,hideSelectedIcon:c,hideEmptyContent:i,variant:u,onClose:w,topContent:g,bottomContent:y,itemClasses:D,getBaseProps:M,getListProps:p,getEmptyContentProps:j}=Ro({...o,ref:a}),$=s.jsxs(t,{...p(),children:[!r.collection.size&&!i&&s.jsx("li",{children:s.jsx("div",{...j()})}),[...r.collection].map(h=>{const S={closeOnSelect:d,color:l,disableAnimation:b,item:h,state:r,variant:u,onClose:w,hideSelectedIcon:c,...h.props},n=So(D,S?.classNames);if(h.type==="section")return s.jsx(To,{...S,itemClasses:n},h.key);let v=s.jsx(Ae,{...S,classNames:n},h.key);return h.wrapper&&(v=h.wrapper(v)),v})]});return s.jsxs("div",{...M(),children:[g,$,y]})}),Eo=Uo,Ho=uo,qo=Ho,Ko=te(function(o,a){const{getMenuProps:t}=Ie();return s.jsx(Do,{children:s.jsx(po,{contain:!0,restoreFocus:!0,children:s.jsx(Eo,{...t(o,a)})})})}),Jo=Ko,Fe=e=>{const{getMenuTriggerProps:o}=Ie(),{children:a,...t}=e;return s.jsx(jo,{...o(t),children:a})};Fe.displayName="HeroUI.DropdownTrigger";var Qo=Fe,Vo=(e,o)=>{if(e){const a=Array.isArray(e.children)?e.children:[...e?.items||[]];if(a&&a.length)return a.find(r=>{if(r&&r.key===o)return r})||{}}return null},Bo=(e,o,a)=>{const t=a||Vo(e,o);return t&&t.props&&"closeOnSelect"in t.props?t.props.closeOnSelect:e?.closeOnSelect};function Lo(e){var o;const a=pe(),{as:t,triggerRef:r,isOpen:d,defaultOpen:l,onOpenChange:b,isDisabled:c,type:i="menu",trigger:u="press",placement:w="bottom",closeOnSelect:g=!0,shouldBlockScroll:y=!0,classNames:D,disableAnimation:M=(o=a?.disableAnimation)!=null?o:!1,onClose:p,className:j,...$}=e,h=t||"div",S=C.useRef(null),n=r||S,v=C.useRef(null),_=C.useRef(null),x=Po({trigger:u,isOpen:d,defaultOpen:l,onOpenChange:P=>{b?.(P),P||p?.()}}),{menuTriggerProps:A,menuProps:T}=yo({type:i,trigger:u,isDisabled:c},x,n),N=C.useMemo(()=>$o({className:j}),[j]),F=P=>{P!==void 0&&!P||g&&x.close()},m=(P={})=>{const O=U($,P);return{state:x,placement:w,ref:_,disableAnimation:M,shouldBlockScroll:y,scrollRef:v,triggerRef:n,...O,classNames:{...D,...P.classNames,content:W(N,D?.content,P.className)}}},R=(P={})=>{const{onPress:O,onPressStart:I,...E}=A;return U(E,{isDisabled:c},P)},V=(P,O=null)=>({ref:vo(O,v),menuProps:T,closeOnSelect:g,...U(P,{onAction:(I,E)=>{const G=Bo(P,I,E);F(G)},onClose:x.close})});return{Component:h,menuRef:v,menuProps:T,closeOnSelect:g,onClose:x.close,autoFocus:x.focusStrategy||!0,disableAnimation:M,getPopoverProps:m,getMenuProps:V,getMenuTriggerProps:R}}var Oe=e=>{const{children:o,...a}=e,t=Lo(a),[r,d]=fo.Children.toArray(o);return s.jsx(ko,{value:t,children:s.jsxs(Io,{...t.getPopoverProps(),children:[r,d]})})};Oe.displayName="HeroUI.Dropdown";var Xo=Oe;export{Qo as a,Jo as b,Xo as d,qo as m}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-Y2AYO5NJ-Crd-u0HB.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-Y2AYO5NJ-Crd-u0HB.js new file mode 100644 index 0000000000..7c601f5f9e --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/chunk-Y2AYO5NJ-Crd-u0HB.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BN_skI-f.js","assets/features-animation-Dc-yT_Yb.js","assets/useThemeContext-DkrqKvLn.js","assets/useThemeContext-BnwPFgTI.css"])))=>i.map(i=>d[i]); +import{e as Ut,f as Ze,F as pe,r as v,aN as qt,E as c,L as ot,_ as Yt,G as nt,T as it,aO as Gt,aP as Je,aQ as Qt,z as W,aR as Xt,aS as Zt,aT as Jt,aU as el,aV as tl,aW as ll,aX as al,aY as sl,n as Se,m as ce,aG as $e,Z as dt,aZ as rl,q as Ce,a_ as ol,U as _e,s as ge,O as nl,j as ct,aB as il,v as Pe,w as we,a$ as dl,y as B,x as Me,b0 as cl,A as z,B as ue,b1 as ul,R as pl,b2 as fl,b3 as bl,N as vl,p as gl,b4 as ml,Q as hl,b5 as et,b6 as xl,b7 as yl,b8 as tt,aD as Pl,b9 as Sl,J as $l,ba as Cl,bb as lt,bc as _l,bd as wl,aK as Ml,ag as Il,be as kl,H as zl}from"./useThemeContext-DkrqKvLn.js";import{u as Kl,$ as jl,a as Bl,b as Dl,m as Nl,c as at,d as Fl,e as Rl}from"./useMenuTriggerState-DfYBgrZh.js";import{$ as Wl}from"./useSelectableItem-BR0VPP-3.js";import{u as Ll,C as Al}from"./index-B9NaYZAN.js";var st=Ut({slots:{base:["group inline-flex flex-col relative"],label:["block","absolute","z-10","origin-top-left","flex-shrink-0","rtl:origin-top-right","subpixel-antialiased","text-small","text-foreground-500","pointer-events-none","group-data-[has-label-outside=true]:pointer-events-auto"],mainWrapper:"w-full flex flex-col",trigger:"relative px-3 gap-3 w-full inline-flex flex-row items-center shadow-xs outline-hidden tap-highlight-transparent",innerWrapper:"inline-flex h-fit w-[calc(100%_-theme(spacing.6))] min-h-4 items-center gap-1.5 box-border",selectorIcon:"absolute end-3 w-4 h-4",spinner:"absolute end-3",value:["text-foreground-500","font-normal","w-full","text-start"],listboxWrapper:"scroll-py-6 w-full",listbox:"",popoverContent:"w-full p-1 overflow-hidden",clearButton:["w-4","h-4","z-10","mb-4","relative","start-auto","appearance-none","outline-none","select-none","opacity-70","hover:!opacity-100","cursor-pointer","active:!opacity-70","rounded-full",...Ze],helperWrapper:"p-1 flex relative flex-col gap-1.5 group-data-[has-helper=true]:flex",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger",endWrapper:"flex end-18",endContent:"mb-4"},variants:{variant:{flat:{trigger:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-200"],clearButton:"mb-4"},faded:{trigger:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 data-[focus=true]:border-default-400 data-[open=true]:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},bordered:{trigger:["border-medium","border-default-200","data-[hover=true]:border-default-400","data-[open=true]:border-default-foreground","data-[focus=true]:border-default-foreground"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},underlined:{trigger:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","data-[open=true]:after:w-full","data-[focus=true]:after:w-full"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4 me-2"}},color:{default:{},primary:{selectorIcon:"text-primary"},secondary:{selectorIcon:"text-secondary"},success:{selectorIcon:"text-success"},warning:{selectorIcon:"text-warning"},danger:{selectorIcon:"text-danger"}},size:{sm:{label:"text-tiny",trigger:"h-8 min-h-8 px-2 rounded-small",value:"text-small",clearButton:"text-medium"},md:{trigger:"h-10 min-h-10 rounded-medium",value:"text-small",clearButton:"text-large"},lg:{trigger:"h-12 min-h-12 rounded-large",value:"text-medium",clearButton:"mb-5 text-large"}},radius:{none:{trigger:"rounded-none"},sm:{trigger:"rounded-small"},md:{trigger:"rounded-medium"},lg:{trigger:"rounded-large"},full:{trigger:"rounded-full"}},labelPlacement:{outside:{base:"flex flex-col",clearButton:"mb-0"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",label:"relative pe-2 text-foreground",clearButton:"mb-0"},inside:{label:"text-tiny cursor-pointer",trigger:"flex-col items-start justify-center gap-0"}},fullWidth:{true:{base:"w-full"},false:{base:"min-w-40"}},isClearable:{true:{clearButton:"peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block",endContent:"ms-3"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",trigger:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",value:"!text-danger",selectorIcon:"text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",trigger:"!h-auto"},false:{value:"truncate"}},disableAnimation:{true:{trigger:"after:transition-none",base:"transition-none",label:"transition-none",selectorIcon:"transition-none"},false:{base:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","origin-top-left","rtl:origin-top-right","!duration-200","!ease-out","transition-[transform,color,left,opacity,translate,scale]","motion-reduce:transition-none"],selectorIcon:"transition-transform duration-150 ease motion-reduce:transition-none",clearButton:["transition-opacity","motion-reduce:transition-none"]}},disableSelectorIconRotation:{true:{},false:{selectorIcon:"data-[open=true]:rotate-180"}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1,disableSelectorIconRotation:!1},compoundVariants:[{variant:"flat",color:"default",class:{value:"group-data-[has-value=true]:text-default-foreground",trigger:["bg-default-100","data-[hover=true]:bg-default-200"]}},{variant:"flat",color:"primary",class:{trigger:["bg-primary-100","text-primary","data-[hover=true]:bg-primary-50","group-data-[focus=true]:bg-primary-50"],value:"text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{trigger:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50"],value:"text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{trigger:["bg-success-100","text-success-600","dark:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],value:"text-success-600 dark:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{trigger:["bg-warning-100","text-warning-600","dark:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],value:"text-warning-600 dark:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{trigger:["bg-danger-100","text-danger","dark:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],value:"text-danger dark:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{trigger:"data-[hover=true]:border-primary data-[focus=true]:border-primary data-[open=true]:border-primary",label:"text-primary"}},{variant:"faded",color:"secondary",class:{trigger:"data-[hover=true]:border-secondary data-[focus=true]:border-secondary data-[open=true]:border-secondary",label:"text-secondary"}},{variant:"faded",color:"success",class:{trigger:"data-[hover=true]:border-success data-[focus=true]:border-success data-[open=true]:border-success",label:"text-success"}},{variant:"faded",color:"warning",class:{trigger:"data-[hover=true]:border-warning data-[focus=true]:border-warning data-[open=true]:border-warning",label:"text-warning"}},{variant:"faded",color:"danger",class:{trigger:"data-[hover=true]:border-danger data-[focus=true]:border-danger data-[open=true]:border-danger",label:"text-danger"}},{variant:"underlined",color:"default",class:{value:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{trigger:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{trigger:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{trigger:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{trigger:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{trigger:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{trigger:["data-[open=true]:border-primary","data-[focus=true]:border-primary"],label:"text-primary"}},{variant:"bordered",color:"secondary",class:{trigger:["data-[open=true]:border-secondary","data-[focus=true]:border-secondary"],label:"text-secondary"}},{variant:"bordered",color:"success",class:{trigger:["data-[open=true]:border-success","data-[focus=true]:border-success"],label:"text-success"}},{variant:"bordered",color:"warning",class:{trigger:["data-[open=true]:border-warning","data-[focus=true]:border-warning"],label:"text-warning"}},{variant:"bordered",color:"danger",class:{trigger:["data-[open=true]:border-danger","data-[focus=true]:border-danger"],label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled=true]:text-foreground"}},{radius:"full",size:["sm"],class:{trigger:"px-3"}},{radius:"full",size:"md",class:{trigger:"px-4"}},{radius:"full",size:"lg",class:{trigger:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{trigger:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{trigger:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{trigger:[...Ze]}},{isInvalid:!0,variant:"flat",class:{trigger:["bg-danger-50","data-[hover=true]:bg-danger-100","group-data-[focus=true]:bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{trigger:"!border-danger group-data-[focus=true]:border-danger"}},{isInvalid:!0,variant:"underlined",class:{trigger:"after:bg-danger"}},{labelPlacement:"inside",size:"sm",class:{trigger:"h-12 min-h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{trigger:"h-14 min-h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{label:"text-medium",trigger:"h-16 min-h-16 py-2.5 gap-0"}},{labelPlacement:"outside",isMultiline:!1,class:{base:"group relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled=true]:start-0"]}},{labelPlacement:["inside"],class:{label:"group-data-[filled=true]:scale-85"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-5"}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled=true]:-translate-y-[calc(100%_+var(--heroui-font-size-tiny)/2_+_16px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_26px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"md",class:{label:["start-3","text-small","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_30px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"lg",class:{label:["start-3","text-medium","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_34px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{labelPlacement:["outside","outside-left"],isClearable:!0,class:{endContent:["mt-4"],clearButton:["group-data-[has-end-content=true]:mt-4"]}},{isClearable:!1,labelPlacement:["outside","outside-left"],class:{endContent:["mt-4"]}},{isClearable:!0,variant:["underlined"],class:{clearButton:["relative group-data-[has-end-content=true]:left-2"],endContent:["me-2"]}},{isClearable:!1,variant:["underlined"],class:{endContent:["me-2"]}},{isClearable:!0,size:"sm",class:{endContent:"ms-2"}}]}),ut=()=>Yt(()=>import("./index-BN_skI-f.js"),__vite__mapDeps([0,1,2,3])).then(e=>e.default),pt=pe(({children:e,motionProps:t,placement:l,disableAnimation:s,style:p={},transformOrigin:r={},...a},o)=>{let u=p;return r.originX!==void 0||r.originY!==void 0?u={...u,transformOrigin:r}:l&&(u={...u,...Qt(l==="center"?"top":l)}),s?c.jsx("div",{...a,ref:o,children:e}):c.jsx(ot,{features:ut,children:c.jsx(nt.div,{ref:o,animate:"enter",exit:"exit",initial:"initial",style:u,variants:it.scaleSpringOpacity,...W(a,t),children:e})})});pt.displayName="HeroUI.FreeSoloPopoverWrapper";var ft=pe(({children:e,transformOrigin:t,disableDialogFocus:l=!1,...s},p)=>{const{Component:r,state:a,placement:o,backdrop:u,portalContainer:n,disableAnimation:b,motionProps:g,isNonModal:x,getPopoverProps:$,getBackdropProps:y,getDialogProps:f,getContentProps:C}=Kl({...s,ref:p}),h=v.useRef(null),{dialogProps:P,titleProps:w}=qt({},h),I=f({...!l&&{ref:h},...P}),m=v.useMemo(()=>u==="transparent"?null:b?c.jsx("div",{...y()}):c.jsx(ot,{features:ut,children:c.jsx(nt.div,{animate:"enter",exit:"exit",initial:"exit",variants:it.fade,...y()})}),[u,b,y]);return c.jsxs(Gt,{portalContainer:n,children:[!x&&m,c.jsx(r,{...$(),children:c.jsxs(pt,{disableAnimation:b,motionProps:g,placement:o,tabIndex:-1,transformOrigin:t,...I,children:[!x&&c.jsx(Je,{onDismiss:a.close}),c.jsx("div",{...C(),children:typeof e=="function"?e(w):e}),c.jsx(Je,{onDismiss:a.close})]})})]})});ft.displayName="HeroUI.FreeSoloPopover";var Ol=ft;class rt{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let l=this.keyMap.get(t);var s;return l&&(s=l.prevKey)!==null&&s!==void 0?s:null}getKeyAfter(t){let l=this.keyMap.get(t);var s;return l&&(s=l.nextKey)!==null&&s!==void 0?s:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){var l;return(l=this.keyMap.get(t))!==null&&l!==void 0?l:null}at(t){const l=[...this.getKeys()];return this.getItem(l[t])}getChildren(t){let l=this.keyMap.get(t);return l?.childNodes||[]}constructor(t){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t;let l=a=>{if(this.keyMap.set(a.key,a),a.childNodes&&a.type==="section")for(let o of a.childNodes)l(o)};for(let a of t)l(a);let s=null,p=0;for(let[a,o]of this.keyMap)s?(s.nextKey=a,o.prevKey=s.key):(this.firstKey=a,o.prevKey=void 0),o.type==="item"&&(o.index=p++),s=o,s.nextKey=void 0;var r;this.lastKey=(r=s?.key)!==null&&r!==void 0?r:null}}function bt(e){let{filter:t,layoutDelegate:l}=e,s=Xt(e),p=v.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),r=v.useCallback(n=>t?new rt(t(n)):new rt(n),[t]),a=v.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),o=Zt(e,r,a),u=v.useMemo(()=>new Jt(o,s,{layoutDelegate:l}),[o,s,l]);return Vl(o,u),{collection:o,disabledKeys:p,selectionManager:u}}function Vl(e,t){const l=v.useRef(null);v.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&l.current){const b=l.current.getItem(t.focusedKey),g=[...l.current.getKeys()].map(h=>{const P=l.current.getItem(h);return P?.type==="item"?P:null}).filter(h=>h!==null),x=[...e.getKeys()].map(h=>{const P=e.getItem(h);return P?.type==="item"?P:null}).filter(h=>h!==null);var s,p;const $=((s=g?.length)!==null&&s!==void 0?s:0)-((p=x?.length)!==null&&p!==void 0?p:0);var r,a,o;let y=Math.min($>1?Math.max(((r=b?.index)!==null&&r!==void 0?r:0)-$+1,0):(a=b?.index)!==null&&a!==void 0?a:0,((o=x?.length)!==null&&o!==void 0?o:0)-1),f=null,C=!1;for(;y>=0;){if(!t.isDisabled(x[y].key)){f=x[y];break}if(y((u=b?.index)!==null&&u!==void 0?u:0)&&(y=(n=b?.index)!==null&&n!==void 0?n:0),y--}}t.setFocusedKey(f?f.key:null)}l.current=e},[e,t])}function El(e){const{collection:t,disabledKeys:l,selectionManager:s,selectionManager:{setSelectedKeys:p,selectedKeys:r,selectionMode:a}}=bt(e),o=v.useMemo(()=>!e.isLoading&&r.size!==0?Array.from(r).filter(Boolean).filter(n=>!t.getItem(n)):[],[r,t]),u=r.size!==0?Array.from(r).map(n=>t.getItem(n)).filter(Boolean):null;return o.length&&console.warn(`Select: Keys "${o.join(", ")}" passed to "selectedKeys" are not present in the collection.`),{collection:t,disabledKeys:l,selectionManager:s,selectionMode:a,selectedKeys:r,setSelectedKeys:p.bind(s),selectedItems:u}}function Hl({validate:e,validationBehavior:t,...l}){const[s,p]=v.useState(!1),[r,a]=v.useState(null),o=jl(l),u=El({...l,onSelectionChange:g=>{l.onSelectionChange!=null&&(g==="all"?l.onSelectionChange(new Set(u.collection.getKeys())):l.onSelectionChange(g)),l.selectionMode==="single"&&o.close()}}),n=el({...l,validationBehavior:t,validate:g=>{if(!e)return;const x=Array.from(g);return e(l.selectionMode==="single"?x[0]:x)},value:u.selectedKeys}),b=u.collection.size===0&&l.hideEmptyContent;return{...n,...u,...o,focusStrategy:r,close(){o.close()},open(g=null){b||(a(g),o.open())},toggle(g=null){b||(a(g),o.toggle())},isFocused:s,setFocused:p}}function Tl(e,t,l){const{disallowEmptySelection:s,isDisabled:p}=e,r=tl({usage:"search",sensitivity:"base"}),a=v.useMemo(()=>new ll(t.collection,t.disabledKeys,null,r),[t.collection,t.disabledKeys,r]),{menuTriggerProps:o,menuProps:u}=Bl({isDisabled:p,type:"listbox"},t,l),n=m=>{if(t.selectionMode==="single")switch(m.key){case"ArrowLeft":{m.preventDefault();const _=t.selectedKeys.size>0?a.getKeyAbove(t.selectedKeys.values().next().value):a.getFirstKey();_&&t.setSelectedKeys([_]);break}case"ArrowRight":{m.preventDefault();const _=t.selectedKeys.size>0?a.getKeyBelow(t.selectedKeys.values().next().value):a.getFirstKey();_&&t.setSelectedKeys([_]);break}}},{typeSelectProps:b}=al({keyboardDelegate:a,selectionManager:t.selectionManager,onTypeSelect(m){t.setSelectedKeys([m])}}),{isInvalid:g,validationErrors:x,validationDetails:$}=t.displayValidation,{labelProps:y,fieldProps:f,descriptionProps:C,errorMessageProps:h}=sl({...e,labelElementType:"span",isInvalid:g,errorMessage:e.errorMessage||x});b.onKeyDown=b.onKeyDownCapture,delete b.onKeyDownCapture,o.onPressStart=m=>{m.pointerType!=="touch"&&m.pointerType!=="keyboard"&&!p&&t.toggle(m.pointerType==="virtual"?"first":null)};const P=Se(e,{labelable:!0}),w=ce(b,o,f),I=$e();return{labelProps:{...y,onClick:()=>{var m;e.isDisabled||((m=l.current)==null||m.focus(),rl("keyboard"))}},triggerProps:ce(P,{...w,onKeyDown:dt(w.onKeyDown,n,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[I,w["aria-labelledby"],w["aria-label"]&&!w["aria-labelledby"]?w.id:null].join(","),onFocus(m){t.isFocused||(e.onFocus&&e.onFocus(m),t.setFocused(!0))},onBlur(m){t.isOpen||(e.onBlur&&e.onBlur(m),t.setFocused(!1))}}),valueProps:{id:I},menuProps:{...u,disallowEmptySelection:s,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,onBlur:m=>{m.currentTarget.contains(m.relatedTarget)||(e.onBlur&&e.onBlur(m),t.setFocused(!1))},onFocus:u?.onFocus,"aria-labelledby":[f["aria-labelledby"],w["aria-label"]&&!f["aria-labelledby"]?w.id:null].filter(Boolean).join(" ")},descriptionProps:C,errorMessageProps:h,isInvalid:g,validationErrors:x,validationDetails:$}}var vt=new WeakMap;function Ul(e){var t,l,s,p,r,a;const o=Ce(),{validationBehavior:u}=ol(ul)||{},[n,b]=_e(e,st.variantKeys),g=(l=(t=e.disableAnimation)!=null?t:o?.disableAnimation)!=null?l:!1,{ref:x,as:$,label:y,name:f,isLoading:C,selectorIcon:h,isOpen:P,defaultOpen:w,onOpenChange:I,startContent:m,endContent:_,description:K,renderValue:D,onSelectionChange:R,placeholder:N,isVirtualized:O,itemHeight:L=36,maxListboxHeight:V=256,children:U,disallowEmptySelection:j=!1,selectionMode:A="single",spinnerRef:M,scrollRef:q,popoverProps:X={},scrollShadowProps:Y={},listboxProps:te={},spinnerProps:Z={},validationState:re,onChange:G,onClose:J,className:le,classNames:d,validationBehavior:oe=(s=u??o?.validationBehavior)!=null?s:"native",hideEmptyContent:ie=!1,onClear:ee,...E}=n,H=ge(q),F={popoverProps:W({placement:"bottom",triggerScaleOnOpen:!1,offset:5,disableAnimation:g},X),scrollShadowProps:W({ref:H,isEnabled:(p=e.showScrollIndicators)!=null?p:!0,hideScrollBar:!0,offset:15},Y),listboxProps:W({disableAnimation:g},te)},fe=$||"button",be=typeof fe=="string",Q=ge(x),T=v.useRef(null),ve=v.useRef(null),de=v.useRef(null);let S=Hl({...n,isOpen:P,selectionMode:A,disallowEmptySelection:j,validationBehavior:oe,children:U,isRequired:e.isRequired,isDisabled:e.isDisabled,isInvalid:e.isInvalid,defaultOpen:w,hideEmptyContent:ie,onOpenChange:i=>{I?.(i),i||J?.()},onSelectionChange:i=>{R?.(i),G&&typeof G=="function"&&G({target:{...Q.current&&{...Q.current,name:Q.current.name},value:Array.from(i).join(",")}}),S.commitValidation()}});S={...S,...e.isDisabled&&{disabledKeys:new Set([...S.collection.getKeys()])}},nl(()=>{var i;(i=Q.current)!=null&&i.value&&S.setSelectedKeys(new Set([...S.selectedKeys,Q.current.value]))},[Q.current]);const{labelProps:ze,triggerProps:xt,valueProps:Ke,menuProps:yt,descriptionProps:Pt,errorMessageProps:je,isInvalid:St,validationErrors:me,validationDetails:$t}=Tl({...n,disallowEmptySelection:j,isDisabled:e.isDisabled},S,T),Ct=v.useCallback(()=>{var i;S.setSelectedKeys(new Set([])),ee?.(),(i=T.current)==null||i.focus()},[ee,S]),{pressProps:Be}=ct({isDisabled:!!e?.isDisabled,onPress:Ct}),ne=e.isInvalid||re==="invalid"||St,{isPressed:De,buttonProps:Ne}=il(xt,T),{focusProps:Fe,isFocused:Re,isFocusVisible:We}=Pe(),{focusProps:Le,isFocusVisible:Ae}=Pe(),{isHovered:Oe,hoverProps:Ve}=we({isDisabled:e.isDisabled}),ae=dl({labelPlacement:e.labelPlacement,label:y}),he=!!N,Ee=ae==="outside-left"||ae==="outside",_t=ae==="inside",He=ae==="outside-left",Te=e.isClearable,Ue=S.isOpen||he||!!((r=S.selectedItems)!=null&&r.length)||!!m||!!_||!!e.isMultiline,qe=!!((a=S.selectedItems)!=null&&a.length),xe=!!y,Ye=xe&&(He||Ee&&he),Ge=B(d?.base,le),k=v.useMemo(()=>st({...b,isInvalid:ne,isClearable:Te,labelPlacement:ae,disableAnimation:g}),[Me(b),ne,ae,g]);cl({isDisabled:!S.isOpen});const Qe=typeof n.errorMessage=="function"?n.errorMessage({isInvalid:ne,validationErrors:me,validationDetails:$t}):n.errorMessage||me?.join(" "),ye=!!K||!!Qe,wt=!!_;v.useEffect(()=>{if(S.isOpen&&de.current&&T.current){let i=T.current.getBoundingClientRect(),se=de.current;se.style.width=i.width+"px"}},[S.isOpen]);const Mt=v.useCallback((i={})=>({"data-slot":"base","data-filled":z(Ue),"data-has-value":z(qe),"data-has-label":z(xe),"data-has-helper":z(ye),"data-has-end-content":z(wt),"data-invalid":z(ne),"data-has-label-outside":z(Ye),className:k.base({class:B(Ge,i.className)}),...i}),[k,ye,qe,xe,Ye,Ue,Ge]),It=v.useCallback((i={})=>({ref:T,"data-slot":"trigger","data-open":z(S.isOpen),"data-disabled":z(e?.isDisabled),"data-focus":z(Re),"data-pressed":z(De),"data-focus-visible":z(We),"data-hover":z(Oe),className:k.trigger({class:d?.trigger}),...W(Ne,Fe,Ve,ue(E,{enabled:be}),ue(i))}),[k,T,S.isOpen,d?.trigger,e?.isDisabled,Re,De,We,Oe,Ne,Fe,Ve,E,be]),kt=v.useCallback((i={})=>({state:S,triggerRef:T,selectRef:Q,selectionMode:A,label:e?.label,name:e?.name,isRequired:e?.isRequired,autoComplete:e?.autoComplete,isDisabled:e?.isDisabled,form:e?.form,onChange:G,...i}),[S,A,e?.label,e?.autoComplete,e?.name,e?.isDisabled,T]),zt=v.useCallback((i={})=>({"data-slot":"label",className:k.label({class:B(d?.label,i.className)}),...ze,...i}),[k,d?.label,ze]),Kt=v.useCallback((i={})=>({"data-slot":"value",className:k.value({class:B(d?.value,i.className)}),...Ke,...i}),[k,d?.value,Ke]),jt=v.useCallback((i={})=>({"data-slot":"listboxWrapper",className:k.listboxWrapper({class:B(d?.listboxWrapper,i?.className)}),style:{maxHeight:V??256,...i.style},...W(F.scrollShadowProps,i)}),[k.listboxWrapper,d?.listboxWrapper,F.scrollShadowProps,V]),Bt=(i={})=>{const se=O??S.collection.size>50;return{state:S,ref:ve,isVirtualized:se,virtualization:se?{maxListboxHeight:V,itemHeight:L}:void 0,"data-slot":"listbox",className:k.listbox({class:B(d?.listbox,i?.className)}),scrollShadowProps:F.scrollShadowProps,...W(F.listboxProps,i,yt)}},Dt=v.useCallback((i={})=>{var se,Xe;const Tt=W(F.popoverProps,i);return{state:S,triggerRef:T,ref:de,"data-slot":"popover",scrollRef:ve,triggerType:"listbox",classNames:{content:k.popoverContent({class:B(d?.popoverContent,i.className)})},...Tt,offset:S.selectedItems&&S.selectedItems.length>0?S.selectedItems.length*1e-8+(((se=F.popoverProps)==null?void 0:se.offset)||0):(Xe=F.popoverProps)==null?void 0:Xe.offset}},[k,d?.popoverContent,F.popoverProps,T,S,S.selectedItems]),Nt=v.useCallback(()=>({"data-slot":"selectorIcon","aria-hidden":z(!0),"data-open":z(S.isOpen),className:k.selectorIcon({class:d?.selectorIcon})}),[k,d?.selectorIcon,S.isOpen]),Ft=v.useCallback((i={})=>({...i,"data-slot":"innerWrapper",className:k.innerWrapper({class:B(d?.innerWrapper,i?.className)})}),[k,d?.innerWrapper]),Rt=v.useCallback((i={})=>({...i,"data-slot":"helperWrapper",className:k.helperWrapper({class:B(d?.helperWrapper,i?.className)})}),[k,d?.helperWrapper]),Wt=v.useCallback((i={})=>({...i,...Pt,"data-slot":"description",className:k.description({class:B(d?.description,i?.className)})}),[k,d?.description]),Lt=v.useCallback((i={})=>({...i,"data-slot":"mainWrapper",className:k.mainWrapper({class:B(d?.mainWrapper,i?.className)})}),[k,d?.mainWrapper]),At=v.useCallback((i={})=>({...i,"data-slot":"end-wrapper",className:k.endWrapper({class:B(d?.endWrapper,i?.className)})}),[k,d?.endWrapper]),Ot=v.useCallback((i={})=>({...i,"data-slot":"end-content",className:k.endContent({class:B(d?.endContent,i?.className)})}),[k,d?.endContent]),Vt=v.useCallback((i={})=>({...i,...je,"data-slot":"error-message",className:k.errorMessage({class:B(d?.errorMessage,i?.className)})}),[k,je,d?.errorMessage]),Et=v.useCallback((i={})=>({"aria-hidden":z(!0),"data-slot":"spinner",color:"current",size:"sm",...Z,...i,ref:M,className:k.spinner({class:B(d?.spinner,i?.className)})}),[k,M,Z,d?.spinner]),Ht=v.useCallback((i={})=>({...i,type:"button",tabIndex:-1,"aria-label":"clear selection","data-slot":"clear-button","data-focus-visible":z(Ae),className:k.clearButton({class:B(d?.clearButton,i?.className)}),...W(Be,Le)}),[k,Ae,Be,Le,d?.clearButton]);return vt.set(S,{isDisabled:e?.isDisabled,isRequired:e?.isRequired,name:e?.name,isInvalid:ne,validationBehavior:oe}),{Component:fe,domRef:Q,state:S,label:y,name:f,triggerRef:T,isLoading:C,placeholder:N,startContent:m,endContent:_,description:K,selectorIcon:h,hasHelper:ye,labelPlacement:ae,hasPlaceholder:he,renderValue:D,selectionMode:A,disableAnimation:g,isOutsideLeft:He,shouldLabelBeOutside:Ee,shouldLabelBeInside:_t,isInvalid:ne,errorMessage:Qe,isClearable:Te,getClearButtonProps:Ht,getBaseProps:Mt,getTriggerProps:It,getLabelProps:zt,getValueProps:Kt,getListboxProps:Bt,getPopoverProps:Dt,getSpinnerProps:Et,getMainWrapperProps:Lt,getListboxWrapperProps:jt,getHiddenSelectProps:kt,getInnerWrapperProps:Ft,getHelperWrapperProps:Rt,getDescriptionProps:Wt,getErrorMessageProps:Vt,getSelectorIconProps:Nt,getEndWrapperProps:At,getEndContentProps:Ot}}var ql=typeof document<"u"?pl.useLayoutEffect:()=>{};function Yl(e){const t=v.useRef(null);return ql(()=>{t.current=e},[e]),v.useCallback((...l)=>{const s=t.current;return s?.(...l)},[])}function Gl(e,t,l){let s=v.useRef(t),p=Yl(()=>{l&&l(s.current)});v.useEffect(()=>{var r;let a=(r=e?.current)==null?void 0:r.form;return a?.addEventListener("reset",p),()=>{a?.removeEventListener("reset",p)}},[e,p])}function Ql(e,t,l){var s;let p=vt.get(t)||{},{autoComplete:r,name:a=p.name,isDisabled:o=p.isDisabled,selectionMode:u,onChange:n,form:b}=e,{validationBehavior:g,isRequired:x,isInvalid:$}=p,{visuallyHiddenProps:y}=fl();return Gl(e.selectRef,t.selectedKeys,t.setSelectedKeys),bl({validationBehavior:g,focus:()=>{var f;return(f=l.current)==null?void 0:f.focus()}},t,e.selectRef),{containerProps:{...y,"aria-hidden":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{form:b,autoComplete:r,disabled:o,"aria-invalid":$||void 0,"aria-required":x&&g==="aria"||void 0,required:x&&g==="native",name:a,tabIndex:-1,value:u==="multiple"?[...t.selectedKeys].map(f=>String(f)):(s=[...t.selectedKeys][0])!=null?s:"",multiple:u==="multiple",onChange:f=>{t.setSelectedKeys(f.target.value),n?.(f)}}}}function Xl(e){var t;let{state:l,triggerRef:s,selectRef:p,label:r,name:a,isDisabled:o,form:u}=e,{containerProps:n,selectProps:b}=Ql({...e,selectRef:p},l,s);return l.collection.size<=300?c.jsx("div",{...n,"data-testid":"hidden-select-container",children:c.jsxs("label",{children:[r,c.jsxs("select",{...b,ref:p,children:[c.jsx("option",{}),[...l.collection.getKeys()].map(g=>{let x=l.collection.getItem(g);if(x?.type==="item")return c.jsx("option",{value:x.key,children:x.textValue},x.key)})]})]})}):a?c.jsx("input",{autoComplete:b.autoComplete,disabled:o,form:u,name:a,type:"hidden",value:(t=[...l.selectedKeys].join(","))!=null?t:""}):null}var Zl=vl,ya=Zl;const Ie=new WeakMap;function Jl(e){return typeof e=="string"?e.replace(/\s*/g,""):""+e}function ea(e,t){let l=Ie.get(e);if(!l)throw new Error("Unknown list");return`${l.id}-option-${Jl(t)}`}function ta(e,t,l){let s=Se(e,{labelable:!0}),p=e.selectionBehavior||"toggle",r=e.linkBehavior||(p==="replace"?"action":"override");p==="toggle"&&r==="action"&&(r="override");let{listProps:a}=gl({...e,ref:l,selectionManager:t.selectionManager,collection:t.collection,disabledKeys:t.disabledKeys,linkBehavior:r}),{focusWithinProps:o}=ml({onFocusWithin:e.onFocus,onBlurWithin:e.onBlur,onFocusWithinChange:e.onFocusChange}),u=$e(e.id);Ie.set(t,{id:u,shouldUseVirtualFocus:e.shouldUseVirtualFocus,shouldSelectOnPressUp:e.shouldSelectOnPressUp,shouldFocusOnHover:e.shouldFocusOnHover,isVirtualized:e.isVirtualized,onAction:e.onAction,linkBehavior:r});let{labelProps:n,fieldProps:b}=hl({...e,id:u,labelElementType:"span"});return{labelProps:n,listBoxProps:ce(s,o,t.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...ce(b,a)})}}function la(e,t,l){var s,p;let{key:r}=e,a=Ie.get(t);var o;let u=(o=e.isDisabled)!==null&&o!==void 0?o:t.selectionManager.isDisabled(r);var n;let b=(n=e.isSelected)!==null&&n!==void 0?n:t.selectionManager.isSelected(r);var g;let x=(g=e.shouldSelectOnPressUp)!==null&&g!==void 0?g:a?.shouldSelectOnPressUp;var $;let y=($=e.shouldFocusOnHover)!==null&&$!==void 0?$:a?.shouldFocusOnHover;var f;let C=(f=e.shouldUseVirtualFocus)!==null&&f!==void 0?f:a?.shouldUseVirtualFocus;var h;let P=(h=e.isVirtualized)!==null&&h!==void 0?h:a?.isVirtualized,w=et(),I=et(),m={role:"option","aria-disabled":u||void 0,"aria-selected":t.selectionManager.selectionMode!=="none"?b:void 0};xl()&&yl()||(m["aria-label"]=e["aria-label"],m["aria-labelledby"]=w,m["aria-describedby"]=I);let _=t.collection.getItem(r);if(P){let M=Number(_?.index);m["aria-posinset"]=Number.isNaN(M)?void 0:M+1,m["aria-setsize"]=Dl(t.collection)}let K=a?.onAction?()=>{var M;return a==null||(M=a.onAction)===null||M===void 0?void 0:M.call(a,r)}:void 0,D=ea(t,r),{itemProps:R,isPressed:N,isFocused:O,hasAction:L,allowsSelection:V}=Wl({selectionManager:t.selectionManager,key:r,ref:l,shouldSelectOnPressUp:x,allowsDifferentPressOrigin:x&&y,isVirtualized:P,shouldUseVirtualFocus:C,isDisabled:u,onAction:K||!(_==null||(s=_.props)===null||s===void 0)&&s.onAction?dt(_==null||(p=_.props)===null||p===void 0?void 0:p.onAction,K):void 0,linkBehavior:a?.linkBehavior,id:D}),{hoverProps:U}=we({isDisabled:u||!y,onHoverStart(){tt()||(t.selectionManager.setFocused(!0),t.selectionManager.setFocusedKey(r))}}),j=Se(_?.props);delete j.id;let A=Pl(_?.props);return{optionProps:{...m,...ce(j,R,U,A),id:D},labelProps:{id:w},descriptionProps:{id:I},isFocused:O,isFocusVisible:O&&t.selectionManager.isFocused&&tt(),isSelected:b,isDisabled:u,isPressed:N,allowsSelection:V,hasAction:L}}function aa(e){let{heading:t,"aria-label":l}=e,s=$e();return{itemProps:{role:"presentation"},headingProps:t?{id:s,role:"presentation"}:{},groupProps:{role:"group","aria-label":l,"aria-labelledby":t?s:void 0}}}function sa(e){var t;const l=Ce(),{ref:s,as:p,state:r,variant:a,color:o,onAction:u,children:n,onSelectionChange:b,disableAnimation:g=(t=l?.disableAnimation)!=null?t:!1,itemClasses:x,className:$,topContent:y,bottomContent:f,emptyContent:C="No items.",hideSelectedIcon:h=!1,hideEmptyContent:P=!1,shouldHighlightOnFocus:w=!1,classNames:I,...m}=e,_=p||"ul",K=typeof _=="string",D=ge(s),R=bt({...e,children:n,onSelectionChange:b}),N=r||R,{listBoxProps:O}=ta({...e,onAction:u},N,D),L=v.useMemo(()=>Nl(),[]),V=B(I?.base,$);return{Component:_,state:N,variant:a,color:o,slots:L,classNames:I,topContent:y,bottomContent:f,emptyContent:C,hideEmptyContent:P,shouldHighlightOnFocus:w,hideSelectedIcon:h,disableAnimation:g,className:$,itemClasses:x,getBaseProps:(M={})=>({ref:D,"data-slot":"base",className:L.base({class:V}),...ue(m,{enabled:K}),...M}),getListProps:(M={})=>({"data-slot":"list",className:L.list({class:I?.list}),...O,...M}),getEmptyContentProps:(M={})=>({"data-slot":"empty-content",children:C,className:L.emptyContent({class:I?.emptyContent}),...M})}}function ra(e){const{isSelected:t,disableAnimation:l,...s}=e;return c.jsx("svg",{"aria-hidden":"true","data-selected":t,role:"presentation",viewBox:"0 0 17 18",...s,children:c.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:t?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:l?{}:{transition:"stroke-dashoffset 200ms ease"}})})}function oa(e){var t,l;const s=Ce(),[p,r]=_e(e,at.variantKeys),{as:a,item:o,state:u,description:n,startContent:b,endContent:g,isVirtualized:x,selectedIcon:$,className:y,classNames:f,autoFocus:C,onPress:h,onPressUp:P,onPressStart:w,onPressEnd:I,onPressChange:m,onClick:_,shouldHighlightOnFocus:K,hideSelectedIcon:D=!1,isReadOnly:R=!1,...N}=p,O=(l=(t=e.disableAnimation)!=null?t:s?.disableAnimation)!=null?l:!1,L=v.useRef(null),V=a||(e.href?"a":"li"),U=typeof V=="string",{rendered:j,key:A}=o,M=u.disabledKeys.has(A)||e.isDisabled,q=u.selectionManager.selectionMode!=="none",X=Fl(),{pressProps:Y,isPressed:te}=ct({ref:L,isDisabled:M,onClick:_,onPress:h,onPressUp:P,onPressStart:w,onPressEnd:I,onPressChange:m}),{isHovered:Z,hoverProps:re}=we({isDisabled:M}),{isFocusVisible:G,focusProps:J}=Pe({autoFocus:C}),{isFocused:le,isSelected:d,optionProps:oe,labelProps:ie,descriptionProps:ee}=la({key:A,isDisabled:M,"aria-label":p["aria-label"],isVirtualized:x},u,L);let E=oe;const H=v.useMemo(()=>at({...r,isDisabled:M,disableAnimation:O,hasTitleTextChild:typeof j=="string",hasDescriptionTextChild:typeof n=="string"}),[Me(r),M,O,j,n]),F=B(f?.base,y);R&&(E=Sl(E));const fe=K&&le||(X?Z||te:Z||le&&!G),be=(S={})=>({ref:L,...W(E,R?{}:W(J,Y),re,ue(N,{enabled:U}),S),"data-selectable":z(q),"data-focus":z(le),"data-hover":z(fe),"data-disabled":z(M),"data-selected":z(d),"data-pressed":z(te),"data-focus-visible":z(G),className:H.base({class:B(F,S.className)})}),Q=(S={})=>({...W(ie,S),"data-label":z(!0),className:H.title({class:f?.title})}),T=(S={})=>({...W(ee,S),className:H.description({class:f?.description})}),ve=(S={})=>({...W(S),className:H.wrapper({class:f?.wrapper})}),de=v.useCallback((S={})=>({"aria-hidden":z(!0),"data-disabled":z(M),className:H.selectedIcon({class:f?.selectedIcon}),...S}),[M,H,f]);return{Component:V,domRef:L,slots:H,classNames:f,isSelectable:q,isSelected:d,isDisabled:M,rendered:j,description:n,startContent:b,endContent:g,selectedIcon:$,hideSelectedIcon:D,disableAnimation:O,getItemProps:be,getLabelProps:Q,getWrapperProps:ve,getDescriptionProps:T,getSelectedIconProps:de}}var gt=e=>{const{Component:t,rendered:l,description:s,isSelectable:p,isSelected:r,isDisabled:a,selectedIcon:o,startContent:u,endContent:n,hideSelectedIcon:b,disableAnimation:g,getItemProps:x,getLabelProps:$,getWrapperProps:y,getDescriptionProps:f,getSelectedIconProps:C}=oa(e),h=v.useMemo(()=>{const P=c.jsx(ra,{disableAnimation:g,isSelected:r});return typeof o=="function"?o({icon:P,isSelected:r,isDisabled:a}):o||P},[o,r,a,g]);return c.jsxs(t,{...x(),children:[u,s?c.jsxs("div",{...y(),children:[c.jsx("span",{...$(),children:l}),c.jsx("span",{...f(),children:s})]}):c.jsx("span",{...$(),children:l}),p&&!b&&c.jsx("span",{...C(),children:h}),n]})};gt.displayName="HeroUI.ListboxItem";var ke=gt,mt=pe(({item:e,state:t,as:l,variant:s,color:p,disableAnimation:r,className:a,classNames:o,hideSelectedIcon:u,showDivider:n=!1,dividerProps:b={},itemClasses:g,title:x,items:$,...y},f)=>{const C=l||"li",h=v.useMemo(()=>Rl(),[]),P=B(o?.base,a),w=B(o?.divider,b?.className),{itemProps:I,headingProps:m,groupProps:_}=aa({heading:e.rendered,"aria-label":e["aria-label"]});return c.jsxs(C,{"data-slot":"base",...W(I,y),className:h.base({class:P}),children:[e.rendered&&c.jsx("span",{...m,className:h.heading({class:o?.heading}),"data-slot":"heading",children:e.rendered}),c.jsxs("ul",{..._,className:h.group({class:o?.group}),"data-has-title":!!e.rendered,"data-slot":"group",children:[[...e.childNodes].map(K=>{const{key:D,props:R}=K;let N=c.jsx(ke,{classNames:g,color:p,disableAnimation:r,hideSelectedIcon:u,item:K,state:t,variant:s,...R},D);return K.wrapper&&(N=K.wrapper(N)),N}),n&&c.jsx($l,{as:"li",className:h.divider({class:w}),...b})]})]},e.key)});mt.displayName="HeroUI.ListboxSection";var ht=mt;function na(e={}){const{domRef:t,isEnabled:l=!0,overflowCheck:s="vertical",visibility:p="auto",offset:r=0,onVisibilityChange:a,updateDeps:o=[]}=e,u=v.useRef(p);v.useEffect(()=>{const n=t?.current;if(!n||!l)return;const b=($,y,f,C,h)=>{if(p==="auto"){const P=`${C}${_l(h)}Scroll`;y&&f?(n.dataset[P]="true",n.removeAttribute(`data-${C}-scroll`),n.removeAttribute(`data-${h}-scroll`)):(n.dataset[`${C}Scroll`]=y.toString(),n.dataset[`${h}Scroll`]=f.toString(),n.removeAttribute(`data-${C}-${h}-scroll`))}else{const P=y&&f?"both":y?C:f?h:"none";P!==u.current&&(a?.(P),u.current=P)}},g=()=>{var $,y;const f=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],C=n.querySelector('ul[data-slot="list"]'),h=+(($=C?.getAttribute("data-virtual-scroll-height"))!=null?$:n.scrollHeight),P=+((y=C?.getAttribute("data-virtual-scroll-top"))!=null?y:n.scrollTop);for(const{type:w,prefix:I,suffix:m}of f)if(s===w||s==="both"){const _=w==="vertical"?P>r:n.scrollLeft>r,K=w==="vertical"?P+n.clientHeight+r{["top","bottom","top-bottom","left","right","left-right"].forEach($=>{n.removeAttribute(`data-${$}-scroll`)})};return g(),n.addEventListener("scroll",g,!0),p!=="auto"&&(x(),p==="both"?(n.dataset.topBottomScroll=String(s==="vertical"),n.dataset.leftRightScroll=String(s==="horizontal")):(n.dataset.topBottomScroll="false",n.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach($=>{n.dataset[`${$}Scroll`]=String(p===$)}))),()=>{n.removeEventListener("scroll",g,!0),x()}},[...o,l,p,s,a,t])}function ia(e){var t;const[l,s]=_e(e,lt.variantKeys),{ref:p,as:r,children:a,className:o,style:u,size:n=40,offset:b=0,visibility:g="auto",isEnabled:x=!0,onVisibilityChange:$,...y}=l,f=r||"div",C=ge(p);na({domRef:C,offset:b,visibility:g,isEnabled:x,onVisibilityChange:$,updateDeps:[a],overflowCheck:(t=e.orientation)!=null?t:"vertical"});const h=v.useMemo(()=>lt({...s,className:o}),[Me(s),o]);return{Component:f,styles:h,domRef:C,children:a,getBaseProps:(w={})=>{var I;return{ref:C,className:h,"data-orientation":(I=e.orientation)!=null?I:"vertical",style:{"--scroll-shadow-size":`${n}px`,...u,...w.style},...y,...w}}}}var da=(e,t)=>{const l=[];for(const s of e)s.type==="section"?l.push(([...s.childNodes].length+1)*t):l.push(t);return l},ca=e=>{if(!e||e.scrollTop===void 0||e.clientHeight===void 0||e.scrollHeight===void 0)return{isTop:!1,isBottom:!1,isMiddle:!1};const t=e.scrollTop===0,l=Math.ceil(e.scrollTop+e.clientHeight)>=e.scrollHeight;return{isTop:t,isBottom:l,isMiddle:!t&&!l}},ua=e=>{var t;const{Component:l,state:s,color:p,variant:r,itemClasses:a,getBaseProps:o,topContent:u,bottomContent:n,hideEmptyContent:b,hideSelectedIcon:g,shouldHighlightOnFocus:x,disableAnimation:$,getEmptyContentProps:y,getListProps:f,scrollShadowProps:C}=e,{virtualization:h}=e;if(!h||!Cl(h)&&!h.maxListboxHeight&&!h.itemHeight)throw new Error("You are using a virtualized listbox. VirtualizedListbox requires 'virtualization' props with 'maxListboxHeight' and 'itemHeight' properties. This error might have originated from autocomplete components that use VirtualizedListbox. Please provide these props to use the virtualized listbox.");const{maxListboxHeight:P,itemHeight:w}=h,I=Math.min(P,w*s.collection.size),m=v.useRef(null),_=v.useMemo(()=>da([...s.collection],w),[s.collection,w]),K=Ll({count:[...s.collection].length,getScrollElement:()=>m.current,estimateSize:j=>_[j]}),D=K.getVirtualItems(),R=K.getTotalSize(),{getBaseProps:N}=ia({...C}),O=j=>{var A;const M=[...s.collection][j.index];if(!M)return null;const q={color:p,item:M,state:s,variant:r,disableAnimation:$,hideSelectedIcon:g,...M.props},X={position:"absolute",top:0,left:0,width:"100%",height:`${j.size}px`,transform:`translateY(${j.start}px)`};if(M.type==="section")return c.jsx(ht,{...q,itemClasses:a,style:{...X,...q.style}},M.key);let Y=c.jsx(ke,{...q,classNames:W(a,(A=M.props)==null?void 0:A.classNames),shouldHighlightOnFocus:x,style:{...X,...q.style}},M.key);return M.wrapper&&(Y=M.wrapper(Y)),Y},[L,V]=v.useState({isTop:!1,isBottom:!0,isMiddle:!1}),U=c.jsxs(l,{...f(),"data-virtual-scroll-height":R,"data-virtual-scroll-top":(t=m?.current)==null?void 0:t.scrollTop,children:[!s.collection.size&&!b&&c.jsx("li",{children:c.jsx("div",{...y()})}),c.jsx("div",{...ue(N()),ref:m,style:{height:P,overflow:"auto"},onScroll:j=>{V(ca(j.target))},children:I>0&&w>0&&c.jsx("div",{style:{height:`${R}px`,width:"100%",position:"relative"},children:D.map(j=>O(j))})})]});return c.jsxs("div",{...o(),children:[u,U,n]})},pa=ua,fa=pe(function(t,l){const{isVirtualized:s,...p}=t,r=sa({...p,ref:l}),{Component:a,state:o,color:u,variant:n,itemClasses:b,getBaseProps:g,topContent:x,bottomContent:$,hideEmptyContent:y,hideSelectedIcon:f,shouldHighlightOnFocus:C,disableAnimation:h,getEmptyContentProps:P,getListProps:w}=r;if(s)return c.jsx(pa,{...t,...r});const I=c.jsxs(a,{...w(),children:[!o.collection.size&&!y&&c.jsx("li",{children:c.jsx("div",{...P()})}),[...o.collection].map(m=>{var _;const K={color:u,item:m,state:o,variant:n,disableAnimation:h,hideSelectedIcon:f,...m.props};if(m.type==="section")return c.jsx(ht,{...K,itemClasses:b},m.key);let D=c.jsx(ke,{...K,classNames:W(b,(_=m.props)==null?void 0:_.classNames),shouldHighlightOnFocus:C},m.key);return m.wrapper&&(D=m.wrapper(D)),D})]});return c.jsxs("div",{...g(),children:[x,I,$]})}),ba=fa,va=pe(function(t,l){var s;const{Component:p,state:r,label:a,hasHelper:o,isLoading:u,triggerRef:n,selectorIcon:b=c.jsx(Al,{}),description:g,errorMessage:x,isInvalid:$,startContent:y,endContent:f,placeholder:C,renderValue:h,shouldLabelBeOutside:P,disableAnimation:w,getBaseProps:I,getLabelProps:m,getTriggerProps:_,getValueProps:K,getListboxProps:D,getPopoverProps:R,getSpinnerProps:N,getMainWrapperProps:O,getInnerWrapperProps:L,getHiddenSelectProps:V,getHelperWrapperProps:U,getListboxWrapperProps:j,getDescriptionProps:A,getErrorMessageProps:M,getSelectorIconProps:q,isClearable:X,getClearButtonProps:Y,getEndWrapperProps:te,getEndContentProps:Z}=Ul({...t,ref:l}),re=a?c.jsx("label",{...m(),children:a}):null,G=v.cloneElement(b,q()),J=v.useMemo(()=>{var E;return X&&((E=r.selectedItems)!=null&&E.length)?c.jsx("span",{...Y(),children:c.jsx(wl,{})}):null},[X,Y,(s=r.selectedItems)==null?void 0:s.length]),le=v.useMemo(()=>J?c.jsxs("div",{...te(),children:[J,f&&c.jsx("span",{...Z(),children:f})]}):f&&c.jsx("span",{...Z(),children:f}),[J,f,te,Z]),d=v.useMemo(()=>{const E=$&&x;return!o||!(E||g)?null:c.jsx("div",{...U(),children:E?c.jsx("div",{...M(),children:x}):c.jsx("div",{...A(),children:g})})},[o,$,x,g,U,M,A]),oe=v.useMemo(()=>{var E;if(!((E=r.selectedItems)!=null&&E.length))return C;if(h&&typeof h=="function"){const H=[...r.selectedItems].map(F=>({key:F.key,data:F.value,type:F.type,props:F.props,textValue:F.textValue,rendered:F.rendered,"aria-label":F["aria-label"]}));return h(H)}return r.selectedItems.map(H=>H.textValue).join(", ")},[r.selectedItems,h,C]),ie=v.useMemo(()=>u?c.jsx(Ml,{...N()}):G,[u,G,N]),ee=v.useMemo(()=>r.isOpen?c.jsx(Ol,{...R(),children:c.jsx(Il,{...j(),children:c.jsx(ba,{...D()})})}):null,[r.isOpen,R,r,n,j,D]);return c.jsxs("div",{...I(),children:[c.jsx(Xl,{...V()}),P?re:null,c.jsxs("div",{...O(),children:[c.jsxs(p,{..._(),children:[P?null:re,c.jsxs("div",{...L(),children:[y,c.jsx("span",{...K(),children:oe}),f&&r.selectedItems&&c.jsx(kl,{elementType:"span",children:","}),le]}),ie]}),d]}),w?ee:c.jsx(zl,{children:ee})]})}),Pa=va;export{bt as $,ya as a,ba as l,Pa as s}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/eval-HtfR9ADq.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/eval-HtfR9ADq.js new file mode 100644 index 0000000000..e175514c37 --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/eval-HtfR9ADq.js @@ -0,0 +1,78 @@ +import{l as os,d as ls,e as Ve,f as Te,ay as ae,az as is,F as ce,s as de,y as q,E as e,q as Be,U as Ge,aA as cs,r as f,aB as ds,D as Je,w as qe,v as Pe,x as Ye,z as ie,A as H,B as Ne,aC as us,n as ms,aD as xs,k as hs,m as $e,aE as Xe,$ as fs,aF as ps,aG as gs,aH as bs,V as js,aI as _s,L as vs,G as ks,Y as Ns,K as ys,N as Ss,a5 as ws,a3 as Cs,a4 as Rs,aJ as Ts,ai as ue,a8 as y,ak as Ps,al as Ce,a7 as W,ap as $s,ae as M,a0 as Y,aK as V,ah as Qe,ad as ee,a9 as Ds,aa as Is,ab as Fs,af as Ls,ac as Le,J as Ms,aL as As,aq as Ks,ar as Es,as as Os,at as Ws,au as zs,aw as Hs,aM as Us}from"./useThemeContext-DkrqKvLn.js";import{$ as Vs,t as Bs,a as Gs,b as re,c as Js,d as qs,e as oe}from"./chunk-F3UDT23P-C4MzBAmg.js";import{$ as Ys}from"./useSelectableItem-BR0VPP-3.js";import{d as Xs}from"./features-animation-Dc-yT_Yb.js";import{$ as Qs,l as Zs,a as Ze,s as et}from"./chunk-Y2AYO5NJ-Crd-u0HB.js";import{d as st,a as tt,b as nt,m as Me}from"./chunk-XHRYXXZA-eia5gCmD.js";import{i as le}from"./chunk-SSA7SXE4-BswVq7lY.js";import{m as at}from"./chunk-IGSAU2ZA-CRWCDn7K.js";import"./index-B9NaYZAN.js";import"./useMenuTriggerState-DfYBgrZh.js";const rt={...Xs,...ls,...os};var Ae=Ve({slots:{base:"inline-flex",tabList:["flex","p-1","h-fit","gap-2","items-center","flex-nowrap","overflow-x-scroll","scrollbar-hide","bg-default-100"],tab:["z-0","w-full","px-3","py-1","flex","group","relative","justify-center","items-center","outline-hidden","cursor-pointer","transition-opacity","tap-highlight-transparent","data-[disabled=true]:cursor-not-allowed","data-[disabled=true]:opacity-30","data-[hover-unselected=true]:opacity-disabled",...Te],tabContent:["relative","z-10","text-inherit","whitespace-nowrap","transition-colors","text-default-500","group-data-[selected=true]:text-foreground"],cursor:["absolute","z-0","bg-white"],panel:["py-3","px-1","outline-hidden","data-[inert=true]:hidden",...Te],tabWrapper:[]},variants:{variant:{solid:{cursor:"inset-0"},light:{tabList:"bg-transparent dark:bg-transparent",cursor:"inset-0"},underlined:{tabList:"bg-transparent dark:bg-transparent",cursor:"h-[2px] w-[80%] bottom-0 shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]"},bordered:{tabList:"bg-transparent dark:bg-transparent border-medium border-default-200 shadow-xs",cursor:"inset-0"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{tabList:"rounded-medium",tab:"h-7 text-tiny rounded-small",cursor:"rounded-small"},md:{tabList:"rounded-medium",tab:"h-8 text-small rounded-small",cursor:"rounded-small"},lg:{tabList:"rounded-large",tab:"h-9 text-medium rounded-medium",cursor:"rounded-medium"}},radius:{none:{tabList:"rounded-none",tab:"rounded-none",cursor:"rounded-none"},sm:{tabList:"rounded-medium",tab:"rounded-small",cursor:"rounded-small"},md:{tabList:"rounded-medium",tab:"rounded-small",cursor:"rounded-small"},lg:{tabList:"rounded-large",tab:"rounded-medium",cursor:"rounded-medium"},full:{tabList:"rounded-full",tab:"rounded-full",cursor:"rounded-full"}},fullWidth:{true:{base:"w-full",tabList:"w-full"}},isDisabled:{true:{tabList:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{tab:"transition-none",tabContent:"transition-none"}},placement:{top:{},start:{tabList:"flex-col",panel:"py-0 px-3",tabWrapper:"flex"},end:{tabList:"flex-col",panel:"py-0 px-3",tabWrapper:"flex flex-row-reverse"},bottom:{tabWrapper:"flex flex-col-reverse"}}},defaultVariants:{color:"default",variant:"solid",size:"md",fullWidth:!1,isDisabled:!1},compoundVariants:[{variant:["solid","bordered","light"],color:"default",class:{cursor:["bg-background","dark:bg-default","shadow-small"],tabContent:"group-data-[selected=true]:text-default-foreground"}},{variant:["solid","bordered","light"],color:"primary",class:{cursor:ae.solid.primary,tabContent:"group-data-[selected=true]:text-primary-foreground"}},{variant:["solid","bordered","light"],color:"secondary",class:{cursor:ae.solid.secondary,tabContent:"group-data-[selected=true]:text-secondary-foreground"}},{variant:["solid","bordered","light"],color:"success",class:{cursor:ae.solid.success,tabContent:"group-data-[selected=true]:text-success-foreground"}},{variant:["solid","bordered","light"],color:"warning",class:{cursor:ae.solid.warning,tabContent:"group-data-[selected=true]:text-warning-foreground"}},{variant:["solid","bordered","light"],color:"danger",class:{cursor:ae.solid.danger,tabContent:"group-data-[selected=true]:text-danger-foreground"}},{variant:"underlined",color:"default",class:{cursor:"bg-foreground",tabContent:"group-data-[selected=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{cursor:"bg-primary",tabContent:"group-data-[selected=true]:text-primary"}},{variant:"underlined",color:"secondary",class:{cursor:"bg-secondary",tabContent:"group-data-[selected=true]:text-secondary"}},{variant:"underlined",color:"success",class:{cursor:"bg-success",tabContent:"group-data-[selected=true]:text-success"}},{variant:"underlined",color:"warning",class:{cursor:"bg-warning",tabContent:"group-data-[selected=true]:text-warning"}},{variant:"underlined",color:"danger",class:{cursor:"bg-danger",tabContent:"group-data-[selected=true]:text-danger"}},{disableAnimation:!0,variant:"underlined",class:{tab:["after:content-['']","after:absolute","after:bottom-0","after:h-[2px]","after:w-[80%]","after:opacity-0","after:shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","data-[selected=true]:after:opacity-100"]}},{disableAnimation:!0,color:"default",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-default data-[selected=true]:text-default-foreground"}},{disableAnimation:!0,color:"primary",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground"}},{disableAnimation:!0,color:"secondary",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-secondary data-[selected=true]:text-secondary-foreground"}},{disableAnimation:!0,color:"success",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-success data-[selected=true]:text-success-foreground"}},{disableAnimation:!0,color:"warning",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-warning data-[selected=true]:text-warning-foreground"}},{disableAnimation:!0,color:"danger",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-danger data-[selected=true]:text-danger-foreground"}},{disableAnimation:!0,color:"default",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-foreground"}},{disableAnimation:!0,color:"primary",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-primary"}},{disableAnimation:!0,color:"secondary",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-secondary"}},{disableAnimation:!0,color:"success",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-success"}},{disableAnimation:!0,color:"warning",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-warning"}},{disableAnimation:!0,color:"danger",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-danger"}}],compoundSlots:[{variant:"underlined",slots:["tab","tabList","cursor"],class:["rounded-none"]}]}),Ke=Ve({slots:{base:["flex","flex-col","relative","overflow-hidden","h-auto","outline-hidden","text-foreground","box-border","bg-content1",...Te],header:["flex","p-3","z-10","w-full","justify-start","items-center","shrink-0","overflow-inherit","color-inherit","subpixel-antialiased"],body:["relative","flex","flex-1","w-full","p-3","flex-auto","flex-col","place-content-inherit","align-items-inherit","h-auto","break-words","text-left","overflow-y-auto","subpixel-antialiased"],footer:["p-3","h-auto","flex","w-full","items-center","overflow-hidden","color-inherit","subpixel-antialiased"]},variants:{shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},radius:{none:{base:"rounded-none",header:"rounded-none",footer:"rounded-none"},sm:{base:"rounded-small",header:"rounded-t-small",footer:"rounded-b-small"},md:{base:"rounded-medium",header:"rounded-t-medium",footer:"rounded-b-medium"},lg:{base:"rounded-large",header:"rounded-t-large",footer:"rounded-b-large"}},fullWidth:{true:{base:"w-full"}},isHoverable:{true:{base:"data-[hover=true]:bg-content2 dark:data-[hover=true]:bg-content2"}},isPressable:{true:{base:"cursor-pointer"}},isBlurred:{true:{base:["bg-background/80","dark:bg-background/20","backdrop-blur-md","backdrop-saturate-150"]}},isFooterBlurred:{true:{footer:["bg-background/10","backdrop-blur","backdrop-saturate-150"]}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:"",false:{base:"transition-transform-background motion-reduce:transition-none"}}},compoundVariants:[{isPressable:!0,class:"data-[pressed=true]:scale-[0.97] tap-highlight-transparent"}],defaultVariants:{radius:"lg",shadow:"md",fullWidth:!1,isHoverable:!1,isPressable:!1,isDisabled:!1,isFooterBlurred:!1}}),[ot,lt]=is({name:"CardContext",strict:!0,errorMessage:"useCardContext: `context` is undefined. Seems you forgot to wrap component within "}),es=ce((t,a)=>{var s;const{as:n,className:r,children:o,...i}=t,l=n||"div",m=de(a),{slots:p,classNames:b}=lt(),g=q(b?.body,r);return e.jsx(l,{ref:m,className:(s=p.body)==null?void 0:s.call(p,{class:g}),...i,children:o})});es.displayName="HeroUI.CardBody";var F=es;function it(t){var a,s,n,r;const o=Be(),[i,l]=Ge(t,Ke.variantKeys),{ref:m,as:p,children:b,onClick:g,onPress:u,autoFocus:j,className:c,classNames:x,allowTextSelectionOnPress:h=!0,...v}=i,d=de(m),N=p||(t.isPressable?"button":"div"),_=typeof N=="string",w=(s=(a=t.disableAnimation)!=null?a:o?.disableAnimation)!=null?s:!1,R=(r=(n=t.disableRipple)!=null?n:o?.disableRipple)!=null?r:!1,$=q(x?.base,c),{onClear:I,onPress:S,ripples:k}=cs(),E=f.useCallback(B=>{R||w||d.current&&S(B)},[R,w,d,S]),{buttonProps:D,isPressed:T}=ds({onPress:Je(u,E),elementType:p,isDisabled:!t.isPressable,onClick:g,allowTextSelectionOnPress:h,...v},d),{hoverProps:C,isHovered:A}=qe({isDisabled:!t.isHoverable,...v}),{isFocusVisible:O,isFocused:P,focusProps:z}=Pe({autoFocus:j}),U=f.useMemo(()=>Ke({...l,disableAnimation:w}),[Ye(l),w]),Q=f.useMemo(()=>({slots:U,classNames:x,disableAnimation:w,isDisabled:t.isDisabled,isFooterBlurred:t.isFooterBlurred,fullWidth:t.fullWidth}),[U,x,t.isDisabled,t.isFooterBlurred,w,t.fullWidth]),te=f.useCallback((B={})=>({ref:d,className:U.base({class:$}),tabIndex:t.isPressable?0:-1,"data-hover":H(A),"data-pressed":H(T),"data-focus":H(P),"data-focus-visible":H(O),"data-disabled":H(t.isDisabled),...ie(t.isPressable?{...D,...z,role:"button"}:{},t.isHoverable?C:{},Ne(v,{enabled:_}),Ne(B))}),[d,U,$,_,t.isPressable,t.isHoverable,t.isDisabled,A,T,O,D,z,C,v]),ne=f.useCallback(()=>({ripples:k,onClear:I}),[k,I]);return{context:Q,domRef:d,Component:N,classNames:x,children:b,isHovered:A,isPressed:T,disableAnimation:w,isPressable:t.isPressable,isHoverable:t.isHoverable,disableRipple:R,handlePress:E,isFocusVisible:O,getCardProps:te,getRippleProps:ne}}var ss=ce((t,a)=>{const{children:s,context:n,Component:r,isPressable:o,disableAnimation:i,disableRipple:l,getCardProps:m,getRippleProps:p}=it({...t,ref:a});return e.jsxs(r,{...m(),children:[e.jsx(ot,{value:n,children:s}),o&&!i&&!l&&e.jsx(us,{...p()})]})});ss.displayName="HeroUI.Card";var L=ss;const Ee=t=>typeof t=="object"&&t!=null&&t.nodeType===1,Oe=(t,a)=>(!a||t!=="hidden")&&t!=="visible"&&t!=="clip",je=(t,a)=>{if(t.clientHeight{const r=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!r&&(r.clientHeightoa||o>t&&i=a&&l>=s?o-t-n:i>a&&ls?i-a+r:0,ct=t=>{const a=t.parentElement;return a??(t.getRootNode().host||null)},We=(t,a)=>{var s,n,r,o;if(typeof document>"u")return[];const{scrollMode:i,block:l,inline:m,boundary:p,skipOverflowHiddenElements:b}=a,g=typeof p=="function"?p:O=>O!==p;if(!Ee(t))throw new TypeError("Invalid target");const u=document.scrollingElement||document.documentElement,j=[];let c=t;for(;Ee(c)&&g(c);){if(c=ct(c),c===u){j.push(c);break}c!=null&&c===document.body&&je(c)&&!je(document.documentElement)||c!=null&&je(c,b)&&j.push(c)}const x=(n=(s=window.visualViewport)==null?void 0:s.width)!=null?n:innerWidth,h=(o=(r=window.visualViewport)==null?void 0:r.height)!=null?o:innerHeight,{scrollX:v,scrollY:d}=window,{height:N,width:_,top:w,right:R,bottom:$,left:I}=t.getBoundingClientRect(),{top:S,right:k,bottom:E,left:D}=(O=>{const P=window.getComputedStyle(O);return{top:parseFloat(P.scrollMarginTop)||0,right:parseFloat(P.scrollMarginRight)||0,bottom:parseFloat(P.scrollMarginBottom)||0,left:parseFloat(P.scrollMarginLeft)||0}})(t);let T=l==="start"||l==="nearest"?w-S:l==="end"?$+E:w+N/2-S+E,C=m==="center"?I+_/2-D+k:m==="end"?R+k:I-D;const A=[];for(let O=0;O=0&&I>=0&&$<=h&&R<=x&&(P===u&&!je(P)||w>=Q&&$<=ne&&I>=B&&R<=te))return A;const me=getComputedStyle(P),xe=parseInt(me.borderLeftWidth,10),he=parseInt(me.borderTopWidth,10),fe=parseInt(me.borderRightWidth,10),pe=parseInt(me.borderBottomWidth,10);let G=0,J=0;const ge="offsetWidth"in P?P.offsetWidth-P.clientWidth-xe-fe:0,be="offsetHeight"in P?P.offsetHeight-P.clientHeight-he-pe:0,Se="offsetWidth"in P?P.offsetWidth===0?0:U/P.offsetWidth:0,we="offsetHeight"in P?P.offsetHeight===0?0:z/P.offsetHeight:0;if(u===P)G=l==="start"?T:l==="end"?T-h:l==="nearest"?_e(d,d+h,h,he,pe,d+T,d+T+N,N):T-h/2,J=m==="start"?C:m==="center"?C-x/2:m==="end"?C-x:_e(v,v+x,x,xe,fe,v+C,v+C+_,_),G=Math.max(0,G+d),J=Math.max(0,J+v);else{G=l==="start"?T-Q-he:l==="end"?T-ne+pe+be:l==="nearest"?_e(Q,ne,z,he,pe+be,T,T+N,N):T-(Q+z/2)+be/2,J=m==="start"?C-B-xe:m==="center"?C-(B+U/2)+ge/2:m==="end"?C-te+fe+ge:_e(B,te,U,xe,fe+ge,C,C+_,_);const{scrollLeft:Ie,scrollTop:Fe}=P;G=we===0?0:Math.max(0,Math.min(Fe+G/we,P.scrollHeight-z/we+be)),J=Se===0?0:Math.max(0,Math.min(Ie+J/Se,P.scrollWidth-U/Se+ge)),T+=Fe-G,C+=Ie-J}A.push({el:P,top:G,left:J})}return A},dt=t=>t===!1?{block:"end",inline:"nearest"}:(a=>a===Object(a)&&Object.keys(a).length!==0)(t)?t:{block:"start",inline:"nearest"};function ut(t,a){if(!t.isConnected||!(n=>{let r=n;for(;r&&r.parentNode;){if(r.parentNode===document)return!0;r=r.parentNode instanceof ShadowRoot?r.parentNode.host:r.parentNode}return!1})(t))return;if((n=>typeof n=="object"&&typeof n.behavior=="function")(a))return a.behavior(We(t,a));const s=typeof a=="boolean"||a==null?void 0:a.behavior;for(const{el:n,top:r,left:o}of We(t,dt(a)))n.scroll({top:r,left:o,behavior:s})}const ts=new WeakMap;function ye(t,a,s){return t?(typeof a=="string"&&(a=a.replace(/\s+/g,"")),`${ts.get(t)}-${s}-${a}`):""}function mt(t,a,s){let{key:n,isDisabled:r,shouldSelectOnPressUp:o}=t,{selectionManager:i,selectedKey:l}=a,m=n===l,p=r||a.isDisabled||a.selectionManager.isDisabled(n),{itemProps:b,isPressed:g}=Ys({selectionManager:i,key:n,ref:s,isDisabled:p,shouldSelectOnPressUp:o,linkBehavior:"selection"}),u=ye(a,n,"tab"),j=ye(a,n,"tabpanel"),{tabIndex:c}=b,x=a.collection.getItem(n),h=ms(x?.props,{labelable:!0});delete h.id;let v=xs(x?.props),{focusableProps:d}=hs({isDisabled:p},s);return{tabProps:$e(h,d,v,b,{id:u,"aria-selected":m,"aria-disabled":p||void 0,"aria-controls":m?j:void 0,tabIndex:p?void 0:c,role:"tab"}),isSelected:m,isDisabled:p,isPressed:g}}function xt(t,a,s){let n=Vs(s)?void 0:0;var r;const o=ye(a,(r=t.id)!==null&&r!==void 0?r:a?.selectedKey,"tabpanel"),i=Xe({...t,id:o,"aria-labelledby":ye(a,a?.selectedKey,"tab")});return{tabPanelProps:$e(i,{tabIndex:n,role:"tabpanel","aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]})}}class ht{getKeyLeftOf(a){return this.flipDirection?this.getNextKey(a):this.getPreviousKey(a)}getKeyRightOf(a){return this.flipDirection?this.getPreviousKey(a):this.getNextKey(a)}isDisabled(a){var s,n;return this.disabledKeys.has(a)||!!(!((n=this.collection.getItem(a))===null||n===void 0||(s=n.props)===null||s===void 0)&&s.isDisabled)}getFirstKey(){let a=this.collection.getFirstKey();return a!=null&&this.isDisabled(a)&&(a=this.getNextKey(a)),a}getLastKey(){let a=this.collection.getLastKey();return a!=null&&this.isDisabled(a)&&(a=this.getPreviousKey(a)),a}getKeyAbove(a){return this.tabDirection?null:this.getPreviousKey(a)}getKeyBelow(a){return this.tabDirection?null:this.getNextKey(a)}getNextKey(a){let s=a;do s=this.collection.getKeyAfter(s),s==null&&(s=this.collection.getFirstKey());while(s!=null&&this.isDisabled(s));return s}getPreviousKey(a){let s=a;do s=this.collection.getKeyBefore(s),s==null&&(s=this.collection.getLastKey());while(s!=null&&this.isDisabled(s));return s}constructor(a,s,n,r=new Set){this.collection=a,this.flipDirection=s==="rtl"&&n==="horizontal",this.disabledKeys=r,this.tabDirection=n==="horizontal"}}function ft(t,a,s){let{orientation:n="horizontal",keyboardActivation:r="automatic"}=t,{collection:o,selectionManager:i,disabledKeys:l}=a,{direction:m}=fs(),p=f.useMemo(()=>new ht(o,m,n,l),[o,l,n,m]),{collectionProps:b}=ps({ref:s,selectionManager:i,keyboardDelegate:p,selectOnFocus:r==="automatic",disallowEmptySelection:!0,scrollRef:s,linkBehavior:"selection"}),g=gs();ts.set(a,g);let u=Xe({...t,id:g});return{tabListProps:{...$e(b,u),role:"tablist","aria-orientation":n,tabIndex:void 0}}}var ns=ce((t,a)=>{var s,n;const{as:r,tabKey:o,destroyInactiveTabPanel:i,state:l,className:m,slots:p,classNames:b,...g}=t,u=r||"div",j=de(a),{tabPanelProps:c}=xt({...t,id:String(o)},l,j),{focusProps:x,isFocused:h,isFocusVisible:v}=Pe(),d=l.selectedItem,N=l.collection.getItem(o).props.children,_=q(b?.panel,m,(s=d?.props)==null?void 0:s.className),w=o===d?.key;return!N||!w&&i?null:e.jsx(u,{ref:j,"data-focus":h,"data-focus-visible":v,"data-inert":w?void 0:"true",inert:bs(!w),...w&&ie(c,x,g),className:(n=p.panel)==null?void 0:n.call(p,{class:_}),"data-slot":"panel",children:N})});ns.displayName="HeroUI.TabPanel";var pt=ns,as=ce((t,a)=>{var s;const{className:n,as:r,item:o,state:i,classNames:l,isDisabled:m,listRef:p,slots:b,motionProps:g,disableAnimation:u,disableCursorAnimation:j,shouldSelectOnPressUp:c,onClick:x,tabRef:h,...v}=t,{key:d}=o,N=de(a),_=r||(t.href?"a":"button"),w=typeof _=="string",{tabProps:R,isSelected:$,isDisabled:I,isPressed:S}=mt({key:d,isDisabled:m,shouldSelectOnPressUp:c},i,N);t.children==null&&delete R["aria-controls"];const k=m||I,{focusProps:E,isFocused:D,isFocusVisible:T}=Pe(),{hoverProps:C,isHovered:A}=qe({isDisabled:k}),O=q(l?.tab,n),[,P]=js({rerender:!0}),z=()=>{!N?.current||!p?.current||ut(N.current,{scrollMode:"if-needed",behavior:"smooth",block:"end",inline:"end",boundary:p?.current})};return e.jsxs(_,{ref:_s(N,h),"data-disabled":H(I),"data-focus":H(D),"data-focus-visible":H(T),"data-hover":H(A),"data-hover-unselected":H((A||S)&&!$),"data-pressed":H(S),"data-selected":H($),"data-slot":"tab",...ie(R,k?{}:{...E,...C},Ne(v,{enabled:w,omitPropNames:new Set(["title"])}),{onClick:Je(z,x,R.onClick)}),className:(s=b.tab)==null?void 0:s.call(b,{class:O}),title:v?.titleValue,type:_==="button"?"button":void 0,children:[$&&!u&&!j&&P?e.jsx(vs,{features:rt,children:e.jsx(ks.span,{className:b.cursor({class:l?.cursor}),"data-slot":"cursor",layoutDependency:!1,layoutId:"cursor",transition:{type:"spring",bounce:.15,duration:.5},...g})}):null,e.jsx("div",{className:b.tabContent({class:l?.tabContent}),"data-slot":"tabContent",children:o.rendered})]})});as.displayName="HeroUI.Tab";var gt=as;function bt(t){var a;let[s,n]=Ns(t.selectedKey,(a=t.defaultSelectedKey)!==null&&a!==void 0?a:null,t.onSelectionChange),r=f.useMemo(()=>s!=null?[s]:[],[s]),{collection:o,disabledKeys:i,selectionManager:l}=Qs({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:r,onSelectionChange:p=>{if(p==="all")return;var b;let g=(b=p.values().next().value)!==null&&b!==void 0?b:null;g===s&&t.onSelectionChange&&t.onSelectionChange(g),n(g)}}),m=s!=null?o.getItem(s):null;return{collection:o,disabledKeys:i,selectionManager:l,selectedKey:s,setSelectedKey:n,selectedItem:m}}function jt(t){var a,s;let n=bt({...t,onSelectionChange:t.onSelectionChange?m=>{var p;m!=null&&((p=t.onSelectionChange)===null||p===void 0||p.call(t,m))}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:(s=(a=t.defaultSelectedKey)!==null&&a!==void 0?a:ze(t.collection,t.disabledKeys?new Set(t.disabledKeys):new Set))!==null&&s!==void 0?s:void 0}),{selectionManager:r,collection:o,selectedKey:i}=n,l=f.useRef(i);return f.useEffect(()=>{let m=i;t.selectedKey==null&&(r.isEmpty||m==null||!o.getItem(m))&&(m=ze(o,n.disabledKeys),m!=null&&r.setSelectedKeys([m])),(m!=null&&r.focusedKey==null||!r.isFocused&&m!==l.current)&&r.setFocusedKey(m),l.current=m}),{...n,isDisabled:t.isDisabled||!1}}function ze(t,a){let s=null;if(t){var n,r,o,i;for(s=t.getFirstKey();s!=null&&(a.has(s)||!((r=t.getItem(s))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled)&&s!==t.getLastKey();)s=t.getKeyAfter(s);s!=null&&(a.has(s)||!((i=t.getItem(s))===null||i===void 0||(o=i.props)===null||o===void 0)&&o.isDisabled)&&s===t.getLastKey()&&(s=t.getFirstKey())}return s}function _t(t){var a,s,n;const r=Be(),[o,i]=Ge(t,Ae.variantKeys),{ref:l,as:m,className:p,classNames:b,children:g,disableCursorAnimation:u,motionProps:j,isVertical:c=!1,shouldSelectOnPressUp:x=!0,destroyInactiveTabPanel:h=!0,...v}=o,d=m||"div",N=typeof d=="string",_=de(l),w=(s=(a=t?.disableAnimation)!=null?a:r?.disableAnimation)!=null?s:!1,R=jt({children:g,...v}),{tabListProps:$}=ft(v,R,_),I=f.useMemo(()=>Ae({...i,disableAnimation:w,...c?{placement:"start"}:{}}),[Ye(i),w,c]),S=q(b?.base,p),k=f.useMemo(()=>({state:R,slots:I,classNames:b,motionProps:j,disableAnimation:w,listRef:_,shouldSelectOnPressUp:x,disableCursorAnimation:u,isDisabled:t?.isDisabled}),[R,I,_,j,w,u,x,t?.isDisabled,b]),E=f.useCallback(A=>({"data-slot":"base",className:I.base({class:q(S,A?.className)}),...ie(Ne(v,{enabled:N}),A)}),[S,v,I]),D=(n=i.placement)!=null?n:c?"start":"top",T=f.useCallback(A=>({"data-slot":"tabWrapper",className:I.tabWrapper({class:q(b?.tabWrapper,A?.className)}),"data-placement":D,"data-vertical":c||D==="start"||D==="end"?"vertical":"horizontal"}),[b,I,D,c]),C=f.useCallback(A=>({ref:_,"data-slot":"tabList",className:I.tabList({class:q(b?.tabList,A?.className)}),...ie($,A)}),[_,$,b,I]);return{Component:d,domRef:_,state:R,values:k,destroyInactiveTabPanel:h,getBaseProps:E,getTabListProps:C,getWrapperProps:T}}var vt=ce(function(a,s){const{Component:n,values:r,state:o,destroyInactiveTabPanel:i,getBaseProps:l,getTabListProps:m,getWrapperProps:p}=_t({...a,ref:s}),b=f.useId(),g=!a.disableAnimation&&!a.disableCursorAnimation,u={state:o,listRef:r.listRef,slots:r.slots,classNames:r.classNames,isDisabled:r.isDisabled,motionProps:r.motionProps,disableAnimation:r.disableAnimation,shouldSelectOnPressUp:r.shouldSelectOnPressUp,disableCursorAnimation:r.disableCursorAnimation},j=[...o.collection].map(x=>e.jsx(gt,{item:x,...u,...x.props},x.key)),c=e.jsxs(e.Fragment,{children:[e.jsx("div",{...l(),children:e.jsx(n,{...m(),children:g?e.jsx(ys,{id:b,children:j}):j})}),[...o.collection].map(x=>e.jsx(pt,{classNames:r.classNames,destroyInactiveTabPanel:i,slots:r.slots,state:r.state,tabKey:x.key},x.key))]});return"placement"in a||"isVertical"in a?e.jsx("div",{...p(),children:c}):c}),rs=vt,kt=Ss,ke=kt;const se=t=>t===0,Re={max_turns_scenario:15,max_turns_task:4,sim_user_model_name:null,checker_model_name:null,default_model:"gpt-4o-mini",persona:null},Nt=()=>ws()(Cs((t,a)=>({config:null,isConfigLoading:!1,configError:null,scenarios:{},selectedScenarioName:null,selectedForRun:[],selectedPersonas:[],executions:{},currentRunId:null,isExecuting:!1,simulationConfig:Re,simulationRuns:[],isSimulationRunsLoading:!1,viewMode:"summary",evalView:"scenarios",runHistory:{},selectedRunId:null,actions:{setConfig:s=>{t(n=>{n.config=s,n.isConfigLoading=!1,n.configError=null})},setConfigLoading:s=>{t(n=>{n.isConfigLoading=s})},setConfigError:s=>{t(n=>{n.configError=s,n.isConfigLoading=!1})},setScenario:(s,n)=>{t(r=>{r.scenarios[s]=n})},selectScenario:s=>{t(n=>{n.selectedScenarioName=s})},updateScenarioTask:(s,n,r)=>{t(o=>{const i=o.scenarios[s];i&&i.tasks[n]&&Object.assign(i.tasks[n],r)})},toggleScenarioForRun:s=>{t(n=>{const r=n.selectedForRun.indexOf(s);r===-1?n.selectedForRun.push(s):n.selectedForRun.splice(r,1)})},selectAllScenariosForRun:()=>{t(s=>{s.config&&(s.selectedForRun=s.config.available_scenarios.filter(n=>!se(n.num_tasks)).map(n=>n.name))})},clearScenariosForRun:()=>{t(s=>{s.selectedForRun=[]})},selectScenariosForRun:s=>{t(n=>{for(const r of s)n.selectedForRun.includes(r)||n.selectedForRun.push(r)})},deselectScenariosForRun:s=>{t(n=>{n.selectedForRun=n.selectedForRun.filter(r=>!s.includes(r))})},togglePersonaForRun:s=>{t(n=>{const r=n.selectedPersonas.indexOf(s);r>=0?n.selectedPersonas.splice(r,1):n.selectedPersonas.push(s)})},selectPersonasForRun:s=>{t(n=>{for(const r of s)n.selectedPersonas.includes(r)||n.selectedPersonas.push(r)})},clearPersonasForRun:()=>{t(s=>{s.selectedPersonas=[]})},startExecution:(s,n)=>{t(r=>{r.currentRunId=s,r.isExecuting=!0;for(const o of n)r.executions[o]={scenarioName:o,status:"queued",startTime:Date.now(),currentTurn:0,currentTaskIndex:0,currentTask:null,turns:[],responseChunks:[],error:null}})},handleProgressUpdate:s=>{t(n=>{const r=n.executions[s.scenario_name];if(r)switch(s.type){case"status":r.status=s.status,r.currentTurn=s.current_turn??0,r.currentTaskIndex=s.current_task_index??0,r.currentTask=s.current_task??null;break;case"turn":{const l={turn_index:s.turn_index,task_index:s.task_index,user_message:s.user_message,assistant_message:s.assistant_message,tool_calls:s.tool_calls,task_completed:s.task_completed,task_completed_reason:s.task_completed_reason,checkers:s.checkers,checker_mode:s.checker_mode};r.turns.push(l),r.currentTurn=s.turn_index,r.currentTaskIndex=s.task_index;break}case"task_complete":break;case"complete":r.status=s.status,Object.values(n.executions).every(l=>l.status==="completed"||l.status==="failed"||l.status==="timeout")&&(n.isExecuting=!1);break;case"error":r.status="failed",r.error=s.error,Object.values(n.executions).every(l=>l.status==="completed"||l.status==="failed"||l.status==="timeout")&&(n.isExecuting=!1);break;case"response_chunk":{const l={turn_index:s.turn_index,task_index:s.task_index,chunk_index:r.responseChunks.length,chunk_type:s.chunk_type,chunk_data:s.chunk_data,timestamp:Date.now()};r.responseChunks.push(l);break}}})},stopExecution:()=>{t(s=>{s.isExecuting=!1;for(const n of Object.values(s.executions))(n.status==="running"||n.status==="queued")&&(n.status="failed",n.error="Stopped by user")})},clearExecutions:()=>{t(s=>{s.executions={},s.currentRunId=null,s.isExecuting=!1})},setSimulationConfig:s=>{t(n=>{Object.assign(n.simulationConfig,s)})},setSimulationRuns:s=>{t(n=>{n.simulationRuns=s,n.isSimulationRunsLoading=!1})},setSimulationRunsLoading:s=>{t(n=>{n.isSimulationRunsLoading=s})},addSimulationRun:s=>{t(n=>{n.simulationRuns.unshift(s)})},updateSimulationRun:(s,n)=>{t(r=>{const o=r.simulationRuns.findIndex(i=>i.id===s);o!==-1&&Object.assign(r.simulationRuns[o],n)})},updateScenarioRunInSimulation:(s,n,r)=>{t(o=>{const i=o.simulationRuns.find(m=>m.id===s);if(!i)return;const l=i.scenarioRuns.find(m=>m.id===n);l&&Object.assign(l,r)})},addResponseChunkToScenarioRun:(s,n,r)=>{t(o=>{const i=o.simulationRuns.find(m=>m.id===s);if(!i)return;const l=i.scenarioRuns.find(m=>m.id===n);l&&(l.responseChunks||(l.responseChunks=[]),l.responseChunks.push(r))})},setViewMode:s=>{t(n=>{n.viewMode=s})},setEvalView:s=>{t(n=>{n.evalView=s})},navigateToScenarioDetail:s=>{t(n=>{n.selectedScenarioName=s,n.evalView="scenario-detail"})},navigateToRunner:s=>{t(n=>{n.selectedScenarioName=s,n.evalView="runner",n.selectedRunId=null})},navigateBack:()=>{t(s=>{s.evalView="scenarios",s.selectedRunId=null})},selectRun:s=>{t(n=>{n.selectedRunId=s})},addToRunHistory:(s,n)=>{t(r=>{r.runHistory[s]||(r.runHistory[s]=[]),r.runHistory[s].unshift(n)})},loadMockData:()=>{t(s=>{s.config={available_scenarios:[{name:"Scenario 1",num_tasks:3,group:"Booking"},{name:"Scenario 2",num_tasks:2,group:"Booking"},{name:"Scenario 3",num_tasks:4,group:"Weather"},{name:"Scenario 4",num_tasks:3,group:"Weather"},{name:"Scenario 5",num_tasks:2,group:null},{name:"Scenario 6",num_tasks:5,group:null},{name:"Personality 1",num_tasks:0,group:null},{name:"Personality 2",num_tasks:0,group:null},{name:"Personality 3",num_tasks:0,group:null}],scenario_files:[{filename:"booking.json",group:"Booking",scenarios:[{name:"Scenario 1",num_tasks:3,group:"Booking"},{name:"Scenario 2",num_tasks:2,group:"Booking"}]},{filename:"weather.json",group:"Weather",scenarios:[{name:"Scenario 3",num_tasks:4,group:"Weather"},{name:"Scenario 4",num_tasks:3,group:"Weather"}]},{filename:"misc.json",group:null,scenarios:[{name:"Scenario 5",num_tasks:2,group:null},{name:"Scenario 6",num_tasks:5,group:null}]}],scenarios_dir:"/mock/scenarios"},s.isConfigLoading=!1,s.scenarios={"Scenario 1":{name:"Scenario 1",tasks:[{task:"Search for available rooms in Krakow",checkers:[{type:"tool_call",tools:["search_rooms"]}],checker_mode:"all"},{task:"Filter by deluxe rooms",checkers:[{type:"tool_call",tools:["filter_rooms"]}],checker_mode:"all"},{task:"Book a room",checkers:[{type:"tool_call",tools:["book_room"]}],checker_mode:"all"}]},"Scenario 2":{name:"Scenario 2",tasks:[{task:"Check weather",checkers:[{type:"tool_call",tools:["get_weather"]}],checker_mode:"all"},{task:"Plan activities",checkers:[{type:"llm",expected_result:"Activity list"}],checker_mode:"all"}]}},s.executions={"Scenario 1":{scenarioName:"Scenario 1",status:"completed",startTime:Date.now()-6e4,currentTurn:3,currentTaskIndex:2,currentTask:null,turns:[{turn_index:0,task_index:0,user_message:"Can you check for available rooms in Krakow on June 1, 2025?",assistant_message:`Here are the available rooms in Kraków on June 1, 2025: + +1. **Grand Hotel Kraków** + - Room 102 (Standard): 350 PLN/night + - Room 202 (Deluxe): 500 PLN/night + +2. **Hotel Stary Kraków** + - Room 12 (Standard): 320 PLN/night + - Room 22 (Deluxe): 480 PLN/night + +Would you like to book any of these rooms?`,tool_calls:[{name:"search_available_rooms",arguments:{city:"Krakow",date:"2025-06-01"},result:{}}],task_completed:!0,task_completed_reason:"Listed available rooms successfully",checkers:[{type:"llm",completed:!0,reason:"Listed available rooms successfully"}],checker_mode:"all"},{turn_index:1,task_index:1,user_message:"Show me only the deluxe rooms please.",assistant_message:`Here are the deluxe rooms available: + +1. **Grand Hotel Kraków - Room 202** + - Price: 500 PLN/night + - Capacity: 3 guests + - Amenities: WiFi, TV, AC, Balcony, City View + +2. **Hotel Stary Kraków - Room 22** + - Price: 480 PLN/night + - Capacity: 3 guests + - Amenities: WiFi, TV, AC, City View, Minibar`,tool_calls:[{name:"filter_rooms",arguments:{type:"deluxe"},result:{}}],task_completed:!0,task_completed_reason:"Filtered to show only deluxe rooms",checkers:[{type:"llm",completed:!0,reason:"Filtered to show only deluxe rooms"}],checker_mode:"all"},{turn_index:2,task_index:2,user_message:"I'd like to book Room 22 at Hotel Stary for John Doe.",assistant_message:`Your reservation has been confirmed! + +**Booking Details:** +- Guest: John Doe +- Hotel: Hotel Stary Kraków +- Room: 22 (Deluxe) +- Date: June 1, 2025 +- Total: 480 PLN + +Confirmation number: HSK-2025-1234`,tool_calls:[{name:"book_room",arguments:{hotel:"Hotel Stary",room:22,guest:"John Doe"},result:{confirmation:"HSK-2025-1234"}}],task_completed:!0,task_completed_reason:"Room booked successfully",checkers:[{type:"llm",completed:!0,reason:"Room booked successfully"}],checker_mode:"all"}],responseChunks:[],error:null},"Scenario 2":{scenarioName:"Scenario 2",status:"completed",startTime:Date.now()-3e4,currentTurn:2,currentTaskIndex:1,currentTask:null,turns:[{turn_index:0,task_index:0,user_message:"What's the weather like in Warsaw today?",assistant_message:`The weather in Warsaw today: + +- Temperature: 22°C +- Conditions: Partly cloudy +- Humidity: 65% +- Wind: 10 km/h NW + +It's a pleasant day for outdoor activities!`,tool_calls:[{name:"get_weather",arguments:{city:"Warsaw"},result:{}}],task_completed:!0,task_completed_reason:"Weather information provided",checkers:[{type:"llm",completed:!0,reason:"Weather information provided"}],checker_mode:"all"},{turn_index:1,task_index:1,user_message:"What activities do you recommend?",assistant_message:`Based on the weather, here are some recommendations: + +1. Visit the Old Town and Royal Castle +2. Walk through Łazienki Park +3. Explore the Warsaw Uprising Museum +4. Enjoy a riverbank cafe by the Vistula + +The partly cloudy weather is perfect for sightseeing!`,tool_calls:[],task_completed:!0,task_completed_reason:"Activities recommended",checkers:[{type:"llm",completed:!0,reason:"Activities recommended"}],checker_mode:"all"}],responseChunks:[],error:null},"Scenario 3":{scenarioName:"Scenario 3",status:"timeout",startTime:Date.now()-12e4,currentTurn:2,currentTaskIndex:1,currentTask:"Complete task 2",turns:[{turn_index:0,task_index:0,user_message:"Start the process",assistant_message:"Starting the process now...",tool_calls:[],task_completed:!0,task_completed_reason:"Process started",checkers:[{type:"llm",completed:!0,reason:"Process started"}],checker_mode:"all"}],responseChunks:[],error:"Scenario timed out after 15 turns"}},s.selectedScenarioName="Scenario 1",s.runHistory={"Scenario 1":[{runId:"run-001",scenarioName:"Scenario 1",timestamp:Date.now()-6e4,status:"completed",execution:s.executions["Scenario 1"]},{runId:"run-002",scenarioName:"Scenario 1",timestamp:Date.now()-36e5,status:"failed",execution:{scenarioName:"Scenario 1",status:"failed",startTime:Date.now()-36e5,currentTurn:1,currentTaskIndex:0,currentTask:null,turns:[{turn_index:0,task_index:0,user_message:"Can you check for available rooms?",assistant_message:"I encountered an error while searching.",tool_calls:[],task_completed:!1,task_completed_reason:"API error",checkers:[{type:"llm",completed:!1,reason:"API error"}],checker_mode:"all"}],responseChunks:[],error:"Connection timeout"}}]},s.simulationRuns=[{id:"sim-run-001",timestamp:new Date(Date.now()-6e4).toISOString(),version:"v1.2.0",status:"completed",config:Re,group:"Booking",totalScenarios:3,completedScenarios:2,failedScenarios:1,totalTokens:15420,totalCostUsd:.0234,overallSuccessRate:.67,scenarioRuns:[{id:"sr_scenario_1_001",scenarioName:"Scenario 1",persona:null,status:"completed",startTime:new Date(Date.now()-6e4).toISOString(),endTime:new Date(Date.now()-45e3).toISOString(),error:null,turns:[{turn_index:0,task_index:0,user_message:"Can you check for available rooms in Krakow on June 1, 2025?",assistant_message:`Here are the available rooms in Kraków on June 1, 2025: + +1. **Grand Hotel Kraków** + - Room 102 (Standard): 350 PLN/night + - Room 202 (Deluxe): 500 PLN/night + +2. **Hotel Stary Kraków** + - Room 12 (Standard): 320 PLN/night + - Room 22 (Deluxe): 480 PLN/night`,tool_calls:[{name:"search_available_rooms",arguments:{city:"Krakow",date:"2025-06-01"},result:{}}],task_completed:!0,task_completed_reason:"Listed available rooms successfully",token_usage:{total:450,prompt:120,completion:330},latency_ms:1200},{turn_index:1,task_index:1,user_message:"Show me only the deluxe rooms please.",assistant_message:`Here are the deluxe rooms available: + +1. **Grand Hotel Kraków - Room 202** - 500 PLN/night +2. **Hotel Stary Kraków - Room 22** - 480 PLN/night`,tool_calls:[{name:"filter_rooms",arguments:{type:"deluxe"},result:{}}],task_completed:!0,task_completed_reason:"Filtered to show only deluxe rooms",token_usage:{total:320,prompt:100,completion:220},latency_ms:890},{turn_index:2,task_index:2,user_message:"I'd like to book Room 22 at Hotel Stary for John Doe.",assistant_message:`Your reservation has been confirmed! + +**Booking Details:** +- Guest: John Doe +- Hotel: Hotel Stary Kraków +- Room: 22 (Deluxe) +- Total: 480 PLN + +Confirmation number: HSK-2025-1234`,tool_calls:[{name:"book_room",arguments:{hotel:"Hotel Stary",room:22,guest:"John Doe"},result:{confirmation:"HSK-2025-1234"}}],task_completed:!0,task_completed_reason:"Room booked successfully",token_usage:{total:380,prompt:150,completion:230},latency_ms:1100}],tasks:[{task_index:0,description:"Search for available rooms in Krakow",completed:!0,turns_taken:1,final_reason:"Listed available rooms successfully"},{task_index:1,description:"Filter by deluxe rooms",completed:!0,turns_taken:1,final_reason:"Filtered to show only deluxe rooms"},{task_index:2,description:"Book a room",completed:!0,turns_taken:1,final_reason:"Room booked successfully"}],metrics:{total_turns:3,total_tasks:3,tasks_completed:3,success_rate:1,total_tokens:1150,prompt_tokens:370,completion_tokens:780,estimated_usd:.0089,deepeval_scores:{},custom:{}}},{id:"sr_scenario_2_001",scenarioName:"Scenario 2",persona:null,status:"completed",startTime:new Date(Date.now()-44e3).toISOString(),endTime:new Date(Date.now()-3e4).toISOString(),error:null,turns:[{turn_index:0,task_index:0,user_message:"What's the weather like in Warsaw today?",assistant_message:`The weather in Warsaw today: + +- Temperature: 22°C +- Conditions: Partly cloudy +- Humidity: 65% +- Wind: 10 km/h NW`,tool_calls:[{name:"get_weather",arguments:{city:"Warsaw"},result:{}}],task_completed:!0,task_completed_reason:"Weather information provided",token_usage:{total:280,prompt:80,completion:200},latency_ms:750},{turn_index:1,task_index:1,user_message:"What activities do you recommend?",assistant_message:`Based on the weather, here are some recommendations: + +1. Visit the Old Town +2. Walk through Łazienki Park +3. Explore the Warsaw Uprising Museum`,tool_calls:[],task_completed:!0,task_completed_reason:"Activities recommended",token_usage:{total:250,prompt:90,completion:160},latency_ms:680}],tasks:[{task_index:0,description:"Check weather",completed:!0,turns_taken:1,final_reason:"Weather information provided"},{task_index:1,description:"Plan activities",completed:!0,turns_taken:1,final_reason:"Activities recommended"}],metrics:{total_turns:2,total_tasks:2,tasks_completed:2,success_rate:1,total_tokens:530,prompt_tokens:170,completion_tokens:360,estimated_usd:.0045,deepeval_scores:{},custom:{}}},{id:"sr_scenario_3_001",scenarioName:"Scenario 3",persona:null,status:"timeout",startTime:new Date(Date.now()-29e3).toISOString(),endTime:new Date(Date.now()-1e4).toISOString(),error:"Scenario timed out after 15 turns",turns:[{turn_index:0,task_index:0,user_message:"Start the process",assistant_message:"Starting the process now...",tool_calls:[],task_completed:!0,task_completed_reason:"Process started",token_usage:{total:100,prompt:40,completion:60},latency_ms:500}],tasks:[{task_index:0,description:"Start the process",completed:!0,turns_taken:1,final_reason:"Process started"},{task_index:1,description:"Complete task 2",completed:!1,turns_taken:14,final_reason:"Timeout"}],metrics:{total_turns:15,total_tasks:4,tasks_completed:1,success_rate:.25,total_tokens:13740,prompt_tokens:4500,completion_tokens:9240,estimated_usd:.01,deepeval_scores:{},custom:{}}}]},{id:"sim-run-002",timestamp:new Date(Date.now()-36e5).toISOString(),version:"v1.1.0",status:"completed",config:Re,group:null,totalScenarios:2,completedScenarios:2,failedScenarios:0,totalTokens:8500,totalCostUsd:.012,overallSuccessRate:1,scenarioRuns:[{id:"sr_scenario_1_002",scenarioName:"Scenario 1",persona:null,status:"completed",startTime:new Date(Date.now()-36e5).toISOString(),endTime:new Date(Date.now()-359e4).toISOString(),error:null,turns:[{turn_index:0,task_index:0,user_message:"Find me a room in Krakow",assistant_message:"I found several rooms available in Krakow.",tool_calls:[{name:"search_rooms",arguments:{city:"Krakow"},result:{}}],task_completed:!0,task_completed_reason:"Rooms found",token_usage:{total:200,prompt:60,completion:140},latency_ms:600}],tasks:[{task_index:0,description:"Search for rooms",completed:!0,turns_taken:1,final_reason:"Rooms found"}],metrics:{total_turns:1,total_tasks:1,tasks_completed:1,success_rate:1,total_tokens:200,prompt_tokens:60,completion_tokens:140,estimated_usd:.002,deepeval_scores:{},custom:{}}},{id:"sr_scenario_2_002",scenarioName:"Scenario 2",persona:null,status:"completed",startTime:new Date(Date.now()-3589e3).toISOString(),endTime:new Date(Date.now()-358e4).toISOString(),error:null,turns:[{turn_index:0,task_index:0,user_message:"What's the weather?",assistant_message:"It's sunny and 25°C.",tool_calls:[{name:"get_weather",arguments:{},result:{}}],task_completed:!0,task_completed_reason:"Weather provided",token_usage:{total:150,prompt:50,completion:100},latency_ms:450}],tasks:[{task_index:0,description:"Check weather",completed:!0,turns_taken:1,final_reason:"Weather provided"}],metrics:{total_turns:1,total_tasks:1,tasks_completed:1,success_rate:1,total_tokens:150,prompt_tokens:50,completion_tokens:100,estimated_usd:.0015,deepeval_scores:{},custom:{}}}]}]})}}}))),yt=t=>{const a=Object.values(t.executions),s=a.length,n=a.filter(l=>l.status==="completed").length,r=a.filter(l=>l.status==="failed"||l.status==="timeout").length,o=a.filter(l=>l.status==="running"||l.status==="queued").length,i=s>0?(n+r)/s*100:0;return{total:s,completed:n,failed:r,running:o,percentage:i}},De=f.createContext(null);function St({children:t}){const a=f.useRef(null);return a.current||(a.current=Nt()),e.jsx(De.Provider,{value:a.current,children:t})}function K(t){const a=f.useContext(De);if(!a)throw new Error("useEvalStore must be used within EvalStoreProvider");return Rs(a,t)}function X(){const t=f.useContext(De);if(!t)throw new Error("useEvalStoreApi must be used within EvalStoreProvider");return t}const He=[{key:"runs",label:"Runs",icon:"heroicons:play-circle",path:"/runs"},{key:"new",label:"New Run",icon:"heroicons:plus-circle",path:"/new"},{key:"scenarios",label:"Scenarios",icon:"heroicons:document-text",path:"/scenarios"},{key:"personas",label:"Personas",icon:"heroicons:user",path:"/personas"},{key:"playground",label:"Playground",icon:"heroicons:beaker",path:"/playground"}];function wt(){const t=Ts(),a=ue(),s=()=>{const r=t.pathname;return r.startsWith("/runs")?"runs":r.startsWith("/new")?"new":r.startsWith("/scenarios")?"scenarios":r.startsWith("/personas")?"personas":r.startsWith("/playground")?"playground":"runs"},n=r=>{const o=He.find(i=>i.key===r);o&&a(o.path)};return e.jsx("div",{className:"border-b border-divider px-6",children:e.jsx(rs,{selectedKey:s(),onSelectionChange:n,variant:"underlined",classNames:{tabList:"gap-6",cursor:"bg-primary",tab:"px-0 h-12"},children:He.map(r=>e.jsx(ke,{title:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{icon:r.icon,className:"text-lg"}),e.jsx("span",{children:r.label})]})},r.key))})})}function Ct(){const{theme:t,setTheme:a}=Ps(),s=t===Ce.DARK,n=()=>a(s?Ce.LIGHT:Ce.DARK);return e.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-background",children:[e.jsxs("header",{className:"flex items-center justify-between border-b border-divider px-6 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-2xl",children:"🧪"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Ragbits Evaluation"}),e.jsx("p",{className:"text-xs text-foreground-500",children:"Test scenarios and view results"})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(W,{isIconOnly:!0,variant:"light",onPress:n,"aria-label":"Toggle theme",children:e.jsx(y,{icon:s?"heroicons:sun":"heroicons:moon",className:"text-xl"})})})]}),e.jsx(wt,{}),e.jsx("main",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx($s,{})})]})}const Rt={completed:{color:"success",label:"Completed"},failed:{color:"danger",label:"Failed"},timeout:{color:"warning",label:"Timeout"},running:{color:"primary",label:"Running"},queued:{color:"default",label:"Queued"},idle:{color:"default",label:"Idle"}};function Tt(t){return new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Pt(t){return t<.01?"<$0.01":`$${t.toFixed(2)}`}function $t(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString()}function Dt(t,a){const s=new Set(t.scenarioRuns.map(r=>r.scenarioName)),n=[];for(const[r,o]of a)o.every(l=>s.has(l))&&o.length>0&&n.push(r);return n.sort()}function It({runs:t,groupScenarios:a,onViewDetails:s,onRerun:n}){return e.jsxs(Bs,{"aria-label":"Simulation runs",classNames:{wrapper:"shadow-none"},children:[e.jsxs(Gs,{children:[e.jsx(re,{children:"SCENARIOS"}),e.jsx(re,{children:"DATE"}),e.jsx(re,{children:"VERSION"}),e.jsx(re,{children:"RESULTS"}),e.jsx(re,{width:180,children:"ACTIONS"})]}),e.jsx(Js,{children:t.map(r=>{const o=Rt[r.status],i=r.scenarioRuns.map(p=>p.scenarioName),l=i.length<=2?i.join(", "):`${i.slice(0,2).join(", ")} +${i.length-2}`,m=Dt(r,a);return e.jsxs(qs,{children:[e.jsx(oe,{children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-medium",children:l}),m.map(p=>e.jsx(M,{size:"sm",variant:"flat",color:"secondary",children:p},p))]}),e.jsxs("p",{className:"text-xs text-foreground-400",children:[r.totalScenarios," scenario",r.totalScenarios!==1?"s":""]})]})}),e.jsx(oe,{children:e.jsx("span",{className:"text-foreground-500",children:Tt(r.timestamp)})}),e.jsx(oe,{children:e.jsx("span",{className:"text-foreground-500 font-mono text-sm",children:r.version})}),e.jsx(oe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{size:"sm",color:o.color,variant:"flat",children:o.label}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-foreground-500",children:[e.jsxs("span",{title:"Success rate",children:[Math.round(r.overallSuccessRate*100),"%"]}),e.jsxs("span",{title:"Scenarios",className:"flex items-center gap-1",children:[e.jsx(y,{icon:"heroicons:check-circle",className:"text-xs text-success"}),r.completedScenarios,"/",r.totalScenarios]}),e.jsxs("span",{title:"Tokens",className:"flex items-center gap-1",children:[e.jsx(y,{icon:"heroicons:cpu-chip",className:"text-xs"}),$t(r.totalTokens)]}),e.jsxs("span",{title:"Cost",className:"flex items-center gap-1",children:[e.jsx(y,{icon:"heroicons:currency-dollar",className:"text-xs"}),Pt(r.totalCostUsd)]})]})]})}),e.jsx(oe,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(st,{children:[e.jsx(tt,{children:e.jsx(W,{size:"sm",variant:"flat",endContent:e.jsx(y,{icon:"heroicons:chevron-down"}),children:"Details"})}),e.jsxs(nt,{"aria-label":"Run actions",children:[e.jsx(Me,{startContent:e.jsx(y,{icon:"heroicons:eye"}),onPress:()=>s(r.id),children:"View details"},"view"),e.jsx(Me,{startContent:e.jsx(y,{icon:"heroicons:chart-bar"}),onPress:()=>s(r.id),children:"View metrics"},"metrics")]})]}),e.jsx(W,{size:"sm",variant:"bordered",onPress:()=>n(r.id),startContent:e.jsx(y,{icon:"heroicons:arrow-path"}),children:"Run"})]})})]},r.id)})})]})}function Ft(){const{client:t}=Y(),a=X(),s=ue(),n=K(h=>h.config),r=K(h=>h.simulationRuns),o=K(h=>h.isSimulationRunsLoading),i=Array.isArray(r)?r:[],[l,m]=f.useState(new Set(["all"])),{scenarios:p,groupScenarios:b}=f.useMemo(()=>{if(!n)return{scenarios:[],groupScenarios:new Map};const h=n.available_scenarios.filter(d=>!se(d.num_tasks)),v=new Map;for(const d of h)d.group&&(v.has(d.group)||v.set(d.group,[]),v.get(d.group).push(d.name));return{scenarios:h.map(d=>d.name),groupScenarios:v}},[n]),g=f.useMemo(()=>l.has("all")?i:i.filter(h=>h.scenarioRuns.some(v=>l.has(v.scenarioName))),[i,l]);f.useEffect(()=>{async function h(){const{setSimulationRunsLoading:v,setSimulationRuns:d}=a.getState().actions;v(!0);try{const w=((await t.makeRequest("/api/eval/runs"))?.runs??[]).map(R=>({id:R.id,timestamp:R.timestamp,version:R.version||"current",status:R.status,scenarioRuns:(R.scenario_runs||[]).map($=>({id:$.id,scenarioName:$.scenario_name,persona:$.persona||null,status:$.status,startTime:$.start_time,endTime:$.end_time,turns:[],tasks:[],responseChunks:[],metrics:{total_turns:$.total_turns||0,total_tasks:$.total_tasks||0,tasks_completed:$.tasks_completed||0,success_rate:$.success_rate||0,total_tokens:$.total_tokens||0,prompt_tokens:0,completion_tokens:0,total_cost_usd:$.total_cost_usd||0,deepeval_scores:{},custom:{}},error:$.error})),config:{max_turns_scenario:15,max_turns_task:4,sim_user_model_name:null,checker_model_name:null,default_model:"gpt-4o-mini",persona:null},group:R.group||null,totalScenarios:R.total_scenarios||0,completedScenarios:R.completed_scenarios||0,failedScenarios:R.failed_scenarios||0,totalTokens:R.total_tokens||0,totalCostUsd:R.total_cost_usd||0,overallSuccessRate:R.overall_success_rate||0}));d(w)}catch(N){console.error("Failed to load simulation runs:",N),d([])}}h()},[t,a]);const u=f.useCallback(h=>{s(`/runs/${h}`)},[s]),j=f.useCallback(h=>{const v=i.find(d=>d.id===h);if(v){const d=v.scenarioRuns.map(N=>N.scenarioName).join(",");s(`/new?scenarios=${encodeURIComponent(d)}`)}},[s,i]),c=f.useCallback(()=>{s("/new")},[s]),x=f.useCallback(h=>{if(h==="all")m(new Set(["all"]));else{const v=new Set(h);v.has("all")&&v.size>1&&v.delete("all"),v.size===0&&v.add("all"),m(v)}},[]);return n?e.jsxs("div",{className:"flex h-full",children:[e.jsxs("aside",{className:"w-56 flex-shrink-0 border-r border-divider p-4",children:[e.jsx("h2",{className:"mb-3 text-sm font-semibold text-foreground-500 uppercase tracking-wide",children:"Scenarios"}),e.jsx(Zs,{"aria-label":"Filter by scenario",selectionMode:"multiple",selectedKeys:l,onSelectionChange:x,items:[{key:"all",label:"All Scenarios"},...p.map(h=>({key:h,label:h}))],classNames:{list:"gap-1"},children:h=>e.jsx(Ze,{className:"text-sm",children:h.label},h.key)})]}),e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"flex items-center justify-between border-b border-divider px-6 py-4",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Simulation Runs"}),e.jsxs("p",{className:"text-sm text-foreground-500",children:[g.length," run",g.length!==1?"s":""," ",!l.has("all")&&"(filtered)"]})]})}),e.jsx("div",{className:"flex-1 overflow-auto p-6",children:o?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(V,{size:"lg"})}):g.length===0?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[e.jsx(y,{icon:"heroicons:inbox",className:"text-6xl text-foreground-300 mb-4"}),e.jsx("p",{className:"text-foreground-500",children:"No runs found"}),e.jsx("p",{className:"text-sm text-foreground-400 mt-1",children:"Start a new run to see results here"})]}):e.jsx(It,{runs:g,groupScenarios:b,onViewDetails:u,onRerun:j})}),e.jsx("div",{className:"flex justify-end border-t border-divider px-6 py-4",children:e.jsx(W,{color:"success",onPress:c,startContent:e.jsx(y,{icon:"heroicons:sparkles"}),children:"New run"})})]})]}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(V,{size:"lg"})})}const ve={completed:{color:"success",label:"Completed"},failed:{color:"danger",label:"Failed"},timeout:{color:"warning",label:"Timeout"},running:{color:"primary",label:"Running"},queued:{color:"default",label:"Queued"},idle:{color:"default",label:"Idle"}};function Lt({scenarioRuns:t,onRerun:a}){const s=f.useMemo(()=>{let r=0,o=0,i=0,l=0;const m=[],p=[];for(const j of t){if(!j.metrics)continue;const c=j.metrics;r+=c.total_turns??0,o+=c.total_tasks??0,i+=c.tasks_completed??0,l+=c.estimated_usd??0,c.latency_avg_ms&&m.push(c.latency_avg_ms),c.time_to_first_token_avg_ms&&p.push(c.time_to_first_token_avg_ms)}const b=o>0?i/o:0,g=m.length>0?m.reduce((j,c)=>j+c,0)/m.length:0,u=p.length>0?p.reduce((j,c)=>j+c,0)/p.length:0;return{totalTurns:r,totalTasks:o,tasksCompleted:i,successRate:b,estimatedUsd:l,avgLatency:g,avgTtft:u}},[t]),n=s.successRate>=.9?"success":s.successRate>=.7?"warning":"danger";return e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-5 text-sm",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-foreground-400",children:"Turns"}),e.jsx("p",{className:"font-semibold",children:s.totalTurns})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-foreground-400",children:"Tasks"}),e.jsxs("p",{className:"font-semibold",children:[s.tasksCompleted,"/",s.totalTasks]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-foreground-400",children:"Success"}),e.jsxs("p",{className:`font-semibold text-${n}`,children:[(s.successRate*100).toFixed(0),"%"]})]}),s.avgLatency>0&&e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-foreground-400",children:"Latency"}),e.jsxs("p",{className:"font-semibold",children:[s.avgLatency.toFixed(0),"ms"]})]}),s.avgTtft>0&&e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-foreground-400",children:"TTFT"}),e.jsxs("p",{className:"font-semibold",children:[s.avgTtft.toFixed(0),"ms"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-foreground-400",children:"Cost"}),e.jsxs("p",{className:"font-semibold",children:["$",s.estimatedUsd.toFixed(4)]})]})]}),e.jsx(W,{color:"primary",variant:"flat",onPress:a,startContent:e.jsx(y,{icon:"heroicons:arrow-path"}),children:"Rerun"})]})}function Mt(t){return{id:t.id,timestamp:t.timestamp,version:t.version||"current",status:t.status,scenarioRuns:(t.scenario_runs||[]).map(a=>({id:a.id,scenarioName:a.scenario_name,persona:a.persona||null,status:a.status,startTime:a.start_time,endTime:a.end_time,turns:(a.turns||[]).map(s=>({turn_index:s.turn_index,task_index:s.task_index,user_message:s.user_message,assistant_message:s.assistant_message,tool_calls:s.tool_calls||[],task_completed:s.task_completed,task_completed_reason:s.task_completed_reason,token_usage:s.token_usage,latency_ms:s.latency_ms,checkers:(s.checkers||[]).map(n=>({type:n.type,completed:n.completed,reason:n.reason})),checker_mode:s.checker_mode||"all"})),tasks:(a.tasks||[]).map(s=>({task_index:s.task_index,description:s.description,completed:s.completed,turns_taken:s.turns_taken,final_reason:s.final_reason})),responseChunks:(a.response_chunks||[]).map(s=>({turn_index:s.turn_index,task_index:s.task_index,chunk_index:s.chunk_index,chunk_type:s.chunk_type,chunk_data:s.chunk_data})),metrics:a.metrics,error:a.error})),config:{max_turns_scenario:15,max_turns_task:4,sim_user_model_name:null,checker_model_name:null,default_model:"gpt-4o-mini",persona:null},group:t.group||null,totalScenarios:t.total_scenarios||0,completedScenarios:t.completed_scenarios||0,failedScenarios:t.failed_scenarios||0,totalTokens:t.total_tokens||0,totalCostUsd:t.total_cost_usd||0,overallSuccessRate:t.overall_success_rate||0}}function At(){const{runId:t}=Qe(),a=ue(),{client:s}=Y(),n=K(d=>d.simulationRuns),[r,o]=f.useState(null),[i,l]=f.useState(!0),[m,p]=f.useState(0),[b,g]=f.useState(new Set),u=n.find(d=>d.id===t)??null;f.useEffect(()=>{async function d(){if(t){l(!0);try{const N=await s.makeRequest(`/api/eval/runs/${t}`);o(Mt(N))}catch{console.debug("Run not found in API, using store data")}finally{l(!1)}}}d()},[t,s]);const j=r??u,c=j?.scenarioRuns[m]??null,x=f.useCallback(async d=>{if(p(d),!t||r||!u)return;const N=u.scenarioRuns[d];if(!(!N?.id||b.has(N.id)))try{const w=(await s.makeRequest(`/api/eval/progress/${t}/buffer/${N.id}`))?.events??[];w.length>0&&(g(R=>new Set(R).add(N.id)),console.debug(`Fetched ${w.length} buffered events for ${N.id}`))}catch(_){console.debug("Could not fetch buffered events:",_)}},[t,r,u,b,s]),h=f.useCallback(()=>{a("/runs")},[a]),v=f.useCallback(()=>{if(j){const d=j.scenarioRuns.map(N=>N.scenarioName).join(",");a(`/new?scenarios=${encodeURIComponent(d)}`)}},[a,j]);return i?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(V,{size:"lg"})}):j?e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-divider px-6 py-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(W,{isIconOnly:!0,variant:"light",onPress:h,"aria-label":"Back",children:e.jsx(y,{icon:"heroicons:arrow-left",className:"text-xl"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Simulation Run"}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground-500",children:[e.jsx("span",{children:new Date(j.timestamp).toLocaleString()}),e.jsx("span",{className:"font-mono",children:j.version}),e.jsx(M,{size:"sm",color:ve[j.status].color,variant:"flat",children:ve[j.status].label})]})]})]}),e.jsx(Lt,{scenarioRuns:j.scenarioRuns,onRerun:v})]}),e.jsxs("div",{className:"flex flex-1 min-h-0",children:[e.jsxs("aside",{className:"w-96 flex-shrink-0 border-r border-divider overflow-y-auto p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-foreground-500 uppercase tracking-wide mb-3",children:["Scenarios (",j.scenarioRuns.length,")"]}),e.jsx("div",{className:"space-y-2",children:j.scenarioRuns.map((d,N)=>e.jsx(L,{isPressable:!0,onPress:()=>x(N),className:`w-full ${m===N?"border-2 border-primary":""}`,children:e.jsxs(F,{className:"p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:d.scenarioName}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-400",children:[e.jsxs("span",{children:[d.turns.length," turns, ",d.tasks.length," tasks"]}),d.persona&&e.jsx(M,{size:"sm",variant:"flat",className:"text-xs",children:d.persona})]})]}),e.jsx(M,{size:"sm",color:ve[d.status].color,variant:"flat",children:ve[d.status].label})]}),d.metrics&&e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-foreground-500",children:[e.jsxs("span",{children:[Math.round(d.metrics.success_rate*100),"%"]}),e.jsxs("span",{children:[d.metrics.total_tokens," tokens"]})]})]})},d.id||d.scenarioName))})]}),e.jsx("main",{className:"flex-1 min-h-0 overflow-hidden",children:c?e.jsx(Kt,{scenarioRun:c}):e.jsx("div",{className:"flex h-full items-center justify-center text-foreground-500",children:"Select a scenario to view details"})})]})]}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[e.jsx(y,{icon:"heroicons:exclamation-triangle",className:"text-6xl text-danger mb-4"}),e.jsx("p",{className:"text-foreground-500",children:"Run not found"}),e.jsx(W,{className:"mt-4",onPress:h,children:"Back to Runs"})]})}function Kt({scenarioRun:t}){const[a,s]=f.useState("conversation"),n=t.responseChunks?.length||0;return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"border-b border-divider px-6 py-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:t.scenarioName}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground-500",children:[e.jsxs("span",{children:[t.tasks.filter(r=>r.completed).length,"/",t.tasks.length," tasks completed"]}),t.persona&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx(M,{size:"sm",variant:"flat",children:t.persona})]})]})]})}),t.error&&e.jsx("div",{className:"mt-2 p-2 bg-danger-50 dark:bg-danger-900/20 rounded-lg text-danger text-sm",children:t.error})]}),e.jsx("div",{className:"border-b border-divider px-6 py-2",children:e.jsxs(rs,{selectedKey:a,onSelectionChange:r=>s(r),size:"sm",variant:"underlined",children:[e.jsx(ke,{title:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{icon:"heroicons:chat-bubble-left-right"}),e.jsx("span",{children:"Conversation"})]})},"conversation"),e.jsx(ke,{title:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{icon:"heroicons:squares-2x2"}),e.jsx("span",{children:"Responses"}),n>0&&e.jsx(M,{size:"sm",variant:"flat",className:"ml-1",children:n})]})},"responses"),e.jsx(ke,{title:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{icon:"heroicons:chart-bar"}),e.jsx("span",{children:"Metrics"})]})},"metrics")]})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:a==="conversation"?e.jsx(Ot,{turns:t.turns,tasks:t.tasks}):a==="responses"?e.jsx(Ht,{scenarioRun:t}):e.jsx(Qt,{metrics:t.metrics})})]})}function Et({checkers:t}){return!t||t.length===0?null:e.jsx("div",{className:"mt-2 space-y-2",children:t.map((a,s)=>e.jsxs("div",{className:`flex items-start gap-2 p-2 rounded ${a.completed?"bg-success/10":"bg-default-100"}`,children:[e.jsx(y,{icon:a.completed?"heroicons:check-circle":"heroicons:x-circle",className:`text-sm flex-shrink-0 mt-0.5 ${a.completed?"text-success":"text-default-400"}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(M,{size:"sm",variant:"bordered",className:"text-xs",children:a.type})}),e.jsx("p",{className:"text-xs text-foreground-500 mt-1",children:a.reason})]})]},s))})}function Ot({turns:t,tasks:a}){if(t.length===0)return e.jsx("div",{className:"flex h-full items-center justify-center text-foreground-500",children:"No conversation data"});const s=n=>a.find(r=>r.task_index===n);return e.jsx("div",{className:"space-y-4",children:t.map((n,r)=>{const o=r>0?t[r-1].task_index:-1,i=n.task_index!==o,l=i?s(n.task_index):null;return e.jsxs("div",{className:"space-y-3",children:[i&&e.jsxs("div",{className:"flex items-center gap-3 py-3",children:[e.jsx("div",{className:"flex-1 h-px bg-primary/30"}),e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20",children:[e.jsx(y,{icon:"heroicons:flag",className:"text-primary text-sm"}),e.jsxs("span",{className:"text-sm font-medium text-primary",children:["Task ",n.task_index+1]})]}),e.jsx("div",{className:"flex-1 h-px bg-primary/30"})]}),i&&l&&e.jsx("div",{className:"mx-4 p-3 rounded-lg bg-primary/5 border border-primary/20 mb-4",children:e.jsx("p",{className:"text-sm text-foreground-600",children:l.description})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:e.jsx(y,{icon:"heroicons:user",className:"text-white text-sm"})}),e.jsxs("div",{className:"flex-1 p-3 rounded-lg bg-content2",children:[e.jsx("p",{className:"text-xs text-foreground-500 mb-1",children:"Simulated User"}),e.jsx("p",{children:n.user_message})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-secondary flex items-center justify-center flex-shrink-0",children:e.jsx(y,{icon:"heroicons:cpu-chip",className:"text-white text-sm"})}),e.jsxs("div",{className:"flex-1 p-3 rounded-lg bg-content2",children:[e.jsx("p",{className:"text-xs text-foreground-500 mb-1",children:"Assistant"}),e.jsx("p",{className:"whitespace-pre-wrap",children:n.assistant_message}),n.tool_calls.length>0&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-divider",children:[e.jsx("p",{className:"text-xs text-foreground-500 mb-1",children:"Tool calls:"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:n.tool_calls.map((m,p)=>e.jsx(M,{size:"sm",variant:"flat",children:m.name},p))})]})]})]}),e.jsx("div",{className:`mx-4 p-3 rounded-lg border ${n.task_completed?"border-success bg-success/5":"border-default-200 bg-default-50"}`,children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0 ${n.task_completed?"bg-success":"bg-default-300"}`,children:e.jsx(y,{icon:n.task_completed?"heroicons:check":"heroicons:x-mark",className:"text-white text-sm"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("p",{className:"text-xs font-medium text-foreground-500",children:"Checker Decision"}),e.jsx(M,{size:"sm",color:n.task_completed?"success":"default",variant:"flat",children:n.task_completed?"Completed":"Not Completed"}),(n.checkers?.length??0)>1&&e.jsxs(M,{size:"sm",variant:"bordered",className:"text-xs",children:["mode: ",n.checker_mode??"all"]})]}),n.task_completed_reason&&e.jsx("p",{className:"text-sm text-foreground-600 mb-2",children:n.task_completed_reason}),e.jsx(Et,{checkers:n.checkers??[]})]})]})})]},r)})})}const Ue={text:{color:"primary",icon:"heroicons:document-text",label:"Text"},reference:{color:"success",icon:"heroicons:bookmark",label:"Reference"},tool_call:{color:"warning",icon:"heroicons:wrench",label:"Tool Call"},usage:{color:"secondary",icon:"heroicons:chart-bar",label:"Usage"},live_update:{color:"primary",icon:"heroicons:arrow-path",label:"Live Update"},checker_decision:{color:"secondary",icon:"heroicons:scale",label:"Checker"},error:{color:"danger",icon:"heroicons:exclamation-triangle",label:"Error"},unknown:{color:"default",icon:"heroicons:question-mark-circle",label:"Unknown"}};function Z(t){return Ue[t]||Ue.unknown}function Wt(t){return"_aggregated"in t&&t._aggregated===!0}function zt({chunk:t}){const a=Z("text");return e.jsx(L,{className:"shadow-sm bg-default-50",children:e.jsx(F,{className:"p-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-${a.color}/10`,children:e.jsx(y,{icon:a.icon,className:`text-${a.color} text-lg`})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(M,{size:"sm",color:a.color,variant:"flat",children:[t.count," text chunk",t.count>1?"s":""]}),e.jsxs("span",{className:"text-xs text-foreground-500",children:["Turn ",t.turn_index+1]})]})]})})})}function Ht({scenarioRun:t}){const a=t.responseChunks||[],s=f.useMemo(()=>{const n=[];let r=0,o=null;for(const i of a)i.chunk_type==="text"?(r===0&&(o=i),r++):(r>0&&o&&(n.push({_aggregated:!0,count:r,turn_index:o.turn_index,chunk_index:o.chunk_index}),r=0,o=null),n.push(i));return r>0&&o&&n.push({_aggregated:!0,count:r,turn_index:o.turn_index,chunk_index:o.chunk_index}),n},[a]);return a.length===0?e.jsxs("div",{className:"flex h-64 flex-col items-center justify-center text-center",children:[e.jsx(y,{icon:"heroicons:squares-2x2",className:"text-5xl text-foreground-300 mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground",children:"No Response Chunks"}),e.jsx("p",{className:"text-sm text-foreground-500 mt-2",children:"Response chunks are only available for live runs"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h4",{className:"font-semibold",children:"Response Stream"}),e.jsxs(M,{size:"sm",variant:"flat",children:[a.length," chunks"]})]}),s.map((n,r)=>Wt(n)?e.jsx(zt,{chunk:n},`agg-${n.turn_index}-${n.chunk_index}`):e.jsx(L,{className:"shadow-sm",children:e.jsx(F,{className:"p-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-${Z(n.chunk_type).color}/10`,children:e.jsx(y,{icon:Z(n.chunk_type).icon,className:`text-${Z(n.chunk_type).color} text-lg`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[e.jsx(M,{size:"sm",color:Z(n.chunk_type).color,variant:"flat",children:Z(n.chunk_type).label}),e.jsxs("span",{className:"text-xs text-foreground-500",children:["Turn ",n.turn_index+1," • Task ",n.task_index+1]})]}),e.jsx("pre",{className:"text-xs p-2 bg-default-100 rounded overflow-auto max-h-32",children:JSON.stringify(n.chunk_data,null,2)})]})]})})},r))]})}function Ut(t,a){return a==null?"N/A":typeof a=="number"?t.includes("rate")||t.includes("success")?`${Math.round(a*100)}%`:t.includes("cost")||t.includes("usd")?`$${a.toFixed(4)}`:t.includes("_ms")||t.includes("latency")||t.includes("time_to")?`${a.toFixed(1)} ms`:Number.isInteger(a)?a.toLocaleString():a.toFixed(2):Array.isArray(a)?a.length>0?a.join(", "):"None":typeof a=="object"?JSON.stringify(a):String(a)}function Vt(t){return t.split("_").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Bt({metrics:t}){const a=t.success_rate??0,s=a<=1?a*100:a,n=s>=90?"success":s>=70?"warning":"danger";return e.jsx(L,{className:"bg-gradient-to-br from-content1 to-content2",children:e.jsxs(F,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(y,{icon:"heroicons:chart-pie",className:"text-lg text-primary"}),e.jsx("h4",{className:"font-semibold",children:"Overview"})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-3xl font-bold",children:t.total_turns??0}),e.jsx("p",{className:"text-xs text-foreground-500 mt-1",children:"Total Turns"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-3xl font-bold",children:[t.tasks_completed??0,"/",t.total_tasks??0]}),e.jsx("p",{className:"text-xs text-foreground-500 mt-1",children:"Tasks Completed"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("div",{className:`w-3 h-3 rounded-full bg-${n}`}),e.jsxs("p",{className:"text-3xl font-bold",children:[s.toFixed(0),"%"]})]}),e.jsx("p",{className:"text-xs text-foreground-500 mt-1",children:"Success Rate"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-3xl font-bold",children:["$",(t.estimated_usd??0).toFixed(4)]}),e.jsx("p",{className:"text-xs text-foreground-500 mt-1",children:"Estimated Cost"})]})]})]})})}function Gt({metrics:t}){const a=t.latency_avg_ms??0,s=t.latency_min_ms??0,n=t.latency_max_ms??0,r=t.time_to_first_token_avg_ms??0,o=t.time_to_first_token_min_ms??0,i=t.time_to_first_token_max_ms??0;return e.jsx(L,{children:e.jsxs(F,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(y,{icon:"heroicons:clock",className:"text-lg text-warning"}),e.jsx("h4",{className:"font-semibold",children:"Latency"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground-500 mb-2",children:"Response Time"}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("p",{className:"text-2xl font-bold",children:a.toFixed(0)}),e.jsx("p",{className:"text-sm text-foreground-500",children:"ms avg"})]}),e.jsxs("div",{className:"flex gap-4 mt-2 text-xs text-foreground-400",children:[e.jsxs("span",{children:["Min: ",s.toFixed(0),"ms"]}),e.jsxs("span",{children:["Max: ",n.toFixed(0),"ms"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground-500 mb-2",children:"Time to First Token"}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("p",{className:"text-2xl font-bold",children:r.toFixed(0)}),e.jsx("p",{className:"text-sm text-foreground-500",children:"ms avg"})]}),e.jsxs("div",{className:"flex gap-4 mt-2 text-xs text-foreground-400",children:[e.jsxs("span",{children:["Min: ",o.toFixed(0),"ms"]}),e.jsxs("span",{children:["Max: ",i.toFixed(0),"ms"]})]})]})]})]})})}function Jt({metrics:t}){const a=t.tokens_total??t.total_tokens??0,s=t.tokens_prompt??t.prompt_tokens??0,n=t.tokens_completion??t.completion_tokens??0,r=t.tokens_avg_per_turn??0,o=a>0?s/a*100:0;return e.jsx(L,{children:e.jsxs(F,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(y,{icon:"heroicons:calculator",className:"text-lg text-secondary"}),e.jsx("h4",{className:"font-semibold",children:"Token Usage"})]}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-3xl font-bold",children:a.toLocaleString()}),e.jsx("p",{className:"text-xs text-foreground-500 mt-1",children:"Total Tokens"})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-3 rounded-full bg-default-200 overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${o}%`}})}),e.jsxs("div",{className:"flex justify-between mt-2 text-xs",children:[e.jsxs("span",{className:"text-primary",children:[s.toLocaleString()," prompt"]}),e.jsxs("span",{className:"text-foreground-500",children:[n.toLocaleString()," completion"]})]})]}),r>0&&e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xl font-bold",children:r.toLocaleString()}),e.jsx("p",{className:"text-xs text-foreground-500",children:"avg/turn"})]})]})]})})}function qt({metrics:t}){const a=t.tools_total_calls??0,s=t.tools_unique,n=t.tools_counts,r=Array.isArray(s)?s:typeof s=="string"?s.split(",").map(o=>o.trim()).filter(Boolean):[];return e.jsx(L,{children:e.jsxs(F,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(y,{icon:"heroicons:wrench-screwdriver",className:"text-lg text-warning"}),e.jsx("h4",{className:"font-semibold",children:"Tool Usage"})]}),e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-3xl font-bold",children:a}),e.jsx("p",{className:"text-xs text-foreground-500 mt-1",children:"Total Calls"})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs text-foreground-500 mb-2",children:"Tools Used"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:n?Object.entries(n).map(([o,i])=>e.jsxs(M,{size:"sm",variant:"flat",children:[o," ",e.jsxs("span",{className:"text-foreground-400 ml-1",children:["×",i]})]},o)):r.length>0?r.map(o=>e.jsx(M,{size:"sm",variant:"flat",children:o},o)):e.jsx("span",{className:"text-foreground-500 text-sm",children:"No tools used"})})]})]})]})})}function Yt({metrics:t}){const a=[];for(const[s,n]of Object.entries(t))if(s.startsWith("deepeval_")&&!s.includes("reason")&&typeof n=="number"){const r=s.replace("deepeval_","").split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),o=`${s}_reason`;a.push({key:s,label:r,value:n,reason:t[o]})}return a.length===0?null:e.jsx(L,{children:e.jsxs(F,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(y,{icon:"heroicons:academic-cap",className:"text-lg text-success"}),e.jsx("h4",{className:"font-semibold",children:"DeepEval Scores"})]}),e.jsx("div",{className:"space-y-4",children:a.map(({key:s,label:n,value:r,reason:o})=>{const i=r<=1?r*100:r,l=i>=90?"success":i>=70?"warning":"danger";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:n}),e.jsxs("span",{className:`text-sm font-bold text-${l}`,children:[i.toFixed(0),"%"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-default-200 overflow-hidden",children:e.jsx("div",{className:`h-full bg-${l} rounded-full transition-all`,style:{width:`${i}%`}})}),o&&e.jsx("p",{className:"text-xs text-foreground-500 mt-2 line-clamp-2",children:o})]},s)})})]})})}function Xt({metrics:t}){const a=Object.entries(t);return a.length===0?null:e.jsx(L,{children:e.jsxs(F,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(y,{icon:"heroicons:squares-plus",className:"text-lg text-foreground-500"}),e.jsx("h4",{className:"font-semibold",children:"Other Metrics"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:a.map(([s,n])=>e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground-400",children:Vt(s)}),e.jsx("p",{className:"text-lg font-semibold",children:Ut(s,n)})]},s))})]})})}function Qt({metrics:t}){if(!t)return e.jsxs("div",{className:"flex h-64 flex-col items-center justify-center text-center",children:[e.jsx(y,{icon:"heroicons:chart-bar",className:"text-5xl text-foreground-300 mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground",children:"No Metrics Available"}),e.jsx("p",{className:"text-sm text-foreground-500 mt-2",children:"Metrics will be available after the simulation completes"})]});const a=t,s={},n={},r={},o={},i={},l={},m=["total_turns","total_tasks","tasks_completed","success_rate","estimated_usd"];for(const[c,x]of Object.entries(a))m.includes(c)?s[c]=x:c.startsWith("latency")||c.startsWith("time_to_first")?n[c]=x:c.startsWith("tokens")||c==="prompt_tokens"||c==="completion_tokens"||c==="total_tokens"?r[c]=x:c.startsWith("tools")?o[c]=x:c.startsWith("deepeval")?i[c]=x:l[c]=x;const p=Object.keys(n).length>0,b=Object.keys(r).length>0,g=Object.keys(o).length>0,u=Object.keys(i).length>0,j=Object.keys(l).length>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Bt,{metrics:s}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[p&&e.jsx(Gt,{metrics:n}),b&&e.jsx(Jt,{metrics:r})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[g&&e.jsx(qt,{metrics:o}),u&&e.jsx(Yt,{metrics:i})]}),j&&e.jsx(Xt,{metrics:l})]})}function Zt(){const t=X(),a=K(c=>c.config),s=K(c=>c.scenarios),n=K(c=>c.selectedForRun),{runnableScenarios:r,groupedScenarios:o}=f.useMemo(()=>{if(!a)return{runnableScenarios:[],groupedScenarios:[]};const c=a.available_scenarios.filter(d=>!se(d.num_tasks)),x=new Map;for(const d of c){const N=d.group;x.has(N)||x.set(N,[]),x.get(N).push(d)}const h=[],v=Array.from(x.keys()).sort((d,N)=>d===null?1:N===null?-1:d.localeCompare(N));for(const d of v)h.push({name:d,scenarios:x.get(d)});return{runnableScenarios:c.map(d=>d.name),groupedScenarios:h}},[a]),i=f.useCallback(c=>{t.getState().actions.toggleScenarioForRun(c)},[t]),l=f.useCallback(()=>{t.getState().actions.selectAllScenariosForRun()},[t]),m=f.useCallback(()=>{t.getState().actions.clearScenariosForRun()},[t]),p=f.useCallback(c=>{const x=o.find(d=>d.name===c);if(!x)return;const h=x.scenarios.map(d=>d.name);h.every(d=>n.includes(d))?t.getState().actions.deselectScenariosForRun(h):t.getState().actions.selectScenariosForRun(h)},[t,o,n]),b=f.useCallback(c=>{const x=o.find(h=>h.name===c);return!x||x.scenarios.length===0?!1:x.scenarios.every(h=>n.includes(h.name))},[o,n]),g=f.useCallback(c=>{const x=o.find(v=>v.name===c);if(!x||x.scenarios.length===0)return!1;const h=x.scenarios.filter(v=>n.includes(v.name)).length;return h>0&&h0&&r.every(c=>n.includes(c)),j=n.length>0&&!u;return a?r.length===0?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center p-6 text-center",children:[e.jsx(y,{icon:"heroicons:document-magnifying-glass",className:"text-4xl text-foreground-300 mb-3"}),e.jsx("p",{className:"text-foreground-500 text-sm",children:"No scenarios available"}),e.jsx("p",{className:"text-xs text-foreground-400 mt-1",children:"Add scenario JSON files to the scenarios directory"})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-divider",children:[e.jsxs("span",{className:"text-xs text-foreground-500",children:[n.length," of ",r.length," selected"]}),e.jsx(ee,{size:"sm",isSelected:u,isIndeterminate:j,onValueChange:()=>{u?m():l()},children:e.jsx("span",{className:"text-xs",children:"All"})})]}),e.jsx("div",{className:"flex-1 overflow-auto p-4 space-y-4",children:o.map(c=>e.jsxs("div",{children:[c.name!==null?e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{size:"sm",variant:"flat",color:"secondary",children:c.name}),e.jsx("span",{className:"text-xs text-foreground-400",children:c.scenarios.length})]}),e.jsx(ee,{size:"sm",isSelected:b(c.name),isIndeterminate:g(c.name),onValueChange:()=>p(c.name),children:e.jsx("span",{className:"text-xs",children:"All"})})]}):o.length>1?e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-foreground-400 uppercase tracking-wide",children:"Ungrouped"}),e.jsx(ee,{size:"sm",isSelected:b(null),isIndeterminate:g(null),onValueChange:()=>p(null),children:e.jsx("span",{className:"text-xs",children:"All"})})]}):null,e.jsx("div",{className:"grid grid-cols-3 gap-2",children:c.scenarios.map(x=>{const h=x.name,v=s[h],d=n.includes(h),N=v?.tasks.length??x.num_tasks;return e.jsxs("button",{onClick:()=>i(h),className:` + flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors + ${d?"bg-primary-100 dark:bg-primary-900/30 border-primary-300 dark:border-primary-700":"bg-content2 border-transparent hover:bg-content3"} + `,children:[e.jsx(ee,{size:"sm",isSelected:d,onValueChange:()=>i(h),onClick:_=>_.stopPropagation()}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:h}),e.jsxs("p",{className:"text-xs text-foreground-500",children:[N," task",N!==1?"s":""]})]})]},h)})})]},c.name??"__ungrouped__"))})]}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(V,{size:"sm"})})}function en(){const t=X(),a=K(u=>u.config),s=K(u=>u.simulationConfig),n=K(u=>u.selectedPersonas),r=f.useMemo(()=>a?a.available_scenarios.filter(u=>se(u.num_tasks)).map(u=>u.name):[],[a]),o=f.useCallback((u,j)=>{t.getState().actions.setSimulationConfig({[u]:j})},[t]),i=f.useCallback((u,j)=>{const c=j===""?null:parseInt(j,10);(j===""||!isNaN(c)&&c>0)&&o(u,c)},[o]),l=f.useCallback(u=>{t.getState().actions.togglePersonaForRun(u)},[t]),m=f.useCallback(()=>{t.getState().actions.selectPersonasForRun(r)},[t,r]),p=f.useCallback(()=>{t.getState().actions.clearPersonasForRun()},[t]),b=r.length>0&&r.every(u=>n.includes(u)),g=n.length>0&&!b;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(L,{children:e.jsxs(F,{className:"gap-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"LLM Models"}),e.jsx(le,{label:"Default Model",placeholder:"e.g., gpt-4o-mini",size:"sm",value:s.default_model||"",onValueChange:u=>o("default_model",u||"gpt-4o-mini"),description:"Model for the agent under test"}),e.jsx(le,{label:"Simulated User Model",placeholder:"Uses default if empty",size:"sm",value:s.sim_user_model_name||"",onValueChange:u=>o("sim_user_model_name",u||null),description:"Model for simulating user behavior"}),e.jsx(le,{label:"Checker Model",placeholder:"Uses default if empty",size:"sm",value:s.checker_model_name||"",onValueChange:u=>o("checker_model_name",u||null),description:"Model for task completion checking"})]})}),e.jsx(L,{children:e.jsxs(F,{className:"gap-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Limits"}),e.jsx(le,{label:"Max Turns per Scenario",type:"number",min:1,size:"sm",value:s.max_turns_scenario?.toString()||"",onValueChange:u=>i("max_turns_scenario",u),description:"Maximum conversation turns for entire scenario"}),e.jsx(le,{label:"Max Turns per Task",type:"number",min:1,size:"sm",value:s.max_turns_task?.toString()||"",onValueChange:u=>i("max_turns_task",u),placeholder:"No limit if empty",description:"Maximum turns allowed for each task"})]})}),r.length>0&&e.jsx(L,{children:e.jsxs(F,{className:"gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Personas"}),e.jsx("p",{className:"text-xs text-foreground-500 mt-0.5",children:"Select personas for matrix runs"})]}),e.jsx(ee,{size:"sm",isSelected:b,isIndeterminate:g,onValueChange:()=>{b?p():m()},children:e.jsx("span",{className:"text-xs",children:"All"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(u=>{const j=n.includes(u);return e.jsxs("button",{onClick:()=>l(u),className:` + flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors + ${j?"bg-secondary-100 dark:bg-secondary-900/30 border-secondary-300 dark:border-secondary-700":"bg-content2 border-transparent hover:bg-content3"} + `,children:[e.jsx(ee,{size:"sm",isSelected:j,onValueChange:()=>l(u),onClick:c=>c.stopPropagation()}),e.jsx("span",{className:"text-sm font-medium",children:u})]},u)})}),n.length>0&&e.jsxs("p",{className:"text-xs text-foreground-400",children:[n.length," persona",n.length!==1?"s":""," selected"]})]})})]})}function sn(){const t=ue(),{client:a}=Y(),s=X(),n=K(c=>c.selectedForRun),r=K(c=>c.selectedPersonas),o=K(c=>c.isExecuting),[i,l]=f.useState(!1),[m,p]=f.useState(null),b=f.useCallback(()=>{const c=s.getState().config,x=s.getState().selectedForRun;if(!c||x.length===0)return null;const h=c.available_scenarios.filter(d=>x.includes(d.name));return new Set(h.map(d=>d.group)).size===1?h[0]?.group??null:null},[s]),g=f.useCallback(async()=>{const c=s.getState().selectedForRun,x=s.getState().selectedPersonas,h=s.getState().simulationConfig;if(c.length===0)return;const v=b();l(!0),p(null);try{const d=await fetch(`${a.getBaseUrl()}/api/eval/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenario_names:c,personas:x.length>0?x:null,config:h})});if(!d.ok)throw new Error(`Failed to start evaluation: ${d.statusText}`);const _=(await d.json()).run_id;if(!_)throw new Error("Invalid response: missing run_id");const w=x.length>0?x:[null],R=[];for(const S of c)for(const k of w)R.push({id:`${_}_${S}${k?`:${k}`:""}`,scenarioName:S,persona:k,status:"queued",startTime:new Date().toISOString(),endTime:null,turns:[],tasks:[],metrics:null,error:null});const $={id:_,timestamp:new Date().toISOString(),version:"current",status:"running",config:h,group:v,scenarioRuns:R,totalScenarios:R.length,completedScenarios:0,failedScenarios:0,totalTokens:0,totalCostUsd:0,overallSuccessRate:0};s.getState().actions.addSimulationRun($),s.getState().actions.startExecution(_,c);const I=new EventSource(`${a.getBaseUrl()}/api/eval/progress/${_}`);I.onmessage=S=>{try{const k=JSON.parse(S.data);s.getState().actions.handleProgressUpdate(k);const E=s.getState().simulationRuns.find(D=>D.id===_);if(E){let D=E.scenarioRuns.findIndex(T=>T.id===k.scenario_run_id);if(D===-1&&(D=E.scenarioRuns.findIndex(T=>T.scenarioName===k.scenario_name&&(T.persona??null)===(k.persona??null)&&!T.id.startsWith("sr_"))),D!==-1){const T=[...E.scenarioRuns],C={...T[D]};k.scenario_run_id&&C.id!==k.scenario_run_id&&(C.id=k.scenario_run_id),k.type==="status"?C.status=k.status:k.type==="turn"?(C.status="running",C.turns=[...C.turns,{turn_index:k.turn_index,task_index:k.task_index,user_message:k.user_message,assistant_message:k.assistant_message,tool_calls:k.tool_calls,task_completed:k.task_completed,task_completed_reason:k.task_completed_reason,token_usage:null,latency_ms:null,checkers:k.checkers,checker_mode:k.checker_mode}]):k.type==="response_chunk"?(C.responseChunks||(C.responseChunks=[]),C.responseChunks=[...C.responseChunks,{turn_index:k.turn_index,task_index:k.task_index,chunk_index:C.responseChunks.length,chunk_type:k.chunk_type,chunk_data:k.chunk_data,timestamp:Date.now()}]):k.type==="complete"?(C.status=k.status,C.endTime=new Date().toISOString()):k.type==="error"&&(C.status="failed",C.error=k.error,C.endTime=new Date().toISOString()),T[D]=C;const A=T.filter(z=>z.status==="completed").length,O=T.filter(z=>z.status==="failed"||z.status==="timeout").length,P=A+O===T.length;s.getState().actions.updateSimulationRun(_,{scenarioRuns:T,status:P?O>0?"failed":"completed":"running",completedScenarios:A,failedScenarios:O})}}(k.type==="complete"||k.type==="error")&&yt(s.getState()).running===0&&I.close()}catch(k){console.error("Failed to parse progress update:",k)}},I.onerror=()=>{console.error("SSE connection error"),I.close()},s.getState().actions.clearScenariosForRun(),s.getState().actions.clearPersonasForRun(),t(`/runs/${_}`)}catch(d){console.error("Failed to start evaluation:",d),p(d instanceof Error?d.message:"Failed to start run"),l(!1)}},[a,s,t,b]),u=n.length*Math.max(r.length,1),j=n.length>0&&!o&&!i;return e.jsxs("div",{className:"flex h-full",children:[e.jsxs("div",{className:"w-1/2 border-r border-divider flex flex-col",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-divider",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Select Scenarios"}),e.jsx("p",{className:"text-sm text-foreground-500 mt-0.5",children:"Choose scenarios to run"})]}),e.jsx(Zt,{})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-3 border-b border-divider",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Configuration"}),e.jsx("p",{className:"text-sm text-foreground-500 mt-0.5",children:"Configure the simulation parameters"})]}),e.jsx("div",{className:"flex-1 overflow-auto p-6",children:e.jsx(en,{})}),e.jsxs("div",{className:"px-6 py-4 border-t border-divider",children:[m&&e.jsx("div",{className:"mb-3 p-3 bg-danger-50 dark:bg-danger-900/20 rounded-lg",children:e.jsx("p",{className:"text-sm text-danger",children:m})}),e.jsx(W,{color:"primary",size:"lg",className:"w-full",isDisabled:!j,isLoading:i,onPress:g,startContent:!i&&e.jsx(y,{icon:"heroicons:play",className:"text-lg"}),children:i?"Starting...":n.length>0?r.length>1?`Start ${u} Runs (${n.length} scenarios × ${r.length} personas)`:`Start Run (${n.length} scenario${n.length!==1?"s":""})`:"Select scenarios to run"})]})]})]})}function tn(){const{client:t}=Y(),a=X(),s=K(g=>g.config),n=K(g=>g.scenarios),r=f.useRef(!1),[o,i]=f.useState(null),{groupedScenarios:l,allScenarioNames:m}=f.useMemo(()=>{if(!s)return{groupedScenarios:[],allScenarioNames:[]};const g=s.available_scenarios.filter(x=>!se(x.num_tasks)),u=new Map;for(const x of g){const h=x.group;u.has(h)||u.set(h,[]),u.get(h).push(x)}const j=[],c=Array.from(u.keys()).sort((x,h)=>x===null?1:h===null?-1:x.localeCompare(h));for(const x of c)j.push({name:x,scenarios:u.get(x)});return{groupedScenarios:j,allScenarioNames:g.map(x=>x.name)}},[s]);f.useEffect(()=>{if(!s||r.current)return;r.current=!0;async function g(){const{setScenario:u}=a.getState().actions;for(const j of s.available_scenarios)try{const c=await t.makeRequest(`/api/eval/scenarios/${j.name}`);u(j.name,c)}catch(c){console.error(`Failed to load scenario ${j.name}:`,c)}}g()},[t,s,a]),f.useEffect(()=>{!o&&m.length>0&&i(m[0])},[o,m]);const p=o?n[o]:null,b=s?.available_scenarios.find(g=>g.name===o);return s?m.length===0?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center p-6 text-center",children:[e.jsx(y,{icon:"heroicons:document-magnifying-glass",className:"text-6xl text-foreground-300 mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"No Scenarios Found"}),e.jsx("p",{className:"text-foreground-500 max-w-md",children:"Add scenario JSON files to the scenarios directory to get started."})]}):e.jsxs("div",{className:"flex h-full",children:[e.jsx("aside",{className:"w-72 flex-shrink-0 border-r border-divider overflow-y-auto",children:e.jsxs("div",{className:"p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-foreground-500 uppercase tracking-wide mb-3",children:["Scenarios (",m.length,")"]}),e.jsx("div",{className:"space-y-4",children:l.map(g=>e.jsxs("div",{children:[g.name!==null&&e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(M,{size:"sm",variant:"flat",color:"secondary",children:g.name}),e.jsx("span",{className:"text-xs text-foreground-400",children:g.scenarios.length})]}),e.jsx("div",{className:"space-y-1",children:g.scenarios.map(u=>e.jsx(L,{isPressable:!0,onPress:()=>i(u.name),className:`w-full ${o===u.name?"border-2 border-primary":""}`,children:e.jsxs(F,{className:"p-3",children:[e.jsx("p",{className:"font-medium truncate",children:u.name}),e.jsxs("p",{className:"text-xs text-foreground-400",children:[u.num_tasks," task",u.num_tasks!==1?"s":""]})]})},u.name))})]},g.name??"__ungrouped__"))})]})}),e.jsx("main",{className:"flex-1 min-h-0 overflow-auto",children:p?e.jsx(nn,{scenario:p,group:b?.group}):o?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(V,{size:"sm"})}):e.jsx("div",{className:"flex h-full items-center justify-center text-foreground-500",children:"Select a scenario to view details"})})]}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(V,{size:"lg"})})}function nn({scenario:t,group:a}){return e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h2",{className:"text-2xl font-semibold",children:t.name}),a&&e.jsx(M,{size:"sm",variant:"flat",color:"secondary",children:a})]}),e.jsxs("p",{className:"text-foreground-500",children:[t.tasks.length," task",t.tasks.length!==1?"s":""]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Tasks"}),t.tasks.map((s,n)=>e.jsx(L,{children:e.jsx(F,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-sm font-semibold text-primary",children:n+1})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-foreground mb-2",children:s.task}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.checkers.map((r,o)=>e.jsx(M,{size:"sm",variant:"flat",children:r.type},o)),s.checker_mode&&s.checker_mode!=="all"&&e.jsxs(M,{size:"sm",variant:"bordered",color:"warning",children:["mode: ",s.checker_mode]})]})]})]})})},n))]})]})}function an({isOpen:t,onClose:a,task:s,taskIndex:n,scenarioName:r}){const{client:o}=Y(),i=K(_=>_.config),l=K(_=>_.simulationConfig),[m,p]=f.useState(l.persona),[b,g]=f.useState(!1),[u,j]=f.useState(null),[c,x]=f.useState(null),h=f.useMemo(()=>i?i.available_scenarios.filter(_=>se(_.num_tasks)).map(_=>_.name):[],[i]),v=f.useCallback(async()=>{if(s){g(!0),x(null),j(null);try{const _=await fetch(`${o.getBaseUrl()}/api/eval/test-persona`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({task:s.task,persona:m,scenario_name:r,task_index:n,model:l.sim_user_model_name||l.default_model})});if(!_.ok)throw new Error(`Failed to test persona: ${_.statusText}`);const w=await _.json();j({message:w.message,persona:w.persona||m||"Default",model:w.model||l.sim_user_model_name||l.default_model})}catch(_){x(_ instanceof Error?_.message:"An error occurred")}finally{g(!1)}}},[o,s,m,r,n,l]),d=f.useCallback(()=>{j(null),x(null),a()},[a]),N=f.useCallback(_=>{if(_==="all")return;const w=Array.from(_)[0]||null;p(w===""?null:w)},[]);return s?e.jsx(Ds,{isOpen:t,onOpenChange:d,size:"2xl",children:e.jsxs(Is,{children:[e.jsxs(at,{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-foreground",children:"Test Task with Persona"}),e.jsx("span",{className:"text-sm font-normal text-foreground-500",children:"See how a simulated user would ask this task"})]}),e.jsx(Fs,{className:"pb-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(L,{className:"bg-default-50",children:e.jsxs(F,{className:"p-4",children:[e.jsxs("p",{className:"text-xs text-foreground-500 mb-1",children:["Task ",n+1]}),e.jsx("p",{className:"text-foreground",children:s.task}),s.checkers&&s.checkers.length>0&&e.jsxs("p",{className:"text-sm text-foreground-500 mt-2",children:[e.jsx("span",{className:"font-medium",children:"Checkers: "}),s.checkers.map(_=>_.type).join(", ")," (",s.checker_mode||"all",")"]})]})}),e.jsxs("div",{className:"flex items-end gap-3",children:[e.jsx(et,{label:"Persona",placeholder:"Select a persona (optional)",size:"sm",className:"flex-1",selectedKeys:m?new Set([m]):new Set,onSelectionChange:N,description:"Choose a persona for the simulated user",children:h.map(_=>e.jsx(Ze,{children:_},_))}),e.jsx(W,{color:"primary",onPress:v,isLoading:b,startContent:!b&&e.jsx(y,{icon:"heroicons:play"}),children:"Generate"})]}),b&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(V,{size:"lg"})}),c&&e.jsx(L,{className:"bg-danger-50 dark:bg-danger-900/20",children:e.jsx(F,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(y,{icon:"heroicons:exclamation-circle",className:"text-danger text-xl flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"Error"}),e.jsx("p",{className:"text-sm text-danger-600 dark:text-danger-400",children:c})]})]})})}),u&&e.jsx(L,{className:"bg-primary-50 dark:bg-primary-900/20",children:e.jsx(F,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:e.jsx(y,{icon:"heroicons:user",className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Simulated User"}),u.persona&&e.jsxs("span",{className:"text-xs text-foreground-500",children:["(",u.persona,")"]})]}),e.jsx("p",{className:"text-foreground whitespace-pre-wrap",children:u.message}),e.jsxs("p",{className:"text-xs text-foreground-400 mt-3",children:["Model: ",u.model]})]})]})})})]})})]})}):null}function rn(){const{scenarioName:t}=Qe(),a=ue(),s=X(),n=K(S=>S.selectedScenarioName),r=t?decodeURIComponent(t):n,o=K(S=>S.scenarios),i=K(S=>S.runHistory),l=r?o[r]:null,m=r?i[r]:null,[p,b]=f.useState(null),[g,u]=f.useState(null),[j,c]=f.useState(null),[x,h]=f.useState(null),v=f.useCallback(()=>{a("/scenarios")},[a]),d=f.useCallback(()=>{r&&a(`/new?scenario=${encodeURIComponent(r)}`)},[a,r]),N=(S,k)=>{b(S),u({...k})},_=()=>{p!==null&&g&&r&&(s.getState().actions.updateScenarioTask(r,p,g),b(null),u(null))},w=()=>{b(null),u(null)},R=(S,k)=>{c(S),h(k)},$=()=>{c(null),h(null)};if(!r||!l)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-foreground-500",children:"No scenario selected"})});const I=m?.[0];return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"border-b border-divider px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(W,{isIconOnly:!0,variant:"light",onPress:v,"aria-label":"Go back",children:e.jsx(y,{icon:"heroicons:arrow-left",className:"text-xl"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-xl font-semibold text-foreground",children:l.name}),e.jsxs("p",{className:"text-sm text-foreground-500",children:[l.tasks.length," task",l.tasks.length!==1?"s":""]})]}),e.jsx(W,{color:"primary",startContent:e.jsx(y,{icon:"heroicons:play"}),onPress:d,children:"Run Scenario"})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:e.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx(L,{className:"flex-1",children:e.jsxs(F,{className:"flex flex-row items-center gap-3 p-4",children:[e.jsx("div",{className:"rounded-lg bg-primary-100 dark:bg-primary-900/30 p-2",children:e.jsx(y,{icon:"heroicons:clipboard-document-list",className:"text-xl text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground-500",children:"Tasks"}),e.jsx("p",{className:"text-lg font-semibold",children:l.tasks.length})]})]})}),e.jsx(L,{className:"flex-1",children:e.jsxs(F,{className:"flex flex-row items-center gap-3 p-4",children:[e.jsx("div",{className:"rounded-lg bg-success-100 dark:bg-success-900/30 p-2",children:e.jsx(y,{icon:"heroicons:clock",className:"text-xl text-success"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground-500",children:"Last Run"}),e.jsx("p",{className:"text-lg font-semibold",children:I?new Date(I.timestamp).toLocaleDateString():"Never"})]})]})}),e.jsx(L,{className:"flex-1",children:e.jsxs(F,{className:"flex flex-row items-center gap-3 p-4",children:[e.jsx("div",{className:"rounded-lg bg-warning-100 dark:bg-warning-900/30 p-2",children:e.jsx(y,{icon:"heroicons:chart-bar",className:"text-xl text-warning"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-foreground-500",children:"Total Runs"}),e.jsx("p",{className:"text-lg font-semibold",children:m?.length??0})]})]})})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Tasks"}),e.jsx("div",{className:"space-y-4",children:l.tasks.map((S,k)=>e.jsx(L,{children:e.jsx(F,{className:"p-4",children:p===k?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-foreground-500",children:["Task ",k+1]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(W,{size:"sm",variant:"flat",onPress:w,children:"Cancel"}),e.jsx(W,{size:"sm",color:"primary",onPress:_,children:"Save"})]})]}),e.jsx(Ls,{label:"Task Description",value:g?.task??"",onValueChange:E=>u(D=>D?{...D,task:E}:null),minRows:2}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-foreground-500 mb-1",children:"Checkers (read-only)"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:g?.checkers?.map((E,D)=>e.jsx(M,{size:"sm",variant:"flat",children:E.type},D))??e.jsx("span",{className:"text-foreground-400 italic",children:"None"})}),g?.checker_mode&&e.jsxs("p",{className:"text-xs text-foreground-400 mt-1",children:["Mode: ",g.checker_mode]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs(M,{size:"sm",variant:"flat",color:"primary",children:["Task ",k+1]})}),e.jsx("p",{className:"text-foreground",children:S.task})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Le,{content:"Test with Persona",children:e.jsx(W,{isIconOnly:!0,size:"sm",variant:"light",onPress:()=>R(k,S),"aria-label":"Test with persona",children:e.jsx(y,{icon:"heroicons:user-circle"})})}),e.jsx(Le,{content:"Edit task",children:e.jsx(W,{isIconOnly:!0,size:"sm",variant:"light",onPress:()=>N(k,S),"aria-label":"Edit task",children:e.jsx(y,{icon:"heroicons:pencil"})})})]})]}),e.jsx(Ms,{className:"my-3"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"text-foreground-500 mb-2",children:"Checkers"}),S.checkers&&S.checkers.length>0?e.jsxs("div",{className:"space-y-2",children:[S.checkers.map((E,D)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{size:"sm",variant:"flat",color:"primary",children:E.type}),e.jsx("span",{className:"text-foreground-400 text-xs",children:Object.entries(E).filter(([T])=>T!=="type").map(([T,C])=>`${T}: ${JSON.stringify(C)}`).join(", ")})]},D)),S.checker_mode&&e.jsxs("p",{className:"text-xs text-foreground-400",children:["Mode: ",S.checker_mode]})]}):e.jsx("p",{className:"text-foreground-400 italic",children:"No checkers configured"})]})]})})},k))})]}),m&&m.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Recent Runs"}),e.jsx("div",{className:"space-y-2",children:m.slice(0,5).map(S=>e.jsx(L,{isPressable:!0,onPress:()=>{a(`/runs/${S.runId}`)},children:e.jsxs(F,{className:"flex flex-row items-center justify-between p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{size:"sm",color:S.status==="completed"?"success":S.status==="failed"?"danger":S.status==="timeout"?"warning":"default",variant:"flat",children:S.status}),e.jsx("span",{className:"text-sm text-foreground",children:new Date(S.timestamp).toLocaleString()})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground-500",children:[e.jsxs("span",{children:[S.execution.turns.length," turns"]}),e.jsx(y,{icon:"heroicons:chevron-right"})]})]})},S.runId))})]})]})}),e.jsx(an,{isOpen:j!==null,onClose:$,task:x,taskIndex:j??0,scenarioName:r})]})}function on(){const{client:t}=Y(),a=f.useRef(!1),[s,n]=f.useState([]),[r,o]=f.useState(!0),[i,l]=f.useState(null),[m,p]=f.useState(null);f.useEffect(()=>{if(a.current)return;a.current=!0;async function g(){try{o(!0);const u=await fetch(`${t.getBaseUrl()}/api/eval/personas`);if(!u.ok)throw new Error(`Failed to load personas: ${u.statusText}`);const j=await u.json();n(j.personas),l(null)}catch(u){console.error("Failed to load personas:",u),l(u instanceof Error?u.message:"Failed to load personas")}finally{o(!1)}}g()},[t]),f.useEffect(()=>{!m&&s.length>0&&p(s[0].name)},[m,s]);const b=s.find(g=>g.name===m);return r?e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(V,{size:"lg"})}):i?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center p-6 text-center",children:[e.jsx(y,{icon:"heroicons:exclamation-triangle",className:"text-6xl text-danger mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Error Loading Personas"}),e.jsx("p",{className:"text-foreground-500 max-w-md",children:i})]}):s.length===0?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center p-6 text-center",children:[e.jsx(y,{icon:"heroicons:user-group",className:"text-6xl text-foreground-300 mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"No Personas Found"}),e.jsxs("p",{className:"text-foreground-500 max-w-md",children:["Create a ",e.jsx("code",{className:"bg-content2 px-1.5 py-0.5 rounded text-sm",children:"personas.json"})," file in your scenarios directory to define user personas for simulations."]})]}):e.jsxs("div",{className:"flex h-full",children:[e.jsx("aside",{className:"w-72 flex-shrink-0 border-r border-divider overflow-y-auto",children:e.jsxs("div",{className:"p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-foreground-500 uppercase tracking-wide mb-3",children:["Personas (",s.length,")"]}),e.jsx("div",{className:"space-y-1",children:s.map(g=>e.jsx(L,{isPressable:!0,onPress:()=>p(g.name),className:`w-full ${m===g.name?"border-2 border-primary":""}`,children:e.jsx(F,{className:"p-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-secondary/20 flex items-center justify-center flex-shrink-0",children:e.jsx(y,{icon:"heroicons:user",className:"text-secondary text-sm"})}),e.jsx("p",{className:"font-medium truncate",children:g.name})]})})},g.name))})]})}),e.jsx("main",{className:"flex-1 min-h-0 overflow-auto",children:b?e.jsx(ln,{persona:b}):e.jsx("div",{className:"flex h-full items-center justify-center text-foreground-500",children:"Select a persona to view details"})})]})}function ln({persona:t}){return e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-secondary/20 flex items-center justify-center",children:e.jsx(y,{icon:"heroicons:user",className:"text-secondary text-2xl"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-semibold",children:t.name}),e.jsx("p",{className:"text-foreground-500",children:"Persona definition"})]})]})}),e.jsx(L,{className:"mb-4",children:e.jsxs(F,{className:"p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground-500 uppercase tracking-wide mb-3",children:"Description"}),e.jsx("p",{className:"text-foreground-700 whitespace-pre-wrap leading-relaxed",children:t.description})]})}),e.jsx(L,{children:e.jsx(F,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(y,{icon:"heroicons:information-circle",className:"text-foreground-400 text-xl flex-shrink-0 mt-0.5"}),e.jsx("div",{children:e.jsx("p",{className:"text-foreground-600",children:"This persona can be selected when running scenarios to define the simulated user's behavior and personality."})})]})})})]})}function cn(){return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center text-center p-6",children:[e.jsx(y,{icon:"heroicons:beaker",className:"text-6xl text-foreground-300 mb-4"}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Playground"}),e.jsx("p",{className:"text-foreground-500 max-w-md",children:"Experiment with scenarios and test agent behavior interactively. Run individual tasks and see results in real-time."}),e.jsx("p",{className:"text-sm text-foreground-400 mt-4",children:"Coming soon"})]})}const dn=[{path:"/",element:e.jsx(Ct,{}),children:[{index:!0,element:e.jsx(As,{to:"/runs",replace:!0})},{path:"runs",element:e.jsx(Ft,{})},{path:"runs/:runId",element:e.jsx(At,{})},{path:"new",element:e.jsx(sn,{})},{path:"scenarios",element:e.jsx(tn,{})},{path:"scenarios/:scenarioName",element:e.jsx(rn,{})},{path:"personas",element:e.jsx(on,{})},{path:"playground",element:e.jsx(cn,{})}]}],un=new URLSearchParams(window.location.search).has("mock");function mn(){const{client:t}=Y(),a=X(),s=K(i=>i.isConfigLoading),n=K(i=>i.configError),r=f.useRef(!1),o=Ks(dn);return f.useEffect(()=>{if(r.current)return;if(r.current=!0,un){a.getState().actions.loadMockData();return}async function i(){const{setConfigLoading:l,setConfig:m,setConfigError:p}=a.getState().actions;l(!0);try{const b=await t.makeRequest("/api/eval/config");m(b)}catch(b){p(b instanceof Error?b.message:"Failed to load config")}}i()},[t,a]),s?e.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(V,{size:"lg"}),e.jsx("p",{className:"text-foreground-500",children:"Loading evaluation configuration..."})]})}):n?e.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"text-6xl",children:"!"}),e.jsx("h1",{className:"text-xl font-semibold text-danger",children:"Failed to Connect"}),e.jsx("p",{className:"max-w-md text-foreground-500",children:"Could not connect to the evaluation API. Make sure the EvalAPI server is running."}),e.jsx("p",{className:"text-sm text-foreground-400",children:n}),e.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 rounded-lg bg-primary px-4 py-2 text-white hover:bg-primary-600",children:"Retry"})]})}):o}const xn="";Es(["heroicons:check","heroicons:x-mark","heroicons:play","heroicons:stop","heroicons:arrow-path","heroicons:sun","heroicons:moon","heroicons:chevron-down","heroicons:chevron-right","heroicons:document-text","heroicons:clipboard","heroicons:trash","heroicons:pencil","heroicons:eye","heroicons:chart-bar","heroicons:chat-bubble-left-right","heroicons:clock","heroicons:currency-dollar","heroicons:cpu-chip"]);Os.createRoot(document.getElementById("root")).render(e.jsx(f.StrictMode,{children:e.jsx(Ws,{children:e.jsx(zs,{baseUrl:xn,children:e.jsx(Hs,{children:e.jsx(St,{children:e.jsx(Us,{children:e.jsx(mn,{})})})})})})})); diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/features-animation-Dc-yT_Yb.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/features-animation-Dc-yT_Yb.js new file mode 100644 index 0000000000..8cab61859e --- /dev/null +++ b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/features-animation-Dc-yT_Yb.js @@ -0,0 +1 @@ +import{g as a,a as e,b as n}from"./useThemeContext-DkrqKvLn.js";const s={renderer:n,...e,...a};export{s as d}; diff --git a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-B3hlerKe.js b/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-B3hlerKe.js deleted file mode 100644 index e290f320a9..0000000000 --- a/packages/ragbits-chat/src/ragbits/chat/ui-build/assets/index-B3hlerKe.js +++ /dev/null @@ -1,131 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FeedbackForm-CmRSbYPS.js","assets/index-B7bSwAmw.js","assets/chunk-SSA7SXE4-BJI2Gxdq.js","assets/useMenuTriggerState-CTz3KfPq.js","assets/useSelectableItem-DK6eABKK.js","assets/index-v15bx9Do.js","assets/chunk-IGSAU2ZA-CsJAveMU.js","assets/ChatOptionsForm-CNjzbIqN.js","assets/ShareButton-lYj0v67r.js","assets/UsageButton-B-N1J-sZ.js","assets/ChatHistory-Cp_DhrUx.js","assets/Login-Djq6QJ18.js","assets/authStore-DATNN-ps.js","assets/AuthGuard-B326tmZN.js","assets/LogoutButton-Cn2L63Hk.js"])))=>i.map(i=>d[i]); -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ig=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zy={exports:{}},pp={},jy={exports:{}},ht={};/** - * @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 r1;function rL(){if(r1)return ht;r1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function b(U){return U===null||typeof U!="object"?null:(U=g&&U[g]||U["@@iterator"],typeof U=="function"?U:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,P={};function T(U,oe,z){this.props=U,this.context=oe,this.refs=P,this.updater=z||x}T.prototype.isReactComponent={},T.prototype.setState=function(U,oe){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,oe,"setState")},T.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function _(){}_.prototype=T.prototype;function A(U,oe,z){this.props=U,this.context=oe,this.refs=P,this.updater=z||x}var L=A.prototype=new _;L.constructor=A,k(L,T.prototype),L.isPureReactComponent=!0;var O=Array.isArray,j=Object.prototype.hasOwnProperty,$={current:null},Y={key:!0,ref:!0,__self:!0,__source:!0};function te(U,oe,z){var me,Ce={},ye=null,Oe=null;if(oe!=null)for(me in oe.ref!==void 0&&(Oe=oe.ref),oe.key!==void 0&&(ye=""+oe.key),oe)j.call(oe,me)&&!Y.hasOwnProperty(me)&&(Ce[me]=oe[me]);var Ne=arguments.length-2;if(Ne===1)Ce.children=z;else if(1>>1,oe=V[U];if(0>>1;Ui(Ce,M))yei(Oe,Ce)?(V[U]=Oe,V[ye]=M,U=ye):(V[U]=Ce,V[me]=M,U=me);else if(yei(Oe,M))V[U]=Oe,V[ye]=M,U=ye;else break e}}return ae}function i(V,ae){var M=V.sortIndex-ae.sortIndex;return M!==0?M:V.id-ae.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],h=[],m=1,g=null,b=3,x=!1,k=!1,P=!1,T=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function L(V){for(var ae=n(h);ae!==null;){if(ae.callback===null)r(h);else if(ae.startTime<=V)r(h),ae.sortIndex=ae.expirationTime,t(d,ae);else break;ae=n(h)}}function O(V){if(P=!1,L(V),!k)if(n(d)!==null)k=!0,J(j);else{var ae=n(h);ae!==null&&X(O,ae.startTime-V)}}function j(V,ae){k=!1,P&&(P=!1,_(te),te=-1),x=!0;var M=b;try{for(L(ae),g=n(d);g!==null&&(!(g.expirationTime>ae)||V&&!W());){var U=g.callback;if(typeof U=="function"){g.callback=null,b=g.priorityLevel;var oe=U(g.expirationTime<=ae);ae=e.unstable_now(),typeof oe=="function"?g.callback=oe:g===n(d)&&r(d),L(ae)}else r(d);g=n(d)}if(g!==null)var z=!0;else{var me=n(h);me!==null&&X(O,me.startTime-ae),z=!1}return z}finally{g=null,b=M,x=!1}}var $=!1,Y=null,te=-1,ie=5,B=-1;function W(){return!(e.unstable_now()-BV||125U?(V.sortIndex=M,t(h,V),n(d)===null&&V===n(h)&&(P?(_(te),te=-1):P=!0,X(O,M-U))):(V.sortIndex=oe,t(d,V),k||x||(k=!0,J(j))),V},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(V){var ae=b;return function(){var M=b;b=ae;try{return V.apply(this,arguments)}finally{b=M}}}}(Uy)),Uy}var l1;function aL(){return l1||(l1=1,Vy.exports=sL()),Vy.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 u1;function lL(){if(u1)return ii;u1=1;var e=ix(),t=aL();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,p=1;p"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},g={};function b(o){return d.call(g,o)?!0:d.call(m,o)?!1:h.test(o)?g[o]=!0:(m[o]=!0,!1)}function x(o,l,p,v){if(p!==null&&p.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:p!==null?!p.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function k(o,l,p,v){if(l===null||typeof l>"u"||x(o,l,p,v))return!0;if(v)return!1;if(p!==null)switch(p.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function P(o,l,p,v,w,C,R){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=R}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){T[o]=new P(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];T[l]=new P(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){T[o]=new P(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){T[o]=new P(o,2,!1,o,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(o){T[o]=new P(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){T[o]=new P(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){T[o]=new P(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){T[o]=new P(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){T[o]=new P(o,5,!1,o.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function A(o){return o[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(o){var l=o.replace(_,A);T[l]=new P(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(_,A);T[l]=new P(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(_,A);T[l]=new P(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){T[o]=new P(o,1,!1,o.toLowerCase(),null,!1,!1)}),T.xlinkHref=new P("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){T[o]=new P(o,1,!1,o.toLowerCase(),null,!0,!0)});function L(o,l,p,v){var w=T.hasOwnProperty(l)?T[l]:null;(w!==null?w.type!==0:v||!(2K||w[R]!==C[K]){var Q=` -`+w[R].replace(" at new "," at ");return o.displayName&&Q.includes("")&&(Q=Q.replace("",o.displayName)),Q}while(1<=R&&0<=K);break}}}finally{z=!1,Error.prepareStackTrace=p}return(o=o?o.displayName||o.name:"")?oe(o):""}function Ce(o){switch(o.tag){case 5:return oe(o.type);case 16:return oe("Lazy");case 13:return oe("Suspense");case 19:return oe("SuspenseList");case 0:case 2:case 15:return o=me(o.type,!1),o;case 11:return o=me(o.type.render,!1),o;case 1:return o=me(o.type,!0),o;default:return""}}function ye(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case Y:return"Fragment";case $:return"Portal";case ie:return"Profiler";case te:return"StrictMode";case ee:return"Suspense";case H:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case W:return(o.displayName||"Context")+".Consumer";case B:return(o._context.displayName||"Context")+".Provider";case G:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case le:return l=o.displayName||null,l!==null?l:ye(o.type)||"Memo";case J:l=o._payload,o=o._init;try{return ye(o(l))}catch{}}return null}function Oe(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(l);case 8:return l===te?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Ne(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function _e(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Qe(o){var l=_e(o)?"checked":"value",p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),v=""+o[l];if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,C=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return w.call(this)},set:function(R){v=""+R,C.call(this,R)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return v},setValue:function(R){v=""+R},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function at(o){o._valueTracker||(o._valueTracker=Qe(o))}function Ie(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var p=l.getValue(),v="";return o&&(v=_e(o)?o.checked?"true":"false":o.value),o=v,o!==p?(l.setValue(o),!0):!1}function mt(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function pt(o,l){var p=l.checked;return M({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??o._wrapperState.initialChecked})}function Ut(o,l){var p=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;p=Ne(l.value!=null?l.value:p),o._wrapperState={initialChecked:v,initialValue:p,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Ue(o,l){l=l.checked,l!=null&&L(o,"checked",l,!1)}function it(o,l){Ue(o,l);var p=Ne(l.value),v=l.type;if(p!=null)v==="number"?(p===0&&o.value===""||o.value!=p)&&(o.value=""+p):o.value!==""+p&&(o.value=""+p);else if(v==="submit"||v==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?er(o,l.type,p):l.hasOwnProperty("defaultValue")&&er(o,l.type,Ne(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Kt(o,l,p){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var v=l.type;if(!(v!=="submit"&&v!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,p||l===o.value||(o.value=l),o.defaultValue=l}p=o.name,p!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,p!==""&&(o.name=p)}function er(o,l,p){(l!=="number"||mt(o.ownerDocument)!==o)&&(p==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+p&&(o.defaultValue=""+p))}var an=Array.isArray;function _t(o,l,p,v){if(o=o.options,l){l={};for(var w=0;w"+l.valueOf().toString()+"",l=ze.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function lt(o,l){if(l){var p=o.firstChild;if(p&&p===o.lastChild&&p.nodeType===3){p.nodeValue=l;return}}o.textContent=l}var Wt={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},Bn=["Webkit","ms","Moz","O"];Object.keys(Wt).forEach(function(o){Bn.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Wt[l]=Wt[o]})});function Jt(o,l,p){return l==null||typeof l=="boolean"||l===""?"":p||typeof l!="number"||l===0||Wt.hasOwnProperty(o)&&Wt[o]?(""+l).trim():l+"px"}function Pt(o,l){o=o.style;for(var p in l)if(l.hasOwnProperty(p)){var v=p.indexOf("--")===0,w=Jt(p,l[p],v);p==="float"&&(p="cssFloat"),v?o.setProperty(p,w):o[p]=w}}var Pr=M({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 Ft(o,l){if(l){if(Pr[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function tr(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 ln=null;function aa(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ms=null,di=null,pi=null;function ul(o){if(o=Kn(o)){if(typeof ms!="function")throw Error(n(280));var l=o.stateNode;l&&(l=uc(l),ms(o.stateNode,o.type,l))}}function Mu(o){di?pi?pi.push(o):pi=[o]:di=o}function gs(){if(di){var o=di,l=pi;if(pi=di=null,ul(o),l)for(o=0;o>>=0,o===0?32:31-(Fh(o)/Oh|0)|0}var ca=64,Fu=4194304;function fa(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function xs(o,l){var p=o.pendingLanes;if(p===0)return 0;var v=0,w=o.suspendedLanes,C=o.pingedLanes,R=p&268435455;if(R!==0){var K=R&~w;K!==0?v=fa(K):(C&=R,C!==0&&(v=fa(C)))}else R=p&~w,R!==0?v=fa(R):C!==0&&(v=fa(C));if(v===0)return 0;if(l!==0&&l!==v&&(l&w)===0&&(w=v&-v,C=l&-l,w>=C||w===16&&(C&4194240)!==0))return l;if((v&4)!==0&&(v|=p&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=v;0p;p++)l.push(o);return l}function gl(o,l,p){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-hi(l),o[l]=p}function Bh(o,l){var p=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var v=o.eventTimes;for(o=o.expirationTimes;0=ao),tm=" ",nm=!1;function rm(o,l){switch(o){case"keyup":return Tr.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function im(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var va=!1;function ya(o,l){switch(o){case"compositionend":return im(l);case"keypress":return l.which!==32?null:(nm=!0,tm);case"textInput":return o=l.data,o===tm&&nm?null:o;default:return null}}function Zv(o,l){if(va)return o==="compositionend"||!wl&&rm(o,l)?(o=ed(),Mi=xl=Gt=null,va=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:p,offset:l-o};o=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=rt(p)}}function pn(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?pn(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function $t(){for(var o=window,l=mt();l instanceof o.HTMLIFrameElement;){try{var p=typeof l.contentWindow.location.href=="string"}catch{p=!1}if(p)o=l.contentWindow;else break;l=mt(o.document)}return l}function Sl(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function oy(o){var l=$t(),p=o.focusedElem,v=o.selectionRange;if(l!==p&&p&&p.ownerDocument&&pn(p.ownerDocument.documentElement,p)){if(v!==null&&Sl(p)){if(l=v.start,o=v.end,o===void 0&&(o=l),"selectionStart"in p)p.selectionStart=l,p.selectionEnd=Math.min(o,p.value.length);else if(o=(l=p.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var w=p.textContent.length,C=Math.min(v.start,w);v=v.end===void 0?C:Math.min(v.end,w),!o.extend&&C>v&&(w=v,v=C,C=w),w=wt(p,C);var R=wt(p,v);w&&R&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==R.node||o.focusOffset!==R.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),o.removeAllRanges(),C>v?(o.addRange(l),o.extend(R.node,R.offset)):(l.setEnd(R.node,R.offset),o.addRange(l)))}}for(l=[],o=p;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p=document.documentMode,lo=null,pd=null,Di=null,xa=!1;function kl(o,l,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;xa||lo==null||lo!==mt(v)||(v=lo,"selectionStart"in v&&Sl(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Di&&Re(Di,v)||(Di=v,v=oc(pd,"onSelect"),0_a||(o.current=yd[_a],yd[_a]=null,_a--)}function Mt(o,l){_a++,yd[_a]=o.current,o.current=l}var Ko={},Wn=pr(Ko),hr=pr(!1),ir=Ko;function Ia(o,l){var p=o.type.contextTypes;if(!p)return Ko;var v=o.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var w={},C;for(C in p)w[C]=l[C];return v&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=w),w}function mr(o){return o=o.childContextTypes,o!=null}function cc(){zt(hr),zt(Wn)}function hm(o,l,p){if(Wn.current!==Ko)throw Error(n(168));Mt(Wn,l),Mt(hr,p)}function mm(o,l,p){var v=o.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return p;v=v.getChildContext();for(var w in v)if(!(w in l))throw Error(n(108,Oe(o)||"Unknown",w));return M({},p,v)}function Wr(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Ko,ir=Wn.current,Mt(Wn,o),Mt(hr,hr.current),!0}function gm(o,l,p){var v=o.stateNode;if(!v)throw Error(n(169));p?(o=mm(o,l,ir),v.__reactInternalMemoizedMergedChildContext=o,zt(hr),zt(Wn),Mt(Wn,o)):zt(hr),Mt(hr,p)}var fo=null,fc=!1,bd=!1;function vm(o){fo===null?fo=[o]:fo.push(o)}function _s(o){fc=!0,vm(o)}function Wo(){if(!bd&&fo!==null){bd=!0;var o=0,l=Et;try{var p=fo;for(Et=1;o>=R,w-=R,Oi=1<<32-hi(l)+w|p<Je?($n=We,We=null):$n=We.sibling;var kt=be(ue,We,ce[Je],Ee);if(kt===null){We===null&&(We=$n);break}o&&We&&kt.alternate===null&&l(ue,We),ne=C(kt,ne,Je),Ge===null?Ve=kt:Ge.sibling=kt,Ge=kt,We=$n}if(Je===ce.length)return p(ue,We),jt&&$s(ue,Je),Ve;if(We===null){for(;JeJe?($n=We,We=null):$n=We.sibling;var rs=be(ue,We,kt.value,Ee);if(rs===null){We===null&&(We=$n);break}o&&We&&rs.alternate===null&&l(ue,We),ne=C(rs,ne,Je),Ge===null?Ve=rs:Ge.sibling=rs,Ge=rs,We=$n}if(kt.done)return p(ue,We),jt&&$s(ue,Je),Ve;if(We===null){for(;!kt.done;Je++,kt=ce.next())kt=ke(ue,kt.value,Ee),kt!==null&&(ne=C(kt,ne,Je),Ge===null?Ve=kt:Ge.sibling=kt,Ge=kt);return jt&&$s(ue,Je),Ve}for(We=v(ue,We);!kt.done;Je++,kt=ce.next())kt=Le(We,ue,Je,kt.value,Ee),kt!==null&&(o&&kt.alternate!==null&&We.delete(kt.key===null?Je:kt.key),ne=C(kt,ne,Je),Ge===null?Ve=kt:Ge.sibling=kt,Ge=kt);return o&&We.forEach(function(Ty){return l(ue,Ty)}),jt&&$s(ue,Je),Ve}function cn(ue,ne,ce,Ee){if(typeof ce=="object"&&ce!==null&&ce.type===Y&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case j:e:{for(var Ve=ce.key,Ge=ne;Ge!==null;){if(Ge.key===Ve){if(Ve=ce.type,Ve===Y){if(Ge.tag===7){p(ue,Ge.sibling),ne=w(Ge,ce.props.children),ne.return=ue,ue=ne;break e}}else if(Ge.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===J&&wm(Ve)===Ge.type){p(ue,Ge.sibling),ne=w(Ge,ce.props),ne.ref=Ml(ue,Ge,ce),ne.return=ue,ue=ne;break e}p(ue,Ge);break}else l(ue,Ge);Ge=Ge.sibling}ce.type===Y?(ne=Us(ce.props.children,ue.mode,Ee,ce.key),ne.return=ue,ue=ne):(Ee=Yc(ce.type,ce.key,ce.props,null,ue.mode,Ee),Ee.ref=Ml(ue,ne,ce),Ee.return=ue,ue=Ee)}return R(ue);case $:e:{for(Ge=ce.key;ne!==null;){if(ne.key===Ge)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){p(ue,ne.sibling),ne=w(ne,ce.children||[]),ne.return=ue,ue=ne;break e}else{p(ue,ne);break}else l(ue,ne);ne=ne.sibling}ne=lp(ce,ue.mode,Ee),ne.return=ue,ue=ne}return R(ue);case J:return Ge=ce._init,cn(ue,ne,Ge(ce._payload),Ee)}if(an(ce))return De(ue,ne,ce,Ee);if(ae(ce))return Fe(ue,ne,ce,Ee);Rs(ue,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,ne!==null&&ne.tag===6?(p(ue,ne.sibling),ne=w(ne,ce),ne.return=ue,ue=ne):(p(ue,ne),ne=ap(ce,ue.mode,Ee),ne.return=ue,ue=ne),R(ue)):p(ue,ne)}return cn}var on=wd(!0),mc=wd(!1),Dl=pr(null),Ar=null,Ho=null,Aa=null;function ho(){Aa=Ho=Ar=null}function gc(o){var l=Dl.current;zt(Dl),o._currentValue=l}function Dn(o,l,p){for(;o!==null;){var v=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,v!==null&&(v.childLanes|=l)):v!==null&&(v.childLanes&l)!==l&&(v.childLanes|=l),o===p)break;o=o.return}}function Go(o,l){Ar=o,Aa=Ho=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(sr=!0),o.firstContext=null)}function qr(o){var l=o._currentValue;if(Aa!==o)if(o={context:o,memoizedValue:l,next:null},Ho===null){if(Ar===null)throw Error(n(308));Ho=o,Ar.dependencies={lanes:0,firstContext:o}}else Ho=Ho.next=o;return l}var Ls=null;function Sd(o){Ls===null?Ls=[o]:Ls.push(o)}function vc(o,l,p,v){var w=l.interleaved;return w===null?(p.next=p,Sd(l)):(p.next=w.next,w.next=p),l.interleaved=p,mo(o,v)}function mo(o,l){o.lanes|=l;var p=o.alternate;for(p!==null&&(p.lanes|=l),p=o,o=o.return;o!==null;)o.childLanes|=l,p=o.alternate,p!==null&&(p.childLanes|=l),p=o,o=o.return;return p.tag===3?p.stateNode:null}var Yr=!1;function yc(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sm(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function go(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function Xr(o,l,p){var v=o.updateQueue;if(v===null)return null;if(v=v.shared,(bt&2)!==0){var w=v.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),v.pending=l,mo(o,p)}return w=v.interleaved,w===null?(l.next=l,Sd(v)):(l.next=w.next,w.next=l),v.interleaved=l,mo(o,p)}function bc(o,l,p){if(l=l.updateQueue,l!==null&&(l=l.shared,(p&4194240)!==0)){var v=l.lanes;v&=o.pendingLanes,p|=v,l.lanes=p,vl(o,p)}}function km(o,l){var p=o.updateQueue,v=o.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var w=null,C=null;if(p=p.firstBaseUpdate,p!==null){do{var R={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};C===null?w=C=R:C=C.next=R,p=p.next}while(p!==null);C===null?w=C=l:C=C.next=l}else w=C=l;p={baseState:v.baseState,firstBaseUpdate:w,lastBaseUpdate:C,shared:v.shared,effects:v.effects},o.updateQueue=p;return}o=p.lastBaseUpdate,o===null?p.firstBaseUpdate=l:o.next=l,p.lastBaseUpdate=l}function Ra(o,l,p,v){var w=o.updateQueue;Yr=!1;var C=w.firstBaseUpdate,R=w.lastBaseUpdate,K=w.shared.pending;if(K!==null){w.shared.pending=null;var Q=K,de=Q.next;Q.next=null,R===null?C=de:R.next=de,R=Q;var xe=o.alternate;xe!==null&&(xe=xe.updateQueue,K=xe.lastBaseUpdate,K!==R&&(K===null?xe.firstBaseUpdate=de:K.next=de,xe.lastBaseUpdate=Q))}if(C!==null){var ke=w.baseState;R=0,xe=de=Q=null,K=C;do{var be=K.lane,Le=K.eventTime;if((v&be)===be){xe!==null&&(xe=xe.next={eventTime:Le,lane:0,tag:K.tag,payload:K.payload,callback:K.callback,next:null});e:{var De=o,Fe=K;switch(be=l,Le=p,Fe.tag){case 1:if(De=Fe.payload,typeof De=="function"){ke=De.call(Le,ke,be);break e}ke=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Fe.payload,be=typeof De=="function"?De.call(Le,ke,be):De,be==null)break e;ke=M({},ke,be);break e;case 2:Yr=!0}}K.callback!==null&&K.lane!==0&&(o.flags|=64,be=w.effects,be===null?w.effects=[K]:be.push(K))}else Le={eventTime:Le,lane:be,tag:K.tag,payload:K.payload,callback:K.callback,next:null},xe===null?(de=xe=Le,Q=ke):xe=xe.next=Le,R|=be;if(K=K.next,K===null){if(K=w.shared.pending,K===null)break;be=K,K=be.next,be.next=null,w.lastBaseUpdate=be,w.shared.pending=null}}while(!0);if(xe===null&&(Q=ke),w.baseState=Q,w.firstBaseUpdate=de,w.lastBaseUpdate=xe,l=w.shared.interleaved,l!==null){w=l;do R|=w.lane,w=w.next;while(w!==l)}else C===null&&(w.shared.lanes=0);Jo|=R,o.lanes=R,o.memoizedState=ke}}function kd(o,l,p){if(o=l.effects,l.effects=null,o!==null)for(l=0;lp?p:4,o(!0);var v=Td.transition;Td.transition={};try{o(!1),l()}finally{Et=p,Td.transition=v}}function Dd(){return Qr().memoizedState}function ay(o,l,p){var v=ts(o);if(p={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null},Nd(o))or(l,p);else if(p=vc(o,l,p,v),p!==null){var w=ur();Si(p,o,v,w),vi(p,l,v)}}function Im(o,l,p){var v=ts(o),w={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if(Nd(o))or(l,w);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var R=l.lastRenderedState,K=C(R,p);if(w.hasEagerState=!0,w.eagerState=K,fe(K,R)){var Q=l.interleaved;Q===null?(w.next=w,Sd(l)):(w.next=Q.next,Q.next=w),l.interleaved=w;return}}catch{}finally{}p=vc(o,l,w,v),p!==null&&(w=ur(),Si(p,o,v,w),vi(p,l,v))}}function Nd(o){var l=o.alternate;return o===en||l!==null&&l===en}function or(o,l){zl=Ma=!0;var p=o.pending;p===null?l.next=l:(l.next=p.next,p.next=l),o.pending=l}function vi(o,l,p){if((p&4194240)!==0){var v=l.lanes;v&=o.pendingLanes,p|=v,l.lanes=p,vl(o,p)}}var Tc={readContext:qr,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},ly={readContext:qr,useCallback:function(o,l){return Ki().memoizedState=[o,l===void 0?null:l],o},useContext:qr,useEffect:Pc,useImperativeHandle:function(o,l,p){return p=p!=null?p.concat([o]):null,Bl(4194308,4,Ld.bind(null,l,o),p)},useLayoutEffect:function(o,l){return Bl(4194308,4,o,l)},useInsertionEffect:function(o,l){return Bl(4,2,o,l)},useMemo:function(o,l){var p=Ki();return l=l===void 0?null:l,o=o(),p.memoizedState=[o,l],o},useReducer:function(o,l,p){var v=Ki();return l=p!==void 0?p(l):l,v.memoizedState=v.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},v.queue=o,o=o.dispatch=ay.bind(null,en,o),[v.memoizedState,o]},useRef:function(o){var l=Ki();return o={current:o},l.memoizedState=o},useState:jl,useDebugValue:Vl,useDeferredValue:function(o){return Ki().memoizedState=o},useTransition:function(){var o=jl(!1),l=o[0];return o=_m.bind(null,o[1]),Ki().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,p){var v=en,w=Ki();if(jt){if(p===void 0)throw Error(n(407));p=p()}else{if(p=l(),In===null)throw Error(n(349));(Yo&30)!==0||Ad(v,l,p)}w.memoizedState=p;var C={value:p,getSnapshot:l};return w.queue=C,Pc(yo.bind(null,v,C,o),[o]),v.flags|=2048,Na(9,vr.bind(null,v,C,p,l),void 0,null),p},useId:function(){var o=Ki(),l=In.identifierPrefix;if(jt){var p=zi,v=Oi;p=(v&~(1<<32-hi(v)-1)).toString(32)+p,l=":"+l+"R"+p,p=Ds++,0<\/script>",o=o.removeChild(o.firstChild)):typeof v.is=="string"?o=R.createElement(p,{is:v.is}):(o=R.createElement(p),p==="select"&&(R=o,v.multiple?R.multiple=!0:v.size&&(R.size=v.size))):o=R.createElementNS(o,p),o[Ni]=l,o[Uo]=v,Fn(o,l,!1,!1),l.stateNode=o;e:{switch(R=tr(p,v),p){case"dialog":Ot("cancel",o),Ot("close",o),w=v;break;case"iframe":case"object":case"embed":Ot("load",o),w=v;break;case"video":case"audio":for(w=0;wzs&&(l.flags|=128,v=!0,Yl(C,!1),l.lanes=4194304)}else{if(!v)if(o=Ms(R),o!==null){if(l.flags|=128,v=!0,p=o.updateQueue,p!==null&&(l.updateQueue=p,l.flags|=4),Yl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!R.alternate&&!jt)return On(l),null}else 2*Ht()-C.renderingStartTime>zs&&p!==1073741824&&(l.flags|=128,v=!0,Yl(C,!1),l.lanes=4194304);C.isBackwards?(R.sibling=l.child,l.child=R):(p=C.last,p!==null?p.sibling=R:l.child=R,C.last=R)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=Ht(),l.sibling=null,p=qt.current,Mt(qt,v?p&1|2:p&1),l):(On(l),null);case 22:case 23:return op(),v=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==v&&(l.flags|=8192),v&&(l.mode&1)!==0?(Lr&1073741824)!==0&&(On(l),l.subtreeFlags&6&&(l.flags|=8192)):On(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function cy(o,l){switch(As(l),l.tag){case 1:return mr(l.type)&&cc(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return qo(),zt(hr),zt(Wn),wc(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return xc(l),null;case 13:if(zt(qt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Bi()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return zt(qt),null;case 4:return qo(),null;case 10:return gc(l.type._context),null;case 22:case 23:return op(),null;case 24:return null;default:return null}}var Nc=!1,Yt=!1,ar=typeof WeakSet=="function"?WeakSet:Set,Me=null;function Va(o,l){var p=o.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(v){tn(o,l,v)}else p.current=null}function Xl(o,l,p){try{p()}catch(v){tn(o,l,v)}}var Nm=!1;function fy(o,l){if(Il=Vu,o=$t(),Sl(o)){if("selectionStart"in o)var p={start:o.selectionStart,end:o.selectionEnd};else e:{p=(p=o.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var w=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{p.nodeType,C.nodeType}catch{p=null;break e}var R=0,K=-1,Q=-1,de=0,xe=0,ke=o,be=null;t:for(;;){for(var Le;ke!==p||w!==0&&ke.nodeType!==3||(K=R+w),ke!==C||v!==0&&ke.nodeType!==3||(Q=R+v),ke.nodeType===3&&(R+=ke.nodeValue.length),(Le=ke.firstChild)!==null;)be=ke,ke=Le;for(;;){if(ke===o)break t;if(be===p&&++de===w&&(K=R),be===C&&++xe===v&&(Q=R),(Le=ke.nextSibling)!==null)break;ke=be,be=ke.parentNode}ke=Le}p=K===-1||Q===-1?null:{start:K,end:Q}}else p=null}p=p||{start:0,end:0}}else p=null;for(Ts={focusedElem:o,selectionRange:p},Vu=!1,Me=l;Me!==null;)if(l=Me,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Me=o;else for(;Me!==null;){l=Me;try{var De=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(De!==null){var Fe=De.memoizedProps,cn=De.memoizedState,ue=l.stateNode,ne=ue.getSnapshotBeforeUpdate(l.elementType===l.type?Fe:Jr(l.type,Fe),cn);ue.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var ce=l.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ee){tn(l,l.return,Ee)}if(o=l.sibling,o!==null){o.return=l.return,Me=o;break}Me=l.return}return De=Nm,Nm=!1,De}function wo(o,l,p){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var w=v=v.next;do{if((w.tag&o)===o){var C=w.destroy;w.destroy=void 0,C!==void 0&&Xl(l,p,C)}w=w.next}while(w!==v)}}function Ql(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&o)===o){var v=p.create;p.destroy=v()}p=p.next}while(p!==l)}}function Fc(o){var l=o.ref;if(l!==null){var p=o.stateNode;switch(o.tag){case 5:o=p;break;default:o=p}typeof l=="function"?l(o):l.current=o}}function Fm(o){var l=o.alternate;l!==null&&(o.alternate=null,Fm(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Ni],delete l[Uo],delete l[lc],delete l[N],delete l[Ta])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Om(o){return o.tag===5||o.tag===3||o.tag===4}function zm(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Om(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function qd(o,l,p){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?p.nodeType===8?p.parentNode.insertBefore(o,l):p.insertBefore(o,l):(p.nodeType===8?(l=p.parentNode,l.insertBefore(o,p)):(l=p,l.appendChild(o)),p=p._reactRootContainer,p!=null||l.onclick!==null||(l.onclick=sc));else if(v!==4&&(o=o.child,o!==null))for(qd(o,l,p),o=o.sibling;o!==null;)qd(o,l,p),o=o.sibling}function Oc(o,l,p){var v=o.tag;if(v===5||v===6)o=o.stateNode,l?p.insertBefore(o,l):p.appendChild(o);else if(v!==4&&(o=o.child,o!==null))for(Oc(o,l,p),o=o.sibling;o!==null;)Oc(o,l,p),o=o.sibling}var _n=null,bi=!1;function qi(o,l,p){for(p=p.child;p!==null;)Yd(o,l,p),p=p.sibling}function Yd(o,l,p){if(Li&&typeof Li.onCommitFiberUnmount=="function")try{Li.onCommitFiberUnmount(Nu,p)}catch{}switch(p.tag){case 5:Yt||Va(p,l);case 6:var v=_n,w=bi;_n=null,qi(o,l,p),_n=v,bi=w,_n!==null&&(bi?(o=_n,p=p.stateNode,o.nodeType===8?o.parentNode.removeChild(p):o.removeChild(p)):_n.removeChild(p.stateNode));break;case 18:_n!==null&&(bi?(o=_n,p=p.stateNode,o.nodeType===8?vd(o.parentNode,p):o.nodeType===1&&vd(o,p),Tt(o)):vd(_n,p.stateNode));break;case 4:v=_n,w=bi,_n=p.stateNode.containerInfo,bi=!0,qi(o,l,p),_n=v,bi=w;break;case 0:case 11:case 14:case 15:if(!Yt&&(v=p.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){w=v=v.next;do{var C=w,R=C.destroy;C=C.tag,R!==void 0&&((C&2)!==0||(C&4)!==0)&&Xl(p,l,R),w=w.next}while(w!==v)}qi(o,l,p);break;case 1:if(!Yt&&(Va(p,l),v=p.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=p.memoizedProps,v.state=p.memoizedState,v.componentWillUnmount()}catch(K){tn(p,l,K)}qi(o,l,p);break;case 21:qi(o,l,p);break;case 22:p.mode&1?(Yt=(v=Yt)||p.memoizedState!==null,qi(o,l,p),Yt=v):qi(o,l,p);break;default:qi(o,l,p)}}function Ua(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var p=o.stateNode;p===null&&(p=o.stateNode=new ar),l.forEach(function(v){var w=yy.bind(null,o,v);p.has(v)||(p.add(v),v.then(w,w))})}}function Rr(o,l){var p=l.deletions;if(p!==null)for(var v=0;vw&&(w=R),v&=~C}if(v=w,v=Ht()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Bm(v/1960))-v,10o?16:o,es===null)var v=!1;else{if(o=es,es=null,lr=0,(bt&6)!==0)throw Error(n(331));var w=bt;for(bt|=4,Me=o.current;Me!==null;){var C=Me,R=C.child;if((Me.flags&16)!==0){var K=C.deletions;if(K!==null){for(var Q=0;QHt()-Zd?Bs(o,0):Bc|=p),br(o,l)}function Gm(o,l){l===0&&((o.mode&1)===0?l=1:(l=Fu,Fu<<=1,(Fu&130023424)===0&&(Fu=4194304)));var p=ur();o=mo(o,l),o!==null&&(gl(o,l,p),br(o,p))}function vy(o){var l=o.memoizedState,p=0;l!==null&&(p=l.retryLane),Gm(o,p)}function yy(o,l){var p=0;switch(o.tag){case 13:var v=o.stateNode,w=o.memoizedState;w!==null&&(p=w.retryLane);break;case 19:v=o.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),Gm(o,p)}var qm;qm=function(o,l,p){if(o!==null)if(o.memoizedProps!==l.pendingProps||hr.current)sr=!0;else{if((o.lanes&p)===0&&(l.flags&128)===0)return sr=!1,Mm(o,l,p);sr=(o.flags&131072)!==0}else sr=!1,jt&&(l.flags&1048576)!==0&&ym(l,pc,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;Dc(o,l),o=l.pendingProps;var w=Ia(l,Wn.current);Go(l,p),w=Ns(null,l,v,o,w,p);var C=Sc();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,mr(v)?(C=!0,Wr(l)):C=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,yc(l),w.updater=$c,l.stateNode=w,w._reactInternals=l,Od(l,v,o,p),l=Wd(null,l,v,!0,C,p)):(l.tag=0,jt&&C&&Rl(l),Nn(null,l,w,p),l=l.child),l;case 16:v=l.elementType;e:{switch(Dc(o,l),o=l.pendingProps,w=v._init,v=w(v._payload),l.type=v,w=l.tag=xy(v),o=Jr(v,o),w){case 0:l=Ud(null,l,v,o,p);break e;case 1:l=Kd(null,l,v,o,p);break e;case 11:l=Rm(null,l,v,o,p);break e;case 14:l=jd(null,l,v,Jr(v.type,o),p);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Ud(o,l,v,w,p);case 1:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Kd(o,l,v,w,p);case 3:e:{if(Lm(l),o===null)throw Error(n(387));v=l.pendingProps,C=l.memoizedState,w=C.element,Sm(o,l),Ra(l,v,null,p);var R=l.memoizedState;if(v=R.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){w=Os(Error(n(423)),l),l=Gi(o,l,v,p,w);break e}else if(v!==w){w=Os(Error(n(424)),l),l=Gi(o,l,v,p,w);break e}else for($r=Vo(l.stateNode.containerInfo.firstChild),Gn=l,jt=!0,gi=null,p=mc(l,null,v,p),l.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Bi(),v===w){l=yi(o,l,p);break e}Nn(o,l,v,p)}l=l.child}return l;case 5:return Ed(l),o===null&&gr(l),v=l.type,w=l.pendingProps,C=o!==null?o.memoizedProps:null,R=w.children,$l(v,w)?R=null:C!==null&&$l(v,C)&&(l.flags|=32),Vd(o,l),Nn(o,l,R,p),l.child;case 6:return o===null&&gr(l),null;case 13:return Mc(o,l,p);case 4:return Cd(l,l.stateNode.containerInfo),v=l.pendingProps,o===null?l.child=on(l,null,v,p):Nn(o,l,v,p),l.child;case 11:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Rm(o,l,v,w,p);case 7:return Nn(o,l,l.pendingProps,p),l.child;case 8:return Nn(o,l,l.pendingProps.children,p),l.child;case 12:return Nn(o,l,l.pendingProps.children,p),l.child;case 10:e:{if(v=l.type._context,w=l.pendingProps,C=l.memoizedProps,R=w.value,Mt(Dl,v._currentValue),v._currentValue=R,C!==null)if(fe(C.value,R)){if(C.children===w.children&&!hr.current){l=yi(o,l,p);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var K=C.dependencies;if(K!==null){R=C.child;for(var Q=K.firstContext;Q!==null;){if(Q.context===v){if(C.tag===1){Q=go(-1,p&-p),Q.tag=2;var de=C.updateQueue;if(de!==null){de=de.shared;var xe=de.pending;xe===null?Q.next=Q:(Q.next=xe.next,xe.next=Q),de.pending=Q}}C.lanes|=p,Q=C.alternate,Q!==null&&(Q.lanes|=p),Dn(C.return,p,l),K.lanes|=p;break}Q=Q.next}}else if(C.tag===10)R=C.type===l.type?null:C.child;else if(C.tag===18){if(R=C.return,R===null)throw Error(n(341));R.lanes|=p,K=R.alternate,K!==null&&(K.lanes|=p),Dn(R,p,l),R=C.sibling}else R=C.child;if(R!==null)R.return=C;else for(R=C;R!==null;){if(R===l){R=null;break}if(C=R.sibling,C!==null){C.return=R.return,R=C;break}R=R.return}C=R}Nn(o,l,w.children,p),l=l.child}return l;case 9:return w=l.type,v=l.pendingProps.children,Go(l,p),w=qr(w),v=v(w),l.flags|=1,Nn(o,l,v,p),l.child;case 14:return v=l.type,w=Jr(v,l.pendingProps),w=Jr(v.type,w),jd(o,l,v,w,p);case 15:return Hi(o,l,l.type,l.pendingProps,p);case 17:return v=l.type,w=l.pendingProps,w=l.elementType===v?w:Jr(v,w),Dc(o,l),l.tag=1,mr(v)?(o=!0,Wr(l)):o=!1,Go(l,p),Fs(l,v,w),Od(l,v,w,p),Wd(null,l,v,!0,o,p);case 19:return Xo(o,l,p);case 22:return Bd(o,l,p)}throw Error(n(156,l.tag))};function Ym(o,l){return Lh(o,l)}function by(o,l,p,v){this.tag=o,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(o,l,p,v){return new by(o,l,p,v)}function qc(o){return o=o.prototype,!(!o||!o.isReactComponent)}function xy(o){if(typeof o=="function")return qc(o)?1:0;if(o!=null){if(o=o.$$typeof,o===G)return 11;if(o===le)return 14}return 2}function ki(o,l){var p=o.alternate;return p===null?(p=ei(o.tag,l,o.key,o.mode),p.elementType=o.elementType,p.type=o.type,p.stateNode=o.stateNode,p.alternate=o,o.alternate=p):(p.pendingProps=l,p.type=o.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=o.flags&14680064,p.childLanes=o.childLanes,p.lanes=o.lanes,p.child=o.child,p.memoizedProps=o.memoizedProps,p.memoizedState=o.memoizedState,p.updateQueue=o.updateQueue,l=o.dependencies,p.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},p.sibling=o.sibling,p.index=o.index,p.ref=o.ref,p}function Yc(o,l,p,v,w,C){var R=2;if(v=o,typeof o=="function")qc(o)&&(R=1);else if(typeof o=="string")R=5;else e:switch(o){case Y:return Us(p.children,w,C,l);case te:R=8,w|=8;break;case ie:return o=ei(12,p,l,w|2),o.elementType=ie,o.lanes=C,o;case ee:return o=ei(13,p,l,w),o.elementType=ee,o.lanes=C,o;case H:return o=ei(19,p,l,w),o.elementType=H,o.lanes=C,o;case X:return Xc(p,w,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case B:R=10;break e;case W:R=9;break e;case G:R=11;break e;case le:R=14;break e;case J:R=16,v=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ei(R,p,l,w),l.elementType=o,l.type=v,l.lanes=C,l}function Us(o,l,p,v){return o=ei(7,o,v,l),o.lanes=p,o}function Xc(o,l,p,v){return o=ei(22,o,v,l),o.elementType=X,o.lanes=p,o.stateNode={isHidden:!1},o}function ap(o,l,p){return o=ei(6,o,null,l),o.lanes=p,o}function lp(o,l,p){return l=ei(4,o.children!==null?o.children:[],o.key,l),l.lanes=p,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function wy(o,l,p,v,w){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ml(0),this.expirationTimes=ml(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ml(0),this.identifierPrefix=v,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function up(o,l,p,v,w,C,R,K,Q){return o=new wy(o,l,p,K,Q),l===1?(l=1,C===!0&&(l|=8)):l=0,C=ei(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:v,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},yc(C),o}function Sy(o,l,p){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),By.exports=lL(),By.exports}var f1;function uL(){if(f1)return og;f1=1;var e=pE();return og.createRoot=e.createRoot,og.hydrateRoot=e.hydrateRoot,og}var cL=uL();function pv(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=S.createContext(void 0);i.displayName=r;function s(){var a;const c=S.useContext(i);if(!c&&t){const d=new Error(n);throw d.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,d,s),d}return c}return[i.Provider,s,i]}function fL(e){return{UNSAFE_getDOMNode(){return e.current}}}function Ii(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current),t}function ox(e){return Array.isArray(e)}function dL(e){return ox(e)&&e.length===0}function sx(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!ox(e)}function pL(e){return sx(e)&&Object.keys(e).length===0}function hL(e){return ox(e)?dL(e):sx(e)?pL(e):e==null||e===""}function mL(e){return typeof e=="function"}var Ae=e=>e?"true":void 0;function hE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tsx(e)?e instanceof Array?[...e]:e[t]:e,mE=(...e)=>{let t=" ";for(const n of e)if(typeof n=="string"&&n.length>0){t=n;break}return t},gL=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"";function d1(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function vL(e){return`${e}-${Math.floor(Math.random()*1e6)}`}function BG(e){for(const t in e)t.startsWith("on")&&delete e[t];return e}function ds(e){if(!e||typeof e!="object")return"";try{return JSON.stringify(e)}catch{return""}}function yL(e,t,n){return Math.min(Math.max(e,t),n)}function bL(e,t=100){return Math.min(Math.max(e,0),t)}var p1={};function xL(e,t,...n){const i=`[Hero UI] : ${e}`;typeof console>"u"||p1[i]||(p1[i]=!0)}function el(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}var h1=new Map;function wL(e,t){if(e===t)return e;let n=h1.get(e);if(n)return n.forEach(i=>i.current=t),t;let r=h1.get(t);return r?(r.forEach(i=>i.current=e),e):t}function nn(...e){let t={...e[0]};for(let n=1;n=65&&i.charCodeAt(2)<=90?t[i]=el(s,a):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof a=="string"?t[i]=Bt(s,a):i==="id"&&s&&a?t.id=wL(s,a):t[i]=a!==void 0?a:s}}return t}function gE(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1;const r=e.map(i=>{const s=m1(i,t);return n||(n=typeof s=="function"),s});if(n)return()=>{r.forEach((i,s)=>{typeof i=="function"?i?.():m1(e[s],null)})}}}function m1(e,t){if(typeof e=="function")return()=>e(t);e!=null&&"current"in e&&(e.current=t)}function SL(e,t){if(e!=null){if(mL(e)){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function vE(...e){return t=>{e.forEach(n=>SL(n,t))}}function kL(){const e=()=>()=>{};return S.useSyncExternalStore(e,()=>!0,()=>!1)}var CL=new Set(["id","type","style","title","role","tabIndex","htmlFor","width","height","abbr","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","challenge","charset","checked","cite","class","className","cols","colSpan","command","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","disabled","download","draggable","dropzone","encType","enterKeyHint","for","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","hidden","high","href","hrefLang","httpEquiv","icon","inputMode","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","list","loop","manifest","max","maxLength","media","mediaGroup","method","min","minLength","multiple","muted","name","noValidate","open","optimum","pattern","ping","placeholder","poster","preload","radioGroup","referrerPolicy","readOnly","rel","required","rows","rowSpan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","slot","sortable","span","spellCheck","src","srcDoc","srcSet","start","step","target","translate","typeMustMatch","useMap","value","wmode","wrap"]),EL=new Set(["onCopy","onCut","onPaste","onLoad","onError","onWheel","onScroll","onCompositionEnd","onCompositionStart","onCompositionUpdate","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onSubmit","onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPointerDown","onPointerEnter","onPointerLeave","onPointerUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd"]),g1=/^(data-.*)$/,PL=/^(aria-.*)$/,sg=/^(on[A-Z].*)$/;function Ef(e,t={}){let{labelable:n=!0,enabled:r=!0,propNames:i,omitPropNames:s,omitEventNames:a,omitDataProps:c,omitEventProps:d}=t,h={};if(!r)return e;for(const m in e)s?.has(m)||a?.has(m)&&sg.test(m)||sg.test(m)&&!EL.has(m)||c&&g1.test(m)||d&&sg.test(m)||(Object.prototype.hasOwnProperty.call(e,m)&&(CL.has(m)||n&&PL.test(m)||i?.has(m)||g1.test(m))||sg.test(m))&&(h[m]=e[m]);return h}var[TL,ci]=pv({name:"ProviderContext",strict:!1});const _L=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),IL=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function yE(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return _L.has(n.script)}let t=e.split("-")[0];return IL.has(t)}const bE={prefix:String(Math.round(Math.random()*1e10)),current:0},xE=He.createContext(bE),$L=He.createContext(!1);let Ky=new WeakMap;function AL(e=!1){let t=S.useContext(xE),n=S.useRef(null);if(n.current===null&&!e){var r,i;let s=(i=He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(s){let a=Ky.get(s);a==null?Ky.set(s,{id:t.current,state:s.memoizedState}):s.memoizedState!==a.state&&(t.current=a.id,Ky.delete(s))}n.current=++t.current}return n.current}function RL(e){let t=S.useContext(xE),n=AL(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function LL(e){let t=He.useId(),[n]=S.useState(ph()),r=n?"react-aria":`react-aria${bE.prefix}`;return e||`${r}-${t}`}const ML=typeof He.useId=="function"?LL:RL;function DL(){return!1}function NL(){return!0}function FL(e){return()=>{}}function ph(){return typeof He.useSyncExternalStore=="function"?He.useSyncExternalStore(FL,DL,NL):S.useContext($L)}const OL=Symbol.for("react-aria.i18n.locale");function wE(){let e=typeof window<"u"&&window[OL]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yE(e)?"rtl":"ltr"}}let K0=wE(),_p=new Set;function v1(){K0=wE();for(let e of _p)e(K0)}function SE(){let e=ph(),[t,n]=S.useState(K0);return S.useEffect(()=>(_p.size===0&&window.addEventListener("languagechange",v1),_p.add(n),()=>{_p.delete(n),_p.size===0&&window.removeEventListener("languagechange",v1)}),[]),e?{locale:"en-US",direction:"ltr"}:t}const kE=He.createContext(null);function zL(e){let{locale:t,children:n}=e,r=SE(),i=He.useMemo(()=>t?{locale:t,direction:yE(t)?"rtl":"ltr"}:r,[r,t]);return He.createElement(kE.Provider,{value:i},n)}function hh(){let e=SE();return S.useContext(kE)||e}const jL=Symbol.for("react-aria.i18n.locale"),BL=Symbol.for("react-aria.i18n.strings");let of;class hv{getStringForLocale(t,n){let i=this.getStringsForLocale(n)[t];if(!i)throw new Error(`Could not find intl message ${t} in ${n} locale`);return i}getStringsForLocale(t){let n=this.strings[t];return n||(n=VL(t,this.strings,this.defaultLocale),this.strings[t]=n),n}static getGlobalDictionaryForPackage(t){if(typeof window>"u")return null;let n=window[jL];if(of===void 0){let i=window[BL];if(!i)return null;of={};for(let s in i)of[s]=new hv({[n]:i[s]},n)}let r=of?.[t];if(!r)throw new Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(t,n="en-US"){this.strings=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n}}function VL(e,t,n="en-US"){if(t[e])return t[e];let r=UL(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}function UL(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const y1=new Map,b1=new Map;class KL{format(t,n){let r=this.strings.getStringForLocale(t,this.locale);return typeof r=="function"?r(n,this):r}plural(t,n,r="cardinal"){let i=n["="+t];if(i)return typeof i=="function"?i():i;let s=this.locale+":"+r,a=y1.get(s);a||(a=new Intl.PluralRules(this.locale,{type:r}),y1.set(s,a));let c=a.select(t);return i=n[c]||n.other,typeof i=="function"?i():i}number(t){let n=b1.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),b1.set(this.locale,n)),n.format(t)}select(t,n){let r=t[n]||t.other;return typeof r=="function"?r():r}constructor(t,n){this.locale=t,this.strings=n}}const x1=new WeakMap;function WL(e){let t=x1.get(e);return t||(t=new hv(e),x1.set(e,t)),t}function HL(e,t){return t&&hv.getGlobalDictionaryForPackage(t)||WL(e)}function GL(e,t){let{locale:n}=hh(),r=HL(e,t);return S.useMemo(()=>new KL(n,r),[n,r])}function qL(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YL(e,t,n){qL(e,t),t.set(e,n)}const sn=typeof document<"u"?He.useLayoutEffect:()=>{};function jn(e){const t=S.useRef(null);return sn(()=>{t.current=e},[e]),S.useCallback((...n)=>{const r=t.current;return r?.(...n)},[])}function XL(e){let[t,n]=S.useState(e),r=S.useRef(null),i=jn(()=>{if(!r.current)return;let a=r.current.next();if(a.done){r.current=null;return}t===a.value?i():n(a.value)});sn(()=>{r.current&&i()});let s=jn(a=>{r.current=a(t),i()});return[t,s]}let QL=!!(typeof window<"u"&&window.document&&window.document.createElement),bf=new Map,Ip;typeof FinalizationRegistry<"u"&&(Ip=new FinalizationRegistry(e=>{bf.delete(e)}));function Pf(e){let[t,n]=S.useState(e),r=S.useRef(null),i=ML(t),s=S.useRef(null);if(Ip&&Ip.register(s,i),QL){const a=bf.get(i);a&&!a.includes(r)?a.push(r):bf.set(i,[r])}return sn(()=>{let a=i;return()=>{Ip&&Ip.unregister(s),bf.delete(a)}},[i]),S.useEffect(()=>{let a=r.current;return a&&n(a),()=>{a&&(r.current=null)}}),i}function JL(e,t){if(e===t)return e;let n=bf.get(e);if(n)return n.forEach(i=>i.current=t),t;let r=bf.get(t);return r?(r.forEach(i=>i.current=e),e):t}function W0(e=[]){let t=Pf(),[n,r]=XL(t),i=S.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return sn(i,[t,i,...e]),n}function Tf(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Dt=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},to=e=>e&&"window"in e&&e.window===e?e:Dt(e).defaultView||window;function ZL(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function eM(e){return ZL(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let tM=!1,nM=!1;function VG(){return tM}function mv(){return nM}function ai(e,t){if(!mv())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:eM(n)?n=n.host:n=n.parentNode}return!1}const zr=(e=document)=>{var t;if(!mv())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function En(e){return mv()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}class rM{get currentNode(){return this._currentNode}set currentNode(t){if(!ai(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let r=t,i=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const a=r,c=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});n.push(c),c.currentNode=i,this._currentSetFor.add(c),r=i=a.host}else r=r.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=i,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return ai(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){var n;let i;if(typeof this.filter=="function"?i=this.filter(t):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(i=this.filter.acceptNode(t)),i===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let s=this.nextNode();return s&&(this.currentNode=s),s}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let i=this.previousNode();return i&&(this.currentNode=i),i}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){var r;let s;if(typeof this.filter=="function"?s=this.filter(n):!((r=this.filter)===null||r===void 0)&&r.acceptNode&&(s=this.filter.acceptNode(n)),s===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let a=this.lastChild();return a&&(this.currentNode=a),a}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let i=this.previousNode();return i&&(this.currentNode=i),i}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(t,n,r,i){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=a=>{if(a.nodeType===Node.ELEMENT_NODE){const d=a.shadowRoot;if(d){const h=this._doc.createTreeWalker(d,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(h),NodeFilter.FILTER_ACCEPT}else{var c;if(typeof this.filter=="function")return this.filter(a);if(!((c=this.filter)===null||c===void 0)&&c.acceptNode)return this.filter.acceptNode(a);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=i??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,r,this._acceptNode));const s=n.shadowRoot;if(s){const a=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(a)}}}function iM(e,t,n,r){return mv()?new rM(e,t,n,r):e.createTreeWalker(t,n,r)}function CE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t=65&&i.charCodeAt(2)<=90?t[i]=Tf(s,a):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof a=="string"?t[i]=oM(s,a):i==="id"&&s&&a?t.id=JL(s,a):t[i]=a!==void 0?a:s}}return t}const sM=new Set(["id"]),aM=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),lM=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),uM=/^(data-.*)$/;function $u(e,t={}){let{labelable:n,isLink:r,propNames:i}=t,s={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(sM.has(a)||n&&aM.has(a)||r&&lM.has(a)||i?.has(a)||uM.test(a))&&(s[a]=e[a]);return s}function tl(e){if(cM())e.focus({preventScroll:!0});else{let t=fM(e);e.focus(),dM(t)}}let ag=null;function cM(){if(ag==null){ag=!1;try{document.createElement("div").focus({get preventScroll(){return ag=!0,!0}})}catch{}}return ag}function fM(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function ax(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ia(e){let t=null;return()=>(t==null&&(t=e()),t)}const wu=ia(function(){return ax(/^Mac/i)}),pM=ia(function(){return ax(/^iPhone/i)}),EE=ia(function(){return ax(/^iPad/i)||wu()&&navigator.maxTouchPoints>1}),vv=ia(function(){return pM()||EE()}),hM=ia(function(){return wu()||vv()}),PE=ia(function(){return gv(/AppleWebKit/i)&&!TE()}),TE=ia(function(){return gv(/Chrome/i)}),lx=ia(function(){return gv(/Android/i)}),mM=ia(function(){return gv(/Firefox/i)}),_E=S.createContext({isNative:!0,open:yM,useHref:e=>e});function gM(e){let{children:t,navigate:n,useHref:r}=e,i=S.useMemo(()=>({isNative:!1,open:(s,a,c,d)=>{IE(s,h=>{vM(h,a)?n(c,d):Su(h,a)})},useHref:r||(s=>s)}),[n,r]);return He.createElement(_E.Provider,{value:i},t)}function ux(){return S.useContext(_E)}function vM(e,t){let n=e.getAttribute("target");return(!n||n==="_self")&&e.origin===location.origin&&!e.hasAttribute("download")&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey}function Su(e,t,n=!0){var r,i;let{metaKey:s,ctrlKey:a,altKey:c,shiftKey:d}=t;mM()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(wu()?s=!0:a=!0);let h=PE()&&wu()&&!EE()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:a,altKey:c,shiftKey:d}):new MouseEvent("click",{metaKey:s,ctrlKey:a,altKey:c,shiftKey:d,bubbles:!0,cancelable:!0});Su.isOpening=n,tl(e),e.dispatchEvent(h),Su.isOpening=!1}Su.isOpening=!1;function IE(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function yM(e,t){IE(e,n=>Su(n,t))}function UG(e){let t=ux();var n;const r=t.useHref((n=e.href)!==null&&n!==void 0?n:"");return{"data-href":e.href?r:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}function KG(e){let t=ux();var n;const r=t.useHref((n=e?.href)!==null&&n!==void 0?n:"");return{href:e?.href?r:void 0,target:e?.target,rel:e?.rel,download:e?.download,ping:e?.ping,referrerPolicy:e?.referrerPolicy}}let Xa=new Map,H0=new Set;function w1(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=Xa.get(r.target);i||(i=new Set,Xa.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=Xa.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),Xa.delete(r.target)),Xa.size===0)){for(let s of H0)s();H0.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?w1():document.addEventListener("DOMContentLoaded",w1));function bM(){for(const[e]of Xa)"isConnected"in e&&!e.isConnected&&Xa.delete(e)}function $E(e){requestAnimationFrame(()=>{bM(),Xa.size===0?e():H0.add(e)})}function cx(){let e=S.useRef(new Map),t=S.useCallback((i,s,a,c)=>{let d=c?.once?(...h)=>{e.current.delete(a),a(...h)}:a;e.current.set(a,{type:s,eventTarget:i,fn:d,options:c}),i.addEventListener(s,d,c)},[]),n=S.useCallback((i,s,a,c)=>{var d;let h=((d=e.current.get(a))===null||d===void 0?void 0:d.fn)||a;i.removeEventListener(s,h,c),e.current.delete(a)},[]),r=S.useCallback(()=>{e.current.forEach((i,s)=>{n(i.eventTarget,i.type,s,i.options)})},[n]);return S.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function AE(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=Pf(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function S1(e,t){const n=S.useRef(!0),r=S.useRef(null);sn(()=>(n.current=!0,()=>{n.current=!1}),[]),sn(()=>{n.current?n.current=!1:(!r.current||t.some((i,s)=>!Object.is(i,r[s])))&&e(),r.current=t},t)}function xM(){return typeof window.ResizeObserver<"u"}function k1(e){const{ref:t,box:n,onResize:r}=e;S.useEffect(()=>{let i=t?.current;if(i)if(xM()){const s=new window.ResizeObserver(a=>{a.length&&r()});return s.observe(i,{box:n}),()=>{i&&s.unobserve(i)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[r,t,n])}function RE(e,t){sn(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function qp(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function LE(e,t){let n=e;for(qp(n,t)&&(n=n.parentElement);n&&!qp(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function wM(e,t){const n=[];for(;e&&e!==document.documentElement;)qp(e,t)&&n.push(e),e=e.parentElement;return n}function lg(e,t,n,r){let i=jn(n),s=n==null;S.useEffect(()=>{if(s||!e.current)return;let a=e.current;return a.addEventListener(t,i,r),()=>{a.removeEventListener(t,i,r)}},[e,t,r,s,i])}function ME(e,t){let n=C1(e,t,"left"),r=C1(e,t,"top"),i=t.offsetWidth,s=t.offsetHeight,a=e.scrollLeft,c=e.scrollTop,{borderTopWidth:d,borderLeftWidth:h,scrollPaddingTop:m,scrollPaddingRight:g,scrollPaddingBottom:b,scrollPaddingLeft:x}=getComputedStyle(e),k=a+parseInt(h,10),P=c+parseInt(d,10),T=k+e.clientWidth,_=P+e.clientHeight,A=parseInt(m,10)||0,L=parseInt(b,10)||0,O=parseInt(g,10)||0,j=parseInt(x,10)||0;n<=a+j?a=n-parseInt(h,10)-j:n+i>T-O&&(a+=n+i-T+O),r<=P+A?c=r-parseInt(d,10)-A:r+s>_-L&&(c+=r+s-_+L),e.scrollLeft=a,e.scrollTop=c}function C1(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function E1(e,t){if(e&&document.contains(e)){let a=document.scrollingElement||document.documentElement;if(window.getComputedStyle(a).overflow==="hidden"){let d=wM(e);for(let h of d)ME(h,e)}else{var n;let{left:d,top:h}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:m,top:g}=e.getBoundingClientRect();if(Math.abs(d-m)>1||Math.abs(h-g)>1){var r,i,s;t==null||(i=t.containingElement)===null||i===void 0||(r=i.scrollIntoView)===null||r===void 0||r.call(i,{block:"center",inline:"center"}),(s=e.scrollIntoView)===null||s===void 0||s.call(e,{block:"nearest"})}}}}function DE(e){return e.mozInputSource===0&&e.isTrusted?!0:lx()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function SM(e){return!lx()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}function NE(e,t,n){let r=S.useRef(t),i=jn(()=>{n&&n(r.current)});S.useEffect(()=>{var s;let a=e==null||(s=e.current)===null||s===void 0?void 0:s.form;return a?.addEventListener("reset",i),()=>{a?.removeEventListener("reset",i)}},[e,i])}const kM="react-aria-clear-focus",CM="react-aria-focus";function hp(e){return wu()?e.metaKey:e.ctrlKey}var FE=pE();const OE=dv(FE),fx=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],EM=fx.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";fx.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const PM=fx.join(':not([hidden]):not([tabindex="-1"]),');function zE(e){return e.matches(EM)}function TM(e){return e.matches(PM)}function Au(e,t,n){let[r,i]=S.useState(e||t),s=S.useRef(e!==void 0),a=e!==void 0;S.useEffect(()=>{s.current,s.current=a},[a]);let c=a?e:r,d=S.useCallback((h,...m)=>{let g=(b,...x)=>{n&&(Object.is(c,b)||n(b,...x)),a||(c=b)};typeof h=="function"?i((x,...k)=>{let P=h(a?c:x,...k);return g(P,...m),a?x:P}):(a||i(h),g(h,...m))},[a,c,n]);return[c,d]}function Bg(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}let Wy=new Map,G0=!1;try{G0=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Vg=!1;try{Vg=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const jE={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class _M{format(t){let n="";if(!G0&&this.options.signDisplay!=null?n=$M(this.numberFormatter,this.options.signDisplay,t):n=this.numberFormatter.format(t),this.options.style==="unit"&&!Vg){var r;let{unit:i,unitDisplay:s="short",locale:a}=this.resolvedOptions();if(!i)return n;let c=(r=jE[i])===null||r===void 0?void 0:r[s];n+=c[a]||c.default}return n}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,n);if(n= start date");return`${this.format(t)} – ${this.format(n)}`}formatRangeToParts(t,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,n);if(n= start date");let r=this.numberFormatter.formatToParts(t),i=this.numberFormatter.formatToParts(n);return[...r.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!G0&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!Vg&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,n={}){this.numberFormatter=IM(t,n),this.options=n}}function IM(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${n}`),t.style==="unit"&&!Vg){var r;let{unit:a,unitDisplay:c="short"}=t;if(!a)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=jE[a])===null||r===void 0)&&r[c]))throw new Error(`Unsupported unit ${a} with unitDisplay = ${c}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((a,c)=>a[0]0||Object.is(n,0):t==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let i=e.format(-n),s=e.format(n),a=i.replace(s,"").replace(/\u200e|\u061C/,"");return[...a].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(s,"!!!").replace(a,"+").replace("!!!",s)}else return e.format(n)}}function AM(e={}){let{locale:t}=hh();return S.useMemo(()=>new _M(t,e),[t,e])}let Hy=new Map;function RM(e){let{locale:t}=hh(),n=t+(e?Object.entries(e).sort((i,s)=>i[0]-1&&e.splice(n,1)}const ta=(e,t,n)=>n>t?t:n{};const fs={},BE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function VE(e){return typeof e=="object"&&e!==null}const UE=e=>/^0[^.\s]+$/u.test(e);function vx(e){let t;return()=>(t===void 0&&(t=e()),t)}const no=e=>e,LM=(e,t)=>n=>t(e(n)),gh=(...e)=>e.reduce(LM),Xp=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class yx{constructor(){this.subscriptions=[]}add(t){return hx(this.subscriptions,t),()=>mx(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;se*1e3,us=e=>e/1e3;function KE(e,t){return t?e*(1e3/t):0}const WE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,MM=1e-7,DM=12;function NM(e,t,n,r,i){let s,a,c=0;do a=t+(n-t)/2,s=WE(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>MM&&++cNM(s,0,1,e,n);return s=>s===0||s===1?s:WE(i(s),t,r)}const HE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,GE=e=>t=>1-e(1-t),qE=vh(.33,1.53,.69,.99),bx=GE(qE),YE=HE(bx),XE=e=>(e*=2)<1?.5*bx(e):.5*(2-Math.pow(2,-10*(e-1))),xx=e=>1-Math.sin(Math.acos(e)),QE=GE(xx),JE=HE(xx),FM=vh(.42,0,1,1),OM=vh(0,0,.58,1),ZE=vh(.42,0,.58,1),zM=e=>Array.isArray(e)&&typeof e[0]!="number",eP=e=>Array.isArray(e)&&typeof e[0]=="number",jM={linear:no,easeIn:FM,easeInOut:ZE,easeOut:OM,circIn:xx,circInOut:JE,circOut:QE,backIn:bx,backInOut:YE,backOut:qE,anticipate:XE},BM=e=>typeof e=="string",P1=e=>{if(eP(e)){gx(e.length===4);const[t,n,r,i]=e;return vh(t,n,r,i)}else if(BM(e))return jM[e];return e},ug=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function VM(e,t){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function d(m){a.has(m)&&(h.schedule(m),e()),m(c)}const h={schedule:(m,g=!1,b=!1)=>{const k=b&&i?n:r;return g&&a.add(m),k.has(m)||k.add(m),m},cancel:m=>{r.delete(m),a.delete(m)},process:m=>{if(c=m,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(d),n.clear(),i=!1,s&&(s=!1,h.process(m))}};return h}const UM=40;function tP(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=ug.reduce((L,O)=>(L[O]=VM(s),L),{}),{setup:c,read:d,resolveKeyframes:h,preUpdate:m,update:g,preRender:b,render:x,postRender:k}=a,P=()=>{const L=fs.useManualTiming?i.timestamp:performance.now();n=!1,fs.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(L-i.timestamp,UM),1)),i.timestamp=L,i.isProcessing=!0,c.process(i),d.process(i),h.process(i),m.process(i),g.process(i),b.process(i),x.process(i),k.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(P))},T=()=>{n=!0,r=!0,i.isProcessing||e(P)};return{schedule:ug.reduce((L,O)=>{const j=a[O];return L[O]=($,Y=!1,te=!1)=>(n||T(),j.schedule($,Y,te)),L},{}),cancel:L=>{for(let O=0;O(Ig===void 0&&li.set(fr.isProcessing||fs.useManualTiming?fr.timestamp:performance.now()),Ig),set:e=>{Ig=e,queueMicrotask(KM)}},nP=e=>t=>typeof t=="string"&&t.startsWith(e),wx=nP("--"),WM=nP("var(--"),Sx=e=>WM(e)?HM.test(e.split("/*")[0].trim()):!1,HM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Nf={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Qp={...Nf,transform:e=>ta(0,1,e)},cg={...Nf,default:1},Dp=e=>Math.round(e*1e5)/1e5,kx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GM(e){return e==null}const qM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Cx=(e,t)=>n=>!!(typeof n=="string"&&qM.test(n)&&n.startsWith(e)||t&&!GM(n)&&Object.prototype.hasOwnProperty.call(n,t)),rP=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,c]=r.match(kx);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},YM=e=>ta(0,255,e),qy={...Nf,transform:e=>Math.round(YM(e))},mu={test:Cx("rgb","red"),parse:rP("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+qy.transform(e)+", "+qy.transform(t)+", "+qy.transform(n)+", "+Dp(Qp.transform(r))+")"};function XM(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const q0={test:Cx("#"),parse:XM,transform:mu.transform},yh=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ya=yh("deg"),cs=yh("%"),tt=yh("px"),QM=yh("vh"),JM=yh("vw"),T1={...cs,parse:e=>cs.parse(e)/100,transform:e=>cs.transform(e*100)},pf={test:Cx("hsl","hue"),parse:rP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+cs.transform(Dp(t))+", "+cs.transform(Dp(n))+", "+Dp(Qp.transform(r))+")"},Rn={test:e=>mu.test(e)||q0.test(e)||pf.test(e),parse:e=>mu.test(e)?mu.parse(e):pf.test(e)?pf.parse(e):q0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?mu.transform(e):pf.transform(e),getAnimatableNone:e=>{const t=Rn.parse(e);return t.alpha=0,Rn.transform(t)}},ZM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function eD(e){return isNaN(e)&&typeof e=="string"&&(e.match(kx)?.length||0)+(e.match(ZM)?.length||0)>0}const iP="number",oP="color",tD="var",nD="var(",_1="${}",rD=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Jp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const c=t.replace(rD,d=>(Rn.test(d)?(r.color.push(s),i.push(oP),n.push(Rn.parse(d))):d.startsWith(nD)?(r.var.push(s),i.push(tD),n.push(d)):(r.number.push(s),i.push(iP),n.push(parseFloat(d))),++s,_1)).split(_1);return{values:n,split:c,indexes:r,types:i}}function sP(e){return Jp(e).values}function aP(e){const{split:t,types:n}=Jp(e),r=t.length;return i=>{let s="";for(let a=0;atypeof e=="number"?0:Rn.test(e)?Rn.getAnimatableNone(e):e;function oD(e){const t=sP(e);return aP(e)(t.map(iD))}const rl={test:eD,parse:sP,createTransformer:aP,getAnimatableNone:oD};function Yy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function sD({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;i=Yy(d,c,e+1/3),s=Yy(d,c,e),a=Yy(d,c,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function Ug(e,t){return n=>n>0?t:e}const dn=(e,t,n)=>e+(t-e)*n,Xy=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},aD=[q0,mu,pf],lD=e=>aD.find(t=>t.test(e));function I1(e){const t=lD(e);if(!t)return!1;let n=t.parse(e);return t===pf&&(n=sD(n)),n}const $1=(e,t)=>{const n=I1(e),r=I1(t);if(!n||!r)return Ug(e,t);const i={...n};return s=>(i.red=Xy(n.red,r.red,s),i.green=Xy(n.green,r.green,s),i.blue=Xy(n.blue,r.blue,s),i.alpha=dn(n.alpha,r.alpha,s),mu.transform(i))},Y0=new Set(["none","hidden"]);function uD(e,t){return Y0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function cD(e,t){return n=>dn(e,t,n)}function Ex(e){return typeof e=="number"?cD:typeof e=="string"?Sx(e)?Ug:Rn.test(e)?$1:pD:Array.isArray(e)?lP:typeof e=="object"?Rn.test(e)?$1:fD:Ug}function lP(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>Ex(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in r)n[s]=r[s](i);return n}}function dD(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i{const n=rl.createTransformer(t),r=Jp(e),i=Jp(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Y0.has(e)&&!i.values.length||Y0.has(t)&&!r.values.length?uD(e,t):gh(lP(dD(r,i),i.values),n):Ug(e,t)};function uP(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?dn(e,t,n):Ex(e)(e,t)}const hD=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>rn.update(t,n),stop:()=>nl(t),now:()=>fr.isProcessing?fr.timestamp:li.now()}},cP=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s=Kg?1/0:t}function mD(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Px(r),Kg);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:us(i)}}const gD=5;function fP(e,t,n){const r=Math.max(t-gD,0);return KE(n-e(r),t-r)}const vn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Qy=.001;function vD({duration:e=vn.duration,bounce:t=vn.bounce,velocity:n=vn.velocity,mass:r=vn.mass}){let i,s,a=1-t;a=ta(vn.minDamping,vn.maxDamping,a),e=ta(vn.minDuration,vn.maxDuration,us(e)),a<1?(i=h=>{const m=h*a,g=m*e,b=m-n,x=X0(h,a),k=Math.exp(-g);return Qy-b/x*k},s=h=>{const g=h*a*e,b=g*n+n,x=Math.pow(a,2)*Math.pow(h,2)*e,k=Math.exp(-g),P=X0(Math.pow(h,2),a);return(-i(h)+Qy>0?-1:1)*((b-x)*k)/P}):(i=h=>{const m=Math.exp(-h*e),g=(h-n)*e+1;return-Qy+m*g},s=h=>{const m=Math.exp(-h*e),g=(n-h)*(e*e);return m*g});const c=5/e,d=bD(i,s,c);if(e=ls(e),isNaN(d))return{stiffness:vn.stiffness,damping:vn.damping,duration:e};{const h=Math.pow(d,2)*r;return{stiffness:h,damping:a*2*Math.sqrt(r*h),duration:e}}}const yD=12;function bD(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function SD(e){let t={velocity:vn.velocity,stiffness:vn.stiffness,damping:vn.damping,mass:vn.mass,isResolvedFromDuration:!1,...e};if(!A1(e,wD)&&A1(e,xD))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*ta(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:vn.mass,stiffness:i,damping:s}}else{const n=vD(e);t={...t,...n,mass:vn.mass},t.isResolvedFromDuration=!0}return t}function Wg(e=vn.visualDuration,t=vn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:d,damping:h,mass:m,duration:g,velocity:b,isResolvedFromDuration:x}=SD({...n,velocity:-us(n.velocity||0)}),k=b||0,P=h/(2*Math.sqrt(d*m)),T=a-s,_=us(Math.sqrt(d/m)),A=Math.abs(T)<5;r||(r=A?vn.restSpeed.granular:vn.restSpeed.default),i||(i=A?vn.restDelta.granular:vn.restDelta.default);let L;if(P<1){const j=X0(_,P);L=$=>{const Y=Math.exp(-P*_*$);return a-Y*((k+P*_*T)/j*Math.sin(j*$)+T*Math.cos(j*$))}}else if(P===1)L=j=>a-Math.exp(-_*j)*(T+(k+_*T)*j);else{const j=_*Math.sqrt(P*P-1);L=$=>{const Y=Math.exp(-P*_*$),te=Math.min(j*$,300);return a-Y*((k+P*_*T)*Math.sinh(te)+j*T*Math.cosh(te))/j}}const O={calculatedDuration:x&&g||null,next:j=>{const $=L(j);if(x)c.done=j>=g;else{let Y=j===0?k:0;P<1&&(Y=j===0?ls(k):fP(L,j,$));const te=Math.abs(Y)<=r,ie=Math.abs(a-$)<=i;c.done=te&&ie}return c.value=c.done?a:$,c},toString:()=>{const j=Math.min(Px(O),Kg),$=cP(Y=>O.next(j*Y).value,j,30);return j+"ms "+$},toTransition:()=>{}};return O}Wg.applyToOptions=e=>{const t=mD(e,100,Wg);return e.ease=t.ease,e.duration=ls(t.duration),e.type="keyframes",e};function Q0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:c,max:d,restDelta:h=.5,restSpeed:m}){const g=e[0],b={done:!1,value:g},x=te=>c!==void 0&&ted,k=te=>c===void 0?d:d===void 0||Math.abs(c-te)-P*Math.exp(-te/r),L=te=>_+A(te),O=te=>{const ie=A(te),B=L(te);b.done=Math.abs(ie)<=h,b.value=b.done?_:B};let j,$;const Y=te=>{x(b.value)&&(j=te,$=Wg({keyframes:[b.value,k(b.value)],velocity:fP(L,te,b.value),damping:i,stiffness:s,restDelta:h,restSpeed:m}))};return Y(0),{calculatedDuration:null,next:te=>{let ie=!1;return!$&&j===void 0&&(ie=!0,O(te),Y(te)),j!==void 0&&te>=j?$.next(te-j):(!ie&&O(te),b)}}}function kD(e,t,n){const r=[],i=n||fs.mix||uP,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=kD(t,r,i),d=c.length,h=m=>{if(a&&m1)for(;gh(ta(e[0],e[s-1],m)):h}function ED(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Xp(0,t,r);e.push(dn(n,1,i))}}function PD(e){const t=[0];return ED(t,e.length-1),t}function TD(e,t){return e.map(n=>n*t)}function _D(e,t){return e.map(()=>t||ZE).splice(0,e.length-1)}function Np({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=zM(r)?r.map(P1):P1(r),s={done:!1,value:t[0]},a=TD(n&&n.length===t.length?n:PD(t),e),c=CD(a,t,{ease:Array.isArray(i)?i:_D(t,i)});return{calculatedDuration:e,next:d=>(s.value=c(d),s.done=d>=e,s)}}const ID=e=>e!==null;function Tx(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(ID),c=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!c||r===void 0?s[c]:r}const $D={decay:Q0,inertia:Q0,tween:Np,keyframes:Np,spring:Wg};function dP(e){typeof e.type=="string"&&(e.type=$D[e.type])}class _x{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const AD=e=>e/100;class Ix extends _x{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==li.now()&&this.tick(li.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;dP(t);const{type:n=Np,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:c}=t;const d=n||Np;d!==Np&&typeof c[0]!="number"&&(this.mixKeyframes=gh(AD,uP(c[0],c[1])),c=[0,100]);const h=d({...t,keyframes:c});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-a})),h.calculatedDuration===null&&(h.calculatedDuration=Px(h));const{calculatedDuration:m}=h;this.calculatedDuration=m,this.resolvedDuration=m+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=h}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:h=0,keyframes:m,repeat:g,repeatType:b,repeatDelay:x,type:k,onUpdate:P,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const _=this.currentTime-h*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?_<0:_>i;this.currentTime=Math.max(_,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let L=this.currentTime,O=r;if(g){const te=Math.min(this.currentTime,i)/c;let ie=Math.floor(te),B=te%1;!B&&te>=1&&(B=1),B===1&&ie--,ie=Math.min(ie,g+1),!!(ie%2)&&(b==="reverse"?(B=1-B,x&&(B-=x/c)):b==="mirror"&&(O=a)),L=ta(0,1,B)*c}const j=A?{done:!1,value:m[0]}:O.next(L);s&&(j.value=s(j.value));let{done:$}=j;!A&&d!==null&&($=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return Y&&k!==Q0&&(j.value=Tx(m,this.options,T,this.speed)),P&&P(j.value),Y&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return us(this.calculatedDuration)}get time(){return us(this.currentTime)}set time(t){t=ls(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(li.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=us(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=hD,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(li.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function RD(e){for(let t=1;te*180/Math.PI,J0=e=>{const t=gu(Math.atan2(e[1],e[0]));return Z0(t)},LD={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:J0,rotateZ:J0,skewX:e=>gu(Math.atan(e[1])),skewY:e=>gu(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Z0=e=>(e=e%360,e<0&&(e+=360),e),R1=J0,L1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),M1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),MD={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:L1,scaleY:M1,scale:e=>(L1(e)+M1(e))/2,rotateX:e=>Z0(gu(Math.atan2(e[6],e[5]))),rotateY:e=>Z0(gu(Math.atan2(-e[2],e[0]))),rotateZ:R1,rotate:R1,skewX:e=>gu(Math.atan(e[4])),skewY:e=>gu(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function eb(e){return e.includes("scale")?1:0}function tb(e,t){if(!e||e==="none")return eb(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=MD,i=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=LD,i=c}if(!i)return eb(t);const s=r[t],a=i[1].split(",").map(ND);return typeof s=="function"?s(a):a[s]}const DD=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return tb(n,t)};function ND(e){return parseFloat(e.trim())}const Ff=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ru=new Set(Ff),D1=e=>e===Nf||e===tt,FD=new Set(["x","y","z"]),OD=Ff.filter(e=>!FD.has(e));function zD(e){const t=[];return OD.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const bu={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tb(t,"x"),y:(e,{transform:t})=>tb(t,"y")};bu.translateX=bu.x;bu.translateY=bu.y;const xu=new Set;let nb=!1,rb=!1,ib=!1;function pP(){if(rb){const e=Array.from(xu).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=zD(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{r.getValue(s)?.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}rb=!1,nb=!1,xu.forEach(e=>e.complete(ib)),xu.clear()}function hP(){xu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(rb=!0)})}function jD(){ib=!0,hP(),pP(),ib=!1}class $x{constructor(t,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(xu.add(this),nb||(nb=!0,rn.read(hP),rn.resolveKeyframes(pP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i?.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const c=r.readValue(n,a);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}RD(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),xu.delete(this)}cancel(){this.state==="scheduled"&&(xu.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const BD=e=>e.startsWith("--");function VD(e,t,n){BD(t)?e.style.setProperty(t,n):e.style[t]=n}const UD=vx(()=>window.ScrollTimeline!==void 0),KD={};function WD(e,t){const n=vx(e);return()=>KD[t]??n()}const mP=WD(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$p=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,N1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$p([0,.65,.55,1]),circOut:$p([.55,0,1,.45]),backIn:$p([.31,.01,.66,-.59]),backOut:$p([.33,1.53,.69,.99])};function gP(e,t){if(e)return typeof e=="function"?mP()?cP(e,t):"ease-out":eP(e)?$p(e):Array.isArray(e)?e.map(n=>gP(n,t)||N1.easeOut):N1[e]}function HD(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:c="easeOut",times:d}={},h=void 0){const m={[t]:n};d&&(m.offset=d);const g=gP(c,i);Array.isArray(g)&&(m.easing=g);const b={delay:r,duration:i,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return h&&(b.pseudoElement=h),e.animate(m,b)}function vP(e){return typeof e=="function"&&"applyToOptions"in e}function GD({type:e,...t}){return vP(e)&&mP()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class qD extends _x{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,gx(typeof t.type!="string");const h=GD(t);this.animation=HD(n,r,i,h,s),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=Tx(i,this.options,c,this.speed);this.updateMotionValue?this.updateMotionValue(m):VD(n,r,m),this.animation.cancel()}d?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return us(Number(t))}get time(){return us(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=ls(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&UD()?(this.animation.timeline=t,no):n(this)}}const yP={anticipate:XE,backInOut:YE,circInOut:JE};function YD(e){return e in yP}function XD(e){typeof e.ease=="string"&&YD(e.ease)&&(e.ease=yP[e.ease])}const F1=10;class QD extends qD{constructor(t){XD(t),dP(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new Ix({...a,autoplay:!1}),d=ls(this.finishedTime??this.time);n.setWithVelocity(c.sample(d-F1).value,c.sample(d).value,F1),c.stop()}}const O1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(rl.test(e)||e==="0")&&!e.startsWith("url("));function JD(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function n3(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:a}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:h}=t.owner.getProps();return t3()&&n&&e3.has(n)&&(n!=="transform"||!h)&&!d&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const r3=40;class i3 extends _x{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:c,name:d,motionValue:h,element:m,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=li.now();const b={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:d,motionValue:h,element:m,...g},x=m?.KeyframeResolver||$x;this.keyframeResolver=new x(c,(k,P,T)=>this.onKeyframesResolved(k,P,b,!T),d,h,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:s,type:a,velocity:c,delay:d,isHandoff:h,onUpdate:m}=r;this.resolvedAt=li.now(),ZD(t,s,a,c)||((fs.instantAnimations||!d)&&m?.(Tx(t,r,n)),t[0]=t[t.length-1],r.duration=0,r.repeat=0);const b={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>r3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=!h&&n3(b)?new QD({...b,element:b.motionValue.owner.current}):new Ix(b);x.finished.then(()=>this.notifyFinished()).catch(no),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),jD()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const o3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function s3(e){const t=o3.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function bP(e,t,n=1){const[r,i]=s3(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return BE(a)?parseFloat(a):a}return Sx(i)?bP(i,t,n+1):i}function Ax(e,t){return e?.[t]??e?.default??e}const xP=new Set(["width","height","top","left","right","bottom",...Ff]),a3={test:e=>e==="auto",parse:e=>e},wP=e=>t=>t.test(e),SP=[Nf,tt,cs,Ya,JM,QM,a3],z1=e=>SP.find(wP(e));function l3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||UE(e):!0}const u3=new Set(["brightness","contrast","saturate","opacity"]);function c3(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(kx)||[];if(!r)return e;const i=n.replace(r,"");let s=u3.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const f3=/\b([a-z-]*)\(.*?\)/gu,ob={...rl,getAnimatableNone:e=>{const t=e.match(f3);return t?t.map(c3).join(" "):e}},j1={...Nf,transform:Math.round},d3={rotate:Ya,rotateX:Ya,rotateY:Ya,rotateZ:Ya,scale:cg,scaleX:cg,scaleY:cg,scaleZ:cg,skew:Ya,skewX:Ya,skewY:Ya,distance:tt,translateX:tt,translateY:tt,translateZ:tt,x:tt,y:tt,z:tt,perspective:tt,transformPerspective:tt,opacity:Qp,originX:T1,originY:T1,originZ:tt},Rx={borderWidth:tt,borderTopWidth:tt,borderRightWidth:tt,borderBottomWidth:tt,borderLeftWidth:tt,borderRadius:tt,radius:tt,borderTopLeftRadius:tt,borderTopRightRadius:tt,borderBottomRightRadius:tt,borderBottomLeftRadius:tt,width:tt,maxWidth:tt,height:tt,maxHeight:tt,top:tt,right:tt,bottom:tt,left:tt,padding:tt,paddingTop:tt,paddingRight:tt,paddingBottom:tt,paddingLeft:tt,margin:tt,marginTop:tt,marginRight:tt,marginBottom:tt,marginLeft:tt,backgroundPositionX:tt,backgroundPositionY:tt,...d3,zIndex:j1,fillOpacity:Qp,strokeOpacity:Qp,numOctaves:j1},p3={...Rx,color:Rn,backgroundColor:Rn,outlineColor:Rn,fill:Rn,stroke:Rn,borderColor:Rn,borderTopColor:Rn,borderRightColor:Rn,borderBottomColor:Rn,borderLeftColor:Rn,filter:ob,WebkitFilter:ob},kP=e=>p3[e];function CP(e,t){let n=kP(e);return n!==ob&&(n=rl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const h3=new Set(["auto","none","0"]);function m3(e,t,n){let r=0,i;for(;r{t.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const v3=new Set(["opacity","clipPath","filter","transform"]);function y3(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const EP=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function PP(e){return VE(e)&&"offsetHeight"in e}const B1=30,b3=e=>!isNaN(parseFloat(e));class TP{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=li.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty();i&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=li.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=b3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new yx);const r=this.events[t].add(n);return t==="change"?()=>{r(),rn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=li.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>B1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,B1);return KE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function _f(e,t){return new TP(e,t)}const{schedule:Lx}=tP(queueMicrotask,!1),Eo={x:!1,y:!1};function _P(){return Eo.x||Eo.y}function x3(e){return e==="x"||e==="y"?Eo[e]?null:(Eo[e]=!0,()=>{Eo[e]=!1}):Eo.x||Eo.y?null:(Eo.x=Eo.y=!0,()=>{Eo.x=Eo.y=!1})}function IP(e,t){const n=y3(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function V1(e){return!(e.pointerType==="touch"||_P())}function w3(e,t,n={}){const[r,i,s]=IP(e,n),a=c=>{if(!V1(c))return;const{target:d}=c,h=t(d,c);if(typeof h!="function"||!d)return;const m=g=>{V1(g)&&(h(g),d.removeEventListener("pointerleave",m))};d.addEventListener("pointerleave",m,i)};return r.forEach(c=>{c.addEventListener("pointerenter",a,i)}),s}const $P=(e,t)=>t?e===t?!0:$P(e,t.parentElement):!1,Mx=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,S3=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function k3(e){return S3.has(e.tagName)||e.tabIndex!==-1}const $g=new WeakSet;function U1(e){return t=>{t.key==="Enter"&&e(t)}}function Jy(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const C3=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=U1(()=>{if($g.has(n))return;Jy(n,"down");const i=U1(()=>{Jy(n,"up")}),s=()=>Jy(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function K1(e){return Mx(e)&&!_P()}function E3(e,t,n={}){const[r,i,s]=IP(e,n),a=c=>{const d=c.currentTarget;if(!K1(c))return;$g.add(d);const h=t(d,c),m=(x,k)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",b),$g.has(d)&&$g.delete(d),K1(x)&&typeof h=="function"&&h(x,{success:k})},g=x=>{m(x,d===window||d===document||n.useGlobalTarget||$P(d,x.target))},b=x=>{m(x,!1)};window.addEventListener("pointerup",g,i),window.addEventListener("pointercancel",b,i)};return r.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,i),PP(c)&&(c.addEventListener("focus",h=>C3(h,i)),!k3(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function AP(e){return VE(e)&&"ownerSVGElement"in e}function P3(e){return AP(e)&&e.tagName==="svg"}const Sr=e=>!!(e&&e.getVelocity),T3=[...SP,Rn,rl],_3=e=>T3.find(wP(e)),Zp=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class I3 extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=PP(r)&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function $3({children:e,isPresent:t,anchorX:n,root:r}){const i=S.useId(),s=S.useRef(null),a=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=S.useContext(Zp);return S.useInsertionEffect(()=>{const{width:d,height:h,top:m,left:g,right:b}=a.current;if(t||!s.current||!d||!h)return;const x=n==="left"?`left: ${g}`:`right: ${b}`;s.current.dataset.motionPopId=i;const k=document.createElement("style");c&&(k.nonce=c);const P=r??document.head;return P.appendChild(k),k.sheet&&k.sheet.insertRule(` - [data-motion-pop-id="${i}"] { - position: absolute !important; - width: ${d}px !important; - height: ${h}px !important; - ${x}px !important; - top: ${m}px !important; - } - `),()=>{P.removeChild(k),P.contains(k)&&P.removeChild(k)}},[t]),D.jsx(I3,{isPresent:t,childRef:s,sizeRef:a,children:S.cloneElement(e,{ref:s})})}const A3=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:c,root:d})=>{const h=mh(R3),m=S.useId();let g=!0,b=S.useMemo(()=>(g=!1,{id:m,initial:t,isPresent:n,custom:i,onExitComplete:x=>{h.set(x,!0);for(const k of h.values())if(!k)return;r&&r()},register:x=>(h.set(x,!1),()=>h.delete(x))}),[n,h,r]);return s&&g&&(b={...b}),S.useMemo(()=>{h.forEach((x,k)=>h.set(k,!1))},[n]),S.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),a==="popLayout"&&(e=D.jsx($3,{isPresent:n,anchorX:c,root:d,children:e})),D.jsx(yv.Provider,{value:b,children:e})};function R3(){return new Map}function RP(e=!0){const t=S.useContext(yv);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=S.useId();S.useEffect(()=>{if(e)return i(s)},[e]);const a=S.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const fg=e=>e.key||"";function W1(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const ol=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:c="left",root:d})=>{const[h,m]=RP(a),g=S.useMemo(()=>W1(e),[e]),b=a&&!h?[]:g.map(fg),x=S.useRef(!0),k=S.useRef(g),P=mh(()=>new Map),[T,_]=S.useState(g),[A,L]=S.useState(g);px(()=>{x.current=!1,k.current=g;for(let $=0;${const Y=fg($),te=a&&!h?!1:g===A||b.includes(Y),ie=()=>{if(P.has(Y))P.set(Y,!0);else return;let B=!0;P.forEach(W=>{W||(B=!1)}),B&&(j?.(),L(k.current),a&&m?.(),r&&r())};return D.jsx(A3,{isPresent:te,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:d,onExitComplete:te?void 0:ie,anchorX:c,children:$},Y)})})},L3=S.createContext(null);function M3(){const e=S.useRef(!1);return px(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function D3(){const e=M3(),[t,n]=S.useState(0),r=S.useCallback(()=>{e.current&&n(t+1)},[t]);return[S.useCallback(()=>rn.postRender(r),[r]),t]}const N3=e=>!e.isLayoutDirty&&e.willUpdate(!1);function H1(){const e=new Set,t=new WeakMap,n=()=>e.forEach(N3);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}const LP=e=>e===!0,F3=e=>LP(e===!0)||e==="id",O3=({children:e,id:t,inherit:n=!0})=>{const r=S.useContext(Yp),i=S.useContext(L3),[s,a]=D3(),c=S.useRef(null),d=r.id||i;c.current===null&&(F3(n)&&d&&(t=t?d+"-"+t:d),c.current={id:t,group:LP(n)&&r.group||H1()});const h=S.useMemo(()=>({...c.current,forceRender:s}),[a]);return D.jsx(Yp.Provider,{value:h,children:e})},Dx=S.createContext({strict:!1}),G1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},If={};for(const e in G1)If[e]={isEnabled:t=>G1[e].some(n=>!!t[n])};function sb(e){for(const t in e)If[t]={...If[t],...e[t]}}function $f({children:e,features:t,strict:n=!1}){const[,r]=S.useState(!Zy(t)),i=S.useRef(void 0);if(!Zy(t)){const{renderer:s,...a}=t;i.current=s,sb(a)}return S.useEffect(()=>{Zy(t)&&t().then(({renderer:s,...a})=>{sb(a),i.current=s,r(!0)})},[]),D.jsx(Dx.Provider,{value:{renderer:i.current,strict:n},children:e})}function Zy(e){return typeof e=="function"}const z3=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Hg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||z3.has(e)}let MP=e=>!Hg(e);function DP(e){typeof e=="function"&&(MP=t=>t.startsWith("on")?!Hg(t):e(t))}try{DP(require("@emotion/is-prop-valid").default)}catch{}function j3(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(MP(i)||n===!0&&Hg(i)||!t&&!Hg(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function B3({children:e,isValidProp:t,...n}){t&&DP(t),n={...S.useContext(Zp),...n},n.isStatic=mh(()=>n.isStatic);const r=S.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return D.jsx(Zp.Provider,{value:r,children:e})}const bv=S.createContext({});function xv(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function eh(e){return typeof e=="string"||Array.isArray(e)}const Nx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fx=["initial",...Nx];function wv(e){return xv(e.animate)||Fx.some(t=>eh(e[t]))}function NP(e){return!!(wv(e)||e.variants)}function V3(e,t){if(wv(e)){const{initial:n,animate:r}=e;return{initial:n===!1||eh(n)?n:void 0,animate:eh(r)?r:void 0}}return e.inherit!==!1?t:{}}function U3(e){const{initial:t,animate:n}=V3(e,S.useContext(bv));return S.useMemo(()=>({initial:t,animate:n}),[q1(t),q1(n)])}function q1(e){return Array.isArray(e)?e.join(" "):e}const th={};function K3(e){for(const t in e)th[t]=e[t],wx(t)&&(th[t].isCSSVariable=!0)}function FP(e,{layout:t,layoutId:n}){return Ru.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!th[e]||e==="opacity")}const W3={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},H3=Ff.length;function G3(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}});function OP(e,t,n){for(const r in t)!Sr(t[r])&&!FP(r,n)&&(e[r]=t[r])}function q3({transformTemplate:e},t){return S.useMemo(()=>{const n=zx();return Ox(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Y3(e,t){const n=e.style||{},r={};return OP(r,n,e),Object.assign(r,q3(e,t)),r}function X3(e,t){const n={},r=Y3(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Q3={offset:"stroke-dashoffset",array:"stroke-dasharray"},J3={offset:"strokeDashoffset",array:"strokeDasharray"};function Z3(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Q3:J3;e[s.offset]=tt.transform(-r);const a=tt.transform(t),c=tt.transform(n);e[s.array]=`${a} ${c}`}function zP(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...c},d,h,m){if(Ox(e,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:b}=e;g.transform&&(b.transform=g.transform,delete g.transform),(b.transform||g.transformOrigin)&&(b.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),b.transform&&(b.transformBox=m?.transformBox??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),i!==void 0&&Z3(g,i,s,a,!1)}const jP=()=>({...zx(),attrs:{}}),BP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function e4(e,t,n,r){const i=S.useMemo(()=>{const s=jP();return zP(s,t,BP(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};OP(s,e.style,e),i.style={...s,...i.style}}return i}const t4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jx(e){return typeof e!="string"||e.includes("-")?!1:!!(t4.indexOf(e)>-1||/[A-Z]/u.test(e))}function n4(e,t,n,{latestValues:r},i,s=!1){const c=(jx(e)?e4:X3)(t,r,i,e),d=j3(t,typeof e=="string",s),h=e!==S.Fragment?{...d,...c,ref:n}:{},{children:m}=t,g=S.useMemo(()=>Sr(m)?m.get():m,[m]);return S.createElement(e,{...h,children:g})}function Y1(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Bx(e,t,n,r){if(typeof t=="function"){const[i,s]=Y1(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Y1(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function Ag(e){return Sr(e)?e.get():e}function r4({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:i4(n,r,i,e),renderState:t()}}function i4(e,t,n,r){const i={},s=r(e,{});for(const b in s)i[b]=Ag(s[b]);let{initial:a,animate:c}=e;const d=wv(e),h=NP(e);t&&h&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),c===void 0&&(c=t.animate));let m=n?n.initial===!1:!1;m=m||a===!1;const g=m?c:a;if(g&&typeof g!="boolean"&&!xv(g)){const b=Array.isArray(g)?g:[g];for(let x=0;x(t,n)=>{const r=S.useContext(bv),i=S.useContext(yv),s=()=>r4(e,t,r,i);return n?s():mh(s)};function Vx(e,t,n){const{style:r}=e,i={};for(const s in r)(Sr(r[s])||t.style&&Sr(t.style[s])||FP(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(i[s]=r[s]);return i}const o4=VP({scrapeMotionValuesFromProps:Vx,createRenderState:zx});function UP(e,t,n){const r=Vx(e,t,n);for(const i in e)if(Sr(e[i])||Sr(t[i])){const s=Ff.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const s4=VP({scrapeMotionValuesFromProps:UP,createRenderState:jP}),a4=Symbol.for("motionComponentSymbol");function hf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function l4(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):hf(n)&&(n.current=r))},[t])}const Ux=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),u4="framerAppearId",KP="data-"+Ux(u4),WP=S.createContext({});function c4(e,t,n,r,i){const{visualElement:s}=S.useContext(bv),a=S.useContext(Dx),c=S.useContext(yv),d=S.useContext(Zp).reducedMotion,h=S.useRef(null);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d}));const m=h.current,g=S.useContext(WP);m&&!m.projection&&i&&(m.type==="html"||m.type==="svg")&&f4(h.current,n,i,g);const b=S.useRef(!1);S.useInsertionEffect(()=>{m&&b.current&&m.update(n,c)});const x=n[KP],k=S.useRef(!!x&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return px(()=>{m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),k.current&&m.animationState&&m.animationState.animateChanges())}),S.useEffect(()=>{m&&(!k.current&&m.animationState&&m.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),k.current=!1))}),m}function f4(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:c,layoutScroll:d,layoutRoot:h,layoutCrossfade:m}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:HP(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||c&&hf(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:d,layoutRoot:h})}function HP(e){if(e)return e.options.allowProjection!==!1?e.projection:HP(e.parent)}function e0(e,{forwardMotionProps:t=!1}={},n,r){n&&sb(n);const i=jx(e)?s4:o4;function s(c,d){let h;const m={...S.useContext(Zp),...c,layoutId:d4(c)},{isStatic:g}=m,b=U3(c),x=i(c,g);if(!g&&dx){p4();const k=h4(m);h=k.MeasureLayout,b.visualElement=c4(e,x,m,r,k.ProjectionNode)}return D.jsxs(bv.Provider,{value:b,children:[h&&b.visualElement?D.jsx(h,{visualElement:b.visualElement,...m}):null,n4(e,c,l4(x,b.visualElement,d),x,g,t)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const a=S.forwardRef(s);return a[a4]=e,a}function d4({layoutId:e}){const t=S.useContext(Yp).id;return t&&e!==void 0?t+"-"+e:e}function p4(e,t){S.useContext(Dx).strict}function h4(e){const{drag:t,layout:n}=If;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function GP(e,t){if(typeof Proxy>"u")return e0;const n=new Map,r=(s,a)=>e0(s,a,e,t),i=(s,a)=>r(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,e0(a,void 0,e,t)),n.get(a))})}const Af=GP();function qP({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function m4({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function g4(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function t0(e){return e===void 0||e===1}function ab({scale:e,scaleX:t,scaleY:n}){return!t0(e)||!t0(t)||!t0(n)}function pu(e){return ab(e)||YP(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function YP(e){return X1(e.x)||X1(e.y)}function X1(e){return e&&e!=="0%"}function Gg(e,t,n){const r=e-n,i=t*r;return n+i}function Q1(e,t,n,r,i){return i!==void 0&&(e=Gg(e,i,r)),Gg(e,n,r)+t}function lb(e,t=0,n=1,r,i){e.min=Q1(e.min,t,n,r,i),e.max=Q1(e.max,t,n,r,i)}function XP(e,{x:t,y:n}){lb(e.x,t.translate,t.scale,t.originPoint),lb(e.y,n.translate,n.scale,n.originPoint)}const J1=.999999999999,Z1=1.0000000000001;function v4(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let c=0;cJ1&&(t.x=1),t.yJ1&&(t.y=1)}function mf(e,t){e.min=e.min+t,e.max=e.max+t}function eS(e,t,n,r,i=.5){const s=dn(e.min,e.max,i);lb(e,t,n,s,r)}function gf(e,t){eS(e.x,t.x,t.scaleX,t.scale,t.originX),eS(e.y,t.y,t.scaleY,t.scale,t.originY)}function QP(e,t){return qP(g4(e.getBoundingClientRect(),t))}function y4(e,t,n){const r=QP(e,n),{scroll:i}=t;return i&&(mf(r.x,i.offset.x),mf(r.y,i.offset.y)),r}const tS=()=>({translate:0,scale:1,origin:0,originPoint:0}),vf=()=>({x:tS(),y:tS()}),nS=()=>({min:0,max:0}),Cn=()=>({x:nS(),y:nS()}),ub={current:null},JP={current:!1};function b4(){if(JP.current=!0,!!dx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ub.current=e.matches;e.addEventListener("change",t),t()}else ub.current=!1}const x4=new WeakMap;function w4(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Sr(i))e.addValue(r,i);else if(Sr(s))e.addValue(r,_f(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,_f(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const rS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class S4{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=$x,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=li.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),JP.current||b4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ub.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),nl(this.notifyUpdate),nl(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ru.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&rn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in If){const n=If[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Cn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_f(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(BE(r)||UE(r))?r=parseFloat(r):!_3(r)&&rl.test(n)&&(r=CP(t,n)),this.setBaseTarget(t,Sr(r)?r.get():r)),Sr(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=Bx(this.props,n,this.presenceContext?.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Sr(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new yx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Lx.render(this.render)}}class ZP extends S4{constructor(){super(...arguments),this.KeyframeResolver=g3}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Sr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function eT(e,{style:t,vars:n},r,i){const s=e.style;let a;for(a in t)s[a]=t[a];i?.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function k4(e){return window.getComputedStyle(e)}class C4 extends ZP{constructor(){super(...arguments),this.type="html",this.renderInstance=eT}readValueFromInstance(t,n){if(Ru.has(n))return this.projection?.isProjecting?eb(n):DD(t,n);{const r=k4(t),i=(wx(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return QP(t,n)}build(t,n,r){Ox(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Vx(t,n,r)}}const tT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function E4(e,t,n,r){eT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(tT.has(i)?i:Ux(i),t.attrs[i])}class P4 extends ZP{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Cn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ru.has(n)){const r=kP(n);return r&&r.default||0}return n=tT.has(n)?n:Ux(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return UP(t,n,r)}build(t,n,r){zP(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){E4(t,n,r,i)}mount(t){this.isSVGTag=BP(t.tagName),super.mount(t)}}const T4=(e,t)=>jx(e)?new P4(t):new C4(t,{allowProjection:e!==S.Fragment});function nh(e,t,n){const r=e.getProps();return Bx(r,t,n!==void 0?n:r.custom,e)}const cb=e=>Array.isArray(e);function _4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_f(n))}function I4(e){return cb(e)?e[e.length-1]||0:e}function $4(e,t){const n=nh(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const c=I4(s[a]);_4(e,a,c)}}function A4(e){return!!(Sr(e)&&e.add)}function fb(e,t){const n=e.getValue("willChange");if(A4(n))return n.add(t);if(!n&&fs.WillChange){const r=new fs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function nT(e){return e.props[KP]}const R4=e=>e!==null;function L4(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(R4),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[s]}const M4={type:"spring",stiffness:500,damping:25,restSpeed:10},D4=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),N4={type:"keyframes",duration:.8},F4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},O4=(e,{keyframes:t})=>t.length>2?N4:Ru.has(e)?e.startsWith("scale")?D4(t[1]):M4:F4;function z4({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:c,from:d,elapsed:h,...m}){return!!Object.keys(m).length}const Kx=(e,t,n,r={},i,s)=>a=>{const c=Ax(r,e)||{},d=c.delay||r.delay||0;let{elapsed:h=0}=r;h=h-ls(d);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-h,onUpdate:b=>{t.set(b),c.onUpdate&&c.onUpdate(b)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:i};z4(c)||Object.assign(m,O4(e,m)),m.duration&&(m.duration=ls(m.duration)),m.repeatDelay&&(m.repeatDelay=ls(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let g=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(g=!0)),(fs.instantAnimations||fs.skipAnimations)&&(g=!0,m.duration=0,m.delay=0),m.allowFlatten=!c.type&&!c.ease,g&&!s&&t.get()!==void 0){const b=L4(m.keyframes,c);if(b!==void 0){rn.update(()=>{m.onUpdate(b),m.onComplete()});return}}return c.isSync?new Ix(m):new i3(m)};function j4({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function rT(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...c}=t;r&&(s=r);const d=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in c){const g=e.getValue(m,e.latestValues[m]??null),b=c[m];if(b===void 0||h&&j4(h,m))continue;const x={delay:n,...Ax(s||{},m)},k=g.get();if(k!==void 0&&!g.isAnimating&&!Array.isArray(b)&&b===k&&!x.velocity)continue;let P=!1;if(window.MotionHandoffAnimation){const _=nT(e);if(_){const A=window.MotionHandoffAnimation(_,m,rn);A!==null&&(x.startTime=A,P=!0)}}fb(e,m),g.start(Kx(m,g,b,e.shouldReduceMotion&&xP.has(m)?{type:!1}:x,e,P));const T=g.animation;T&&d.push(T)}return a&&Promise.all(d).then(()=>{rn.update(()=>{a&&$4(e,a)})}),d}function db(e,t,n={}){const r=nh(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(rT(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:g}=i;return B4(e,t,d,h,m,g,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[d,h]=c==="beforeChildren"?[s,a]:[a,s];return d().then(()=>h())}else return Promise.all([s(),a(n.delay)])}function B4(e,t,n=0,r=0,i=0,s=1,a){const c=[],d=e.variantChildren.size,h=(d-1)*i,m=typeof r=="function",g=m?b=>r(b,d):s===1?(b=0)=>b*i:(b=0)=>h-b*i;return Array.from(e.variantChildren).sort(V4).forEach((b,x)=>{b.notify("AnimationStart",t),c.push(db(b,t,{...a,delay:n+(m?0:r)+g(x)}).then(()=>b.notify("AnimationComplete",t)))}),Promise.all(c)}function V4(e,t){return e.sortNodePosition(t)}function U4(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>db(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=db(e,t,n);else{const i=typeof t=="function"?nh(e,t,n.custom):t;r=Promise.all(rT(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function iT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rPromise.all(t.map(({animation:n,options:r})=>U4(e,n,r)))}function q4(e){let t=G4(e),n=iS(),r=!0;const i=d=>(h,m)=>{const g=nh(e,m,d==="exit"?e.presenceContext?.custom:void 0);if(g){const{transition:b,transitionEnd:x,...k}=g;h={...h,...k,...x}}return h};function s(d){t=d(e)}function a(d){const{props:h}=e,m=oT(e.parent)||{},g=[],b=new Set;let x={},k=1/0;for(let T=0;Tk&&O,ie=!1;const B=Array.isArray(L)?L:[L];let W=B.reduce(i(_),{});j===!1&&(W={});const{prevResolvedValues:G={}}=A,ee={...G,...W},H=X=>{te=!0,b.has(X)&&(ie=!0,b.delete(X)),A.needsAnimating[X]=!0;const V=e.getValue(X);V&&(V.liveStyle=!1)};for(const X in ee){const V=W[X],ae=G[X];if(x.hasOwnProperty(X))continue;let M=!1;cb(V)&&cb(ae)?M=!iT(V,ae):M=V!==ae,M?V!=null?H(X):b.add(X):V!==void 0&&b.has(X)?H(X):A.protectedKeys[X]=!0}A.prevProp=L,A.prevResolvedValues=W,A.isActive&&(x={...x,...W}),r&&e.blockInitialAnimation&&(te=!1),te&&(!($&&Y)||ie)&&g.push(...B.map(X=>({animation:X,options:{type:_}})))}if(b.size){const T={};if(typeof h.initial!="boolean"){const _=nh(e,Array.isArray(h.initial)?h.initial[0]:h.initial);_&&_.transition&&(T.transition=_.transition)}b.forEach(_=>{const A=e.getBaseTarget(_),L=e.getValue(_);L&&(L.liveStyle=!0),T[_]=A??null}),g.push({animation:T})}let P=!!g.length;return r&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(P=!1),r=!1,P?t(g):Promise.resolve()}function c(d,h){if(n[d].isActive===h)return Promise.resolve();e.variantChildren?.forEach(g=>g.animationState?.setActive(d,h)),n[d].isActive=h;const m=a(d);for(const g in n)n[g].protectedKeys={};return m}return{animateChanges:a,setActive:c,setAnimateFunction:s,getState:()=>n,reset:()=>{n=iS(),r=!0}}}function Y4(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!iT(t,e):!1}function su(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iS(){return{animate:su(!0),whileInView:su(),whileHover:su(),whileTap:su(),whileDrag:su(),whileFocus:su(),exit:su()}}class sl{constructor(t){this.isMounted=!1,this.node=t}update(){}}class X4 extends sl{constructor(t){super(t),t.animationState||(t.animationState=q4(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();xv(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Q4=0;class J4 extends sl{constructor(){super(...arguments),this.id=Q4++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Z4={animation:{Feature:X4},exit:{Feature:J4}};function rh(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function bh(e){return{point:{x:e.pageX,y:e.pageY}}}const eN=e=>t=>Mx(t)&&e(t,bh(t));function Fp(e,t,n,r){return rh(e,t,eN(n),r)}const sT=1e-4,tN=1-sT,nN=1+sT,aT=.01,rN=0-aT,iN=0+aT;function Or(e){return e.max-e.min}function oN(e,t,n){return Math.abs(e-t)<=n}function oS(e,t,n,r=.5){e.origin=r,e.originPoint=dn(t.min,t.max,e.origin),e.scale=Or(n)/Or(t),e.translate=dn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=tN&&e.scale<=nN||isNaN(e.scale))&&(e.scale=1),(e.translate>=rN&&e.translate<=iN||isNaN(e.translate))&&(e.translate=0)}function Op(e,t,n,r){oS(e.x,t.x,n.x,r?r.originX:void 0),oS(e.y,t.y,n.y,r?r.originY:void 0)}function sS(e,t,n){e.min=n.min+t.min,e.max=e.min+Or(t)}function sN(e,t,n){sS(e.x,t.x,n.x),sS(e.y,t.y,n.y)}function aS(e,t,n){e.min=t.min-n.min,e.max=e.min+Or(t)}function zp(e,t,n){aS(e.x,t.x,n.x),aS(e.y,t.y,n.y)}function Ji(e){return[e("x"),e("y")]}const lT=({current:e})=>e?e.ownerDocument.defaultView:null,lS=(e,t)=>Math.abs(e-t);function aN(e,t){const n=lS(e.x,t.x),r=lS(e.y,t.y);return Math.sqrt(n**2+r**2)}class uT{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=r0(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,k=aN(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!k)return;const{point:P}=b,{timestamp:T}=fr;this.history.push({...P,timestamp:T});const{onStart:_,onMove:A}=this.handlers;x||(_&&_(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),A&&A(this.lastMoveEvent,b)},this.handlePointerMove=(b,x)=>{this.lastMoveEvent=b,this.lastMoveEventInfo=n0(x,this.transformPagePoint),rn.update(this.updatePoint,!0)},this.handlePointerUp=(b,x)=>{this.end();const{onEnd:k,onSessionEnd:P,resumeAnimation:T}=this.handlers;if(this.dragSnapToOrigin&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=r0(b.type==="pointercancel"?this.lastMoveEventInfo:n0(x,this.transformPagePoint),this.history);this.startEvent&&k&&k(b,_),P&&P(b,_)},!Mx(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const c=bh(t),d=n0(c,this.transformPagePoint),{point:h}=d,{timestamp:m}=fr;this.history=[{...h,timestamp:m}];const{onSessionStart:g}=n;g&&g(t,r0(d,this.history)),this.removeListeners=gh(Fp(this.contextWindow,"pointermove",this.handlePointerMove),Fp(this.contextWindow,"pointerup",this.handlePointerUp),Fp(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),nl(this.updatePoint)}}function n0(e,t){return t?{point:t(e.point)}:e}function uS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function r0({point:e},t){return{point:e,delta:uS(e,cT(t)),offset:uS(e,lN(t)),velocity:uN(t,.1)}}function lN(e){return e[0]}function cT(e){return e[e.length-1]}function uN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=cT(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ls(t)));)n--;if(!r)return{x:0,y:0};const s=us(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function cN(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?dn(n,e,r.max):Math.min(e,n)),e}function cS(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function fN(e,{top:t,left:n,bottom:r,right:i}){return{x:cS(e.x,n,i),y:cS(e.y,t,r)}}function fS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Xp(t.min,t.max-r,e.min):r>i&&(n=Xp(e.min,e.max-i,t.min)),ta(0,1,n)}function hN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const pb=.35;function mN(e=pb){return e===!1?e=0:e===!0&&(e=pb),{x:dS(e,"left","right"),y:dS(e,"top","bottom")}}function dS(e,t,n){return{min:pS(e,t),max:pS(e,n)}}function pS(e,t){return typeof e=="number"?e:e[t]||0}const gN=new WeakMap;class vN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Cn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=g=>{const{dragSnapToOrigin:b}=this.getProps();b?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(bh(g).point)},a=(g,b)=>{const{drag:x,dragPropagation:k,onDragStart:P}=this.getProps();if(x&&!k&&(this.openDragLock&&this.openDragLock(),this.openDragLock=x3(x),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ji(_=>{let A=this.getAxisMotionValue(_).get()||0;if(cs.test(A)){const{projection:L}=this.visualElement;if(L&&L.layout){const O=L.layout.layoutBox[_];O&&(A=Or(O)*(parseFloat(A)/100))}}this.originPoint[_]=A}),P&&rn.postRender(()=>P(g,b)),fb(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b;const{dragPropagation:x,dragDirectionLock:k,onDirectionLock:P,onDrag:T}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:_}=b;if(k&&this.currentDirection===null){this.currentDirection=yN(_),this.currentDirection!==null&&P&&P(this.currentDirection);return}this.updateAxis("x",b.point,_),this.updateAxis("y",b.point,_),this.visualElement.render(),T&&T(g,b)},d=(g,b)=>{this.latestPointerEvent=g,this.latestPanInfo=b,this.stop(g,b),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>Ji(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:m}=this.getProps();this.panSession=new uT(t,{onSessionStart:s,onStart:a,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:r,contextWindow:lT(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:c}=this.getProps();c&&rn.postRender(()=>c(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!dg(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=cN(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&hf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=fN(r.layoutBox,t):this.constraints=!1,this.elastic=mN(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ji(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=hN(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!hf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=y4(r,i.root,this.visualElement.getTransformPagePoint());let a=dN(i.layout.layoutBox,s);if(n){const c=n(m4(a));this.hasMutatedConstraints=!!c,c&&(a=qP(c))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},h=Ji(m=>{if(!dg(m,n,this.currentDirection))return;let g=d&&d[m]||{};a&&(g={min:0,max:0});const b=i?200:1e6,x=i?40:1e7,k={type:"inertia",velocity:r?t[m]:0,bounceStiffness:b,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...s,...g};return this.startAxisValueAnimation(m,k)});return Promise.all(h).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return fb(this.visualElement,t),r.start(Kx(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ji(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ji(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ji(n=>{const{drag:r}=this.getProps();if(!dg(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:c}=i.layout.layoutBox[n];s.set(t[n]-dn(a,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!hf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ji(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const d=c.get();i[a]=pN({min:d,max:d},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ji(a=>{if(!dg(a,t,null))return;const c=this.getAxisMotionValue(a),{min:d,max:h}=this.constraints[a];c.set(dn(d,h,i[a]))})}addListeners(){if(!this.visualElement.current)return;gN.set(this.visualElement,this);const t=this.visualElement.current,n=Fp(t,"pointerdown",d=>{const{drag:h,dragListener:m=!0}=this.getProps();h&&m&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();hf(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),rn.read(r);const a=rh(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(Ji(m=>{const g=this.getAxisMotionValue(m);g&&(this.originPoint[m]+=d[m].translate,g.set(g.get()+d[m].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=pb,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:c}}}function dg(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function yN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class bN extends sl{constructor(t){super(t),this.removeGroupControls=no,this.removeListeners=no,this.controls=new vN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||no}unmount(){this.removeGroupControls(),this.removeListeners()}}const hS=e=>(t,n)=>{e&&rn.postRender(()=>e(t,n))};class xN extends sl{constructor(){super(...arguments),this.removePointerDownListener=no}onPointerDown(t){this.session=new uT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:lT(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:hS(t),onStart:hS(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&rn.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Fp(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Rg={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function mS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const mp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(tt.test(e))e=parseFloat(e);else return e;const n=mS(e,t.target.x),r=mS(e,t.target.y);return`${n}% ${r}%`}},wN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=rl.parse(e);if(i.length>5)return r;const s=rl.createTransformer(e),a=typeof i[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;i[0+a]/=c,i[1+a]/=d;const h=dn(c,d,.5);return typeof i[2+a]=="number"&&(i[2+a]/=h),typeof i[3+a]=="number"&&(i[3+a]/=h),s(i)}};let gS=!1;class SN extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;K3(kN),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),gS&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Rg.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,gS=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||rn.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Lx.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function fT(e){const[t,n]=RP(),r=S.useContext(Yp);return D.jsx(SN,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(WP),isPresent:t,safeToRemove:n})}const kN={borderRadius:{...mp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mp,borderTopRightRadius:mp,borderBottomLeftRadius:mp,borderBottomRightRadius:mp,boxShadow:wN};function CN(e,t,n){const r=Sr(e)?e:_f(e);return r.start(Kx("",r,t,n)),r.animation}const EN=(e,t)=>e.depth-t.depth;class PN{constructor(){this.children=[],this.isDirty=!1}add(t){hx(this.children,t),this.isDirty=!0}remove(t){mx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(EN),this.isDirty=!1,this.children.forEach(t)}}function TN(e,t){const n=li.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(nl(r),e(s-t))};return rn.setup(r,!0),()=>nl(r)}const dT=["TopLeft","TopRight","BottomLeft","BottomRight"],_N=dT.length,vS=e=>typeof e=="string"?parseFloat(e):e,yS=e=>typeof e=="number"||tt.test(e);function IN(e,t,n,r,i,s){i?(e.opacity=dn(0,n.opacity??1,$N(r)),e.opacityExit=dn(t.opacity??1,0,AN(r))):s&&(e.opacity=dn(t.opacity??1,n.opacity??1,r));for(let a=0;a<_N;a++){const c=`border${dT[a]}Radius`;let d=bS(t,c),h=bS(n,c);if(d===void 0&&h===void 0)continue;d||(d=0),h||(h=0),d===0||h===0||yS(d)===yS(h)?(e[c]=Math.max(dn(vS(d),vS(h),r),0),(cs.test(h)||cs.test(d))&&(e[c]+="%")):e[c]=h}(t.rotate||n.rotate)&&(e.rotate=dn(t.rotate||0,n.rotate||0,r))}function bS(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $N=pT(0,.5,QE),AN=pT(.5,.95,no);function pT(e,t,n){return r=>rt?1:n(Xp(e,t,r))}function xS(e,t){e.min=t.min,e.max=t.max}function Xi(e,t){xS(e.x,t.x),xS(e.y,t.y)}function wS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function SS(e,t,n,r,i){return e-=t,e=Gg(e,1/n,r),i!==void 0&&(e=Gg(e,1/i,r)),e}function RN(e,t=0,n=1,r=.5,i,s=e,a=e){if(cs.test(t)&&(t=parseFloat(t),t=dn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let c=dn(s.min,s.max,r);e===s&&(c-=t),e.min=SS(e.min,t,n,c,i),e.max=SS(e.max,t,n,c,i)}function kS(e,t,[n,r,i],s,a){RN(e,t[n],t[r],t[i],t.scale,s,a)}const LN=["x","scaleX","originX"],MN=["y","scaleY","originY"];function CS(e,t,n,r){kS(e.x,t,LN,n?n.x:void 0,r?r.x:void 0),kS(e.y,t,MN,n?n.y:void 0,r?r.y:void 0)}function ES(e){return e.translate===0&&e.scale===1}function hT(e){return ES(e.x)&&ES(e.y)}function PS(e,t){return e.min===t.min&&e.max===t.max}function DN(e,t){return PS(e.x,t.x)&&PS(e.y,t.y)}function TS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function mT(e,t){return TS(e.x,t.x)&&TS(e.y,t.y)}function _S(e){return Or(e.x)/Or(e.y)}function IS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class NN{constructor(){this.members=[]}add(t){hx(this.members,t),t.scheduleRender()}remove(t){if(mx(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function FN(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=n?.z||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:m,rotateX:g,rotateY:b,skewX:x,skewY:k}=n;h&&(r=`perspective(${h}px) ${r}`),m&&(r+=`rotate(${m}deg) `),g&&(r+=`rotateX(${g}deg) `),b&&(r+=`rotateY(${b}deg) `),x&&(r+=`skewX(${x}deg) `),k&&(r+=`skewY(${k}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const i0=["","X","Y","Z"],ON=1e3;let zN=0;function o0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function gT(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=nT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rn,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&gT(r)}function vT({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},c=t?.()){this.id=zN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(VN),this.nodes.forEach(HN),this.nodes.forEach(GN),this.nodes.forEach(UN)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;dthis.root.updateBlockedByResize=!1;rn.read(()=>{g=window.innerWidth}),e(a,()=>{const x=window.innerWidth;x!==g&&(g=x,this.root.updateBlockedByResize=!0,m&&m(),m=TN(b,250),Rg.hasAnimatedSinceResize&&(Rg.hasAnimatedSinceResize=!1,this.nodes.forEach(RS)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&h&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeLayoutChanged:b,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const k=this.options.transition||h.getDefaultTransition()||JN,{onLayoutAnimationStart:P,onLayoutAnimationComplete:T}=h.getProps(),_=!this.targetLayout||!mT(this.targetLayout,x),A=!g&&b;if(this.options.layoutRoot||this.resumeFrom||A||g&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...Ax(k,"layout"),onPlay:P,onComplete:T};(h.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(m,A)}else g||RS(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),nl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qN),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&gT(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Or(this.snapshot.measuredBox.x)&&!Or(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d{const j=O/1e3;LS(g.x,a.x,j),LS(g.y,a.y,j),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zp(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),XN(this.relativeTarget,this.relativeTargetOrigin,b,j),L&&DN(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=Cn()),Xi(L,this.relativeTarget)),P&&(this.animationValues=m,IN(m,h,this.latestValues,j,A,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(nl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rn.update(()=>{Rg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_f(0)),this.currentAnimation=CN(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ON),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:d,layout:h,latestValues:m}=a;if(!(!c||!d||!h)){if(this!==a&&this.layout&&h&&yT(this.options.animationType,this.layout.layoutBox,h.layoutBox)){d=this.target||Cn();const g=Or(this.layout.layoutBox.x);d.x.min=a.target.x.min,d.x.max=d.x.min+g;const b=Or(this.layout.layoutBox.y);d.y.min=a.target.y.min,d.y.max=d.y.min+b}Xi(c,d),gf(c,m),Op(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new NN),this.sharedNodes.get(a).add(c);const h=c.options.initialPromotionConfig;c.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:d}={}){const h=this.getStack();h&&h.promote(this,d),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:d}=a;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const h={};d.z&&o0("z",a,h,this.animationValues);for(let m=0;ma.currentAnimation?.stop()),this.root.nodes.forEach($S),this.root.sharedNodes.clear()}}}function jN(e){e.updateLayout()}function BN(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;i==="size"?Ji(m=>{const g=s?t.measuredBox[m]:t.layoutBox[m],b=Or(g);g.min=n[m].min,g.max=g.min+b}):yT(i,t.layoutBox,n)&&Ji(m=>{const g=s?t.measuredBox[m]:t.layoutBox[m],b=Or(n[m]);g.max=g.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+b)});const a=vf();Op(a,n,t.layoutBox);const c=vf();s?Op(c,e.applyTransform(r,!0),t.measuredBox):Op(c,n,t.layoutBox);const d=!hT(a);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:b}=m;if(g&&b){const x=Cn();zp(x,t.layoutBox,g.layoutBox);const k=Cn();zp(k,n,b.layoutBox),mT(x,k)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=k,e.relativeTargetOrigin=x,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function VN(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function UN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KN(e){e.clearSnapshot()}function $S(e){e.clearMeasurements()}function AS(e){e.isLayoutDirty=!1}function WN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function RS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function HN(e){e.resolveTargetDelta()}function GN(e){e.calcProjection()}function qN(e){e.resetSkewAndRotation()}function YN(e){e.removeLeadSnapshot()}function LS(e,t,n){e.translate=dn(t.translate,0,n),e.scale=dn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function MS(e,t,n,r){e.min=dn(t.min,n.min,r),e.max=dn(t.max,n.max,r)}function XN(e,t,n,r){MS(e.x,t.x,n.x,r),MS(e.y,t.y,n.y,r)}function QN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const JN={duration:.45,ease:[.4,0,.1,1]},DS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),NS=DS("applewebkit/")&&!DS("chrome/")?Math.round:no;function FS(e){e.min=NS(e.min),e.max=NS(e.max)}function ZN(e){FS(e.x),FS(e.y)}function yT(e,t,n){return e==="position"||e==="preserve-aspect"&&!oN(_S(t),_S(n),.2)}function e5(e){return e!==e.root&&e.scroll?.wasRoot}const t5=vT({attachResizeListener:(e,t)=>rh(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),s0={current:void 0},bT=vT({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!s0.current){const e=new t5({});e.mount(window),e.setOptions({layoutScroll:!0}),s0.current=e}return s0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),n5={pan:{Feature:xN},drag:{Feature:bN,ProjectionNode:bT,MeasureLayout:fT}};function OS(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&rn.postRender(()=>s(t,bh(t)))}class r5 extends sl{mount(){const{current:t}=this.node;t&&(this.unmount=w3(t,(n,r)=>(OS(this.node,r,"Start"),i=>OS(this.node,i,"End"))))}unmount(){}}class i5 extends sl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gh(rh(this.node.current,"focus",()=>this.onFocus()),rh(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function zS(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&rn.postRender(()=>s(t,bh(t)))}class o5 extends sl{mount(){const{current:t}=this.node;t&&(this.unmount=E3(t,(n,r)=>(zS(this.node,r,"Start"),(i,{success:s})=>zS(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const hb=new WeakMap,a0=new WeakMap,s5=e=>{const t=hb.get(e.target);t&&t(e)},a5=e=>{e.forEach(s5)};function l5({root:e,...t}){const n=e||document;a0.has(n)||a0.set(n,{});const r=a0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(a5,{root:e,...t})),r[i]}function u5(e,t,n){const r=l5(t);return hb.set(e,n),r.observe(e),()=>{hb.delete(e),r.unobserve(e)}}const c5={some:0,all:1};class f5 extends sl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:c5[i]},c=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,s&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:g}=this.node.getProps(),b=h?m:g;b&&b(d)};return u5(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(d5(t,n))&&this.startObserver()}unmount(){}}function d5({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const p5={inView:{Feature:f5},tap:{Feature:o5},focus:{Feature:i5},hover:{Feature:r5}},h5={layout:{ProjectionNode:bT,MeasureLayout:fT}},m5={...Z4,...p5,...n5,...h5},Zs=GP(m5,T4);class g5 extends TP{constructor(){super(...arguments),this.isEnabled=!1}add(t){(Ru.has(t)||v3.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function v5(){return mh(()=>new g5("auto"))}const as={top:"top",bottom:"top",left:"left",right:"left"},qg={top:"bottom",bottom:"top",left:"right",right:"left"},y5={top:"left",left:"top"},mb={top:"height",left:"width"},xT={width:"totalWidth",height:"totalHeight"},pg={};let Qn=typeof document<"u"?window.visualViewport:null;function jS(e){let t=0,n=0,r=0,i=0,s=0,a=0,c={};var d;let h=((d=Qn?.scale)!==null&&d!==void 0?d:1)>1;if(e.tagName==="BODY"){let k=document.documentElement;r=k.clientWidth,i=k.clientHeight;var m;t=(m=Qn?.width)!==null&&m!==void 0?m:r;var g;n=(g=Qn?.height)!==null&&g!==void 0?g:i,c.top=k.scrollTop||e.scrollTop,c.left=k.scrollLeft||e.scrollLeft,Qn&&(s=Qn.offsetTop,a=Qn.offsetLeft)}else({width:t,height:n,top:s,left:a}=xf(e)),c.top=e.scrollTop,c.left=e.scrollLeft,r=t,i=n;if(PE()&&(e.tagName==="BODY"||e.tagName==="HTML")&&h){c.top=0,c.left=0;var b;s=(b=Qn?.pageTop)!==null&&b!==void 0?b:0;var x;a=(x=Qn?.pageLeft)!==null&&x!==void 0?x:0}return{width:t,height:n,totalWidth:r,totalHeight:i,scroll:c,top:s,left:a}}function b5(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function BS(e,t,n,r,i,s,a){var c;let d=(c=i.scroll[e])!==null&&c!==void 0?c:0,h=r[mb[e]],m=r.scroll[as[e]]+s,g=h+r.scroll[as[e]]-s,b=t-d+a[e]-r[as[e]],x=t-d+n+a[e]-r[as[e]];return bg?Math.max(g-x,m-b):0}function x5(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function VS(e){if(pg[e])return pg[e];let[t,n]=e.split(" "),r=as[t]||"right",i=y5[r];as[n]||(n="center");let s=mb[r],a=mb[i];return pg[e]={placement:t,crossPlacement:n,axis:r,crossAxis:i,size:s,crossSize:a},pg[e]}function l0(e,t,n,r,i,s,a,c,d,h){let{placement:m,crossPlacement:g,axis:b,crossAxis:x,size:k,crossSize:P}=r,T={};var _;T[x]=(_=e[x])!==null&&_!==void 0?_:0;var A,L,O,j;g==="center"?T[x]+=(((A=e[P])!==null&&A!==void 0?A:0)-((L=n[P])!==null&&L!==void 0?L:0))/2:g!==x&&(T[x]+=((O=e[P])!==null&&O!==void 0?O:0)-((j=n[P])!==null&&j!==void 0?j:0)),T[x]+=s;const $=e[x]-n[P]+d+h,Y=e[x]+e[P]-d-h;if(T[x]=Bg(T[x],$,Y),m===b){const te=c?a[k]:t[xT[k]];T[qg[b]]=Math.floor(te-e[b]+i)}else T[b]=Math.floor(e[b]+e[k]+i);return T}function w5(e,t,n,r,i,s,a,c){const d=r?n.height:t[xT.height];var h;let m=e.top!=null?n.top+e.top:n.top+(d-((h=e.bottom)!==null&&h!==void 0?h:0)-a);var g,b,x,k,P,T;let _=c!=="top"?Math.max(0,t.height+t.top+((g=t.scroll.top)!==null&&g!==void 0?g:0)-m-(((b=i.top)!==null&&b!==void 0?b:0)+((x=i.bottom)!==null&&x!==void 0?x:0)+s)):Math.max(0,m+a-(t.top+((k=t.scroll.top)!==null&&k!==void 0?k:0))-(((P=i.top)!==null&&P!==void 0?P:0)+((T=i.bottom)!==null&&T!==void 0?T:0)+s));return Math.min(t.height-s*2,_)}function US(e,t,n,r,i,s){let{placement:a,axis:c,size:d}=s;var h,m;if(a===c)return Math.max(0,n[c]-e[c]-((h=e.scroll[c])!==null&&h!==void 0?h:0)+t[c]-((m=r[c])!==null&&m!==void 0?m:0)-r[qg[c]]-i);var g;return Math.max(0,e[d]+e[c]+e.scroll[c]-t[c]-n[c]-n[d]-((g=r[c])!==null&&g!==void 0?g:0)-r[qg[c]]-i)}function S5(e,t,n,r,i,s,a,c,d,h,m,g,b,x,k,P){let T=VS(e),{size:_,crossAxis:A,crossSize:L,placement:O,crossPlacement:j}=T,$=l0(t,c,n,T,m,g,h,b,k,P),Y=m,te=US(c,h,t,i,s+m,T);if(a&&r[_]>te){let me=VS(`${qg[O]} ${j}`),Ce=l0(t,c,n,me,m,g,h,b,k,P);US(c,h,t,i,s+m,me)>te&&(T=me,$=Ce,Y=m)}let ie="bottom";T.axis==="top"?T.placement==="top"?ie="top":T.placement==="bottom"&&(ie="bottom"):T.crossAxis==="top"&&(T.crossPlacement==="top"?ie="bottom":T.crossPlacement==="bottom"&&(ie="top"));let B=BS(A,$[A],n[L],c,d,s,h);$[A]+=B;let W=w5($,c,h,b,i,s,n.height,ie);x&&x{if(!n||r===null)return;let i=s=>{let a=s.target;if(!t.current||a instanceof Node&&!a.contains(t.current)||s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement)return;let c=r||E5.get(t.current);c&&c()};return window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("scroll",i,!0)}},[n,r,t])}let kn=typeof document<"u"?window.visualViewport:null;function T5(e){let{direction:t}=hh(),{arrowSize:n=0,targetRef:r,overlayRef:i,scrollRef:s=i,placement:a="bottom",containerPadding:c=12,shouldFlip:d=!0,boundaryElement:h=typeof document<"u"?document.body:null,offset:m=0,crossOffset:g=0,shouldUpdatePosition:b=!0,isOpen:x=!0,onClose:k,maxHeight:P,arrowBoundaryOffset:T=0}=e,[_,A]=S.useState(null),L=[b,a,i.current,r.current,s.current,c,d,h,m,g,x,t,P,T,n],O=S.useRef(kn?.scale);S.useEffect(()=>{x&&(O.current=kn?.scale)},[x]);let j=S.useCallback(()=>{if(b===!1||!x||!i.current||!r.current||!h||kn?.scale!==O.current)return;let B=null;if(s.current&&s.current.contains(document.activeElement)){var W;let V=(W=document.activeElement)===null||W===void 0?void 0:W.getBoundingClientRect(),ae=s.current.getBoundingClientRect();var G;if(B={type:"top",offset:((G=V?.top)!==null&&G!==void 0?G:0)-ae.top},B.offset>ae.height/2){B.type="bottom";var ee;B.offset=((ee=V?.bottom)!==null&&ee!==void 0?ee:0)-ae.bottom}}let H=i.current;if(!P&&i.current){var le;H.style.top="0px",H.style.bottom="";var J;H.style.maxHeight=((J=(le=window.visualViewport)===null||le===void 0?void 0:le.height)!==null&&J!==void 0?J:window.innerHeight)+"px"}let X=k5({placement:I5(a,t),overlayNode:i.current,targetNode:r.current,scrollNode:s.current||i.current,padding:c,shouldFlip:d,boundaryElement:h,offset:m,crossOffset:g,maxHeight:P,arrowSize:n,arrowBoundaryOffset:T});if(X.position){if(H.style.top="",H.style.bottom="",H.style.left="",H.style.right="",Object.keys(X.position).forEach(V=>H.style[V]=X.position[V]+"px"),H.style.maxHeight=X.maxHeight!=null?X.maxHeight+"px":"",B&&document.activeElement&&s.current){let V=document.activeElement.getBoundingClientRect(),ae=s.current.getBoundingClientRect(),M=V[B.type]-ae[B.type];s.current.scrollTop+=M-B.offset}A(X)}},L);sn(j,L),_5(j),k1({ref:i,onResize:j}),k1({ref:r,onResize:j});let $=S.useRef(!1);sn(()=>{let B,W=()=>{$.current=!0,clearTimeout(B),B=setTimeout(()=>{$.current=!1},500),j()},G=()=>{$.current&&W()};return kn?.addEventListener("resize",W),kn?.addEventListener("scroll",G),()=>{kn?.removeEventListener("resize",W),kn?.removeEventListener("scroll",G)}},[j]);let Y=S.useCallback(()=>{$.current||k?.()},[k,$]);P5({triggerRef:r,isOpen:x,onClose:k&&Y});var te,ie;return{overlayProps:{style:{position:"absolute",zIndex:1e5,..._?.position,maxHeight:(te=_?.maxHeight)!==null&&te!==void 0?te:"100vh"}},placement:(ie=_?.placement)!==null&&ie!==void 0?ie:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:_?.arrowOffsetLeft,top:_?.arrowOffsetTop}},updatePosition:j}}function _5(e){sn(()=>(window.addEventListener("resize",e,!1),()=>{window.removeEventListener("resize",e,!1)}),[e])}function I5(e,t){return t==="rtl"?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")}function $5(e){const t=to(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:s}=e.ownerDocument.defaultView;let{display:a,visibility:c}=s(e);i=a!=="none"&&c!=="hidden"&&c!=="collapse"}return i}function A5(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function wT(e,t){return e.nodeName!=="#comment"&&$5(e)&&A5(e,t)&&(!e.parentElement||wT(e.parentElement,e))}function Wx(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ST(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function kT(e){let t=S.useRef({isFocused:!1,observer:null});sn(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=jn(r=>{e?.(r)});return S.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let i=r.target,s=a=>{if(t.current.isFocused=!1,i.disabled){let c=Wx(a);n(c)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var a;(a=t.current.observer)===null||a===void 0||a.disconnect();let c=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Yg=!1;function R5(e){for(;e&&!zE(e);)e=e.parentElement;let t=to(e),n=t.document.activeElement;if(!n||n===e)return;Yg=!0;let r=!1,i=m=>{(m.target===n||r)&&m.stopImmediatePropagation()},s=m=>{(m.target===n||r)&&(m.stopImmediatePropagation(),!e&&!r&&(r=!0,tl(n),d()))},a=m=>{(m.target===e||r)&&m.stopImmediatePropagation()},c=m=>{(m.target===e||r)&&(m.stopImmediatePropagation(),r||(r=!0,tl(n),d()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",c,!0),t.addEventListener("focus",a,!0);let d=()=>{cancelAnimationFrame(h),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",c,!0),t.removeEventListener("focus",a,!0),Yg=!1,r=!1},h=requestAnimationFrame(d);return d}let yf="default",gb="",Lg=new WeakMap;function L5(e){if(vv()){if(yf==="default"){const t=Dt(e);gb=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}yf="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";Lg.set(e,e.style[t]),e.style[t]="none"}}function HS(e){if(vv()){if(yf!=="disabled")return;yf="restoring",setTimeout(()=>{$E(()=>{if(yf==="restoring"){const t=Dt(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=gb||""),gb="",yf="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Lg.has(e)){let t=Lg.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),Lg.delete(e)}}const Hx=He.createContext({register:()=>{}});Hx.displayName="PressResponderContext";function M5(e,t){return t.get?t.get.call(e):t.value}function CT(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function D5(e,t){var n=CT(e,t,"get");return M5(e,n)}function N5(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function GS(e,t,n){var r=CT(e,t,"set");return N5(e,r,n),n}function F5(e){let t=S.useContext(Hx);if(t){let{register:n,...r}=t;e=Pn(r,e),n()}return RE(t,e.ref),e}var hg=new WeakMap;class mg{continuePropagation(){GS(this,hg,!1)}get shouldStopPropagation(){return D5(this,hg)}constructor(t,n,r,i){YL(this,hg,{writable:!0,value:void 0}),GS(this,hg,!0);var s;let a=(s=i?.target)!==null&&s!==void 0?s:r.currentTarget;const c=a?.getBoundingClientRect();let d,h=0,m,g=null;r.clientX!=null&&r.clientY!=null&&(m=r.clientX,g=r.clientY),c&&(m!=null&&g!=null?(d=m-c.left,h=g-c.top):(d=c.width/2,h=c.height/2)),this.type=t,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=d,this.y=h}}const qS=Symbol("linkClicked"),YS="react-aria-pressable-style",XS="data-react-aria-pressable";function il(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:s,onClick:a,isDisabled:c,isPressed:d,preventFocusOnPress:h,shouldCancelOnPointerExit:m,allowTextSelectionOnPress:g,ref:b,...x}=F5(e),[k,P]=S.useState(!1),T=S.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:_,removeAllGlobalListeners:A}=cx(),L=jn((W,G)=>{let ee=T.current;if(c||ee.didFirePressStart)return!1;let H=!0;if(ee.isTriggeringEvent=!0,r){let le=new mg("pressstart",G,W);r(le),H=le.shouldStopPropagation}return n&&n(!0),ee.isTriggeringEvent=!1,ee.didFirePressStart=!0,P(!0),H}),O=jn((W,G,ee=!0)=>{let H=T.current;if(!H.didFirePressStart)return!1;H.didFirePressStart=!1,H.isTriggeringEvent=!0;let le=!0;if(i){let J=new mg("pressend",G,W);i(J),le=J.shouldStopPropagation}if(n&&n(!1),P(!1),t&&ee&&!c){let J=new mg("press",G,W);t(J),le&&(le=J.shouldStopPropagation)}return H.isTriggeringEvent=!1,le}),j=jn((W,G)=>{let ee=T.current;if(c)return!1;if(s){ee.isTriggeringEvent=!0;let H=new mg("pressup",G,W);return s(H),ee.isTriggeringEvent=!1,H.shouldStopPropagation}return!0}),$=jn(W=>{let G=T.current;if(G.isPressed&&G.target){G.didFirePressStart&&G.pointerType!=null&&O(au(G.target,W),G.pointerType,!1),G.isPressed=!1,G.isOverTarget=!1,G.activePointerId=null,G.pointerType=null,A(),g||HS(G.target);for(let ee of G.disposables)ee();G.disposables=[]}}),Y=jn(W=>{m&&$(W)}),te=jn(W=>{a?.(W)}),ie=jn((W,G)=>{if(a){let ee=new MouseEvent("click",W);ST(ee,G),a(Wx(ee))}}),B=S.useMemo(()=>{let W=T.current,G={onKeyDown(H){if(u0(H.nativeEvent,H.currentTarget)&&ai(H.currentTarget,En(H.nativeEvent))){var le;QS(En(H.nativeEvent),H.key)&&H.preventDefault();let J=!0;if(!W.isPressed&&!H.repeat){W.target=H.currentTarget,W.isPressed=!0,W.pointerType="keyboard",J=L(H,"keyboard");let X=H.currentTarget,V=ae=>{u0(ae,X)&&!ae.repeat&&ai(X,En(ae))&&W.target&&j(au(W.target,ae),"keyboard")};_(Dt(H.currentTarget),"keyup",Tf(V,ee),!0)}J&&H.stopPropagation(),H.metaKey&&wu()&&((le=W.metaKeyEvents)===null||le===void 0||le.set(H.key,H.nativeEvent))}else H.key==="Meta"&&(W.metaKeyEvents=new Map)},onClick(H){if(!(H&&!ai(H.currentTarget,En(H.nativeEvent)))&&H&&H.button===0&&!W.isTriggeringEvent&&!Su.isOpening){let le=!0;if(c&&H.preventDefault(),!W.ignoreEmulatedMouseEvents&&!W.isPressed&&(W.pointerType==="virtual"||DE(H.nativeEvent))){let J=L(H,"virtual"),X=j(H,"virtual"),V=O(H,"virtual");te(H),le=J&&X&&V}else if(W.isPressed&&W.pointerType!=="keyboard"){let J=W.pointerType||H.nativeEvent.pointerType||"virtual",X=j(au(H.currentTarget,H),J),V=O(au(H.currentTarget,H),J,!0);le=X&&V,W.isOverTarget=!1,te(H),$(H)}W.ignoreEmulatedMouseEvents=!1,le&&H.stopPropagation()}}},ee=H=>{var le;if(W.isPressed&&W.target&&u0(H,W.target)){var J;QS(En(H),H.key)&&H.preventDefault();let V=En(H),ae=ai(W.target,En(H));O(au(W.target,H),"keyboard",ae),ae&&ie(H,W.target),A(),H.key!=="Enter"&&Gx(W.target)&&ai(W.target,V)&&!H[qS]&&(H[qS]=!0,Su(W.target,H,!1)),W.isPressed=!1,(J=W.metaKeyEvents)===null||J===void 0||J.delete(H.key)}else if(H.key==="Meta"&&(!((le=W.metaKeyEvents)===null||le===void 0)&&le.size)){var X;let V=W.metaKeyEvents;W.metaKeyEvents=void 0;for(let ae of V.values())(X=W.target)===null||X===void 0||X.dispatchEvent(new KeyboardEvent("keyup",ae))}};if(typeof PointerEvent<"u"){G.onPointerDown=J=>{if(J.button!==0||!ai(J.currentTarget,En(J.nativeEvent)))return;if(SM(J.nativeEvent)){W.pointerType="virtual";return}W.pointerType=J.pointerType;let X=!0;if(!W.isPressed){W.isPressed=!0,W.isOverTarget=!0,W.activePointerId=J.pointerId,W.target=J.currentTarget,g||L5(W.target),X=L(J,W.pointerType);let V=En(J.nativeEvent);"releasePointerCapture"in V&&V.releasePointerCapture(J.pointerId),_(Dt(J.currentTarget),"pointerup",H,!1),_(Dt(J.currentTarget),"pointercancel",le,!1)}X&&J.stopPropagation()},G.onMouseDown=J=>{if(ai(J.currentTarget,En(J.nativeEvent))&&J.button===0){if(h){let X=R5(J.target);X&&W.disposables.push(X)}J.stopPropagation()}},G.onPointerUp=J=>{!ai(J.currentTarget,En(J.nativeEvent))||W.pointerType==="virtual"||J.button===0&&!W.isPressed&&j(J,W.pointerType||J.pointerType)},G.onPointerEnter=J=>{J.pointerId===W.activePointerId&&W.target&&!W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!0,L(au(W.target,J),W.pointerType))},G.onPointerLeave=J=>{J.pointerId===W.activePointerId&&W.target&&W.isOverTarget&&W.pointerType!=null&&(W.isOverTarget=!1,O(au(W.target,J),W.pointerType,!1),Y(J))};let H=J=>{if(J.pointerId===W.activePointerId&&W.isPressed&&J.button===0&&W.target){if(ai(W.target,En(J))&&W.pointerType!=null){let X=!1,V=setTimeout(()=>{W.isPressed&&W.target instanceof HTMLElement&&(X?$(J):(tl(W.target),W.target.click()))},80);_(J.currentTarget,"click",()=>X=!0,!0),W.disposables.push(()=>clearTimeout(V))}else $(J);W.isOverTarget=!1}},le=J=>{$(J)};G.onDragStart=J=>{ai(J.currentTarget,En(J.nativeEvent))&&$(J)}}return G},[_,c,h,A,g,$,Y,O,L,j,te,ie]);return S.useEffect(()=>{if(!b)return;const W=Dt(b.current);if(!W||!W.head||W.getElementById(YS))return;const G=W.createElement("style");G.id=YS,G.textContent=` -@layer { - [${XS}] { - touch-action: pan-x pan-y pinch-zoom; - } -} - `.trim(),W.head.prepend(G)},[b]),S.useEffect(()=>{let W=T.current;return()=>{var G;g||HS((G=W.target)!==null&&G!==void 0?G:void 0);for(let ee of W.disposables)ee();W.disposables=[]}},[g]),{isPressed:d||k,pressProps:Pn(x,B,{[XS]:!0})}}function Gx(e){return e.tagName==="A"&&e.hasAttribute("href")}function u0(e,t){const{key:n,code:r}=e,i=t,s=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof to(i).HTMLInputElement&&!ET(i,n)||i instanceof to(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&Gx(i))&&n!=="Enter")}function au(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r}}function O5(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!Gx(e)}function QS(e,t){return e instanceof HTMLInputElement?!ET(e,t):O5(e)}const z5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ET(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":z5.has(e.type)}let na=null,ih=new Set,jp=new Map,ku=!1,vb=!1;const j5={Tab:!0,Escape:!0};function Sv(e,t){for(let n of ih)n(e,t)}function B5(e){return!(e.metaKey||!wu()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Xg(e){ku=!0,B5(e)&&(na="keyboard",Sv("keyboard",e))}function wf(e){na="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(ku=!0,Sv("pointer",e))}function PT(e){DE(e)&&(ku=!0,na="virtual")}function TT(e){e.target===window||e.target===document||Yg||!e.isTrusted||(!ku&&!vb&&(na="virtual",Sv("virtual",e)),ku=!1,vb=!1)}function _T(){Yg||(ku=!1,vb=!0)}function Qg(e){if(typeof window>"u"||typeof document>"u"||jp.get(to(e)))return;const t=to(e),n=Dt(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){ku=!0,r.apply(this,arguments)},n.addEventListener("keydown",Xg,!0),n.addEventListener("keyup",Xg,!0),n.addEventListener("click",PT,!0),t.addEventListener("focus",TT,!0),t.addEventListener("blur",_T,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",wf,!0),n.addEventListener("pointermove",wf,!0),n.addEventListener("pointerup",wf,!0)),t.addEventListener("beforeunload",()=>{IT(e)},{once:!0}),jp.set(t,{focus:r})}const IT=(e,t)=>{const n=to(e),r=Dt(e);t&&r.removeEventListener("DOMContentLoaded",t),jp.has(n)&&(n.HTMLElement.prototype.focus=jp.get(n).focus,r.removeEventListener("keydown",Xg,!0),r.removeEventListener("keyup",Xg,!0),r.removeEventListener("click",PT,!0),n.removeEventListener("focus",TT,!0),n.removeEventListener("blur",_T,!1),typeof PointerEvent<"u"&&(r.removeEventListener("pointerdown",wf,!0),r.removeEventListener("pointermove",wf,!0),r.removeEventListener("pointerup",wf,!0)),jp.delete(n))};function V5(e){const t=Dt(e);let n;return t.readyState!=="loading"?Qg(e):(n=()=>{Qg(e)},t.addEventListener("DOMContentLoaded",n)),()=>IT(e,n)}typeof document<"u"&&V5();function qx(){return na!=="pointer"}function oh(){return na}function U5(e){na=e,Sv(e,null)}function HG(){Qg();let[e,t]=S.useState(na);return S.useEffect(()=>{let n=()=>{t(na)};return ih.add(n),()=>{ih.delete(n)}},[]),ph()?null:e}const K5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function W5(e,t,n){let r=Dt(n?.target);const i=typeof window<"u"?to(n?.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?to(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?to(n?.target).HTMLElement:HTMLElement,c=typeof window<"u"?to(n?.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof i&&!K5.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof a&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!j5[n.key])}function H5(e,t,n){Qg(),S.useEffect(()=>{let r=(i,s)=>{W5(!!n?.isTextInput,i,s)&&e(qx())};return ih.add(r),()=>{ih.delete(r)}},t)}function Cu(e){const t=Dt(e),n=zr(t);if(oh()==="virtual"){let r=n;$E(()=>{zr(t)===r&&e.isConnected&&tl(e)})}else tl(e)}function $T(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const s=S.useCallback(d=>{if(d.target===d.currentTarget)return r&&r(d),i&&i(!1),!0},[r,i]),a=kT(s),c=S.useCallback(d=>{const h=Dt(d.target),m=h?zr(h):zr();d.target===d.currentTarget&&m===En(d.nativeEvent)&&(n&&n(d),i&&i(!0),a(d))},[i,n,a]);return{focusProps:{onFocus:!t&&(n||i||r)?c:void 0,onBlur:!t&&(r||i)?s:void 0}}}function JS(e){if(!e)return;let t=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}};e(r),t&&n.stopPropagation()}}function G5(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:JS(e.onKeyDown),onKeyUp:JS(e.onKeyUp)}}}let q5=He.createContext(null);function Y5(e){let t=S.useContext(q5)||{};RE(t,e);let{ref:n,...r}=t;return r}function xh(e,t){let{focusProps:n}=$T(e),{keyboardProps:r}=G5(e),i=Pn(n,r),s=Y5(t),a=e.isDisabled?{}:s,c=S.useRef(e.autoFocus);S.useEffect(()=>{c.current&&t.current&&Cu(t.current),c.current=!1},[t]);let d=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(d=void 0),{focusableProps:Pn({...i,tabIndex:d},a)}}function X5({children:e}){let t=S.useMemo(()=>({register:()=>{}}),[]);return He.createElement(Hx.Provider,{value:t},e)}function kv(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,s=S.useRef({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:c}=cx(),d=S.useCallback(g=>{g.currentTarget.contains(g.target)&&s.current.isFocusWithin&&!g.currentTarget.contains(g.relatedTarget)&&(s.current.isFocusWithin=!1,c(),n&&n(g),i&&i(!1))},[n,i,s,c]),h=kT(d),m=S.useCallback(g=>{if(!g.currentTarget.contains(g.target))return;const b=Dt(g.target),x=zr(b);if(!s.current.isFocusWithin&&x===En(g.nativeEvent)){r&&r(g),i&&i(!0),s.current.isFocusWithin=!0,h(g);let k=g.currentTarget;a(b,"focus",P=>{if(s.current.isFocusWithin&&!ai(k,P.target)){let T=new b.defaultView.FocusEvent("blur",{relatedTarget:P.target});ST(T,k);let _=Wx(T);d(_)}},{capture:!0})}},[r,i,h,a,d]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:m,onBlur:d}}}let yb=!1,c0=0;function Q5(){yb=!0,setTimeout(()=>{yb=!1},50)}function ZS(e){e.pointerType==="touch"&&Q5()}function J5(){if(!(typeof document>"u"))return typeof PointerEvent<"u"&&document.addEventListener("pointerup",ZS),c0++,()=>{c0--,!(c0>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",ZS)}}function Eu(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[s,a]=S.useState(!1),c=S.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;S.useEffect(J5,[]);let{addGlobalListener:d,removeAllGlobalListeners:h}=cx(),{hoverProps:m,triggerHoverEnd:g}=S.useMemo(()=>{let b=(P,T)=>{if(c.pointerType=T,i||T==="touch"||c.isHovered||!P.currentTarget.contains(P.target))return;c.isHovered=!0;let _=P.currentTarget;c.target=_,d(Dt(P.target),"pointerover",A=>{c.isHovered&&c.target&&!ai(c.target,A.target)&&x(A,A.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:_,pointerType:T}),n&&n(!0),a(!0)},x=(P,T)=>{let _=c.target;c.pointerType="",c.target=null,!(T==="touch"||!c.isHovered||!_)&&(c.isHovered=!1,h(),r&&r({type:"hoverend",target:_,pointerType:T}),n&&n(!1),a(!1))},k={};return typeof PointerEvent<"u"&&(k.onPointerEnter=P=>{yb&&P.pointerType==="mouse"||b(P,P.pointerType)},k.onPointerLeave=P=>{!i&&P.currentTarget.contains(P.target)&&x(P,P.pointerType)}),{hoverProps:k,triggerHoverEnd:x}},[t,n,r,i,c,d,h]);return S.useEffect(()=>{i&&g({currentTarget:c.target},c.pointerType)},[i]),{hoverProps:m,isHovered:s}}function Z5(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,s=S.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=jn(d=>{n&&ek(d,t)&&(i&&i(d),s.current.isPointerDown=!0)}),c=jn(d=>{n&&n(d)});S.useEffect(()=>{let d=s.current;if(r)return;const h=t.current,m=Dt(h);if(typeof PointerEvent<"u"){let g=b=>{d.isPointerDown&&ek(b,t)&&c(b),d.isPointerDown=!1};return m.addEventListener("pointerdown",a,!0),m.addEventListener("click",g,!0),()=>{m.removeEventListener("pointerdown",a,!0),m.removeEventListener("click",g,!0)}}},[t,r,a,c])}function ek(e,t){if(e.button>0)return!1;if(e.target){const n=e.target.ownerDocument;if(!n||!n.documentElement.contains(e.target)||e.target.closest("[data-react-aria-top-layer]"))return!1}return t.current?!e.composedPath().includes(t.current):!1}const tk=He.createContext(null),bb="react-aria-focus-scope-restore";let Qt=null;function eF(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,s=S.useRef(null),a=S.useRef(null),c=S.useRef([]),{parentNode:d}=S.useContext(tk)||{},h=S.useMemo(()=>new wb({scopeRef:c}),[c]);sn(()=>{let b=d||Ln.root;if(Ln.getTreeNode(b.scopeRef)&&Qt&&!Jg(Qt,b.scopeRef)){let x=Ln.getTreeNode(Qt);x&&(b=x)}b.addChild(h),Ln.addNode(h)},[h,d]),sn(()=>{let b=Ln.getTreeNode(c);b&&(b.contain=!!n)},[n]),sn(()=>{var b;let x=(b=s.current)===null||b===void 0?void 0:b.nextSibling,k=[],P=T=>T.stopPropagation();for(;x&&x!==a.current;)k.push(x),x.addEventListener(bb,P),x=x.nextSibling;return c.current=k,()=>{for(let T of k)T.removeEventListener(bb,P)}},[t]),oF(c,r,n),nF(c,n),sF(c,r,n),iF(c,i),S.useEffect(()=>{const b=zr(Dt(c.current?c.current[0]:void 0));let x=null;if(ro(b,c.current)){for(let k of Ln.traverse())k.scopeRef&&ro(b,k.scopeRef.current)&&(x=k);x===Ln.getTreeNode(c)&&(Qt=x.scopeRef)}},[c]),sn(()=>()=>{var b,x,k;let P=(k=(x=Ln.getTreeNode(c))===null||x===void 0||(b=x.parent)===null||b===void 0?void 0:b.scopeRef)!==null&&k!==void 0?k:null;(c===Qt||Jg(c,Qt))&&(!P||Ln.getTreeNode(P))&&(Qt=P),Ln.removeTreeNode(c)},[c]);let m=S.useMemo(()=>tF(c),[]),g=S.useMemo(()=>({focusManager:m,parentNode:h}),[h,m]);return He.createElement(tk.Provider,{value:g},He.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:s}),t,He.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:a}))}function tF(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:s,accept:a}=t;var c;let d=r||zr(Dt((c=n[0])!==null&&c!==void 0?c:void 0)),h=n[0].previousElementSibling,m=vu(n),g=Js(m,{tabbable:i,accept:a},n);g.currentNode=ro(d,n)?d:h;let b=g.nextNode();return!b&&s&&(g.currentNode=h,b=g.nextNode()),b&&Qs(b,!0),b},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:s,accept:a}=t;var c;let d=r||zr(Dt((c=n[0])!==null&&c!==void 0?c:void 0)),h=n[n.length-1].nextElementSibling,m=vu(n),g=Js(m,{tabbable:i,accept:a},n);g.currentNode=ro(d,n)?d:h;let b=g.previousNode();return!b&&s&&(g.currentNode=h,b=g.previousNode()),b&&Qs(b,!0),b},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,s=vu(n),a=Js(s,{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let c=a.nextNode();return c&&Qs(c,!0),c},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,s=vu(n),a=Js(s,{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let c=a.previousNode();return c&&Qs(c,!0),c}}}function vu(e){return e[0].parentElement}function Ap(e){let t=Ln.getTreeNode(Qt);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function nF(e,t){let n=S.useRef(void 0),r=S.useRef(void 0);sn(()=>{let i=e.current;if(!t){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const s=Dt(i?i[0]:void 0);let a=h=>{if(h.key!=="Tab"||h.altKey||h.ctrlKey||h.metaKey||!Ap(e)||h.isComposing)return;let m=zr(s),g=e.current;if(!g||!ro(m,g))return;let b=vu(g),x=Js(b,{tabbable:!0},g);if(!m)return;x.currentNode=m;let k=h.shiftKey?x.previousNode():x.nextNode();k||(x.currentNode=h.shiftKey?g[g.length-1].nextElementSibling:g[0].previousElementSibling,k=h.shiftKey?x.previousNode():x.nextNode()),h.preventDefault(),k&&Qs(k,!0)},c=h=>{(!Qt||Jg(Qt,e))&&ro(En(h),e.current)?(Qt=e,n.current=En(h)):Ap(e)&&!Qa(En(h),e)?n.current?n.current.focus():Qt&&Qt.current&&xb(Qt.current):Ap(e)&&(n.current=En(h))},d=h=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let m=oh(),g=(m==="virtual"||m===null)&&lx()&&TE(),b=zr(s);if(!g&&b&&Ap(e)&&!Qa(b,e)){Qt=e;let k=En(h);if(k&&k.isConnected){var x;n.current=k,(x=n.current)===null||x===void 0||x.focus()}else Qt.current&&xb(Qt.current)}})};return s.addEventListener("keydown",a,!1),s.addEventListener("focusin",c,!1),i?.forEach(h=>h.addEventListener("focusin",c,!1)),i?.forEach(h=>h.addEventListener("focusout",d,!1)),()=>{s.removeEventListener("keydown",a,!1),s.removeEventListener("focusin",c,!1),i?.forEach(h=>h.removeEventListener("focusin",c,!1)),i?.forEach(h=>h.removeEventListener("focusout",d,!1))}},[e,t]),sn(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function AT(e){return Qa(e)}function ro(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function Qa(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of Ln.traverse(Ln.getTreeNode(t)))if(n&&ro(e,n.current))return!0;return!1}function rF(e){return Qa(e,Qt)}function Jg(e,t){var n;let r=(n=Ln.getTreeNode(t))===null||n===void 0?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function Qs(e,t=!1){if(e!=null&&!t)try{Cu(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function RT(e,t=!0){let n=e[0].previousElementSibling,r=vu(e),i=Js(r,{tabbable:t},e);i.currentNode=n;let s=i.nextNode();return t&&!s&&(r=vu(e),i=Js(r,{tabbable:!1},e),i.currentNode=n,s=i.nextNode()),s}function xb(e,t=!0){Qs(RT(e,t))}function iF(e,t){const n=He.useRef(t);S.useEffect(()=>{if(n.current){Qt=e;const r=Dt(e.current?e.current[0]:void 0);!ro(zr(r),Qt.current)&&e.current&&xb(e.current)}n.current=!1},[e])}function oF(e,t,n){sn(()=>{if(t||n)return;let r=e.current;const i=Dt(r?r[0]:void 0);let s=a=>{let c=En(a);ro(c,e.current)?Qt=e:AT(c)||(Qt=null)};return i.addEventListener("focusin",s,!1),r?.forEach(a=>a.addEventListener("focusin",s,!1)),()=>{i.removeEventListener("focusin",s,!1),r?.forEach(a=>a.removeEventListener("focusin",s,!1))}},[e,t,n])}function nk(e){let t=Ln.getTreeNode(Qt);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function sF(e,t,n){const r=S.useRef(typeof document<"u"?zr(Dt(e.current?e.current[0]:void 0)):null);sn(()=>{let i=e.current;const s=Dt(i?i[0]:void 0);if(!t||n)return;let a=()=>{(!Qt||Jg(Qt,e))&&ro(zr(s),e.current)&&(Qt=e)};return s.addEventListener("focusin",a,!1),i?.forEach(c=>c.addEventListener("focusin",a,!1)),()=>{s.removeEventListener("focusin",a,!1),i?.forEach(c=>c.removeEventListener("focusin",a,!1))}},[e,n]),sn(()=>{const i=Dt(e.current?e.current[0]:void 0);if(!t)return;let s=a=>{if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey||!Ap(e)||a.isComposing)return;let c=i.activeElement;if(!Qa(c,e)||!nk(e))return;let d=Ln.getTreeNode(e);if(!d)return;let h=d.nodeToRestore,m=Js(i.body,{tabbable:!0});m.currentNode=c;let g=a.shiftKey?m.previousNode():m.nextNode();if((!h||!h.isConnected||h===i.body)&&(h=void 0,d.nodeToRestore=void 0),(!g||!Qa(g,e))&&h){m.currentNode=h;do g=a.shiftKey?m.previousNode():m.nextNode();while(Qa(g,e));a.preventDefault(),a.stopPropagation(),g?Qs(g,!0):AT(h)?Qs(h,!0):c.blur()}};return n||i.addEventListener("keydown",s,!0),()=>{n||i.removeEventListener("keydown",s,!0)}},[e,t,n]),sn(()=>{const i=Dt(e.current?e.current[0]:void 0);if(!t)return;let s=Ln.getTreeNode(e);if(s){var a;return s.nodeToRestore=(a=r.current)!==null&&a!==void 0?a:void 0,()=>{let c=Ln.getTreeNode(e);if(!c)return;let d=c.nodeToRestore,h=zr(i);if(t&&d&&(h&&Qa(h,e)||h===i.body&&nk(e))){let m=Ln.clone();requestAnimationFrame(()=>{if(i.activeElement===i.body){let g=m.getTreeNode(e);for(;g;){if(g.nodeToRestore&&g.nodeToRestore.isConnected){rk(g.nodeToRestore);return}g=g.parent}for(g=m.getTreeNode(e);g;){if(g.scopeRef&&g.scopeRef.current&&Ln.getTreeNode(g.scopeRef)){let b=RT(g.scopeRef.current,!0);rk(b);return}g=g.parent}}})}}}},[e,t])}function rk(e){e.dispatchEvent(new CustomEvent(bb,{bubbles:!0,cancelable:!0}))&&Qs(e)}function Js(e,t,n){let r=t?.tabbable?TM:zE,i=e?.nodeType===Node.ELEMENT_NODE?e:null,s=Dt(i),a=iM(s,e||s,NodeFilter.SHOW_ELEMENT,{acceptNode(c){var d;return!(t==null||(d=t.from)===null||d===void 0)&&d.contains(c)?NodeFilter.FILTER_REJECT:r(c)&&wT(c)&&(!n||ro(c,n))&&(!t?.accept||t.accept(c))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(a.currentNode=t.from),a}class Yx{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let s=new wb({scopeRef:t});i.addChild(s),s.parent=i,this.fastMap.set(t,s),r&&(s.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&ro(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(s=>r&&r.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new Yx;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new wb({scopeRef:null}),this.fastMap.set(null,this.root)}}class wb{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}let Ln=new Yx;function Pu(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=S.useRef({isFocused:!1,isFocusVisible:t||qx()}),[s,a]=S.useState(!1),[c,d]=S.useState(()=>i.current.isFocused&&i.current.isFocusVisible),h=S.useCallback(()=>d(i.current.isFocused&&i.current.isFocusVisible),[]),m=S.useCallback(x=>{i.current.isFocused=x,a(x),h()},[h]);H5(x=>{i.current.isFocusVisible=x,h()},[],{isTextInput:n});let{focusProps:g}=$T({isDisabled:r,onFocusChange:m}),{focusWithinProps:b}=kv({isDisabled:!r,onFocusWithinChange:m});return{isFocused:s,isFocusVisible:c,focusProps:r?b:g}}function aF(e){let t=cF(Dt(e));t!==e&&(t&&lF(t,e),e&&uF(e,t))}function lF(e,t){e.dispatchEvent(new FocusEvent("blur",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:t}))}function uF(e,t){e.dispatchEvent(new FocusEvent("focus",{relatedTarget:t})),e.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:t}))}function cF(e){let t=zr(e),n=t?.getAttribute("aria-activedescendant");return n&&e.getElementById(n)||t}const f0=typeof document<"u"&&window.visualViewport,fF=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let gg=0,d0;function dF(e={}){let{isDisabled:t}=e;sn(()=>{if(!t)return gg++,gg===1&&(vv()?d0=hF():d0=pF()),()=>{gg--,gg===0&&d0()}},[t])}function pF(){let e=window.innerWidth-document.documentElement.clientWidth;return Tf(e>0&&("scrollbarGutter"in document.documentElement.style?yu(document.documentElement,"scrollbarGutter","stable"):yu(document.documentElement,"paddingRight",`${e}px`)),yu(document.documentElement,"overflow","hidden"))}function hF(){let e,t,n=h=>{e=LE(h.target,!0),!(e===document.documentElement&&e===document.body)&&e instanceof HTMLElement&&window.getComputedStyle(e).overscrollBehavior==="auto"&&(t=yu(e,"overscrollBehavior","contain"))},r=h=>{if(!e||e===document.documentElement||e===document.body){h.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&h.preventDefault()},i=()=>{t&&t()},s=h=>{let m=h.target;mF(m)&&(c(),m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",f0&&(f0.height{ik(m)}):f0.addEventListener("resize",()=>ik(m),{once:!0}))}))},a=null,c=()=>{if(a)return;let h=()=>{window.scrollTo(0,0)},m=window.pageXOffset,g=window.pageYOffset;a=Tf(gp(window,"scroll",h),yu(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),yu(document.documentElement,"overflow","hidden"),yu(document.body,"marginTop",`-${g}px`),()=>{window.scrollTo(m,g)}),window.scrollTo(0,0)},d=Tf(gp(document,"touchstart",n,{passive:!1,capture:!0}),gp(document,"touchmove",r,{passive:!1,capture:!0}),gp(document,"touchend",i,{passive:!1,capture:!0}),gp(document,"focus",s,!0));return()=>{t?.(),a?.(),d()}}function yu(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function gp(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ik(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let r=LE(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect().top,s=n.getBoundingClientRect().top;s>i+n.clientHeight&&(r.scrollTop+=s-i)}n=r.parentElement}}function mF(e){return e instanceof HTMLInputElement&&!fF.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}const gF=S.createContext({});function LT(){var e;return(e=S.useContext(gF))!==null&&e!==void 0?e:{}}const Sb=He.createContext(null);function vF(e){let{children:t}=e,n=S.useContext(Sb),[r,i]=S.useState(0),s=S.useMemo(()=>({parent:n,modalCount:r,addModal(){i(a=>a+1),n&&n.addModal()},removeModal(){i(a=>a-1),n&&n.removeModal()}}),[n,r]);return He.createElement(Sb.Provider,{value:s},t)}function yF(){let e=S.useContext(Sb);return{modalProviderProps:{"aria-hidden":e&&e.modalCount>0?!0:void 0}}}function bF(e){let{modalProviderProps:t}=yF();return He.createElement("div",{"data-overlay-container":!0,...e,...t})}function MT(e){return He.createElement(vF,null,He.createElement(bF,e))}function ok(e){let t=ph(),{portalContainer:n=t?null:document.body,...r}=e,{getContainer:i}=LT();if(!e.portalContainer&&i&&(n=i()),He.useEffect(()=>{if(n?.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[n]),!n)return null;let s=He.createElement(MT,r);return OE.createPortal(s,n)}var DT={};DT={dismiss:"تجاهل"};var NT={};NT={dismiss:"Отхвърляне"};var FT={};FT={dismiss:"Odstranit"};var OT={};OT={dismiss:"Luk"};var zT={};zT={dismiss:"Schließen"};var jT={};jT={dismiss:"Απόρριψη"};var BT={};BT={dismiss:"Dismiss"};var VT={};VT={dismiss:"Descartar"};var UT={};UT={dismiss:"Lõpeta"};var KT={};KT={dismiss:"Hylkää"};var WT={};WT={dismiss:"Rejeter"};var HT={};HT={dismiss:"התעלם"};var GT={};GT={dismiss:"Odbaci"};var qT={};qT={dismiss:"Elutasítás"};var YT={};YT={dismiss:"Ignora"};var XT={};XT={dismiss:"閉じる"};var QT={};QT={dismiss:"무시"};var JT={};JT={dismiss:"Atmesti"};var ZT={};ZT={dismiss:"Nerādīt"};var e_={};e_={dismiss:"Lukk"};var t_={};t_={dismiss:"Negeren"};var n_={};n_={dismiss:"Zignoruj"};var r_={};r_={dismiss:"Descartar"};var i_={};i_={dismiss:"Dispensar"};var o_={};o_={dismiss:"Revocare"};var s_={};s_={dismiss:"Пропустить"};var a_={};a_={dismiss:"Zrušiť"};var l_={};l_={dismiss:"Opusti"};var u_={};u_={dismiss:"Odbaci"};var c_={};c_={dismiss:"Avvisa"};var f_={};f_={dismiss:"Kapat"};var d_={};d_={dismiss:"Скасувати"};var p_={};p_={dismiss:"取消"};var h_={};h_={dismiss:"關閉"};var m_={};m_={"ar-AE":DT,"bg-BG":NT,"cs-CZ":FT,"da-DK":OT,"de-DE":zT,"el-GR":jT,"en-US":BT,"es-ES":VT,"et-EE":UT,"fi-FI":KT,"fr-FR":WT,"he-IL":HT,"hr-HR":GT,"hu-HU":qT,"it-IT":YT,"ja-JP":XT,"ko-KR":QT,"lt-LT":JT,"lv-LV":ZT,"nb-NO":e_,"nl-NL":t_,"pl-PL":n_,"pt-BR":r_,"pt-PT":i_,"ro-RO":o_,"ru-RU":s_,"sk-SK":a_,"sl-SI":l_,"sr-SP":u_,"sv-SE":c_,"tr-TR":f_,"uk-UA":d_,"zh-CN":p_,"zh-TW":h_};const sk={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function xF(e={}){let{style:t,isFocusable:n}=e,[r,i]=S.useState(!1),{focusWithinProps:s}=kv({isDisabled:!n,onFocusWithinChange:c=>i(c)}),a=S.useMemo(()=>r?t:t?{...sk,...t}:sk,[r]);return{visuallyHiddenProps:{...s,style:a}}}function wF(e){let{children:t,elementType:n="div",isFocusable:r,style:i,...s}=e,{visuallyHiddenProps:a}=xF(e);return He.createElement(n,Pn(s,a),t)}function SF(e){return e&&e.__esModule?e.default:e}function ak(e){let{onDismiss:t,...n}=e,r=GL(SF(m_),"@react-aria/overlays"),i=AE(n,r.format("dismiss")),s=()=>{t&&t()};return He.createElement(wF,null,He.createElement("button",{...i,tabIndex:-1,onClick:s,style:{width:1,height:1}}))}let vp=new WeakMap,Qi=[];function kF(e,t=document.body){let n=new Set(e),r=new Set,i=d=>{for(let b of d.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(b);let h=b=>{if(n.has(b)||b.parentElement&&r.has(b.parentElement)&&b.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let x of n)if(b.contains(x))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},m=document.createTreeWalker(d,NodeFilter.SHOW_ELEMENT,{acceptNode:h}),g=h(d);if(g===NodeFilter.FILTER_ACCEPT&&s(d),g!==NodeFilter.FILTER_REJECT){let b=m.nextNode();for(;b!=null;)s(b),b=m.nextNode()}},s=d=>{var h;let m=(h=vp.get(d))!==null&&h!==void 0?h:0;d.getAttribute("aria-hidden")==="true"&&m===0||(m===0&&d.setAttribute("aria-hidden","true"),r.add(d),vp.set(d,m+1))};Qi.length&&Qi[Qi.length-1].disconnect(),i(t);let a=new MutationObserver(d=>{for(let h of d)if(!(h.type!=="childList"||h.addedNodes.length===0)&&![...n,...r].some(m=>m.contains(h.target))){for(let m of h.removedNodes)m instanceof Element&&(n.delete(m),r.delete(m));for(let m of h.addedNodes)(m instanceof HTMLElement||m instanceof SVGElement)&&(m.dataset.liveAnnouncer==="true"||m.dataset.reactAriaTopLayer==="true")?n.add(m):m instanceof Element&&i(m)}});a.observe(t,{childList:!0,subtree:!0});let c={visibleNodes:n,hiddenNodes:r,observe(){a.observe(t,{childList:!0,subtree:!0})},disconnect(){a.disconnect()}};return Qi.push(c),()=>{a.disconnect();for(let d of r){let h=vp.get(d);h!=null&&(h===1?(d.removeAttribute("aria-hidden"),vp.delete(d)):vp.set(d,h-1))}c===Qi[Qi.length-1]?(Qi.pop(),Qi.length&&Qi[Qi.length-1].observe()):Qi.splice(Qi.indexOf(c),1)}}const g_=He.createContext(null);function CF(e){let t=ph(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,s]=S.useState(!1),a=S.useMemo(()=>({contain:i,setContain:s}),[i,s]),{getContainer:c}=LT();if(!e.portalContainer&&c&&(n=c()),!n)return null;let d=e.children;return e.disableFocusManagement||(d=He.createElement(eF,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},d)),d=He.createElement(g_.Provider,{value:a},He.createElement(X5,null,d)),OE.createPortal(d,n)}function v_(){let e=S.useContext(g_),t=e?.setContain;sn(()=>{t?.(!0)},[t])}var EF=({children:e,navigate:t,disableAnimation:n,useHref:r,disableRipple:i=!1,skipFramerMotionAnimations:s=n,reducedMotion:a="never",validationBehavior:c,locale:d="en-US",labelPlacement:h,defaultDates:m,createCalendar:g,spinnerVariant:b,...x})=>{let k=e;t&&(k=D.jsx(gM,{navigate:t,useHref:r,children:k}));const P=S.useMemo(()=>(n&&s&&(fs.skipAnimations=!0),{createCalendar:g,defaultDates:m,disableAnimation:n,disableRipple:i,validationBehavior:c,labelPlacement:h,spinnerVariant:b}),[g,m?.maxDate,m?.minDate,n,i,c,h,b]);return D.jsx(TL,{value:P,children:D.jsx(zL,{locale:d,children:D.jsx(B3,{reducedMotion:a,children:D.jsx(MT,{...x,children:k})})})})};function GG(e){const t=ci(),n=t?.labelPlacement;return S.useMemo(()=>{var r,i;const s=(i=(r=e.labelPlacement)!=null?r:n)!=null?i:"inside";return s==="inside"&&!e.label?"outside":s},[e.labelPlacement,n,e.label])}function PF(e){const t=ci(),n=t?.labelPlacement;return S.useMemo(()=>{var r,i;const s=(i=(r=e.labelPlacement)!=null?r:n)!=null?i:"inside";return s==="inside"&&!e.label?"outside":s},[e.labelPlacement,n,e.label])}function jr(e){return S.forwardRef(e)}var oa=(e,t,n=!0)=>{if(!t)return[e,{}];const r=t.reduce((i,s)=>s in e?{...i,[s]:e[s]}:i,{});return n?[Object.keys(e).filter(s=>!t.includes(s)).reduce((s,a)=>({...s,[a]:e[a]}),{}),r]:[e,r]},TF={default:"bg-default text-default-foreground",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",danger:"bg-danger text-danger-foreground",foreground:"bg-foreground text-background"},_F={default:"shadow-lg shadow-default/50 bg-default text-default-foreground",primary:"shadow-lg shadow-primary/40 bg-primary text-primary-foreground",secondary:"shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground",success:"shadow-lg shadow-success/40 bg-success text-success-foreground",warning:"shadow-lg shadow-warning/40 bg-warning text-warning-foreground",danger:"shadow-lg shadow-danger/40 bg-danger text-danger-foreground"},IF={default:"bg-transparent border-default text-foreground",primary:"bg-transparent border-primary text-primary",secondary:"bg-transparent border-secondary text-secondary",success:"bg-transparent border-success text-success",warning:"bg-transparent border-warning text-warning",danger:"bg-transparent border-danger text-danger"},$F={default:"bg-default/40 text-default-700",primary:"bg-primary/20 text-primary-600",secondary:"bg-secondary/20 text-secondary-600",success:"bg-success/20 text-success-700 dark:text-success",warning:"bg-warning/20 text-warning-700 dark:text-warning",danger:"bg-danger/20 text-danger-600 dark:text-danger-500"},AF={default:"border-default bg-default-100 text-default-foreground",primary:"border-default bg-default-100 text-primary",secondary:"border-default bg-default-100 text-secondary",success:"border-default bg-default-100 text-success",warning:"border-default bg-default-100 text-warning",danger:"border-default bg-default-100 text-danger"},RF={default:"bg-transparent text-default-foreground",primary:"bg-transparent text-primary",secondary:"bg-transparent text-secondary",success:"bg-transparent text-success",warning:"bg-transparent text-warning",danger:"bg-transparent text-danger"},LF={default:"border-default text-default-foreground",primary:"border-primary text-primary",secondary:"border-secondary text-secondary",success:"border-success text-success",warning:"border-warning text-warning",danger:"border-danger text-danger"},Te={solid:TF,shadow:_F,bordered:IF,flat:$F,faded:AF,light:RF,ghost:LF},MF={".spinner-bar-animation":{"animation-delay":"calc(-1.2s + (0.1s * var(--bar-index)))",transform:"rotate(calc(30deg * var(--bar-index)))translate(140%)"},".spinner-dot-animation":{"animation-delay":"calc(250ms * var(--dot-index))"},".spinner-dot-blink-animation":{"animation-delay":"calc(200ms * var(--dot-index))"}},DF={".leading-inherit":{"line-height":"inherit"},".bg-img-inherit":{"background-image":"inherit"},".bg-clip-inherit":{"background-clip":"inherit"},".text-fill-inherit":{"-webkit-text-fill-color":"inherit"},".tap-highlight-transparent":{"-webkit-tap-highlight-color":"transparent"},".input-search-cancel-button-none":{"&::-webkit-search-cancel-button":{"-webkit-appearance":"none"}}},NF={".scrollbar-hide":{"-ms-overflow-style":"none","scrollbar-width":"none","&::-webkit-scrollbar":{display:"none"}},".scrollbar-default":{"-ms-overflow-style":"auto","scrollbar-width":"auto","&::-webkit-scrollbar":{display:"block"}}},FF={".text-tiny":{"font-size":"var(--heroui-font-size-tiny)","line-height":"var(--heroui-line-height-tiny)"},".text-small":{"font-size":"var(--heroui-font-size-small)","line-height":"var(--heroui-line-height-small)"},".text-medium":{"font-size":"var(--heroui-font-size-medium)","line-height":"var(--heroui-line-height-medium)"},".text-large":{"font-size":"var(--heroui-font-size-large)","line-height":"var(--heroui-line-height-large)"}},is="250ms",OF={".transition-background":{"transition-property":"background","transition-timing-function":"ease","transition-duration":is},".transition-colors-opacity":{"transition-property":"color, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":is},".transition-width":{"transition-property":"width","transition-timing-function":"ease","transition-duration":is},".transition-height":{"transition-property":"height","transition-timing-function":"ease","transition-duration":is},".transition-size":{"transition-property":"width, height","transition-timing-function":"ease","transition-duration":is},".transition-left":{"transition-property":"left","transition-timing-function":"ease","transition-duration":is},".transition-transform-opacity":{"transition-property":"transform, scale, opacity rotate","transition-timing-function":"ease","transition-duration":is},".transition-transform-background":{"transition-property":"transform, scale, background","transition-timing-function":"ease","transition-duration":is},".transition-transform-colors":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke","transition-timing-function":"ease","transition-duration":is},".transition-transform-colors-opacity":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":is}},zF={...DF,...OF,...NF,...FF,...MF},vg=["small","medium","large"],kb={theme:{spacing:["divider"],radius:vg},classGroups:{shadow:[{shadow:vg}],opacity:[{opacity:["disabled"]}],"font-size":[{text:["tiny",...vg]}],"border-w":[{border:vg}],"bg-image":["bg-stripe-gradient-default","bg-stripe-gradient-primary","bg-stripe-gradient-secondary","bg-stripe-gradient-success","bg-stripe-gradient-warning","bg-stripe-gradient-danger"],transition:Object.keys(zF).filter(e=>e.includes(".transition")).map(e=>e.replace(".",""))}},lk=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,oi=e=>!e||typeof e!="object"||Object.keys(e).length===0,jF=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function y_(e,t){e.forEach(function(n){Array.isArray(n)?y_(n,t):t.push(n)})}function b_(e){let t=[];return y_(e,t),t}var x_=(...e)=>b_(e).filter(Boolean),w_=(e,t)=>{let n={},r=Object.keys(e),i=Object.keys(t);for(let s of r)if(i.includes(s)){let a=e[s],c=t[s];Array.isArray(a)||Array.isArray(c)?n[s]=x_(c,a):typeof a=="object"&&typeof c=="object"?n[s]=w_(a,c):n[s]=c+" "+a}else n[s]=e[s];for(let s of i)r.includes(s)||(n[s]=t[s]);return n},uk=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim();const Xx="-",BF=e=>{const t=UF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const c=a.split(Xx);return c[0]===""&&c.length!==1&&c.shift(),S_(c,t)||VF(a)},getConflictingClassGroupIds:(a,c)=>{const d=n[a]||[];return c&&r[a]?[...d,...r[a]]:d}}},S_=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?S_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Xx);return t.validators.find(({validator:a})=>a(s))?.classGroupId},ck=/^\[(.+)\]$/,VF=e=>{if(ck.test(e)){const t=ck.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},UF=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)Cb(n[i],r,i,t);return r},Cb=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:fk(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(KF(i)){Cb(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Cb(a,fk(t,s),n,r)})})},fk=(e,t)=>{let n=e;return t.split(Xx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},KF=e=>e.isThemeGetter,WF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},Eb="!",Pb=":",HF=Pb.length,GF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let a=0,c=0,d=0,h;for(let k=0;kd?h-d:void 0;return{modifiers:s,hasImportantModifier:b,baseClassName:g,maybePostfixModifierPosition:x}};if(t){const i=t+Pb,s=r;r=a=>a.startsWith(i)?s(a.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},qF=e=>e.endsWith(Eb)?e.substring(0,e.length-1):e.startsWith(Eb)?e.substring(1):e,YF=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let s=[];return r.forEach(a=>{a[0]==="["||t[a]?(i.push(...s.sort(),a),s=[]):s.push(a)}),i.push(...s.sort()),i}},XF=e=>({cache:WF(e.cacheSize),parseClassName:GF(e),sortModifiers:YF(e),...BF(e)}),QF=/\s+/,JF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],c=e.trim().split(QF);let d="";for(let h=c.length-1;h>=0;h-=1){const m=c[h],{isExternal:g,modifiers:b,hasImportantModifier:x,baseClassName:k,maybePostfixModifierPosition:P}=n(m);if(g){d=m+(d.length>0?" "+d:d);continue}let T=!!P,_=r(T?k.substring(0,P):k);if(!_){if(!T){d=m+(d.length>0?" "+d:d);continue}if(_=r(k),!_){d=m+(d.length>0?" "+d:d);continue}T=!1}const A=s(b).join(":"),L=x?A+Eb:A,O=L+_;if(a.includes(O))continue;a.push(O);const j=i(_,T);for(let $=0;$0?" "+d:d)}return d};function ZF(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rg(m),e());return n=XF(h),r=n.cache.get,i=n.cache.set,s=c,c(d)}function c(d){const h=r(d);if(h)return h;const m=JF(d,n);return i(d,m),m}return function(){return s(ZF.apply(null,arguments))}}const Jn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},C_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,E_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eO=/^\d+\/\d+$/,tO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,iO=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sf=e=>eO.test(e),yt=e=>!!e&&!Number.isNaN(Number(e)),lu=e=>!!e&&Number.isInteger(Number(e)),dk=e=>e.endsWith("%")&&yt(e.slice(0,-1)),Ga=e=>tO.test(e),sO=()=>!0,aO=e=>nO.test(e)&&!rO.test(e),Qx=()=>!1,lO=e=>iO.test(e),uO=e=>oO.test(e),cO=e=>!je(e)&&!Be(e),fO=e=>Of(e,__,Qx),je=e=>C_.test(e),uu=e=>Of(e,I_,aO),p0=e=>Of(e,SO,yt),dO=e=>Of(e,P_,Qx),pO=e=>Of(e,T_,uO),hO=e=>Of(e,Qx,lO),Be=e=>E_.test(e),yg=e=>zf(e,I_),mO=e=>zf(e,kO),gO=e=>zf(e,P_),vO=e=>zf(e,__),yO=e=>zf(e,T_),bO=e=>zf(e,CO,!0),Of=(e,t,n)=>{const r=C_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zf=(e,t,n=!1)=>{const r=E_.exec(e);return r?r[1]?t(r[1]):n:!1},P_=e=>e==="position",xO=new Set(["image","url"]),T_=e=>xO.has(e),wO=new Set(["length","size","percentage"]),__=e=>wO.has(e),I_=e=>e==="length",SO=e=>e==="number",kO=e=>e==="family-name",CO=e=>e==="shadow",_b=()=>{const e=Jn("color"),t=Jn("font"),n=Jn("text"),r=Jn("font-weight"),i=Jn("tracking"),s=Jn("leading"),a=Jn("breakpoint"),c=Jn("container"),d=Jn("spacing"),h=Jn("radius"),m=Jn("shadow"),g=Jn("inset-shadow"),b=Jn("drop-shadow"),x=Jn("blur"),k=Jn("perspective"),P=Jn("aspect"),T=Jn("ease"),_=Jn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],$=()=>[Be,je,d],Y=()=>[sf,"full","auto",...$()],te=()=>[lu,"none","subgrid",Be,je],ie=()=>["auto",{span:["full",lu,Be,je]},Be,je],B=()=>[lu,"auto",Be,je],W=()=>["auto","min","max","fr",Be,je],G=()=>["start","end","center","between","around","evenly","stretch","baseline"],ee=()=>["start","end","center","stretch"],H=()=>["auto",...$()],le=()=>[sf,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...$()],J=()=>[e,Be,je],X=()=>[dk,uu],V=()=>["","none","full",h,Be,je],ae=()=>["",yt,yg,uu],M=()=>["solid","dashed","dotted","double"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>["","none",x,Be,je],z=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Be,je],me=()=>["none",yt,Be,je],Ce=()=>["none",yt,Be,je],ye=()=>[yt,Be,je],Oe=()=>[sf,"full",...$()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ga],breakpoint:[Ga],color:[sO],container:[Ga],"drop-shadow":[Ga],ease:["in","out","in-out"],font:[cO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ga],shadow:[Ga],spacing:["px",yt],text:[Ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sf,je,Be,P]}],container:["container"],columns:[{columns:[yt,je,Be,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),je,Be]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[lu,"auto",Be,je]}],basis:[{basis:[sf,"full","auto",c,...$()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[yt,sf,"auto","initial","none",je]}],grow:[{grow:["",yt,Be,je]}],shrink:[{shrink:["",yt,Be,je]}],order:[{order:[lu,"first","last","none",Be,je]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:$()}],"gap-x":[{"gap-x":$()}],"gap-y":[{"gap-y":$()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...ee(),"baseline"]}],"align-self":[{self:["auto",...ee(),"baseline"]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:$()}],px:[{px:$()}],py:[{py:$()}],ps:[{ps:$()}],pe:[{pe:$()}],pt:[{pt:$()}],pr:[{pr:$()}],pb:[{pb:$()}],pl:[{pl:$()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":$()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":$()}],"space-y-reverse":["space-y-reverse"],size:[{size:le()}],w:[{w:[c,"screen",...le()]}],"min-w":[{"min-w":[c,"screen","none",...le()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...le()]}],h:[{h:["screen",...le()]}],"min-h":[{"min-h":["screen","none",...le()]}],"max-h":[{"max-h":["screen",...le()]}],"font-size":[{text:["base",n,yg,uu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Be,p0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dk,je]}],"font-family":[{font:[mO,je,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Be,je]}],"line-clamp":[{"line-clamp":[yt,"none",Be,p0]}],leading:[{leading:[s,...$()]}],"list-image":[{"list-image":["none",Be,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:[yt,"from-font","auto",Be,uu]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[yt,"auto",Be,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),gO,dO]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",vO,fO]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},lu,Be,je],radial:["",Be,je],conic:[lu,Be,je]},yO,pO]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...M(),"hidden","none"]}],"divide-style":[{divide:[...M(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...M(),"none","hidden"]}],"outline-offset":[{"outline-offset":[yt,Be,je]}],"outline-w":[{outline:["",yt,yg,uu]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",m,bO,hO]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",Be,je,g]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[yt,uu]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":J()}],opacity:[{opacity:[yt,Be,je]}],"mix-blend":[{"mix-blend":[...U(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none",Be,je]}],blur:[{blur:oe()}],brightness:[{brightness:[yt,Be,je]}],contrast:[{contrast:[yt,Be,je]}],"drop-shadow":[{"drop-shadow":["","none",b,Be,je]}],grayscale:[{grayscale:["",yt,Be,je]}],"hue-rotate":[{"hue-rotate":[yt,Be,je]}],invert:[{invert:["",yt,Be,je]}],saturate:[{saturate:[yt,Be,je]}],sepia:[{sepia:["",yt,Be,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,je]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[yt,Be,je]}],"backdrop-contrast":[{"backdrop-contrast":[yt,Be,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",yt,Be,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yt,Be,je]}],"backdrop-invert":[{"backdrop-invert":["",yt,Be,je]}],"backdrop-opacity":[{"backdrop-opacity":[yt,Be,je]}],"backdrop-saturate":[{"backdrop-saturate":[yt,Be,je]}],"backdrop-sepia":[{"backdrop-sepia":["",yt,Be,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":$()}],"border-spacing-x":[{"border-spacing-x":$()}],"border-spacing-y":[{"border-spacing-y":$()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[yt,"initial",Be,je]}],ease:[{ease:["linear","initial",T,Be,je]}],delay:[{delay:[yt,Be,je]}],animate:[{animate:["none",_,Be,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Be,je]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Be,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,je]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[yt,yg,uu,p0]}],stroke:[{stroke:["none",...J()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},EO=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:s={}})=>(Rp(e,"cacheSize",t),Rp(e,"prefix",n),Rp(e,"experimentalParseClassName",r),bg(e.theme,s.theme),bg(e.classGroups,s.classGroups),bg(e.conflictingClassGroups,s.conflictingClassGroups),bg(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Rp(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),xg(e.theme,i.theme),xg(e.classGroups,i.classGroups),xg(e.conflictingClassGroups,i.conflictingClassGroups),xg(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),$_(e,i,"orderSensitiveModifiers"),e),Rp=(e,t,n)=>{n!==void 0&&(e[t]=n)},bg=(e,t)=>{if(t)for(const n in t)Rp(e,n,t[n])},xg=(e,t)=>{if(t)for(const n in t)$_(e,t,n)},$_=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},A_=(e,...t)=>typeof e=="function"?Tb(_b,e,...t):Tb(()=>EO(_b(),e),...t),PO=Tb(_b);var TO={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},R_=e=>e||void 0,sh=(...e)=>R_(b_(e).filter(Boolean).join(" ")),h0=null,Xs={},Ib=!1,yp=(...e)=>t=>t.twMerge?((!h0||Ib)&&(Ib=!1,h0=oi(Xs)?PO:A_({...Xs,extend:{theme:Xs.theme,classGroups:Xs.classGroups,conflictingClassGroupModifiers:Xs.conflictingClassGroupModifiers,conflictingClassGroups:Xs.conflictingClassGroups,...Xs.extend}})),R_(h0(sh(e)))):sh(e),pk=(e,t)=>{for(let n in t)e.hasOwnProperty(n)?e[n]=sh(e[n],t[n]):e[n]=t[n];return e},_O=(e,t)=>{let{extend:n=null,slots:r={},variants:i={},compoundVariants:s=[],compoundSlots:a=[],defaultVariants:c={}}=e,d={...TO,...t},h=n!=null&&n.base?sh(n.base,e?.base):e?.base,m=n!=null&&n.variants&&!oi(n.variants)?w_(i,n.variants):i,g=n!=null&&n.defaultVariants&&!oi(n.defaultVariants)?{...n.defaultVariants,...c}:c;!oi(d.twMergeConfig)&&!jF(d.twMergeConfig,Xs)&&(Ib=!0,Xs=d.twMergeConfig);let b=oi(n?.slots),x=oi(r)?{}:{base:sh(e?.base,b&&n?.base),...r},k=b?x:pk({...n?.slots},oi(x)?{base:e?.base}:x),P=oi(n?.compoundVariants)?s:x_(n?.compoundVariants,s),T=A=>{if(oi(m)&&oi(r)&&b)return yp(h,A?.class,A?.className)(d);if(P&&!Array.isArray(P))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof P}`);if(a&&!Array.isArray(a))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof a}`);let L=(G,ee,H=[],le)=>{let J=H;if(typeof ee=="string")J=J.concat(uk(ee).split(" ").map(X=>`${G}:${X}`));else if(Array.isArray(ee))J=J.concat(ee.reduce((X,V)=>X.concat(`${G}:${V}`),[]));else if(typeof ee=="object"&&typeof le=="string"){for(let X in ee)if(ee.hasOwnProperty(X)&&X===le){let V=ee[X];if(V&&typeof V=="string"){let ae=uk(V);J[le]?J[le]=J[le].concat(ae.split(" ").map(M=>`${G}:${M}`)):J[le]=ae.split(" ").map(M=>`${G}:${M}`)}else Array.isArray(V)&&V.length>0&&(J[le]=V.reduce((ae,M)=>ae.concat(`${G}:${M}`),[]))}}return J},O=(G,ee=m,H=null,le=null)=>{var J;let X=ee[G];if(!X||oi(X))return null;let V=(J=le?.[G])!=null?J:A?.[G];if(V===null)return null;let ae=lk(V),M=Array.isArray(d.responsiveVariants)&&d.responsiveVariants.length>0||d.responsiveVariants===!0,U=g?.[G],oe=[];if(typeof ae=="object"&&M)for(let[Ce,ye]of Object.entries(ae)){let Oe=X[ye];if(Ce==="initial"){U=ye;continue}Array.isArray(d.responsiveVariants)&&!d.responsiveVariants.includes(Ce)||(oe=L(Ce,Oe,oe,H))}let z=ae!=null&&typeof ae!="object"?ae:lk(U),me=X[z||"false"];return typeof oe=="object"&&typeof H=="string"&&oe[H]?pk(oe,me):oe.length>0?(oe.push(me),H==="base"?oe.join(" "):oe):me},j=()=>m?Object.keys(m).map(G=>O(G,m)):null,$=(G,ee)=>{if(!m||typeof m!="object")return null;let H=new Array;for(let le in m){let J=O(le,m,G,ee),X=G==="base"&&typeof J=="string"?J:J&&J[G];X&&(H[H.length]=X)}return H},Y={};for(let G in A)A[G]!==void 0&&(Y[G]=A[G]);let te=(G,ee)=>{var H;let le=typeof A?.[G]=="object"?{[G]:(H=A[G])==null?void 0:H.initial}:{};return{...g,...Y,...le,...ee}},ie=(G=[],ee)=>{let H=[];for(let{class:le,className:J,...X}of G){let V=!0;for(let[ae,M]of Object.entries(X)){let U=te(ae,ee)[ae];if(Array.isArray(M)){if(!M.includes(U)){V=!1;break}}else{let oe=z=>z==null||z===!1;if(oe(M)&&oe(U))continue;if(U!==M){V=!1;break}}}V&&(le&&H.push(le),J&&H.push(J))}return H},B=G=>{let ee=ie(P,G);if(!Array.isArray(ee))return ee;let H={};for(let le of ee)if(typeof le=="string"&&(H.base=yp(H.base,le)(d)),typeof le=="object")for(let[J,X]of Object.entries(le))H[J]=yp(H[J],X)(d);return H},W=G=>{if(a.length<1)return null;let ee={};for(let{slots:H=[],class:le,className:J,...X}of a){if(!oi(X)){let V=!0;for(let ae of Object.keys(X)){let M=te(ae,G)[ae];if(M===void 0||(Array.isArray(X[ae])?!X[ae].includes(M):X[ae]!==M)){V=!1;break}}if(!V)continue}for(let V of H)ee[V]=ee[V]||[],ee[V].push([le,J])}return ee};if(!oi(r)||!b){let G={};if(typeof k=="object"&&!oi(k))for(let ee of Object.keys(k))G[ee]=H=>{var le,J;return yp(k[ee],$(ee,H),((le=B(H))!=null?le:[])[ee],((J=W(H))!=null?J:[])[ee],H?.class,H?.className)(d)};return G}return yp(h,j(),ie(P),A?.class,A?.className)(d)},_=()=>{if(!(!m||typeof m!="object"))return Object.keys(m)};return T.variantKeys=_(),T.extend=n,T.base=h,T.slots=k,T.variants=m,T.defaultVariants=g,T.compoundSlots=a,T.compoundVariants=P,T},Zn=(e,t)=>{var n,r,i;return _O(e,{...t,twMerge:(n=t?.twMerge)!=null?n:!0,twMergeConfig:{...t?.twMergeConfig,theme:{...(r=t?.twMergeConfig)==null?void 0:r.theme,...kb.theme},classGroups:{...(i=t?.twMergeConfig)==null?void 0:i.classGroups,...kb.classGroups}}})},hk=Zn({slots:{base:"relative inline-flex flex-col gap-2 items-center justify-center",wrapper:"relative flex",label:"text-foreground dark:text-foreground-dark font-regular",circle1:"absolute w-full h-full rounded-full",circle2:"absolute w-full h-full rounded-full",dots:"relative rounded-full mx-auto",spinnerBars:["absolute","animate-fade-out","rounded-full","w-[25%]","h-[8%]","left-[calc(37.5%)]","top-[calc(46%)]","spinner-bar-animation"]},variants:{size:{sm:{wrapper:"w-5 h-5",circle1:"border-2",circle2:"border-2",dots:"size-1",label:"text-small"},md:{wrapper:"w-8 h-8",circle1:"border-3",circle2:"border-3",dots:"size-1.5",label:"text-medium"},lg:{wrapper:"w-10 h-10",circle1:"border-3",circle2:"border-3",dots:"size-2",label:"text-large"}},color:{current:{circle1:"border-b-current",circle2:"border-b-current",dots:"bg-current",spinnerBars:"bg-current"},white:{circle1:"border-b-white",circle2:"border-b-white",dots:"bg-white",spinnerBars:"bg-white"},default:{circle1:"border-b-default",circle2:"border-b-default",dots:"bg-default",spinnerBars:"bg-default"},primary:{circle1:"border-b-primary",circle2:"border-b-primary",dots:"bg-primary",spinnerBars:"bg-primary"},secondary:{circle1:"border-b-secondary",circle2:"border-b-secondary",dots:"bg-secondary",spinnerBars:"bg-secondary"},success:{circle1:"border-b-success",circle2:"border-b-success",dots:"bg-success",spinnerBars:"bg-success"},warning:{circle1:"border-b-warning",circle2:"border-b-warning",dots:"bg-warning",spinnerBars:"bg-warning"},danger:{circle1:"border-b-danger",circle2:"border-b-danger",dots:"bg-danger",spinnerBars:"bg-danger"}},labelColor:{foreground:{label:"text-foreground"},primary:{label:"text-primary"},secondary:{label:"text-secondary"},success:{label:"text-success"},warning:{label:"text-warning"},danger:{label:"text-danger"}},variant:{default:{circle1:["animate-spinner-ease-spin","border-solid","border-t-transparent","border-l-transparent","border-r-transparent"],circle2:["opacity-75","animate-spinner-linear-spin","border-dotted","border-t-transparent","border-l-transparent","border-r-transparent"]},gradient:{circle1:["border-0","bg-gradient-to-b","from-transparent","via-transparent","to-primary","animate-spinner-linear-spin","[animation-duration:1s]","[-webkit-mask:radial-gradient(closest-side,rgba(0,0,0,0.0)calc(100%-3px),rgba(0,0,0,1)calc(100%-3px))]"],circle2:["hidden"]},wave:{wrapper:"translate-y-3/4",dots:["animate-sway","spinner-dot-animation"]},dots:{wrapper:"translate-y-2/4",dots:["animate-blink","spinner-dot-blink-animation"]},spinner:{},simple:{wrapper:"text-foreground h-5 w-5 animate-spin",circle1:"opacity-25",circle2:"opacity-75"}}},defaultVariants:{size:"md",color:"primary",labelColor:"foreground",variant:"default"},compoundVariants:[{variant:"gradient",color:"current",class:{circle1:"to-current"}},{variant:"gradient",color:"white",class:{circle1:"to-white"}},{variant:"gradient",color:"default",class:{circle1:"to-default"}},{variant:"gradient",color:"primary",class:{circle1:"to-primary"}},{variant:"gradient",color:"secondary",class:{circle1:"to-secondary"}},{variant:"gradient",color:"success",class:{circle1:"to-success"}},{variant:"gradient",color:"warning",class:{circle1:"to-warning"}},{variant:"gradient",color:"danger",class:{circle1:"to-danger"}},{variant:"wave",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"wave",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"wave",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"dots",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"dots",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"dots",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"simple",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"simple",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",color:"current",class:{wrapper:"text-current"}},{variant:"simple",color:"white",class:{wrapper:"text-white"}},{variant:"simple",color:"default",class:{wrapper:"text-default"}},{variant:"simple",color:"primary",class:{wrapper:"text-primary"}},{variant:"simple",color:"secondary",class:{wrapper:"text-secondary"}},{variant:"simple",color:"success",class:{wrapper:"text-success"}},{variant:"simple",color:"warning",class:{wrapper:"text-warning"}},{variant:"simple",color:"danger",class:{wrapper:"text-danger"}}]}),wh=["outline-hidden","data-[focus-visible=true]:z-10","data-[focus-visible=true]:outline-2","data-[focus-visible=true]:outline-focus","data-[focus-visible=true]:outline-offset-2"],L_=["outline-hidden","group-data-[focus-visible=true]:z-10","group-data-[focus-visible=true]:ring-2","group-data-[focus-visible=true]:ring-focus","group-data-[focus-visible=true]:ring-offset-2","group-data-[focus-visible=true]:ring-offset-background"],IO=["outline-hidden","ring-2","ring-focus","ring-offset-2","ring-offset-background"],af={default:["[&+.border-medium.border-default]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],primary:["[&+.border-medium.border-primary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],secondary:["[&+.border-medium.border-secondary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],success:["[&+.border-medium.border-success]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],warning:["[&+.border-medium.border-warning]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],danger:["[&+.border-medium.border-danger]:ms-[calc(var(--heroui-border-width-medium)*-1)]"]},$O=["font-inherit","text-[100%]","leading-[1.15]","m-0","p-0","overflow-visible","box-border","absolute","top-0","w-full","h-full","opacity-[0.0001]","z-[1]","cursor-pointer","disabled:cursor-default"],mk=Zn({slots:{base:["z-0","relative","bg-transparent","before:content-['']","before:hidden","before:z-[-1]","before:absolute","before:rotate-45","before:w-2.5","before:h-2.5","before:rounded-sm","data-[arrow=true]:before:block","data-[placement=top]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top]:before:left-1/2","data-[placement=top]:before:-translate-x-1/2","data-[placement=top-start]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-start]:before:left-3","data-[placement=top-end]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-end]:before:right-3","data-[placement=bottom]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom]:before:left-1/2","data-[placement=bottom]:before:-translate-x-1/2","data-[placement=bottom-start]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-start]:before:left-3","data-[placement=bottom-end]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-end]:before:right-3","data-[placement=left]:before:-right-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=left]:before:top-1/2","data-[placement=left]:before:-translate-y-1/2","data-[placement=left-start]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-start]:before:top-1/4","data-[placement=left-end]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-end]:before:bottom-1/4","data-[placement=right]:before:-left-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=right]:before:top-1/2","data-[placement=right]:before:-translate-y-1/2","data-[placement=right-start]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-start]:before:top-1/4","data-[placement=right-end]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-end]:before:bottom-1/4",...wh],content:["z-10","px-2.5","py-1","w-full","inline-flex","flex-col","items-center","justify-center","box-border","subpixel-antialiased","outline-hidden","box-border"],trigger:["z-10"],backdrop:["hidden"],arrow:[]},variants:{size:{sm:{content:"text-tiny"},md:{content:"text-small"},lg:{content:"text-medium"}},color:{default:{base:"before:bg-content1 before:shadow-small",content:"bg-content1"},foreground:{base:"before:bg-foreground",content:Te.solid.foreground},primary:{base:"before:bg-primary",content:Te.solid.primary},secondary:{base:"before:bg-secondary",content:Te.solid.secondary},success:{base:"before:bg-success",content:Te.solid.success},warning:{base:"before:bg-warning",content:Te.solid.warning},danger:{base:"before:bg-danger",content:Te.solid.danger}},radius:{none:{content:"rounded-none"},sm:{content:"rounded-small"},md:{content:"rounded-medium"},lg:{content:"rounded-large"},full:{content:"rounded-full"}},shadow:{none:{content:"shadow-none"},sm:{content:"shadow-small"},md:{content:"shadow-medium"},lg:{content:"shadow-large"}},backdrop:{transparent:{},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-sm backdrop-saturate-150 bg-overlay/30"}},triggerScaleOnOpen:{true:{trigger:["aria-expanded:scale-[0.97]","aria-expanded:opacity-70","subpixel-antialiased"]},false:{}},disableAnimation:{true:{base:"animate-none"}},isTriggerDisabled:{true:{trigger:"opacity-disabled pointer-events-none"},false:{}}},defaultVariants:{color:"default",radius:"lg",size:"md",shadow:"md",backdrop:"transparent",triggerScaleOnOpen:!0},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"block w-full h-full fixed inset-0 -z-30"}}]});Zn({slots:{base:"flex flex-col gap-2 w-full",label:"",labelWrapper:"flex justify-between",value:"",track:"z-0 relative bg-default-300/50 overflow-hidden rtl:rotate-180",indicator:"h-full"},variants:{color:{default:{indicator:"bg-default-400"},primary:{indicator:"bg-primary"},secondary:{indicator:"bg-secondary"},success:{indicator:"bg-success"},warning:{indicator:"bg-warning"},danger:{indicator:"bg-danger"}},size:{sm:{label:"text-small",value:"text-small",track:"h-1"},md:{label:"text-medium",value:"text-medium",track:"h-3"},lg:{label:"text-large",value:"text-large",track:"h-5"}},radius:{none:{track:"rounded-none",indicator:"rounded-none"},sm:{track:"rounded-small",indicator:"rounded-small"},md:{track:"rounded-medium",indicator:"rounded-medium"},lg:{track:"rounded-large",indicator:"rounded-large"},full:{track:"rounded-full",indicator:"rounded-full"}},isStriped:{true:{indicator:"bg-stripe-gradient-default bg-stripe-size"}},isIndeterminate:{true:{indicator:["absolute","w-full","origin-left","animate-indeterminate-bar"]}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:{},false:{indicator:"transition-transform !duration-500"}}},defaultVariants:{color:"primary",size:"md",radius:"full",isStriped:!1,isIndeterminate:!1,isDisabled:!1},compoundVariants:[{disableAnimation:!0,isIndeterminate:!1,class:{indicator:"!transition-none motion-reduce:transition-none"}},{color:"primary",isStriped:!0,class:{indicator:"bg-stripe-gradient-primary bg-stripe-size"}},{color:"secondary",isStriped:!0,class:{indicator:"bg-stripe-gradient-secondary bg-stripe-size"}},{color:"success",isStriped:!0,class:{indicator:"bg-stripe-gradient-success bg-stripe-size"}},{color:"warning",isStriped:!0,class:{indicator:"bg-stripe-gradient-warning bg-stripe-size"}},{color:"danger",isStriped:!0,class:{indicator:"bg-stripe-gradient-danger bg-stripe-size"}}]},{twMerge:!0});var gk=Zn({slots:{base:"flex flex-col justify-center gap-1 max-w-fit items-center",label:"",svgWrapper:"relative block",svg:"z-0 relative overflow-hidden",track:"h-full stroke-default-300/50",indicator:"h-full stroke-current",value:"absolute font-normal inset-0 flex items-center justify-center"},variants:{color:{default:{svg:"text-default-400"},primary:{svg:"text-primary"},secondary:{svg:"text-secondary"},success:{svg:"text-success"},warning:{svg:"text-warning"},danger:{svg:"text-danger"}},size:{sm:{svg:"w-8 h-8",label:"text-small",value:"text-[0.5rem]"},md:{svg:"w-10 h-10",label:"text-small",value:"text-[0.55rem]"},lg:{svg:"w-12 h-12",label:"text-medium",value:"text-[0.6rem]"}},isIndeterminate:{true:{svg:"animate-spinner-ease-spin"}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:{},false:{indicator:"transition-all !duration-500"}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1},compoundVariants:[{disableAnimation:!0,isIndeterminate:!1,class:{svg:"!transition-none motion-reduce:transition-none"}}]}),AO=["data-[top-scroll=true]:[mask-image:linear-gradient(0deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[bottom-scroll=true]:[mask-image:linear-gradient(180deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[top-bottom-scroll=true]:[mask-image:linear-gradient(#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],RO=["data-[left-scroll=true]:[mask-image:linear-gradient(270deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[right-scroll=true]:[mask-image:linear-gradient(90deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[left-right-scroll=true]:[mask-image:linear-gradient(to_right,#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],vk=Zn({base:[],variants:{orientation:{vertical:["overflow-y-auto",...AO],horizontal:["overflow-x-auto",...RO]},hideScrollBar:{true:"scrollbar-hide",false:""}},defaultVariants:{orientation:"vertical",hideScrollBar:!1}}),yk=Zn({slots:{base:["group","relative","overflow-hidden","bg-content3 dark:bg-content2","pointer-events-none","before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-shimmer","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2","data-[loaded=true]:pointer-events-auto","data-[loaded=true]:overflow-visible","data-[loaded=true]:!bg-transparent","data-[loaded=true]:before:opacity-0 data-[loaded=true]:before:-z-10 data-[loaded=true]:before:animate-none","data-[loaded=true]:after:opacity-0"],content:["opacity-0","group-data-[loaded=true]:opacity-100"]},variants:{disableAnimation:{true:{base:"before:animate-none before:transition-none after:transition-none",content:"transition-none"},false:{base:"transition-background !duration-300",content:"transition-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{}}),bk=Zn({slots:{base:"group flex flex-col data-[hidden=true]:hidden",label:["absolute","z-10","pointer-events-none","origin-top-left","shrink-0","rtl:origin-top-right","subpixel-antialiased","block","text-small","text-foreground-500"],mainWrapper:"h-full",inputWrapper:"relative w-full inline-flex tap-highlight-transparent flex-row items-center shadow-xs px-3 gap-3",innerWrapper:"inline-flex w-full items-center h-full box-border",input:["w-full font-normal bg-transparent !outline-hidden placeholder:text-foreground-500 focus-visible:outline-hidden","data-[has-start-content=true]:ps-1.5","data-[has-end-content=true]:pe-1.5","data-[type=color]:rounded-none","file:cursor-pointer file:bg-transparent file:border-0","autofill:bg-transparent bg-clip-text"],clearButton:["p-2","-m-2","z-10","absolute","end-3","start-auto","pointer-events-none","appearance-none","outline-hidden","select-none","opacity-0","cursor-pointer","active:!opacity-70","rounded-full",...wh],helperWrapper:"hidden group-data-[has-helper=true]:flex p-1 relative flex-col gap-1.5",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger"},variants:{variant:{flat:{inputWrapper:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-100"]},faded:{inputWrapper:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 focus-within:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground"},bordered:{inputWrapper:["border-medium","border-default-200","data-[hover=true]:border-default-400","group-data-[focus=true]:border-default-foreground"]},underlined:{inputWrapper:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","group-data-[focus=true]:after:w-full"],innerWrapper:"pb-1",label:"group-data-[filled-within=true]:text-foreground"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{label:"text-tiny",inputWrapper:"h-8 min-h-8 px-2 rounded-small",input:"text-small",clearButton:"text-medium"},md:{inputWrapper:"h-10 min-h-10 rounded-medium",input:"text-small",clearButton:"text-large hover:!opacity-100"},lg:{label:"text-medium",inputWrapper:"h-12 min-h-12 rounded-large",input:"text-medium",clearButton:"text-large hover:!opacity-100"}},radius:{none:{inputWrapper:"rounded-none"},sm:{inputWrapper:"rounded-small"},md:{inputWrapper:"rounded-medium"},lg:{inputWrapper:"rounded-large"},full:{inputWrapper:"rounded-full"}},labelPlacement:{outside:{mainWrapper:"flex flex-col"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",inputWrapper:"flex-1",mainWrapper:"flex flex-col",label:"relative text-foreground pe-2 ps-2 pointer-events-auto"},"outside-top":{mainWrapper:"flex flex-col",label:"relative text-foreground pb-2 pointer-events-auto"},inside:{label:"cursor-text",inputWrapper:"flex-col items-start justify-center gap-0",innerWrapper:"group-data-[has-label=true]:items-end"}},fullWidth:{true:{base:"w-full"},false:{}},isClearable:{true:{input:"peer pe-6 input-search-cancel-button-none",clearButton:["peer-data-[filled=true]:pointer-events-auto","peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block","peer-data-[filled=true]:scale-100"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",inputWrapper:"pointer-events-none",label:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",input:"!placeholder:text-danger !text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",inputWrapper:"!h-auto",innerWrapper:"items-start group-data-[has-label=true]:items-start",input:"resize-none data-[hide-scroll=true]:scrollbar-hide",clearButton:"absolute top-2 right-2 rtl:right-auto rtl:left-2 z-10"}},disableAnimation:{true:{input:"transition-none",inputWrapper:"transition-none",label:"transition-none"},false:{inputWrapper:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","!duration-200","!ease-out","motion-reduce:transition-none","transition-[transform,color,left,opacity,translate,scale]"],clearButton:["scale-90","ease-out","duration-150","transition-[opacity,transform]","motion-reduce:transition-none","motion-reduce:scale-100"]}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1},compoundVariants:[{variant:"flat",color:"default",class:{input:"group-data-[has-value=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{inputWrapper:["bg-primary-100","data-[hover=true]:bg-primary-50","text-primary","group-data-[focus=true]:bg-primary-50","placeholder:text-primary"],input:"placeholder:text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{inputWrapper:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50","placeholder:text-secondary"],input:"placeholder:text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{inputWrapper:["bg-success-100","text-success-600","dark:text-success","placeholder:text-success-600","dark:placeholder:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],input:"placeholder:text-success-600 dark:placeholder:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{inputWrapper:["bg-warning-100","text-warning-600","dark:text-warning","placeholder:text-warning-600","dark:placeholder:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],input:"placeholder:text-warning-600 dark:placeholder:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{inputWrapper:["bg-danger-100","text-danger","dark:text-danger-500","placeholder:text-danger","dark:placeholder:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],input:"placeholder:text-danger dark:placeholder:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{label:"text-primary",inputWrapper:"data-[hover=true]:border-primary focus-within:border-primary"}},{variant:"faded",color:"secondary",class:{label:"text-secondary",inputWrapper:"data-[hover=true]:border-secondary focus-within:border-secondary"}},{variant:"faded",color:"success",class:{label:"text-success",inputWrapper:"data-[hover=true]:border-success focus-within:border-success"}},{variant:"faded",color:"warning",class:{label:"text-warning",inputWrapper:"data-[hover=true]:border-warning focus-within:border-warning"}},{variant:"faded",color:"danger",class:{label:"text-danger",inputWrapper:"data-[hover=true]:border-danger focus-within:border-danger"}},{variant:"underlined",color:"default",class:{input:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{inputWrapper:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{inputWrapper:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{inputWrapper:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{inputWrapper:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{inputWrapper:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{inputWrapper:"group-data-[focus=true]:border-primary",label:"text-primary"}},{variant:"bordered",color:"secondary",class:{inputWrapper:"group-data-[focus=true]:border-secondary",label:"text-secondary"}},{variant:"bordered",color:"success",class:{inputWrapper:"group-data-[focus=true]:border-success",label:"text-success"}},{variant:"bordered",color:"warning",class:{inputWrapper:"group-data-[focus=true]:border-warning",label:"text-warning"}},{variant:"bordered",color:"danger",class:{inputWrapper:"group-data-[focus=true]:border-danger",label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled-within=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled-within=true]:text-foreground"}},{radius:"full",size:["sm"],class:{inputWrapper:"px-3"}},{radius:"full",size:"md",class:{inputWrapper:"px-4"}},{radius:"full",size:"lg",class:{inputWrapper:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{inputWrapper:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{inputWrapper:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{inputWrapper:[...L_]}},{isInvalid:!0,variant:"flat",class:{inputWrapper:["!bg-danger-50","data-[hover=true]:!bg-danger-100","group-data-[focus=true]:!bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{inputWrapper:"!border-danger group-data-[focus=true]:!border-danger"}},{isInvalid:!0,variant:"underlined",class:{inputWrapper:"after:!bg-danger"}},{labelPlacement:"inside",size:"sm",class:{inputWrapper:"h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{inputWrapper:"h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{inputWrapper:"h-16 py-2.5 gap-0"}},{labelPlacement:"inside",size:"sm",variant:["bordered","faded"],class:{inputWrapper:"py-1"}},{labelPlacement:["inside","outside"],class:{label:["group-data-[filled-within=true]:pointer-events-auto"]}},{labelPlacement:"outside",isMultiline:!1,class:{base:"relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled-within=true]:start-0"]}},{labelPlacement:["inside"],class:{label:["group-data-[filled-within=true]:scale-85"]}},{labelPlacement:["inside"],variant:"flat",class:{innerWrapper:"pb-0.5"}},{variant:"underlined",size:"sm",class:{innerWrapper:"pb-1"}},{variant:"underlined",size:["md","lg"],class:{innerWrapper:"pb-1.5"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",size:"lg",isMultiline:!1,class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-tiny)/2_+_16px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",size:"md",isMultiline:!1,class:{label:["start-3","end-auto","text-small","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",size:"lg",isMultiline:!1,class:{label:["start-3","end-auto","text-medium","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:["outside","outside-left"],isMultiline:!0,class:{inputWrapper:"py-2"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:"inside",isMultiline:!0,class:{label:"pb-0.5",input:"pt-0"}},{isMultiline:!0,disableAnimation:!1,class:{input:"transition-height !duration-100 motion-reduce:transition-none"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{isMultiline:!0,radius:"full",class:{inputWrapper:"data-[has-multiple-rows=true]:rounded-large"}},{isClearable:!0,isMultiline:!0,class:{clearButton:["group-data-[has-value=true]:opacity-70 group-data-[has-value=true]:block","group-data-[has-value=true]:scale-100","group-data-[has-value=true]:pointer-events-auto"]}}]}),xk=Zn({slots:{wrapper:["flex","w-screen","h-[100dvh]","fixed","inset-0","z-50","overflow-x-auto","justify-center","h-[--visual-viewport-height]"],base:["flex","flex-col","relative","bg-white","z-50","w-full","box-border","bg-content1","outline-hidden","mx-1","my-1","sm:mx-6","sm:my-16"],backdrop:"z-50",header:"flex py-4 px-6 flex-initial text-large font-semibold",body:"flex flex-1 flex-col gap-3 px-6 py-2",footer:"flex flex-row gap-2 px-6 py-4 justify-end",closeButton:["absolute","appearance-none","outline-hidden","select-none","top-1","end-1","p-2","text-foreground-500","rounded-full","hover:bg-default-100","active:bg-default-200","tap-highlight-transparent",...wh]},variants:{size:{xs:{base:"max-w-xs"},sm:{base:"max-w-sm"},md:{base:"max-w-md"},lg:{base:"max-w-lg"},xl:{base:"max-w-xl"},"2xl":{base:"max-w-2xl"},"3xl":{base:"max-w-3xl"},"4xl":{base:"max-w-4xl"},"5xl":{base:"max-w-5xl"},full:{base:"my-0 mx-0 sm:mx-0 sm:my-0 max-w-full h-[100dvh] min-h-[100dvh] !rounded-none"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"}},placement:{auto:{wrapper:"items-end sm:items-center"},center:{wrapper:"items-center sm:items-center"},top:{wrapper:"items-start sm:items-start"},"top-center":{wrapper:"items-start sm:items-center"},bottom:{wrapper:"items-end sm:items-end"},"bottom-center":{wrapper:"items-end sm:items-center"}},shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},backdrop:{transparent:{backdrop:"hidden"},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-md backdrop-saturate-150 bg-overlay/30"}},scrollBehavior:{normal:{base:"overflow-y-hidden"},inside:{base:"max-h-[calc(100%_-_8rem)]",body:"overflow-y-auto"},outside:{wrapper:"items-start sm:items-start overflow-y-auto",base:"my-16"}},disableAnimation:{false:{wrapper:["[--scale-enter:100%]","[--scale-exit:100%]","[--slide-enter:0px]","[--slide-exit:80px]","sm:[--scale-enter:100%]","sm:[--scale-exit:103%]","sm:[--slide-enter:0px]","sm:[--slide-exit:0px]"]}}},defaultVariants:{size:"md",radius:"lg",shadow:"sm",placement:"auto",backdrop:"opaque",scrollBehavior:"normal"},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"w-screen h-screen fixed inset-0"}}]}),LO=Zn({base:"shrink-0 bg-divider border-none",variants:{orientation:{horizontal:"w-full h-divider",vertical:"h-full w-divider"}},defaultVariants:{orientation:"horizontal"}}),MO=Zn({base:"flex flex-col gap-2 items-start"}),wk=Zn({slots:{wrapper:"relative shadow-black/5",zoomedWrapper:"relative overflow-hidden rounded-inherit",img:"relative z-10 opacity-0 shadow-black/5 data-[loaded=true]:opacity-100",blurredImg:["absolute","z-0","inset-0","w-full","h-full","object-cover","filter","blur-lg","scale-105","saturate-150","opacity-30","translate-y-1"]},variants:{radius:{none:{},sm:{},md:{},lg:{},full:{}},shadow:{none:{wrapper:"shadow-none",img:"shadow-none"},sm:{wrapper:"shadow-small",img:"shadow-small"},md:{wrapper:"shadow-medium",img:"shadow-medium"},lg:{wrapper:"shadow-large",img:"shadow-large"}},isZoomed:{true:{img:["object-cover","transform","hover:scale-125"]}},showSkeleton:{true:{wrapper:["group","relative","overflow-hidden","bg-content3 dark:bg-content2"],img:"opacity-0"}},disableAnimation:{true:{img:"transition-none"},false:{img:"transition-transform-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{radius:"lg",shadow:"none",isZoomed:!1,isBlurred:!1,showSkeleton:!1},compoundVariants:[{showSkeleton:!0,disableAnimation:!1,class:{wrapper:["before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-shimmer","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2"]}}],compoundSlots:[{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"none",class:"rounded-none"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"full",class:"rounded-full"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"sm",class:"rounded-small"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"md",class:"rounded-md"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"lg",class:"rounded-large"}]}),DO=Zn({base:["z-0","group","relative","inline-flex","items-center","justify-center","box-border","appearance-none","outline-hidden","select-none","whitespace-nowrap","min-w-max","font-normal","subpixel-antialiased","overflow-hidden","tap-highlight-transparent","transform-gpu data-[pressed=true]:scale-[0.97]","cursor-pointer",...wh],variants:{variant:{solid:"",bordered:"border-medium bg-transparent",light:"bg-transparent",flat:"",faded:"border-medium",shadow:"",ghost:"border-medium bg-transparent"},size:{sm:"px-3 min-w-16 h-8 text-tiny gap-2 rounded-small",md:"px-4 min-w-20 h-10 text-small gap-2 rounded-medium",lg:"px-6 min-w-24 h-12 text-medium gap-3 rounded-large"},color:{default:"",primary:"",secondary:"",success:"",warning:"",danger:""},radius:{none:"rounded-none",sm:"rounded-small",md:"rounded-medium",lg:"rounded-large",full:"rounded-full"},fullWidth:{true:"w-full"},isDisabled:{true:"opacity-disabled pointer-events-none"},isInGroup:{true:"[&:not(:first-child):not(:last-child)]:rounded-none"},isIconOnly:{true:"px-0 !gap-0",false:"[&>svg]:max-w-[theme(spacing.8)]"},disableAnimation:{true:"!transition-none data-[pressed=true]:scale-100",false:"transition-transform-colors-opacity motion-reduce:transition-none"}},defaultVariants:{size:"md",variant:"solid",color:"default",fullWidth:!1,isDisabled:!1,isInGroup:!1},compoundVariants:[{variant:"solid",color:"default",class:Te.solid.default},{variant:"solid",color:"primary",class:Te.solid.primary},{variant:"solid",color:"secondary",class:Te.solid.secondary},{variant:"solid",color:"success",class:Te.solid.success},{variant:"solid",color:"warning",class:Te.solid.warning},{variant:"solid",color:"danger",class:Te.solid.danger},{variant:"shadow",color:"default",class:Te.shadow.default},{variant:"shadow",color:"primary",class:Te.shadow.primary},{variant:"shadow",color:"secondary",class:Te.shadow.secondary},{variant:"shadow",color:"success",class:Te.shadow.success},{variant:"shadow",color:"warning",class:Te.shadow.warning},{variant:"shadow",color:"danger",class:Te.shadow.danger},{variant:"bordered",color:"default",class:Te.bordered.default},{variant:"bordered",color:"primary",class:Te.bordered.primary},{variant:"bordered",color:"secondary",class:Te.bordered.secondary},{variant:"bordered",color:"success",class:Te.bordered.success},{variant:"bordered",color:"warning",class:Te.bordered.warning},{variant:"bordered",color:"danger",class:Te.bordered.danger},{variant:"flat",color:"default",class:Te.flat.default},{variant:"flat",color:"primary",class:Te.flat.primary},{variant:"flat",color:"secondary",class:Te.flat.secondary},{variant:"flat",color:"success",class:Te.flat.success},{variant:"flat",color:"warning",class:Te.flat.warning},{variant:"flat",color:"danger",class:Te.flat.danger},{variant:"faded",color:"default",class:Te.faded.default},{variant:"faded",color:"primary",class:Te.faded.primary},{variant:"faded",color:"secondary",class:Te.faded.secondary},{variant:"faded",color:"success",class:Te.faded.success},{variant:"faded",color:"warning",class:Te.faded.warning},{variant:"faded",color:"danger",class:Te.faded.danger},{variant:"light",color:"default",class:[Te.light.default,"data-[hover=true]:bg-default/40"]},{variant:"light",color:"primary",class:[Te.light.primary,"data-[hover=true]:bg-primary/20"]},{variant:"light",color:"secondary",class:[Te.light.secondary,"data-[hover=true]:bg-secondary/20"]},{variant:"light",color:"success",class:[Te.light.success,"data-[hover=true]:bg-success/20"]},{variant:"light",color:"warning",class:[Te.light.warning,"data-[hover=true]:bg-warning/20"]},{variant:"light",color:"danger",class:[Te.light.danger,"data-[hover=true]:bg-danger/20"]},{variant:"ghost",color:"default",class:[Te.ghost.default,"data-[hover=true]:!bg-default"]},{variant:"ghost",color:"primary",class:[Te.ghost.primary,"data-[hover=true]:!bg-primary data-[hover=true]:!text-primary-foreground"]},{variant:"ghost",color:"secondary",class:[Te.ghost.secondary,"data-[hover=true]:!bg-secondary data-[hover=true]:!text-secondary-foreground"]},{variant:"ghost",color:"success",class:[Te.ghost.success,"data-[hover=true]:!bg-success data-[hover=true]:!text-success-foreground"]},{variant:"ghost",color:"warning",class:[Te.ghost.warning,"data-[hover=true]:!bg-warning data-[hover=true]:!text-warning-foreground"]},{variant:"ghost",color:"danger",class:[Te.ghost.danger,"data-[hover=true]:!bg-danger data-[hover=true]:!text-danger-foreground"]},{isInGroup:!0,class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,size:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,isRounded:!0,class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,radius:"none",class:"rounded-none first:rounded-s-none last:rounded-e-none"},{isInGroup:!0,radius:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,radius:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,radius:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,radius:"full",class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,variant:["ghost","bordered"],color:"default",className:af.default},{isInGroup:!0,variant:["ghost","bordered"],color:"primary",className:af.primary},{isInGroup:!0,variant:["ghost","bordered"],color:"secondary",className:af.secondary},{isInGroup:!0,variant:["ghost","bordered"],color:"success",className:af.success},{isInGroup:!0,variant:["ghost","bordered"],color:"warning",className:af.warning},{isInGroup:!0,variant:["ghost","bordered"],color:"danger",className:af.danger},{isIconOnly:!0,size:"sm",class:"min-w-8 w-8 h-8"},{isIconOnly:!0,size:"md",class:"min-w-10 w-10 h-10"},{isIconOnly:!0,size:"lg",class:"min-w-12 w-12 h-12"},{variant:["solid","faded","flat","bordered","shadow"],class:"data-[hover=true]:opacity-hover"}]});Zn({base:"inline-flex items-center justify-center h-auto",variants:{fullWidth:{true:"w-full"}},defaultVariants:{fullWidth:!1}});var NO=Zn({slots:{base:"group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2 select-none",wrapper:["relative","inline-flex","items-center","justify-center","shrink-0","overflow-hidden","before:content-['']","before:absolute","before:inset-0","before:border-solid","before:border-2","before:box-border","before:border-default","after:content-['']","after:absolute","after:inset-0","after:scale-50","after:opacity-0","after:origin-center","group-data-[selected=true]:after:scale-100","group-data-[selected=true]:after:opacity-100","group-data-[hover=true]:before:bg-default-100",...L_],hiddenInput:$O,icon:"z-10 w-4 h-3 opacity-0 group-data-[selected=true]:opacity-100 pointer-events-none",label:"relative text-foreground select-none"},variants:{color:{default:{wrapper:"after:bg-default after:text-default-foreground text-default-foreground"},primary:{wrapper:"after:bg-primary after:text-primary-foreground text-primary-foreground"},secondary:{wrapper:"after:bg-secondary after:text-secondary-foreground text-secondary-foreground"},success:{wrapper:"after:bg-success after:text-success-foreground text-success-foreground"},warning:{wrapper:"after:bg-warning after:text-warning-foreground text-warning-foreground"},danger:{wrapper:"after:bg-danger after:text-danger-foreground text-danger-foreground"}},size:{sm:{wrapper:["w-4 h-4 me-2","rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"],label:"text-small",icon:"w-3 h-2"},md:{wrapper:["w-5 h-5 me-2","rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"],label:"text-medium",icon:"w-4 h-3"},lg:{wrapper:["w-6 h-6 me-2","rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"],label:"text-large",icon:"w-5 h-4"}},radius:{none:{wrapper:"rounded-none before:rounded-none after:rounded-none"},sm:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"]},md:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"]},lg:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"]},full:{wrapper:"rounded-full before:rounded-full after:rounded-full"}},lineThrough:{true:{label:["inline-flex","items-center","justify-center","before:content-['']","before:absolute","before:bg-foreground","before:w-0","before:h-0.5","group-data-[selected=true]:opacity-60","group-data-[selected=true]:before:w-full"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isInvalid:{true:{wrapper:"before:border-danger",label:"text-danger"}},disableAnimation:{true:{wrapper:"transition-none",icon:"transition-none",label:"transition-none"},false:{wrapper:["before:transition-colors","group-data-[pressed=true]:scale-95","transition-transform","after:transition-transform-opacity","after:!ease-linear","after:!duration-200","motion-reduce:transition-none"],icon:"transition-opacity motion-reduce:transition-none",label:"transition-colors-opacity before:transition-width motion-reduce:transition-none"}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1,lineThrough:!1}});Zn({slots:{base:"relative flex flex-col gap-2",label:"relative text-medium text-foreground-500",wrapper:"flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row",description:"text-small text-foreground-400",errorMessage:"text-small text-danger"},variants:{isRequired:{true:{label:"after:content-['*'] after:text-danger after:ml-0.5"}},isInvalid:{true:{description:"text-danger"}},disableAnimation:{true:{},false:{description:"transition-colors !duration-150 motion-reduce:transition-none"}}},defaultVariants:{isInvalid:!1,isRequired:!1}});var Sk=Zn({slots:{base:["relative","max-w-fit","min-w-min","inline-flex","items-center","justify-between","box-border","whitespace-nowrap"],content:"flex-1 text-inherit font-normal",dot:["w-2","h-2","ml-1","rounded-full"],avatar:"shrink-0",closeButton:["z-10","appearance-none","outline-hidden","select-none","transition-opacity","opacity-70","hover:opacity-100","cursor-pointer","active:opacity-disabled","tap-highlight-transparent"]},variants:{variant:{solid:{},bordered:{base:"border-medium bg-transparent"},light:{base:"bg-transparent"},flat:{},faded:{base:"border-medium"},shadow:{},dot:{base:"border-medium border-default text-foreground bg-transparent"}},color:{default:{dot:"bg-default-400"},primary:{dot:"bg-primary"},secondary:{dot:"bg-secondary"},success:{dot:"bg-success"},warning:{dot:"bg-warning"},danger:{dot:"bg-danger"}},size:{sm:{base:"px-1 h-6 text-tiny",content:"px-1",closeButton:"text-medium",avatar:"w-4 h-4"},md:{base:"px-1 h-7 text-small",content:"px-2",closeButton:"text-large",avatar:"w-5 h-5"},lg:{base:"px-2 h-8 text-medium",content:"px-2",closeButton:"text-xl",avatar:"w-6 h-6"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"},full:{base:"rounded-full"}},isOneChar:{true:{},false:{}},isCloseable:{true:{},false:{}},hasStartContent:{true:{}},hasEndContent:{true:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isCloseButtonFocusVisible:{true:{closeButton:[...IO,"ring-1","rounded-full"]}}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"full",isDisabled:!1},compoundVariants:[{variant:"solid",color:"default",class:{base:Te.solid.default}},{variant:"solid",color:"primary",class:{base:Te.solid.primary}},{variant:"solid",color:"secondary",class:{base:Te.solid.secondary}},{variant:"solid",color:"success",class:{base:Te.solid.success}},{variant:"solid",color:"warning",class:{base:Te.solid.warning}},{variant:"solid",color:"danger",class:{base:Te.solid.danger}},{variant:"shadow",color:"default",class:{base:Te.shadow.default}},{variant:"shadow",color:"primary",class:{base:Te.shadow.primary}},{variant:"shadow",color:"secondary",class:{base:Te.shadow.secondary}},{variant:"shadow",color:"success",class:{base:Te.shadow.success}},{variant:"shadow",color:"warning",class:{base:Te.shadow.warning}},{variant:"shadow",color:"danger",class:{base:Te.shadow.danger}},{variant:"bordered",color:"default",class:{base:Te.bordered.default}},{variant:"bordered",color:"primary",class:{base:Te.bordered.primary}},{variant:"bordered",color:"secondary",class:{base:Te.bordered.secondary}},{variant:"bordered",color:"success",class:{base:Te.bordered.success}},{variant:"bordered",color:"warning",class:{base:Te.bordered.warning}},{variant:"bordered",color:"danger",class:{base:Te.bordered.danger}},{variant:"flat",color:"default",class:{base:Te.flat.default}},{variant:"flat",color:"primary",class:{base:Te.flat.primary}},{variant:"flat",color:"secondary",class:{base:Te.flat.secondary}},{variant:"flat",color:"success",class:{base:Te.flat.success}},{variant:"flat",color:"warning",class:{base:Te.flat.warning}},{variant:"flat",color:"danger",class:{base:Te.flat.danger}},{variant:"faded",color:"default",class:{base:Te.faded.default}},{variant:"faded",color:"primary",class:{base:Te.faded.primary}},{variant:"faded",color:"secondary",class:{base:Te.faded.secondary}},{variant:"faded",color:"success",class:{base:Te.faded.success}},{variant:"faded",color:"warning",class:{base:Te.faded.warning}},{variant:"faded",color:"danger",class:{base:Te.faded.danger}},{variant:"light",color:"default",class:{base:Te.light.default}},{variant:"light",color:"primary",class:{base:Te.light.primary}},{variant:"light",color:"secondary",class:{base:Te.light.secondary}},{variant:"light",color:"success",class:{base:Te.light.success}},{variant:"light",color:"warning",class:{base:Te.light.warning}},{variant:"light",color:"danger",class:{base:Te.light.danger}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"sm",class:{base:"w-5 h-5 min-w-5 min-h-5"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"md",class:{base:"w-6 h-6 min-w-6 min-h-6"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"lg",class:{base:"w-7 h-7 min-w-7 min-h-7"}},{isOneChar:!0,isCloseable:!1,hasStartContent:!1,hasEndContent:!1,class:{base:"px-0 justify-center",content:"px-0 flex-none"}},{isOneChar:!0,isCloseable:!0,hasStartContent:!1,hasEndContent:!1,class:{base:"w-auto"}},{isOneChar:!0,variant:"dot",class:{base:"w-auto h-7 px-1 items-center",content:"px-2"}},{hasStartContent:!0,size:"sm",class:{content:"pl-0.5"}},{hasStartContent:!0,size:["md","lg"],class:{content:"pl-1"}},{hasEndContent:!0,size:"sm",class:{content:"pr-0.5"}},{hasEndContent:!0,size:["md","lg"],class:{content:"pr-1"}}]}),FO=Zn({base:"px-2",variants:{variant:{light:"",shadow:"px-4 shadow-medium rounded-medium bg-content1",bordered:"px-4 border-medium border-divider rounded-medium",splitted:"flex flex-col gap-2"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"light",fullWidth:!0}}),OO=Zn({slots:{base:"",heading:"",trigger:["flex py-4 w-full h-full gap-3 outline-hidden items-center tap-highlight-transparent",...wh],startContent:"shrink-0",indicator:"text-default-400",titleWrapper:"flex-1 flex flex-col text-start",title:"text-foreground text-medium",subtitle:"text-small text-foreground-500 font-normal",content:"py-2"},variants:{variant:{splitted:{base:"px-4 bg-content1 shadow-medium rounded-medium"}},isCompact:{true:{trigger:"py-2",title:"text-medium",subtitle:"text-small",indicator:"text-medium",content:"py-1"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},hideIndicator:{true:{indicator:"hidden"}},disableAnimation:{true:{content:"hidden data-[open=true]:block"},false:{indicator:"transition-transform",trigger:"transition-opacity"}},disableIndicatorAnimation:{true:{indicator:"transition-none"},false:{indicator:"rotate-0 data-[open=true]:-rotate-90 rtl:-rotate-180 rtl:data-[open=true]:-rotate-90"}}},defaultVariants:{size:"md",radius:"lg",isDisabled:!1,hideIndicator:!1,disableIndicatorAnimation:!1}});function M_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0){let d=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(h=>{if(h=VO(h),h in kk)return;kk[h]=!0;const m=h.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":BO,m||(b.as="script"),b.crossOrigin="",b.href=h,c&&b.setAttribute("nonce",c),document.head.appendChild(b),m)return new Promise((x,k)=>{b.addEventListener("load",x),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};function UO(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,preventFocusOnPress:h,allowFocusWhenDisabled:m,onClick:g,href:b,target:x,rel:k,type:P="button"}=e,T;n==="button"?T={type:P,disabled:r}:T={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?x:void 0,type:n==="input"?P:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?k:void 0};let{pressProps:_,isPressed:A}=il({onPressStart:s,onPressEnd:a,onPressChange:d,onPress:i,onPressUp:c,onClick:g,isDisabled:r,preventFocusOnPress:h,ref:t}),{focusableProps:L}=xh(e,t);m&&(L.tabIndex=r?-1:L.tabIndex);let O=Pn(L,_,$u(e,{labelable:!0}));return{isPressed:A,buttonProps:Pn(T,O,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}function KO(e,t,n){let{item:r,isDisabled:i}=e,s=r.key,a=t.selectionManager,c=S.useId(),d=S.useId(),h=t.disabledKeys.has(r.key)||i;S.useEffect(()=>{s===t.focusedKey&&document.activeElement!==n.current&&n.current&&Cu(n.current)},[n,s,t.focusedKey]);let m=S.useCallback(P=>{a.canSelectItem(s)&&(a.select(s,P),t.toggleKey(s))},[s,a]);const g=S.useCallback(P=>{a.selectionBehavior==="replace"&&a.extendSelection(P),a.setFocusedKey(P)},[a]),b=S.useCallback(P=>{const _={ArrowDown:()=>{const A=t.collection.getKeyAfter(s);if(A&&t.disabledKeys.has(A)){const L=t.collection.getKeyAfter(A);L&&g(L)}else A&&g(A)},ArrowUp:()=>{const A=t.collection.getKeyBefore(s);if(A&&t.disabledKeys.has(A)){const L=t.collection.getKeyBefore(A);L&&g(L)}else A&&g(A)},Home:()=>{const A=t.collection.getFirstKey();A&&g(A)},End:()=>{const A=t.collection.getLastKey();A&&g(A)}}[P.key];_&&(P.preventDefault(),a.canSelectItem(s)&&_(P))},[s,a]);let{buttonProps:x}=UO({id:c,elementType:"button",isDisabled:h,onKeyDown:b,onPress:m},n),k=t.selectionManager.isSelected(r.key);return{buttonProps:{...x,"aria-expanded":k,"aria-controls":k?d:void 0},regionProps:{id:d,role:"region","aria-labelledby":c}}}function Ck(e){return hM()?e.altKey:e.ctrlKey}function Mg(e,t){var n,r;let i=`[data-key="${CSS.escape(String(t))}"]`,s=(n=e.current)===null||n===void 0?void 0:n.dataset.collection;return s&&(i=`[data-collection="${CSS.escape(s)}"]${i}`),(r=e.current)===null||r===void 0?void 0:r.querySelector(i)}const D_=new WeakMap;function WO(e){let t=Pf();return D_.set(e,t),t}function qG(e){return D_.get(e)}const HO=1e3;function GO(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=S.useRef({search:"",timeout:void 0}).current,s=a=>{let c=qO(a.key);if(!(!c||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target))){if(c===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=c,t.getKeyForSearch!=null){let d=t.getKeyForSearch(i.search,n.focusedKey);d==null&&(d=t.getKeyForSearch(i.search)),d!=null&&(n.setFocusedKey(d),r&&r(d))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},HO)}};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:void 0}}}function qO(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function YO(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:s=!1,disallowEmptySelection:a=!1,disallowSelectAll:c=!1,escapeKeyBehavior:d="clearSelection",selectOnFocus:h=t.selectionBehavior==="replace",disallowTypeAhead:m=!1,shouldUseVirtualFocus:g,allowsTabNavigation:b=!1,isVirtualized:x,scrollRef:k=r,linkBehavior:P="action"}=e,{direction:T}=hh(),_=ux(),A=X=>{var V;if(X.altKey&&X.key==="Tab"&&X.preventDefault(),!(!((V=r.current)===null||V===void 0)&&V.contains(X.target)))return;const ae=(Ie,mt)=>{if(Ie!=null){if(t.isLink(Ie)&&P==="selection"&&h&&!Ck(X)){FE.flushSync(()=>{t.setFocusedKey(Ie,mt)});let pt=Mg(r,Ie),Ut=t.getItemProps(Ie);pt&&_.open(pt,X,Ut.href,Ut.routerOptions);return}if(t.setFocusedKey(Ie,mt),t.isLink(Ie)&&P==="override")return;X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Ie):h&&!Ck(X)&&t.replaceSelection(Ie)}};switch(X.key){case"ArrowDown":if(n.getKeyBelow){var M,U,oe;let Ie=t.focusedKey!=null?(M=n.getKeyBelow)===null||M===void 0?void 0:M.call(n,t.focusedKey):(U=n.getFirstKey)===null||U===void 0?void 0:U.call(n);Ie==null&&s&&(Ie=(oe=n.getFirstKey)===null||oe===void 0?void 0:oe.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"ArrowUp":if(n.getKeyAbove){var z,me,Ce;let Ie=t.focusedKey!=null?(z=n.getKeyAbove)===null||z===void 0?void 0:z.call(n,t.focusedKey):(me=n.getLastKey)===null||me===void 0?void 0:me.call(n);Ie==null&&s&&(Ie=(Ce=n.getLastKey)===null||Ce===void 0?void 0:Ce.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"ArrowLeft":if(n.getKeyLeftOf){var ye,Oe,Ne;let Ie=t.focusedKey!=null?(ye=n.getKeyLeftOf)===null||ye===void 0?void 0:ye.call(n,t.focusedKey):null;Ie==null&&s&&(Ie=T==="rtl"?(Oe=n.getFirstKey)===null||Oe===void 0?void 0:Oe.call(n,t.focusedKey):(Ne=n.getLastKey)===null||Ne===void 0?void 0:Ne.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie,T==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var _e,Qe,at;let Ie=t.focusedKey!=null?(_e=n.getKeyRightOf)===null||_e===void 0?void 0:_e.call(n,t.focusedKey):null;Ie==null&&s&&(Ie=T==="rtl"?(Qe=n.getLastKey)===null||Qe===void 0?void 0:Qe.call(n,t.focusedKey):(at=n.getFirstKey)===null||at===void 0?void 0:at.call(n,t.focusedKey)),Ie!=null&&(X.preventDefault(),ae(Ie,T==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(t.focusedKey===null&&X.shiftKey)return;X.preventDefault();let Ie=n.getFirstKey(t.focusedKey,hp(X));t.setFocusedKey(Ie),Ie!=null&&(hp(X)&&X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Ie):h&&t.replaceSelection(Ie))}break;case"End":if(n.getLastKey){if(t.focusedKey===null&&X.shiftKey)return;X.preventDefault();let Ie=n.getLastKey(t.focusedKey,hp(X));t.setFocusedKey(Ie),Ie!=null&&(hp(X)&&X.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(Ie):h&&t.replaceSelection(Ie))}break;case"PageDown":if(n.getKeyPageBelow&&t.focusedKey!=null){let Ie=n.getKeyPageBelow(t.focusedKey);Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"PageUp":if(n.getKeyPageAbove&&t.focusedKey!=null){let Ie=n.getKeyPageAbove(t.focusedKey);Ie!=null&&(X.preventDefault(),ae(Ie))}break;case"a":hp(X)&&t.selectionMode==="multiple"&&c!==!0&&(X.preventDefault(),t.selectAll());break;case"Escape":d==="clearSelection"&&!a&&t.selectedKeys.size!==0&&(X.stopPropagation(),X.preventDefault(),t.clearSelection());break;case"Tab":if(!b){if(X.shiftKey)r.current.focus();else{let Ie=Js(r.current,{tabbable:!0}),mt,pt;do pt=Ie.lastChild(),pt&&(mt=pt);while(pt);mt&&!mt.contains(document.activeElement)&&tl(mt)}break}}},L=S.useRef({top:0,left:0});lg(k,"scroll",x?void 0:()=>{var X,V,ae,M;L.current={top:(ae=(X=k.current)===null||X===void 0?void 0:X.scrollTop)!==null&&ae!==void 0?ae:0,left:(M=(V=k.current)===null||V===void 0?void 0:V.scrollLeft)!==null&&M!==void 0?M:0}});let O=X=>{if(t.isFocused){X.currentTarget.contains(X.target)||t.setFocused(!1);return}if(X.currentTarget.contains(X.target)){if(t.setFocused(!0),t.focusedKey==null){var V,ae;let oe=me=>{me!=null&&(t.setFocusedKey(me),h&&!t.isSelected(me)&&t.replaceSelection(me))},z=X.relatedTarget;var M,U;z&&X.currentTarget.compareDocumentPosition(z)&Node.DOCUMENT_POSITION_FOLLOWING?oe((M=t.lastSelectedKey)!==null&&M!==void 0?M:(V=n.getLastKey)===null||V===void 0?void 0:V.call(n)):oe((U=t.firstSelectedKey)!==null&&U!==void 0?U:(ae=n.getFirstKey)===null||ae===void 0?void 0:ae.call(n))}else!x&&k.current&&(k.current.scrollTop=L.current.top,k.current.scrollLeft=L.current.left);if(t.focusedKey!=null&&k.current){let oe=Mg(r,t.focusedKey);oe instanceof HTMLElement&&(!oe.contains(document.activeElement)&&!g&&tl(oe),oh()==="keyboard"&&E1(oe,{containingElement:r.current}))}}},j=X=>{X.currentTarget.contains(X.relatedTarget)||t.setFocused(!1)},$=S.useRef(!1);lg(r,CM,g?X=>{let{detail:V}=X;X.stopPropagation(),t.setFocused(!0),V?.focusStrategy==="first"&&($.current=!0)}:void 0);let Y=jn(()=>{var X,V;let ae=(V=(X=n.getFirstKey)===null||X===void 0?void 0:X.call(n))!==null&&V!==void 0?V:null;ae==null?(aF(r.current),t.collection.size>0&&($.current=!1)):(t.setFocusedKey(ae),$.current=!1)});S1(()=>{$.current&&Y()},[t.collection,Y]);let te=jn(()=>{t.collection.size>0&&($.current=!1)});S1(()=>{te()},[t.focusedKey,te]),lg(r,kM,g?X=>{var V;X.stopPropagation(),t.setFocused(!1),!((V=X.detail)===null||V===void 0)&&V.clearFocusKey&&t.setFocusedKey(null)}:void 0);const ie=S.useRef(i),B=S.useRef(!1);S.useEffect(()=>{if(ie.current){var X,V;let U=null;var ae;i==="first"&&(U=(ae=(X=n.getFirstKey)===null||X===void 0?void 0:X.call(n))!==null&&ae!==void 0?ae:null);var M;i==="last"&&(U=(M=(V=n.getLastKey)===null||V===void 0?void 0:V.call(n))!==null&&M!==void 0?M:null);let oe=t.selectedKeys;if(oe.size){for(let z of oe)if(t.canSelectItem(z)){U=z;break}}t.setFocused(!0),t.setFocusedKey(U),U==null&&!g&&r.current&&Cu(r.current),t.collection.size>0&&(ie.current=!1,B.current=!0)}});let W=S.useRef(t.focusedKey),G=S.useRef(null);S.useEffect(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==W.current||B.current)&&k.current&&r.current){let X=oh(),V=Mg(r,t.focusedKey);if(!(V instanceof HTMLElement))return;(X==="keyboard"||B.current)&&(G.current&&cancelAnimationFrame(G.current),G.current=requestAnimationFrame(()=>{k.current&&(ME(k.current,V),X!=="virtual"&&E1(V,{containingElement:r.current}))}))}!g&&t.isFocused&&t.focusedKey==null&&W.current!=null&&r.current&&Cu(r.current),W.current=t.focusedKey,B.current=!1}),S.useEffect(()=>()=>{G.current&&cancelAnimationFrame(G.current)},[]),lg(r,"react-aria-focus-scope-restore",X=>{X.preventDefault(),t.setFocused(!0)});let ee={onKeyDown:A,onFocus:O,onBlur:j,onMouseDown(X){k.current===X.target&&X.preventDefault()}},{typeSelectProps:H}=GO({keyboardDelegate:n,selectionManager:t});m||(ee=Pn(H,ee));let le;g||(le=t.focusedKey==null?0:-1);let J=WO(t.collection);return{collectionProps:Pn(ee,{tabIndex:le,"data-collection":J})}}class Ek{getItemRect(t){let n=this.ref.current;if(!n)return null;let r=t!=null?Mg(this.ref,t):null;if(!r)return null;let i=n.getBoundingClientRect(),s=r.getBoundingClientRect();return{x:s.left-i.left+n.scrollLeft,y:s.top-i.top+n.scrollTop,width:s.width,height:s.height}}getContentSize(){let t=this.ref.current;var n,r;return{width:(n=t?.scrollWidth)!==null&&n!==void 0?n:0,height:(r=t?.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let t=this.ref.current;var n,r,i,s;return{x:(n=t?.scrollLeft)!==null&&n!==void 0?n:0,y:(r=t?.scrollTop)!==null&&r!==void 0?r:0,width:(i=t?.offsetWidth)!==null&&i!==void 0?i:0,height:(s=t?.offsetHeight)!==null&&s!==void 0?s:0}}constructor(t){this.ref=t}}class XO{isDisabled(t){var n;return this.disabledBehavior==="all"&&(((n=t.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(t.key))}findNextNonDisabled(t,n){let r=t;for(;r!=null;){let i=this.collection.getItem(r);if(i?.type==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(t){let n=t;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(t){let n=t;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(t,n,r){let i=t,s=this.layoutDelegate.getItemRect(i);if(!s||i==null)return null;let a=s;do{if(i=n(i),i==null)break;s=this.layoutDelegate.getItemRect(i)}while(s&&r(a,s)&&i!=null);return i}isSameRow(t,n){return t.y===n.y||t.x!==n.x}isSameColumn(t,n){return t.x===n.x||t.y!==n.y}getKeyBelow(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(t)}getKeyAbove(t){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(t,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(t)}getNextColumn(t,n){return n?this.getPreviousKey(t):this.getNextKey(t)}getKeyRightOf(t){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(t=this.layoutDelegate[n](t),this.findNextNonDisabled(t,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="rtl"):this.findKey(t,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="rtl"):null}getKeyLeftOf(t){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(t=this.layoutDelegate[n](t),this.findNextNonDisabled(t,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(t,this.direction==="ltr"):this.findKey(t,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(t,this.direction==="ltr"):null}getFirstKey(){let t=this.collection.getFirstKey();return this.findNextNonDisabled(t,n=>this.collection.getKeyAfter(n))}getLastKey(){let t=this.collection.getLastKey();return this.findNextNonDisabled(t,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(t){let n=this.ref.current,r=this.layoutDelegate.getItemRect(t);if(!r)return null;if(n&&!qp(n))return this.getFirstKey();let i=t;if(this.orientation==="horizontal"){let s=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let s=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>s&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(t){let n=this.ref.current,r=this.layoutDelegate.getItemRect(t);if(!r)return null;if(n&&!qp(n))return this.getLastKey();let i=t;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.xs||new XO({collection:n,disabledKeys:r,disabledBehavior:d,ref:i,collator:c,layoutDelegate:a}),[s,a,n,r,i,c,d]),{collectionProps:m}=YO({...e,ref:i,selectionManager:t,keyboardDelegate:h});return{listProps:m}}function JO(e,t,n){let{listProps:r}=QO({...e,...t,allowsTabNavigation:!0,disallowSelectAll:!0,ref:n});return delete r.onKeyDownCapture,{accordionProps:{...r,tabIndex:void 0}}}function ZO(e){var t,n;const r=ci(),{ref:i,as:s,item:a,onFocusChange:c}=e,{state:d,className:h,indicator:m,children:g,title:b,subtitle:x,startContent:k,motionProps:P,focusedKey:T,variant:_,isCompact:A=!1,classNames:L={},isDisabled:O=!1,hideIndicator:j=!1,disableAnimation:$=(t=r?.disableAnimation)!=null?t:!1,keepContentMounted:Y=!1,disableIndicatorAnimation:te=!1,HeadingComponent:ie=s||"h2",onPress:B,onPressStart:W,onPressEnd:G,onPressChange:ee,onPressUp:H,onClick:le,...J}=e,X=s||"div",V=typeof X=="string",ae=Ii(i),M=d.disabledKeys.has(a.key)||O,U=d.selectionManager.isSelected(a.key),{buttonProps:oe,regionProps:z}=KO({item:a,isDisabled:M},{...d,focusedKey:T},ae),{onFocus:me,onBlur:Ce,...ye}=oe,{isFocused:Oe,isFocusVisible:Ne,focusProps:_e}=Pu({autoFocus:(n=a.props)==null?void 0:n.autoFocus}),{isHovered:Qe,hoverProps:at}=Eu({isDisabled:M}),{pressProps:Ie,isPressed:mt}=il({ref:ae,isDisabled:M,onPress:B,onPressStart:W,onPressEnd:G,onPressChange:ee,onPressUp:H}),pt=S.useCallback(()=>{c?.(!0,a.key)},[]),Ut=S.useCallback(()=>{c?.(!1,a.key)},[]),Ue=S.useMemo(()=>({...L}),[ds(L)]),it=S.useMemo(()=>OO({isCompact:A,isDisabled:M,hideIndicator:j,disableAnimation:$,disableIndicatorAnimation:te,variant:_}),[A,M,j,$,te,_]),Kt=Bt(Ue?.base,h),er=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(M),"data-slot":"base",className:it.base({class:Kt}),...nn(Ef(J,{enabled:V}),pe)}),[Kt,V,J,it,a.props,U,M]),an=(pe={})=>{var Se,ze;return{ref:ae,"data-open":Ae(U),"data-focus":Ae(Oe),"data-focus-visible":Ae(Ne),"data-disabled":Ae(M),"data-hover":Ae(Qe),"data-pressed":Ae(mt),"data-slot":"trigger",className:it.trigger({class:Ue?.trigger}),onFocus:d1(pt,me,_e.onFocus,J.onFocus,(Se=a.props)==null?void 0:Se.onFocus),onBlur:d1(Ut,Ce,_e.onBlur,J.onBlur,(ze=a.props)==null?void 0:ze.onBlur),...nn(ye,at,Ie,pe,{onClick:el(Ie.onClick,le)})}},_t=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(M),"data-slot":"content",className:it.content({class:Ue?.content}),...nn(z,pe)}),[it,Ue,z,U,M,Ue?.content]),Rt=S.useCallback((pe={})=>({"aria-hidden":Ae(!0),"data-open":Ae(U),"data-disabled":Ae(M),"data-slot":"indicator",className:it.indicator({class:Ue?.indicator}),...pe}),[it,Ue?.indicator,U,M,Ue?.indicator]),Tn=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(M),"data-slot":"heading",className:it.heading({class:Ue?.heading}),...pe}),[it,Ue?.heading,U,M,Ue?.heading]),Er=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(M),"data-slot":"title",className:it.title({class:Ue?.title}),...pe}),[it,Ue?.title,U,M,Ue?.title]),Nt=S.useCallback((pe={})=>({"data-open":Ae(U),"data-disabled":Ae(M),"data-slot":"subtitle",className:it.subtitle({class:Ue?.subtitle}),...pe}),[it,Ue,U,M,Ue?.subtitle]);return{Component:X,HeadingComponent:ie,item:a,slots:it,classNames:Ue,domRef:ae,indicator:m,children:g,title:b,subtitle:x,startContent:k,isOpen:U,isDisabled:M,hideIndicator:j,keepContentMounted:Y,disableAnimation:$,motionProps:P,getBaseProps:er,getHeadingProps:Tn,getButtonProps:an,getContentProps:_t,getIndicatorProps:Rt,getTitleProps:Er,getSubtitleProps:Nt}}var Pk=e=>D.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...e,children:D.jsx("path",{d:"M15.5 19l-7-7 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),N_=e=>D.jsx("svg",{"aria-hidden":"true",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...e,children:D.jsx("path",{d:"M12 2a10 10 0 1010 10A10.016 10.016 0 0012 2zm3.36 12.3a.754.754 0 010 1.06.748.748 0 01-1.06 0l-2.3-2.3-2.3 2.3a.748.748 0 01-1.06 0 .754.754 0 010-1.06l2.3-2.3-2.3-2.3A.75.75 0 019.7 8.64l2.3 2.3 2.3-2.3a.75.75 0 011.06 1.06l-2.3 2.3z",fill:"currentColor"})}),e6=e=>{const{isSelected:t,isIndeterminate:n,disableAnimation:r,...i}=e;return D.jsx("svg",{"aria-hidden":"true",className:"fill-current",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:"1em",...i,children:D.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})},Bp={ease:[.36,.66,.4,1]},Zg={scaleSpring:{enter:{transform:"scale(1)",opacity:1,transition:{type:"spring",bounce:0,duration:.2}},exit:{transform:"scale(0.85)",opacity:0,transition:{type:"easeOut",duration:.15}}},scaleSpringOpacity:{initial:{opacity:0,transform:"scale(0.8)"},enter:{opacity:1,transform:"scale(1)",transition:{type:"spring",bounce:0,duration:.3}},exit:{opacity:0,transform:"scale(0.96)",transition:{type:"easeOut",bounce:0,duration:.15}}},fade:{enter:{opacity:1,transition:{duration:.4,ease:Bp.ease}},exit:{opacity:0,transition:{duration:.3,ease:Bp.ease}}},collapse:{enter:{opacity:1,height:"auto",transition:{height:{type:"spring",bounce:0,duration:.3},opacity:{easings:"ease",duration:.4}}},exit:{opacity:0,height:0,transition:{easings:"ease",duration:.3}}}},Tk=()=>io(()=>import("./index-C_JcEI3R.js"),[]).then(e=>e.default),F_=jr((e,t)=>{const{Component:n,HeadingComponent:r,classNames:i,slots:s,indicator:a,children:c,title:d,subtitle:h,startContent:m,isOpen:g,isDisabled:b,hideIndicator:x,keepContentMounted:k,disableAnimation:P,motionProps:T,getBaseProps:_,getHeadingProps:A,getButtonProps:L,getTitleProps:O,getSubtitleProps:j,getContentProps:$,getIndicatorProps:Y}=ZO({...e,ref:t}),te=v5(),B=S.useMemo(()=>typeof a=="function"?a({indicator:D.jsx(Pk,{}),isOpen:g,isDisabled:b}):a||null,[a,g,b])||D.jsx(Pk,{}),W=S.useMemo(()=>{if(P)return k?D.jsx("div",{...$(),children:c}):g&&D.jsx("div",{...$(),children:c});const G={exit:{...Zg.collapse.exit,overflowY:"hidden"},enter:{...Zg.collapse.enter,overflowY:"unset"}};return k?D.jsx($f,{features:Tk,children:D.jsx(Af.section,{animate:g?"enter":"exit",exit:"exit",initial:"exit",style:{willChange:te},variants:G,onKeyDown:ee=>{ee.stopPropagation()},...T,children:D.jsx("div",{...$(),children:c})},"accordion-content")}):D.jsx(ol,{initial:!1,children:g&&D.jsx($f,{features:Tk,children:D.jsx(Af.section,{animate:"enter",exit:"exit",initial:"exit",style:{willChange:te},variants:G,onKeyDown:ee=>{ee.stopPropagation()},...T,children:D.jsx("div",{...$(),children:c})},"accordion-content")})})},[g,P,k,c,T]);return D.jsxs(n,{..._(),children:[D.jsx(r,{...A(),children:D.jsxs("button",{...L(),children:[m&&D.jsx("div",{className:s.startContent({class:i?.startContent}),children:m}),D.jsxs("div",{className:s.titleWrapper({class:i?.titleWrapper}),children:[d&&D.jsx("span",{...O(),children:d}),h&&D.jsx("span",{...j(),children:h})]}),!x&&B&&D.jsx("span",{...Y(),children:B})]})}),W]})});F_.displayName="HeroUI.AccordionItem";var t6=F_;class n6{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let n=this.keyMap.get(t);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(t){let n=this.keyMap.get(t);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){var n;return(n=this.keyMap.get(t))!==null&&n!==void 0?n:null}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}constructor(t,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t,n=n||new Set;let r=c=>{if(this.keyMap.set(c.key,c),c.childNodes&&(c.type==="section"||n.has(c.key)))for(let d of c.childNodes)r(d)};for(let c of t)r(c);let i=null,s=0;for(let[c,d]of this.keyMap)i?(i.nextKey=c,d.prevKey=i.key):(this.firstKey=c,d.prevKey=void 0),d.type==="item"&&(d.index=s++),i=d,i.nextKey=void 0;var a;this.lastKey=(a=i?.key)!==null&&a!==void 0?a:null}}class Po extends Set{constructor(t,n,r){super(t),t instanceof Po?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function r6(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function i6(e){let{selectionMode:t="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:s="all"}=e,a=S.useRef(!1),[,c]=S.useState(!1),d=S.useRef(null),h=S.useRef(null),[,m]=S.useState(null),g=S.useMemo(()=>_k(e.selectedKeys),[e.selectedKeys]),b=S.useMemo(()=>_k(e.defaultSelectedKeys,new Po),[e.defaultSelectedKeys]),[x,k]=Au(g,b,e.onSelectionChange),P=S.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[T,_]=S.useState(i);i==="replace"&&T==="toggle"&&typeof x=="object"&&x.size===0&&_("replace");let A=S.useRef(i);return S.useEffect(()=>{i!==A.current&&(_(i),A.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:T,setSelectionBehavior:_,get isFocused(){return a.current},setFocused(L){a.current=L,c(L)},get focusedKey(){return d.current},get childFocusStrategy(){return h.current},setFocusedKey(L,O="first"){d.current=L,h.current=O,m(L)},selectedKeys:x,setSelectedKeys(L){(r||!r6(L,x))&&k(L)},disabledKeys:P,disabledBehavior:s}}function _k(e,t){return e?e==="all"?"all":new Po(e):t}function O_(e){return null}O_.getCollectionNode=function*(t,n){let{childItems:r,title:i,children:s}=t,a=t.title||t.children,c=t.textValue||(typeof a=="string"?a:"")||t["aria-label"]||"";!c&&n?.suppressTextValueWarning,yield{type:"item",props:t,rendered:a,textValue:c,"aria-label":t["aria-label"],hasChildNodes:o6(t),*childNodes(){if(r)for(let d of r)yield{type:"item",value:d};else if(i){let d=[];He.Children.forEach(s,h=>{d.push({type:"item",element:h})}),yield*d}}}};function o6(e){return e.hasChildItems!=null?e.hasChildItems:!!(e.childItems||e.title&&He.Children.count(e.children)>0)}let s6=O_;class a6{build(t,n){return this.context=n,Ik(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:n,items:r}=t;if(He.isValidElement(n)&&n.type===He.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let s of r)yield*this.getFullNode({value:s,index:i},{renderer:n}),i++}else{let i=[];He.Children.forEach(n,a=>{a&&i.push(a)});let s=0;for(let a of i){let c=this.getFullNode({element:a,index:s},{});for(let d of c)s++,yield d}}}getKey(t,n,r,i){if(t.key!=null)return t.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let s=n.value;if(s!=null){var a;let c=(a=s.key)!==null&&a!==void 0?a:s.id;if(c==null)throw new Error("No key found for item");return c}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(t,n){return{renderer:n.renderer||t.renderer}}*getFullNode(t,n,r,i){if(He.isValidElement(t.element)&&t.element.type===He.Fragment){let T=[];He.Children.forEach(t.element.props.children,A=>{T.push(A)});var s;let _=(s=t.index)!==null&&s!==void 0?s:0;for(const A of T)yield*this.getFullNode({element:A,index:_++},n,r,i);return}let a=t.element;if(!a&&t.value&&n&&n.renderer){let T=this.cache.get(t.value);if(T&&(!T.shouldInvalidate||!T.shouldInvalidate(this.context))){T.index=t.index,T.parentKey=i?i.key:null,yield T;return}a=n.renderer(t.value)}if(He.isValidElement(a)){let T=a.type;if(typeof T!="function"&&typeof T.getCollectionNode!="function"){let O=a.type;throw new Error(`Unknown element <${O}> in collection.`)}let _=T.getCollectionNode(a.props,this.context);var c;let A=(c=t.index)!==null&&c!==void 0?c:0,L=_.next();for(;!L.done&&L.value;){let O=L.value;t.index=A;var d;let j=(d=O.key)!==null&&d!==void 0?d:null;j==null&&(j=O.element?null:this.getKey(a,t,n,r));let Y=[...this.getFullNode({...O,key:j,index:A,wrapper:l6(t.wrapper,O.wrapper)},this.getChildState(n,O),r?`${r}${a.key}`:a.key,i)];for(let te of Y){var h,m;te.value=(m=(h=O.value)!==null&&h!==void 0?h:t.value)!==null&&m!==void 0?m:null,te.value&&this.cache.set(te.value,te);var g;if(t.type&&te.type!==t.type)throw new Error(`Unsupported type <${m0(te.type)}> in <${m0((g=i?.type)!==null&&g!==void 0?g:"unknown parent type")}>. Only <${m0(t.type)}> is supported.`);A++,yield te}L=_.next(Y)}return}if(t.key==null||t.type==null)return;let b=this;var x,k;let P={type:t.type,props:t.props,key:t.key,parentKey:i?i.key:null,value:(x=t.value)!==null&&x!==void 0?x:null,level:i?i.level+1:0,index:t.index,rendered:t.rendered,textValue:(k=t.textValue)!==null&&k!==void 0?k:"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:Ik(function*(){if(!t.hasChildNodes||!t.childNodes)return;let T=0;for(let _ of t.childNodes()){_.key!=null&&(_.key=`${P.key}${_.key}`);let A=b.getFullNode({..._,index:T},b.getChildState(n,_),P.key,P);for(let L of A)T++,yield L}})};yield P}constructor(){this.cache=new WeakMap}}function Ik(e){let t=[],n=null;return{*[Symbol.iterator](){for(let r of t)yield r;n||(n=e());for(let r of n)t.push(r),yield r}}}function l6(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function m0(e){return e[0].toUpperCase()+e.slice(1)}function u6(e,t,n){let r=S.useMemo(()=>new a6,[]),{children:i,items:s,collection:a}=e;return S.useMemo(()=>{if(a)return a;let d=r.build({children:i,items:s},n);return t(d)},[r,i,s,a,n,t])}function c6(e,t){return typeof t.getChildren=="function"?t.getChildren(e.key):e.childNodes}function f6(e){return d6(e,0)}function d6(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function YG(e){let t;for(let n of e)t=n;return t}function g0(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...$k(e,t),t],i=[...$k(e,n),n],s=r.slice(0,i.length).findIndex((a,c)=>a!==i[c]);return s!==-1?(t=r[s],n=i[s],t.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===t)>=0,-1)}function $k(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}class Jx{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,n){(t==null||this.collection.getItem(t))&&this.state.setFocusedKey(t,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){if(this.state.selectionMode==="none")return!1;let n=this.getKey(t);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=t.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!t||i&&g0(this.collection,i,t)<0)&&(t=i)}var n;return(n=t?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let t=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!t||i&&g0(this.collection,i,t)>0)&&(t=i)}var n;return(n=t?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Po([n],n,n);else{let a=this.state.selectedKeys;var i;let c=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new Po(a,c,n);var s;for(let d of this.getKeyRange(c,(s=a.currentKey)!==null&&s!==void 0?s:n))r.delete(d);for(let d of this.getKeyRange(n,c))this.canSelectItem(d)&&r.add(d)}this.state.setSelectedKeys(r)}getKeyRange(t,n){let r=this.collection.getItem(t),i=this.collection.getItem(n);return r&&i?g0(this.collection,r,i)<=0?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(t,n);let i=[],s=t;for(;s!=null;){let a=this.collection.getItem(s);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(s),s===n)return i;s=this.collection.getKeyAfter(s)}return[]}getKey(t){let n=this.collection.getItem(t);if(!n||n.type==="cell"&&this.allowsCellSelection)return t;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let r=new Po(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(t){if(this.selectionMode==="none")return;let n=this.getKey(t);if(n==null)return;let r=this.canSelectItem(n)?new Po([n],n,n):new Po;this.state.setSelectedKeys(r)}setSelectedKeys(t){if(this.selectionMode==="none")return;let n=new Po;for(let r of t){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let t=[],n=r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);a?.type==="item"&&t.push(r);var s;a?.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((s=(i=f6(c6(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&s!==void 0?s:null)}r=this.collection.getKeyAfter(r)}};return n(this.collection.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Po)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(t.size!==n.size)return!1;for(let r of t)if(!n.has(r))return!1;for(let r of n)if(!t.has(r))return!1;return!0}canSelectItem(t){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let r=this.collection.getItem(t);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(t){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(t)||!!(!((r=this.collection.getItem(t))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(t){var n,r;return!!(!((r=this.collection.getItem(t))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(t){var n;return(n=this.collection.getItem(t))===null||n===void 0?void 0:n.props}withCollection(t){return new Jx(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(t,n,r){this.collection=t,this.state=n;var i;this.allowsCellSelection=(i=r?.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=r?.layoutDelegate||null}}function p6(e){let{onExpandedChange:t}=e,[n,r]=Au(e.expandedKeys?new Set(e.expandedKeys):void 0,e.defaultExpandedKeys?new Set(e.defaultExpandedKeys):new Set,t),i=i6(e),s=S.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),a=u6(e,S.useCallback(d=>new n6(d,{expandedKeys:n}),[n]),null);return S.useEffect(()=>{i.focusedKey!=null&&!a.getItem(i.focusedKey)&&i.setFocusedKey(null)},[a,i.focusedKey]),{collection:a,expandedKeys:n,disabledKeys:s,toggleKey:d=>{r(h6(n,d))},setExpandedKeys:r,selectionManager:new Jx(a,i)}}function h6(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function m6(e){var t;const n=ci(),{ref:r,as:i,className:s,items:a,variant:c,motionProps:d,expandedKeys:h,disabledKeys:m,selectedKeys:g,children:b,defaultExpandedKeys:x,selectionMode:k="single",selectionBehavior:P="toggle",keepContentMounted:T=!1,disallowEmptySelection:_,defaultSelectedKeys:A,onExpandedChange:L,onSelectionChange:O,dividerProps:j={},isCompact:$=!1,isDisabled:Y=!1,showDivider:te=!0,hideIndicator:ie=!1,disableAnimation:B=(t=n?.disableAnimation)!=null?t:!1,disableIndicatorAnimation:W=!1,itemClasses:G,...ee}=e,[H,le]=S.useState(null),J=i||"div",X=typeof J=="string",V=Ii(r),ae=S.useMemo(()=>FO({variant:c,className:s}),[c,s]),U={children:S.useMemo(()=>{let _e=[];return He.Children.map(b,Qe=>{var at;if(He.isValidElement(Qe)&&typeof((at=Qe.props)==null?void 0:at.children)!="string"){const Ie=He.cloneElement(Qe,{hasChildItems:!1});_e.push(Ie)}else _e.push(Qe)}),_e},[b]),items:a},oe={expandedKeys:h,defaultExpandedKeys:x,onExpandedChange:L},z={disabledKeys:m,selectedKeys:g,selectionMode:k,selectionBehavior:P,disallowEmptySelection:_,defaultSelectedKeys:A??x,onSelectionChange:O,...U,...oe},me=p6(z);me.selectionManager.setFocusedKey=_e=>{le(_e)};const{accordionProps:Ce}=JO({...U,...oe},me,V),ye=S.useMemo(()=>({state:me,focusedKey:H,motionProps:d,isCompact:$,isDisabled:Y,hideIndicator:ie,disableAnimation:B,keepContentMounted:T,disableIndicatorAnimation:W}),[H,$,Y,ie,g,B,T,me?.expandedKeys.values,W,me.expandedKeys.size,me.disabledKeys.size,d]),Oe=S.useCallback((_e={})=>({ref:V,className:ae,"data-orientation":"vertical",...nn(Ce,Ef(ee,{enabled:X}),_e)}),[]),Ne=S.useCallback((_e,Qe)=>{_e&&le(Qe)},[]);return{Component:J,values:ye,state:me,focusedKey:H,getBaseProps:Oe,isSplitted:c==="splitted",classNames:ae,showDivider:te,dividerProps:j,disableAnimation:B,handleFocusChanged:Ne,itemClasses:G}}function g6(e){let t=Ef(e,{enabled:typeof e.elementType=="string"}),n;return e.orientation==="vertical"&&(n="vertical"),e.elementType!=="hr"?{separatorProps:{...t,role:"separator","aria-orientation":n}}:{separatorProps:t}}function v6(e){const{as:t,className:n,orientation:r,...i}=e;let s=t||"hr";s==="hr"&&r==="vertical"&&(s="div");const{separatorProps:a}=g6({elementType:typeof s=="string"?s:"hr",orientation:r}),c=S.useMemo(()=>LO({orientation:r,className:n}),[r,n]),d=S.useCallback((h={})=>({className:c,role:"separator","data-orientation":r,...a,...i,...h}),[c,r,a,i]);return{Component:s,getDividerProps:d}}var z_=jr((e,t)=>{const{Component:n,getDividerProps:r}=v6({...e});return D.jsx(n,{ref:t,...r()})});z_.displayName="HeroUI.Divider";var y6=z_,j_=jr((e,t)=>{const{Component:n,values:r,state:i,isSplitted:s,showDivider:a,getBaseProps:c,disableAnimation:d,handleFocusChanged:h,itemClasses:m,dividerProps:g}=m6({...e,ref:t}),b=S.useCallback((k,P)=>h(k,P),[h]),x=S.useMemo(()=>[...i.collection].map((k,P)=>{const T={...m,...k.props.classNames||{}};return D.jsxs(S.Fragment,{children:[D.jsx(t6,{item:k,variant:e.variant,onFocusChange:b,...r,...k.props,classNames:T}),!k.props.hidden&&!s&&a&&P{const t={top:{originY:1},bottom:{originY:0},left:{originX:1},right:{originX:0},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1}};return t?.[e]||{}},x6=e=>({top:"top",bottom:"bottom",left:"left",right:"right","top-start":"top start","top-end":"top end","bottom-start":"bottom start","bottom-end":"bottom end","left-start":"left top","left-end":"left bottom","right-start":"right top","right-end":"right bottom"})[e],XG=(e,t)=>{if(t.includes("-")){const[n]=t.split("-");if(n.includes(e))return!1}return!0},Rk=(e,t)=>{if(t.includes("-")){const[,n]=t.split("-");return`${e}-${n}`}return e},w6=s6,bp=w6,Sh=globalThis?.document?S.useLayoutEffect:S.useEffect;function S6(e={}){const{onLoad:t,onError:n,ignoreFallback:r,src:i,crossOrigin:s,srcSet:a,sizes:c,loading:d,shouldBypassImageLoad:h=!1}=e,m=kL(),g=S.useRef(m?new Image:null),[b,x]=S.useState("pending");S.useEffect(()=>{g.current&&(g.current.onload=T=>{k(),x("loaded"),t?.(T)},g.current.onerror=T=>{k(),x("failed"),n?.(T)})},[g.current]);const k=()=>{g.current&&(g.current.onload=null,g.current.onerror=null,g.current=null)},P=S.useCallback(()=>{if(!i)return"pending";if(r||h)return"loaded";const T=new Image;return T.src=i,s&&(T.crossOrigin=s),a&&(T.srcset=a),c&&(T.sizes=c),d&&(T.loading=d),g.current=T,T.complete&&T.naturalWidth?"loaded":"loading"},[i,s,a,c,t,n,d,h]);return Sh(()=>{m&&x(P())},[m,P]),r?"loaded":b}var[QG,k6]=pv({name:"ButtonGroupContext",strict:!1});function B_(e,t){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,preventFocusOnPress:h,allowFocusWhenDisabled:m,onClick:g,href:b,target:x,rel:k,type:P="button",allowTextSelectionOnPress:T}=e,_;n==="button"?_={type:P,disabled:r}:_={role:"button",href:n==="a"&&!r?b:void 0,target:n==="a"?x:void 0,type:n==="input"?P:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?k:void 0};let{pressProps:A,isPressed:L}=il({onClick:g,onPressStart:s,onPressEnd:a,onPressUp:c,onPressChange:d,onPress:i,isDisabled:r,preventFocusOnPress:h,allowTextSelectionOnPress:T,ref:t}),{focusableProps:O}=xh(e,t);m&&(O.tabIndex=r?-1:O.tabIndex);let j=Pn(O,A,$u(e,{labelable:!0}));return{isPressed:L,buttonProps:Pn(_,j,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}var C6=()=>io(()=>import("./index-C_JcEI3R.js"),[]).then(e=>e.default),V_=e=>{const{ripples:t=[],motionProps:n,color:r="currentColor",style:i,onClear:s}=e;return D.jsx(D.Fragment,{children:t.map(a=>{const c=yL(.01*a.size,.2,a.size>100?.75:.5);return D.jsx($f,{features:C6,children:D.jsx(ol,{mode:"popLayout",children:D.jsx(Af.span,{animate:{transform:"scale(2)",opacity:0},className:"heroui-ripple",exit:{opacity:0},initial:{transform:"scale(0)",opacity:.35},style:{position:"absolute",backgroundColor:r,borderRadius:"100%",transformOrigin:"center",pointerEvents:"none",overflow:"hidden",inset:0,zIndex:0,top:a.y,left:a.x,width:`${a.size}px`,height:`${a.size}px`,...i},transition:{duration:c},onAnimationComplete:()=>{s(a.key)},...n})})},a.key)})})};V_.displayName="HeroUI.Ripple";var E6=V_;function P6(e={}){const[t,n]=S.useState([]),r=S.useCallback(s=>{const a=s.target,c=Math.max(a.clientWidth,a.clientHeight);n(d=>[...d,{key:vL(d.length.toString()),size:c,x:s.x-c/2,y:s.y-c/2}])},[]),i=S.useCallback(s=>{n(a=>a.filter(c=>c.key!==s))},[]);return{ripples:t,onClear:i,onPress:r,...e}}function T6(e){var t,n,r,i,s,a,c,d,h;const m=k6(),g=ci(),b=!!m,{ref:x,as:k,children:P,startContent:T,endContent:_,autoFocus:A,className:L,spinner:O,isLoading:j=!1,disableRipple:$=!1,fullWidth:Y=(t=m?.fullWidth)!=null?t:!1,radius:te=m?.radius,size:ie=(n=m?.size)!=null?n:"md",color:B=(r=m?.color)!=null?r:"default",variant:W=(i=m?.variant)!=null?i:"solid",disableAnimation:G=(a=(s=m?.disableAnimation)!=null?s:g?.disableAnimation)!=null?a:!1,isDisabled:ee=(c=m?.isDisabled)!=null?c:!1,isIconOnly:H=(d=m?.isIconOnly)!=null?d:!1,spinnerPlacement:le="start",onPress:J,onClick:X,...V}=e,ae=k||"button",M=typeof ae=="string",U=Ii(x),oe=(h=$||g?.disableRipple)!=null?h:G,{isFocusVisible:z,isFocused:me,focusProps:Ce}=Pu({autoFocus:A}),ye=ee||j,Oe=S.useMemo(()=>DO({size:ie,color:B,variant:W,radius:te,fullWidth:Y,isDisabled:ye,isInGroup:b,disableAnimation:G,isIconOnly:H,className:L}),[ie,B,W,te,Y,ye,b,H,G,L]),{onPress:Ne,onClear:_e,ripples:Qe}=P6(),at=S.useCallback(Rt=>{oe||ye||G||U.current&&Ne(Rt)},[oe,ye,G,U,Ne]),{buttonProps:Ie,isPressed:mt}=B_({elementType:k,isDisabled:ye,onPress:el(J,at),onClick:X,...V},U),{isHovered:pt,hoverProps:Ut}=Eu({isDisabled:ye}),Ue=S.useCallback((Rt={})=>({"data-disabled":Ae(ye),"data-focus":Ae(me),"data-pressed":Ae(mt),"data-focus-visible":Ae(z),"data-hover":Ae(pt),"data-loading":Ae(j),...nn(Ie,Ce,Ut,Ef(V,{enabled:M}),Ef(Rt)),className:Oe}),[j,ye,me,mt,M,z,pt,Ie,Ce,Ut,V,Oe]),it=Rt=>S.isValidElement(Rt)?S.cloneElement(Rt,{"aria-hidden":!0,focusable:!1}):null,Kt=it(T),er=it(_),an=S.useMemo(()=>({sm:"sm",md:"sm",lg:"md"})[ie],[ie]),_t=S.useCallback(()=>({ripples:Qe,onClear:_e}),[Qe,_e]);return{Component:ae,children:P,domRef:U,spinner:O,styles:Oe,startContent:Kt,endContent:er,isLoading:j,spinnerPlacement:le,spinnerSize:an,disableRipple:oe,getButtonProps:Ue,getRippleProps:_t,isIconOnly:H}}function _6(e){var t,n;const[r,i]=oa(e,hk.variantKeys),s=ci(),a=(n=(t=e?.variant)!=null?t:s?.spinnerVariant)!=null?n:"default",{children:c,className:d,classNames:h,label:m,...g}=r,b=S.useMemo(()=>hk({...i}),[ds(i)]),x=Bt(h?.base,d),k=m||c,P=S.useMemo(()=>k&&typeof k=="string"?k:g["aria-label"]?"":"Loading",[c,k,g["aria-label"]]),T=S.useCallback(()=>({"aria-label":P,className:b.base({class:x}),...g}),[P,b,x,g]);return{label:k,slots:b,classNames:h,variant:a,getSpinnerProps:T}}var U_=jr((e,t)=>{const{slots:n,classNames:r,label:i,variant:s,getSpinnerProps:a}=_6({...e});return s==="wave"||s==="dots"?D.jsxs("div",{ref:t,...a(),children:[D.jsx("div",{className:n.wrapper({class:r?.wrapper}),children:[...new Array(3)].map((c,d)=>D.jsx("i",{className:n.dots({class:r?.dots}),style:{"--dot-index":d}},`dot-${d}`))}),i&&D.jsx("span",{className:n.label({class:r?.label}),children:i})]}):s==="simple"?D.jsxs("div",{ref:t,...a(),children:[D.jsxs("svg",{className:n.wrapper({class:r?.wrapper}),fill:"none",viewBox:"0 0 24 24",children:[D.jsx("circle",{className:n.circle1({class:r?.circle1}),cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),D.jsx("path",{className:n.circle2({class:r?.circle2}),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"})]}),i&&D.jsx("span",{className:n.label({class:r?.label}),children:i})]}):s==="spinner"?D.jsxs("div",{ref:t,...a(),children:[D.jsx("div",{className:n.wrapper({class:r?.wrapper}),children:[...new Array(12)].map((c,d)=>D.jsx("i",{className:n.spinnerBars({class:r?.spinnerBars}),style:{"--bar-index":d}},`star-${d}`))}),i&&D.jsx("span",{className:n.label({class:r?.label}),children:i})]}):D.jsxs("div",{ref:t,...a(),children:[D.jsxs("div",{className:n.wrapper({class:r?.wrapper}),children:[D.jsx("i",{className:n.circle1({class:r?.circle1})}),D.jsx("i",{className:n.circle2({class:r?.circle2})})]}),i&&D.jsx("span",{className:n.label({class:r?.label}),children:i})]})});U_.displayName="HeroUI.Spinner";var I6=U_,K_=jr((e,t)=>{const{Component:n,domRef:r,children:i,spinnerSize:s,spinner:a=D.jsx(I6,{color:"current",size:s}),spinnerPlacement:c,startContent:d,endContent:h,isLoading:m,disableRipple:g,getButtonProps:b,getRippleProps:x,isIconOnly:k}=T6({...e,ref:t});return D.jsxs(n,{ref:r,...b(),children:[d,m&&c==="start"&&a,m&&k?null:i,m&&c==="end"&&a,h,!g&&D.jsx(E6,{...x()})]})});K_.displayName="HeroUI.Button";var wr=K_;function $6(e){const[t,n]=oa(e,Sk.variantKeys),{ref:r,as:i,children:s,avatar:a,startContent:c,endContent:d,onClose:h,classNames:m,className:g,...b}=t,x=i||"div",k=Ii(r),P=Bt(m?.base,g),T=!!h,_=e.variant==="dot",{focusProps:A,isFocusVisible:L}=Pu(),O=S.useMemo(()=>typeof s=="string"&&s?.length===1,[s]),j=S.useMemo(()=>!!a||!!c,[a,c]),$=S.useMemo(()=>!!d||T,[d,T]),Y=S.useMemo(()=>Sk({...n,hasStartContent:j,hasEndContent:$,isOneChar:O,isCloseable:T,isCloseButtonFocusVisible:L}),[ds(n),L,j,$,O,T]),{pressProps:te}=il({isDisabled:!!e?.isDisabled,onPress:h}),ie=()=>({ref:k,className:Y.base({class:P}),...b}),B=()=>({role:"button",tabIndex:0,className:Y.closeButton({class:m?.closeButton}),"aria-label":"close chip",...nn(te,A)}),W=ee=>S.isValidElement(ee)?S.cloneElement(ee,{className:Y.avatar({class:m?.avatar})}):null,G=ee=>S.isValidElement(ee)?S.cloneElement(ee,{className:Bt("max-h-[80%]",ee.props.className)}):null;return{Component:x,children:s,slots:Y,classNames:m,isDot:_,isCloseable:T,startContent:W(a)||G(c),endContent:G(d),getCloseButtonProps:B,getChipProps:ie}}var W_=jr((e,t)=>{const{Component:n,children:r,slots:i,classNames:s,isDot:a,isCloseable:c,startContent:d,endContent:h,getCloseButtonProps:m,getChipProps:g}=$6({...e,ref:t}),b=S.useMemo(()=>a&&!d?D.jsx("span",{className:i.dot({class:s?.dot})}):d,[i,d,a]),x=S.useMemo(()=>c?D.jsx("span",{...m(),children:h||D.jsx(N_,{})}):h,[h,c,m]);return D.jsxs(n,{...g(),children:[b,D.jsx("span",{className:i.content({class:s?.content}),children:r}),x]})});W_.displayName="HeroUI.Chip";var wg=W_;const H_={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},G_={...H_,customError:!0,valid:!1},ff={isInvalid:!1,validationDetails:H_,validationErrors:[]},q_=S.createContext({}),ev="__formValidationState"+Date.now();function Zx(e){if(e[ev]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:s}=e[ev];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:s}}return A6(e)}function A6(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:s,validate:a,validationBehavior:c="aria"}=e;n&&(t||(t=n==="invalid"));let d=t!==void 0?{isInvalid:t,validationErrors:[],validationDetails:G_}:null,h=S.useMemo(()=>{if(!a||i==null)return null;let B=R6(a,i);return Lk(B)},[a,i]);s?.validationDetails.valid&&(s=void 0);let m=S.useContext(q_),g=S.useMemo(()=>r?Array.isArray(r)?r.flatMap(B=>$b(m[B])):$b(m[r]):[],[m,r]),[b,x]=S.useState(m),[k,P]=S.useState(!1);m!==b&&(x(m),P(!1));let T=S.useMemo(()=>Lk(k?[]:g),[k,g]),_=S.useRef(ff),[A,L]=S.useState(ff),O=S.useRef(ff),j=()=>{if(!$)return;Y(!1);let B=h||s||_.current;v0(B,O.current)||(O.current=B,L(B))},[$,Y]=S.useState(!1);return S.useEffect(j),{realtimeValidation:d||T||h||s||ff,displayValidation:c==="native"?d||T||A:d||T||h||s||A,updateValidation(B){c==="aria"&&!v0(A,B)?L(B):_.current=B},resetValidation(){let B=ff;v0(B,O.current)||(O.current=B,L(B)),c==="native"&&Y(!1),P(!0)},commitValidation(){c==="native"&&Y(!0),P(!0)}}}function $b(e){return e?Array.isArray(e)?e:[e]:[]}function R6(e,t){if(typeof e=="function"){let n=e(t);if(n&&typeof n!="boolean")return $b(n)}return[]}function Lk(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:G_}:null}function v0(e,t){return e===t?!0:!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((n,r)=>n===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([n,r])=>t.validationDetails[n]===r)}function Y_(e,t,n){let{validationBehavior:r,focus:i}=e;sn(()=>{if(r==="native"&&n?.current&&!n.current.disabled){let d=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(d),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation(M6(n.current))}});let s=jn(()=>{t.resetValidation()}),a=jn(d=>{var h;t.displayValidation.isInvalid||t.commitValidation();let m=n==null||(h=n.current)===null||h===void 0?void 0:h.form;if(!d.defaultPrevented&&n&&m&&D6(m)===n.current){var g;i?i():(g=n.current)===null||g===void 0||g.focus(),U5("keyboard")}d.preventDefault()}),c=jn(()=>{t.commitValidation()});S.useEffect(()=>{let d=n?.current;if(!d)return;let h=d.form;return d.addEventListener("invalid",a),d.addEventListener("change",c),h?.addEventListener("reset",s),()=>{d.removeEventListener("invalid",a),d.removeEventListener("change",c),h?.removeEventListener("reset",s)}},[n,a,c,s,r])}function L6(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function M6(e){return{isInvalid:!e.validity.valid,validationDetails:L6(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function D6(e){for(let t=0;t{O.stopPropagation(),t.setSelected(O.target.checked)},{pressProps:x,isPressed:k}=il({isDisabled:r}),{pressProps:P,isPressed:T}=il({onPress(){var O;t.toggle(),(O=n.current)===null||O===void 0||O.focus()},isDisabled:r||i}),{focusableProps:_}=xh(e,n),A=Pn(x,_),L=$u(e,{labelable:!0});return NE(n,t.isSelected,t.setSelected),{labelProps:Pn(P,{onClick:O=>O.preventDefault()}),inputProps:Pn(L,{"aria-invalid":g||m==="invalid"||void 0,"aria-errormessage":e["aria-errormessage"],"aria-controls":e["aria-controls"],"aria-readonly":i||void 0,onChange:b,disabled:r,...s==null?{}:{value:s},name:a,type:"checkbox",...A}),isSelected:t.isSelected,isPressed:k||T,isDisabled:r,isReadOnly:i,isInvalid:g||m==="invalid"}}function X_(e,t,n){let r=Zx({...e,value:t.isSelected}),{isInvalid:i,validationErrors:s,validationDetails:a}=r.displayValidation,{labelProps:c,inputProps:d,isSelected:h,isPressed:m,isDisabled:g,isReadOnly:b}=N6({...e,isInvalid:i},t,n);Y_(e,r,n);let{isIndeterminate:x,isRequired:k,validationBehavior:P="aria"}=e;S.useEffect(()=>{n.current&&(n.current.indeterminate=!!x)});let{pressProps:T}=il({isDisabled:g||b,onPress(){let{[ev]:_}=e,{commitValidation:A}=_||r;A()}});return{labelProps:Pn(c,T),inputProps:{...d,checked:h,"aria-required":k&&P==="aria"||void 0,required:k&&P==="native"},isSelected:h,isPressed:m,isDisabled:g,isReadOnly:b,isInvalid:i,validationErrors:s,validationDetails:a}}const F6=new WeakMap;function Q_(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:s="label"}=e;t=Pf(t);let a=Pf(),c={};n&&(r=r?`${a} ${r}`:a,c={id:a,htmlFor:s==="label"?t:void 0});let d=AE({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:c,fieldProps:d}}function O6(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:s,fieldProps:a}=Q_(e),c=W0([!!t,!!n,r,i]),d=W0([!!t,!!n,r,i]);return a=Pn(a,{"aria-describedby":[c,d,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:s,fieldProps:a,descriptionProps:{id:c},errorMessageProps:{id:d}}}function J_(e={}){let{isReadOnly:t}=e,[n,r]=Au(e.isSelected,e.defaultSelected||!1,e.onChange);function i(a){t||r(a)}function s(){t||r(!n)}return{isSelected:n,setSelected:i,toggle:s}}function z6(e,t,n){const r=J_({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),onChange(T){T?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(T)}});let{name:i,descriptionId:s,errorMessageId:a,validationBehavior:c}=F6.get(t);var d;c=(d=e.validationBehavior)!==null&&d!==void 0?d:c;let{realtimeValidation:h}=Zx({...e,value:r.isSelected,name:void 0,validationBehavior:"aria"}),m=S.useRef(ff),g=()=>{t.setInvalid(e.value,h.isInvalid?h:m.current)};S.useEffect(g);let b=t.realtimeValidation.isInvalid?t.realtimeValidation:h,x=c==="native"?t.displayValidation:b;var k;let P=X_({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,isRequired:(k=e.isRequired)!==null&&k!==void 0?k:t.isRequired,validationBehavior:c,[ev]:{realtimeValidation:b,displayValidation:x,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(T){m.current=T,g()}}},r,n);return{...P,inputProps:{...P.inputProps,"aria-describedby":[e["aria-describedby"],t.isInvalid?a:null,s].filter(Boolean).join(" ")||void 0}}}var Mk=Symbol("default");function j6(e){const t=S.useRef(null),n=S.useRef(void 0),r=S.useCallback(i=>{if(typeof e=="function"){const s=e,a=s(i);return()=>{typeof a=="function"?a():s(null)}}else if(e)return e.current=i,()=>{e.current=null}},[e]);return S.useMemo(()=>({get current(){return t.current},set current(i){t.current=i,n.current&&(n.current(),n.current=void 0),i!=null&&(n.current=r(i))}}),[r])}function ew(e,t){let n=S.useContext(e);if(t===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`));if(!t&&!n.slots[Mk])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let i=t||Mk;if(!n.slots[i])throw new Error(`Invalid slot "${t}". Valid slot names are ${r}.`);return n.slots[i]}return n}function B6(e,t,n){let r=ew(n,e.slot)||{},{ref:i,...s}=r,a=j6(S.useMemo(()=>gE(t,i),[t,i])),c=nn(s,e);return"style"in s&&s.style&&"style"in e&&e.style&&(typeof s.style=="function"||typeof e.style=="function"?c.style=d=>{let h=typeof s.style=="function"?s.style(d):s.style,m={...d.defaultStyle,...h},g=typeof e.style=="function"?e.style({...d,defaultStyle:m}):e.style;return{...m,...g}}:c.style={...s.style,...e.style}),[c,a]}var tv=S.createContext(null),V6=S.forwardRef(function(t,n){[t,n]=B6(t,n,tv);let{validationErrors:r,validationBehavior:i="native",children:s,className:a,...c}=t;const d=S.useMemo(()=>MO({className:a}),[a]);return D.jsx("form",{noValidate:i!=="native",...c,ref:n,className:d,children:D.jsx(tv.Provider,{value:{...t,validationBehavior:i},children:D.jsx(q_.Provider,{value:r??{},children:s})})})}),U6=S.forwardRef(function(t,n){var r,i;const s=ci(),a=(i=(r=t.validationBehavior)!=null?r:s?.validationBehavior)!=null?i:"native";return D.jsx(V6,{...t,ref:n,validationBehavior:a})}),[JG,K6]=pv({name:"CheckboxGroupContext",strict:!1});function W6(e){const{isSelected:t,disableAnimation:n,...r}=e;return D.jsx("svg",{"aria-hidden":"true",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:t?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,style:!n&&t?{transition:"stroke-dashoffset 250ms linear 0.2s"}:{},viewBox:"0 0 17 18",...r,children:D.jsx("polyline",{points:"1 9 7 14 15 4"})})}function H6(e){const{isSelected:t,disableAnimation:n,...r}=e;return D.jsx("svg",{stroke:"currentColor",strokeWidth:3,viewBox:"0 0 24 24",...r,children:D.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function G6(e){const{isIndeterminate:t,...n}=e,r=t?H6:W6;return D.jsx(r,{...n})}function Ab(e,t=[]){const n=S.useRef(e);return Sh(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function q6(e={}){var t,n,r,i,s,a,c,d;const h=ci(),m=K6(),{validationBehavior:g}=ew(tv)||{},b=!!m,{as:x,ref:k,value:P="",children:T,icon:_,name:A,isRequired:L,isReadOnly:O=!1,autoFocus:j=!1,isSelected:$,size:Y=(t=m?.size)!=null?t:"md",color:te=(n=m?.color)!=null?n:"primary",radius:ie=m?.radius,lineThrough:B=(r=m?.lineThrough)!=null?r:!1,isDisabled:W=(i=m?.isDisabled)!=null?i:!1,disableAnimation:G=(a=(s=m?.disableAnimation)!=null?s:h?.disableAnimation)!=null?a:!1,validationState:ee,isInvalid:H=ee?ee==="invalid":(c=m?.isInvalid)!=null?c:!1,isIndeterminate:le=!1,validationBehavior:J=b?m.validationBehavior:(d=g??h?.validationBehavior)!=null?d:"native",defaultSelected:X,classNames:V,className:ae,onValueChange:M,validate:U,...oe}=e,z=x||"label",me=S.useRef(null),Ce=S.useRef(null);let ye=e.onChange;b&&(ye=el(()=>{m.groupState.resetValidation()},ye));const Oe=S.useId(),Ne=S.useMemo(()=>({name:A,value:P,children:T,autoFocus:j,defaultSelected:X,isIndeterminate:le,isRequired:L,isInvalid:H,isSelected:$,isDisabled:W,isReadOnly:O,"aria-label":mE(oe["aria-label"],T),"aria-labelledby":oe["aria-labelledby"]||Oe,onChange:M}),[A,P,T,j,X,le,L,H,$,W,O,oe["aria-label"],oe["aria-labelledby"],Oe,M]),_e=J_(Ne),Qe={isInvalid:H,isRequired:L,validate:U,validationState:ee,validationBehavior:J},{inputProps:at,isSelected:Ie,isDisabled:mt,isReadOnly:pt,isPressed:Ut,isInvalid:Ue}=b?z6({...Ne,...Qe},m.groupState,Ce):X_({...Ne,...Qe},_e,Ce),it=mt||pt,Kt=ee==="invalid"||H||Ue,er=it?!1:Ut,{hoverProps:an,isHovered:_t}=Eu({isDisabled:at.disabled}),{focusProps:Rt,isFocused:Tn,isFocusVisible:Er}=Pu({autoFocus:at.autoFocus}),Nt=S.useMemo(()=>NO({color:te,size:Y,radius:ie,isInvalid:Kt,lineThrough:B,isDisabled:mt,disableAnimation:G}),[te,Y,ie,Kt,B,mt,G]);Sh(()=>{if(!Ce.current)return;const Pt=!!Ce.current.checked;_e.setSelected(Pt)},[Ce.current]);const pe=Ab(ye),Se=S.useCallback(Pt=>{if(pt||mt){Pt.preventDefault();return}pe?.(Pt)},[pt,mt,pe]),ze=Bt(V?.base,ae),nt=S.useCallback(()=>({ref:me,className:Nt.base({class:ze}),"data-disabled":Ae(mt),"data-selected":Ae(Ie||le),"data-invalid":Ae(Kt),"data-hover":Ae(_t),"data-focus":Ae(Tn),"data-pressed":Ae(er),"data-readonly":Ae(at.readOnly),"data-focus-visible":Ae(Er),"data-indeterminate":Ae(le),...nn(an,oe)}),[Nt,ze,mt,Ie,le,Kt,_t,Tn,er,at.readOnly,Er,an,oe]),lt=S.useCallback((Pt={})=>({...Pt,"aria-hidden":!0,className:Bt(Nt.wrapper({class:Bt(V?.wrapper,Pt?.className)}))}),[Nt,V?.wrapper]),Wt=S.useCallback(()=>({ref:vE(Ce,k),...nn(at,Rt),className:Nt.hiddenInput({class:V?.hiddenInput}),onChange:el(at.onChange,Se)}),[at,Rt,Se,V?.hiddenInput]),Bn=S.useCallback(()=>({id:Oe,className:Nt.label({class:V?.label})}),[Nt,V?.label,mt,Ie,Kt]),Jt=S.useCallback(()=>({isSelected:Ie,isIndeterminate:le,disableAnimation:G,className:Nt.icon({class:V?.icon})}),[Nt,V?.icon,Ie,le,G]);return{Component:z,icon:_,children:T,isSelected:Ie,isDisabled:mt,isInvalid:Kt,isFocused:Tn,isHovered:_t,isFocusVisible:Er,getBaseProps:nt,getWrapperProps:lt,getInputProps:Wt,getLabelProps:Bn,getIconProps:Jt}}var Z_=jr((e,t)=>{const{Component:n,children:r,icon:i=D.jsx(G6,{}),getBaseProps:s,getWrapperProps:a,getInputProps:c,getIconProps:d,getLabelProps:h}=q6({...e,ref:t}),m=typeof i=="function"?i(d()):S.cloneElement(i,d());return D.jsxs(n,{...s(),children:[D.jsx("input",{...c()}),D.jsx("span",{...a(),children:m}),r&&D.jsx("span",{...h(),children:r})]})});Z_.displayName="HeroUI.Checkbox";var e2=Z_;function t2(e){let[t,n]=Au(e.isOpen,e.defaultOpen||!1,e.onOpenChange);const r=S.useCallback(()=>{n(!0)},[n]),i=S.useCallback(()=>{n(!1)},[n]),s=S.useCallback(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:i,toggle:s}}const Y6=1500,Dk=500;let cu={},X6=0,xp=!1,qs=null,fu=null;function Q6(e={}){let{delay:t=Y6,closeDelay:n=Dk}=e,{isOpen:r,open:i,close:s}=t2(e),a=S.useMemo(()=>`${++X6}`,[]),c=S.useRef(null),d=S.useRef(s),h=()=>{cu[a]=b},m=()=>{for(let k in cu)k!==a&&(cu[k](!0),delete cu[k])},g=()=>{c.current&&clearTimeout(c.current),c.current=null,m(),h(),xp=!0,i(),qs&&(clearTimeout(qs),qs=null),fu&&(clearTimeout(fu),fu=null)},b=k=>{k||n<=0?(c.current&&clearTimeout(c.current),c.current=null,d.current()):c.current||(c.current=setTimeout(()=>{c.current=null,d.current()},n)),qs&&(clearTimeout(qs),qs=null),xp&&(fu&&clearTimeout(fu),fu=setTimeout(()=>{delete cu[a],fu=null,xp=!1},Math.max(Dk,n)))},x=()=>{m(),h(),!r&&!qs&&!xp?qs=setTimeout(()=>{qs=null,xp=!0,g()},t):r||g()};return S.useEffect(()=>{d.current=s},[s]),S.useEffect(()=>()=>{c.current&&clearTimeout(c.current),cu[a]&&delete cu[a]},[a]),{isOpen:r,open:k=>{!k&&t>0&&!c.current?x():g()},close:b}}function J6(e,t){let n=$u(e,{labelable:!0}),{hoverProps:r}=Eu({onHoverStart:()=>t?.open(!0),onHoverEnd:()=>t?.close()});return{tooltipProps:Pn(n,r,{role:"tooltip"})}}function Z6(e,t,n){let{isDisabled:r,trigger:i}=e,s=Pf(),a=S.useRef(!1),c=S.useRef(!1),d=()=>{(a.current||c.current)&&t.open(c.current)},h=_=>{!a.current&&!c.current&&t.close(_)};S.useEffect(()=>{let _=A=>{n&&n.current&&A.key==="Escape"&&(A.stopPropagation(),t.close(!0))};if(t.isOpen)return document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("keydown",_,!0)}},[n,t]);let m=()=>{i!=="focus"&&(oh()==="pointer"?a.current=!0:a.current=!1,d())},g=()=>{i!=="focus"&&(c.current=!1,a.current=!1,h())},b=()=>{c.current=!1,a.current=!1,h(!0)},x=()=>{qx()&&(c.current=!0,d())},k=()=>{c.current=!1,a.current=!1,h(!0)},{hoverProps:P}=Eu({isDisabled:r,onHoverStart:m,onHoverEnd:g}),{focusableProps:T}=xh({isDisabled:r,onFocus:x,onBlur:k},n);return{triggerProps:{"aria-describedby":t.isOpen?s:void 0,...Pn(T,P,{onPointerDown:b,onKeyDown:b,tabIndex:void 0})},tooltipProps:{id:s}}}var Ys=[];function n2(e,t){const{disableOutsideEvents:n=!0,isDismissable:r=!1,isKeyboardDismissDisabled:i=!1,isOpen:s,onClose:a,shouldCloseOnBlur:c,shouldCloseOnInteractOutside:d}=e;S.useEffect(()=>(s&&Ys.push(t),()=>{const P=Ys.indexOf(t);P>=0&&Ys.splice(P,1)}),[s,t]);const h=()=>{Ys[Ys.length-1]===t&&a&&a()},m=P=>{(!d||d(P.target))&&(Ys[Ys.length-1]===t&&n&&(P.stopPropagation(),P.preventDefault()),P.pointerType!=="touch"&&h())},g=P=>{P.pointerType==="touch"&&(!d||d(P.target))&&(Ys[Ys.length-1]===t&&n&&(P.stopPropagation(),P.preventDefault()),h())},b=P=>{P.key==="Escape"&&!i&&!P.nativeEvent.isComposing&&(P.stopPropagation(),P.preventDefault(),h())};Z5({isDisabled:!(r&&s),onInteractOutside:r&&s?g:void 0,onInteractOutsideStart:m,ref:t});const{focusWithinProps:x}=kv({isDisabled:!c,onBlurWithin:P=>{!P.relatedTarget||rF(P.relatedTarget)||(!d||d(P.relatedTarget))&&h()}}),k=P=>{P.target===P.currentTarget&&P.preventDefault()};return{overlayProps:{onKeyDown:b,...x},underlayProps:{onPointerDown:k}}}function ez(e){var t,n;const r=ci(),[i,s]=oa(e,mk.variantKeys),{ref:a,as:c,isOpen:d,content:h,children:m,defaultOpen:g,onOpenChange:b,isDisabled:x,trigger:k,shouldFlip:P=!0,containerPadding:T=12,placement:_="top",delay:A=0,closeDelay:L=500,showArrow:O=!1,offset:j=7,crossOffset:$=0,isDismissable:Y,shouldCloseOnBlur:te=!0,portalContainer:ie,isKeyboardDismissDisabled:B=!1,updatePositionDeps:W=[],shouldCloseOnInteractOutside:G,className:ee,onClose:H,motionProps:le,classNames:J,...X}=i,V=c||"div",ae=(n=(t=e?.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,M=Q6({delay:A,closeDelay:L,isDisabled:x,defaultOpen:g,isOpen:d,onOpenChange:Ue=>{b?.(Ue),Ue||H?.()}}),U=S.useRef(null),oe=S.useRef(null),z=S.useId(),me=M.isOpen&&!x;S.useImperativeHandle(a,()=>fL(oe));const{triggerProps:Ce,tooltipProps:ye}=Z6({isDisabled:x,trigger:k},M,U),{tooltipProps:Oe}=J6({isOpen:me,...nn(i,ye)},M),{overlayProps:Ne,placement:_e,updatePosition:Qe}=T5({isOpen:me,targetRef:U,placement:x6(_),overlayRef:oe,offset:O?j+3:j,crossOffset:$,shouldFlip:P,containerPadding:T});Sh(()=>{W.length&&Qe()},W);const{overlayProps:at}=n2({isOpen:me,onClose:M.close,isDismissable:Y,shouldCloseOnBlur:te,isKeyboardDismissDisabled:B,shouldCloseOnInteractOutside:G},oe),Ie=S.useMemo(()=>{var Ue,it,Kt;return mk({...s,disableAnimation:ae,radius:(Ue=e?.radius)!=null?Ue:"md",size:(it=e?.size)!=null?it:"md",shadow:(Kt=e?.shadow)!=null?Kt:"sm"})},[ds(s),ae,e?.radius,e?.size,e?.shadow]),mt=S.useCallback((Ue={},it=null)=>({...nn(Ce,Ue),ref:vE(it,U),"aria-describedby":me?z:void 0}),[Ce,me,z,M]),pt=S.useCallback(()=>({ref:oe,"data-slot":"base","data-open":Ae(me),"data-arrow":Ae(O),"data-disabled":Ae(x),"data-placement":Rk(_e||"top",_),...nn(Oe,at,X),style:nn(Ne.style,X.style,i.style),className:Ie.base({class:J?.base}),id:z}),[Ie,me,O,x,_e,_,Oe,at,X,Ne,i,z]),Ut=S.useCallback(()=>({"data-slot":"content","data-open":Ae(me),"data-arrow":Ae(O),"data-disabled":Ae(x),"data-placement":Rk(_e||"top",_),className:Ie.content({class:Bt(J?.content,ee)})}),[Ie,me,O,x,_e,_,J]);return{Component:V,content:h,children:m,isOpen:me,triggerRef:U,showArrow:O,portalContainer:ie,placement:_,disableAnimation:ae,isDisabled:x,motionProps:le,getTooltipContentProps:Ut,getTriggerProps:mt,getTooltipProps:pt}}var tz=()=>io(()=>import("./index-C_JcEI3R.js"),[]).then(e=>e.default),r2=jr((e,t)=>{var n;const{Component:r,children:i,content:s,isOpen:a,portalContainer:c,placement:d,disableAnimation:h,motionProps:m,getTriggerProps:g,getTooltipProps:b,getTooltipContentProps:x}=ez({...e,ref:t});let k;try{if(S.Children.count(i)!==1)throw new Error;if(!S.isValidElement(i))k=D.jsx("p",{...g(),children:i});else{const j=i,$=(n=j.props.ref)!=null?n:j.ref;k=S.cloneElement(j,g(j.props,$))}}catch{k=D.jsx("span",{}),xL("Tooltip must have only one child node. Please, check your code.")}const{ref:P,id:T,style:_,...A}=b(),L=D.jsx("div",{ref:P,id:T,style:_,children:D.jsx(Af.div,{animate:"enter",exit:"exit",initial:"exit",variants:Zg.scaleSpring,...nn(m,A),style:{...b6(d)},children:D.jsx(r,{...x(),children:s})},`${T}-tooltip-inner`)},`${T}-tooltip-content`);return D.jsxs(D.Fragment,{children:[k,h?a&&D.jsx(ok,{portalContainer:c,children:D.jsx("div",{ref:P,id:T,style:_,...A,children:D.jsx(r,{...x(),children:s})})}):D.jsx($f,{features:tz,children:D.jsx(ol,{children:a&&D.jsx(ok,{portalContainer:c,children:L})})})]})});r2.displayName="HeroUI.Tooltip";var nz=r2;function rz(e={}){const{rerender:t=!1,delay:n=0}=e,r=S.useRef(!1),[i,s]=S.useState(!1);return S.useEffect(()=>{r.current=!0;let a=null;return t&&(n>0?a=setTimeout(()=>{s(!0)},n):s(!0)),()=>{r.current=!1,t&&s(!1),a&&clearTimeout(a)}},[t]),[S.useCallback(()=>r.current,[]),i]}function iz(e){let{value:t=0,minValue:n=0,maxValue:r=100,valueLabel:i,isIndeterminate:s,formatOptions:a={style:"percent"}}=e,c=$u(e,{labelable:!0}),{labelProps:d,fieldProps:h}=Q_({...e,labelElementType:"span"});t=Bg(t,n,r);let m=(t-n)/(r-n),g=AM(a);if(!s&&!i){let b=a.style==="percent"?m:t;i=g.format(b)}return{progressBarProps:Pn(c,{...h,"aria-valuenow":s?void 0:t,"aria-valuemin":n,"aria-valuemax":r,"aria-valuetext":s?void 0:i,role:"progressbar"}),labelProps:d}}function oz(e){var t,n,r;const i=ci(),[s,a]=oa(e,gk.variantKeys),{ref:c,as:d,id:h,className:m,classNames:g,label:b,valueLabel:x,value:k=void 0,minValue:P=0,maxValue:T=100,strokeWidth:_,showValueLabel:A=!1,formatOptions:L={style:"percent"},...O}=s,j=d||"div",$=Ii(c),Y=Bt(g?.base,m),[,te]=rz({rerender:!0,delay:100}),ie=((t=e.isIndeterminate)!=null?t:!0)&&k===void 0,B=(r=(n=e.disableAnimation)!=null?n:i?.disableAnimation)!=null?r:!1,{progressBarProps:W,labelProps:G}=iz({id:h,label:b,value:k,minValue:P,maxValue:T,valueLabel:x,formatOptions:L,isIndeterminate:ie,"aria-labelledby":e["aria-labelledby"],"aria-label":e["aria-label"]}),ee=S.useMemo(()=>gk({...a,disableAnimation:B,isIndeterminate:ie}),[ds(a),B,ie]),H=B?!0:te,le=16,J=_||(e.size==="sm"?2:3),X=16-J,V=2*X*Math.PI,ae=S.useMemo(()=>H?ie?.25:k?bL((k-P)/(T-P),1):0:0,[H,k,P,T,ie]),M=V-ae*V,U=S.useCallback((ye={})=>({ref:$,"data-indeterminate":Ae(ie),"data-disabled":Ae(e.isDisabled),className:ee.base({class:Y}),...nn(W,O,ye)}),[$,ee,ie,e.isDisabled,Y,W,O]),oe=S.useCallback((ye={})=>({className:ee.label({class:g?.label}),...nn(G,ye)}),[ee,g,G]),z=S.useCallback((ye={})=>({viewBox:"0 0 32 32",fill:"none",strokeWidth:J,className:ee.svg({class:g?.svg}),...ye}),[J,ee,g]),me=S.useCallback((ye={})=>({cx:le,cy:le,r:X,role:"presentation",strokeDasharray:`${V} ${V}`,strokeDashoffset:M,transform:"rotate(-90 16 16)",strokeLinecap:"round",className:ee.indicator({class:g?.indicator}),...ye}),[ee,g,M,V,X]),Ce=S.useCallback((ye={})=>({cx:le,cy:le,r:X,role:"presentation",strokeDasharray:`${V} ${V}`,strokeDashoffset:0,transform:"rotate(-90 16 16)",strokeLinecap:"round",className:ee.track({class:g?.track}),...ye}),[ee,g,V,X]);return{Component:j,domRef:$,slots:ee,classNames:g,label:b,showValueLabel:A,getProgressBarProps:U,getLabelProps:oe,getSvgProps:z,getIndicatorProps:me,getTrackProps:Ce}}var i2=jr((e,t)=>{const{Component:n,slots:r,classNames:i,label:s,showValueLabel:a,getProgressBarProps:c,getLabelProps:d,getSvgProps:h,getIndicatorProps:m,getTrackProps:g}=oz({ref:t,...e}),b=c();return D.jsxs(n,{...b,children:[D.jsxs("div",{className:r.svgWrapper({class:i?.svgWrapper}),children:[D.jsxs("svg",{...h(),children:[D.jsx("circle",{...g()}),D.jsx("circle",{...m()})]}),a&&D.jsx("span",{className:r.value({class:i?.value}),children:b["aria-valuetext"]})]}),s&&D.jsx("span",{...d(),children:s})]})});i2.displayName="HeroUI.CircularProgress";var o2=i2;function sz(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:i=!1,isReadOnly:s=!1,type:a="text",validationBehavior:c="aria"}=e,[d,h]=Au(e.value,e.defaultValue||"",e.onChange),{focusableProps:m}=xh(e,t),g=Zx({...e,value:d}),{isInvalid:b,validationErrors:x,validationDetails:k}=g.displayValidation,{labelProps:P,fieldProps:T,descriptionProps:_,errorMessageProps:A}=O6({...e,isInvalid:b,errorMessage:e.errorMessage||x}),L=$u(e,{labelable:!0});const O={type:a,pattern:e.pattern};return NE(t,d,h),Y_(e,g,t),S.useEffect(()=>{if(t.current instanceof to(t.current).HTMLTextAreaElement){let j=t.current;Object.defineProperty(j,"defaultValue",{get:()=>j.value,set:()=>{},configurable:!0})}},[t]),{labelProps:P,inputProps:Pn(L,n==="input"?O:void 0,{disabled:r,readOnly:s,required:i&&c==="native","aria-required":i&&c==="aria"||void 0,"aria-invalid":b||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:d,onChange:j=>h(j.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(He.version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...m,...T}),descriptionProps:_,errorMessageProps:A,isInvalid:b,validationErrors:x,validationDetails:k}}function az(e){var t,n,r,i,s,a,c;const d=ci(),{validationBehavior:h}=ew(tv)||{},[m,g]=oa(e,bk.variantKeys),{ref:b,as:x,type:k,label:P,baseRef:T,wrapperRef:_,description:A,className:L,classNames:O,autoFocus:j,startContent:$,endContent:Y,onClear:te,onChange:ie,validationState:B,validationBehavior:W=(t=h??d?.validationBehavior)!=null?t:"native",innerWrapperRef:G,onValueChange:ee=()=>{},...H}=m,le=S.useCallback(Xe=>{ee(Xe??"")},[ee]),[J,X]=S.useState(!1),V=x||"div",ae=(r=(n=e.disableAnimation)!=null?n:d?.disableAnimation)!=null?r:!1,M=Ii(b),U=Ii(T),oe=Ii(_),z=Ii(G),[me,Ce]=Au(m.value,(i=m.defaultValue)!=null?i:"",le),ye=k==="file",Oe=((c=(a=(s=M?.current)==null?void 0:s.files)==null?void 0:a.length)!=null?c:0)>0,Ne=["date","time","month","week","range"].includes(k),_e=!hL(me)||Ne||Oe,Qe=_e||J,at=k==="hidden",Ie=e.isMultiline,mt=Bt(O?.base,L,_e?"is-filled":""),pt=S.useCallback(()=>{var Xe;ye?M.current.value="":Ce(""),te?.(),(Xe=M.current)==null||Xe.focus()},[Ce,te,ye]);Sh(()=>{M.current&&Ce(M.current.value)},[M.current]);const{labelProps:Ut,inputProps:Ue,isInvalid:it,validationErrors:Kt,validationDetails:er,descriptionProps:an,errorMessageProps:_t}=sz({...e,validationBehavior:W,autoCapitalize:e.autoCapitalize,value:me,"aria-label":e.label?e["aria-label"]:mE(e["aria-label"],e.placeholder),inputElementType:Ie?"textarea":"input",onChange:Ce},M);ye&&(delete Ue.value,delete Ue.onChange);const{isFocusVisible:Rt,isFocused:Tn,focusProps:Er}=Pu({autoFocus:j,isTextInput:!0}),{isHovered:Nt,hoverProps:pe}=Eu({isDisabled:!!e?.isDisabled}),{isHovered:Se,hoverProps:ze}=Eu({isDisabled:!!e?.isDisabled}),{focusProps:nt,isFocusVisible:lt}=Pu(),{focusWithinProps:Wt}=kv({onFocusWithinChange:X}),{pressProps:Bn}=il({isDisabled:!!e?.isDisabled||!!e?.isReadOnly,onPress:pt}),Jt=B==="invalid"||it,Pt=PF({labelPlacement:e.labelPlacement,label:P}),Pr=typeof m.errorMessage=="function"?m.errorMessage({isInvalid:Jt,validationErrors:Kt,validationDetails:er}):m.errorMessage||Kt?.join(" "),Ft=!!te||e.isClearable,tr=!!P||!!A||!!Pr,ln=!!m.placeholder,aa=!!P,ms=!!A||!!Pr,di=Pt==="outside-left",pi=Pt==="outside-top",ul=Pt==="outside"||di||pi,Mu=Pt==="inside",gs=M.current?(!M.current.value||M.current.value===""||!me||me==="")&&ln:!1,Vr=!!$,cl=ul?di||pi||ln||Pt==="outside"&&Vr:!1,fl=Pt==="outside"&&!ln&&!Vr,Zt=S.useMemo(()=>bk({...g,isInvalid:Jt,labelPlacement:Pt,isClearable:Ft,disableAnimation:ae}),[ds(g),Jt,Pt,Ft,Vr,ae]),vs=S.useCallback((Xe={})=>({ref:U,className:Zt.base({class:mt}),"data-slot":"base","data-filled":Ae(_e||ln||Vr||gs||ye),"data-filled-within":Ae(Qe||ln||Vr||gs||ye),"data-focus-within":Ae(J),"data-focus-visible":Ae(Rt),"data-readonly":Ae(e.isReadOnly),"data-focus":Ae(Tn),"data-hover":Ae(Nt||Se),"data-required":Ae(e.isRequired),"data-invalid":Ae(Jt),"data-disabled":Ae(e.isDisabled),"data-has-elements":Ae(tr),"data-has-helper":Ae(ms),"data-has-label":Ae(aa),"data-has-value":Ae(!gs),"data-hidden":Ae(at),...Wt,...Xe}),[Zt,mt,_e,Tn,Nt,Se,Jt,ms,aa,tr,gs,Vr,J,Rt,Qe,ln,Wt,at,e.isReadOnly,e.isRequired,e.isDisabled]),ys=S.useCallback((Xe={})=>({"data-slot":"label",className:Zt.label({class:O?.label}),...nn(Ut,ze,Xe)}),[Zt,Se,Ut,O?.label]),Ro=S.useCallback(Xe=>{Xe.key==="Escape"&&me&&(Ft||te)&&!e.isReadOnly&&(Ce(""),te?.())},[me,Ce,te,Ft,e.isReadOnly]),dl=S.useCallback((Xe={})=>({"data-slot":"input","data-filled":Ae(_e),"data-filled-within":Ae(Qe),"data-has-start-content":Ae(Vr),"data-has-end-content":Ae(!!Y),"data-type":k,className:Zt.input({class:Bt(O?.input,_e?"is-filled":"",Ie?"pe-0":"",k==="password"?"[&::-ms-reveal]:hidden":"")}),...nn(Er,Ue,Ef(H,{enabled:!0,labelable:!0,omitEventNames:new Set(Object.keys(Ue))}),Xe),"aria-readonly":Ae(e.isReadOnly),onChange:el(Ue.onChange,ie),onKeyDown:el(Ue.onKeyDown,Xe.onKeyDown,Ro),ref:M}),[Zt,me,Er,Ue,H,_e,Qe,Vr,Y,O?.input,e.isReadOnly,e.isRequired,ie,Ro]),bs=S.useCallback((Xe={})=>({ref:oe,"data-slot":"input-wrapper","data-hover":Ae(Nt||Se),"data-focus-visible":Ae(Rt),"data-focus":Ae(Tn),className:Zt.inputWrapper({class:Bt(O?.inputWrapper,_e?"is-filled":"")}),...nn(Xe,pe),onClick:so=>{M.current&&so.currentTarget===so.target&&M.current.focus()},style:{cursor:"text",...Xe.style}}),[Zt,Nt,Se,Rt,Tn,me,O?.inputWrapper]),la=S.useCallback((Xe={})=>({...Xe,ref:z,"data-slot":"inner-wrapper",onClick:so=>{M.current&&so.currentTarget===so.target&&M.current.focus()},className:Zt.innerWrapper({class:Bt(O?.innerWrapper,Xe?.className)})}),[Zt,O?.innerWrapper]),ua=S.useCallback((Xe={})=>({...Xe,"data-slot":"main-wrapper",className:Zt.mainWrapper({class:Bt(O?.mainWrapper,Xe?.className)})}),[Zt,O?.mainWrapper]),pl=S.useCallback((Xe={})=>({...Xe,"data-slot":"helper-wrapper",className:Zt.helperWrapper({class:Bt(O?.helperWrapper,Xe?.className)})}),[Zt,O?.helperWrapper]),Kf=S.useCallback((Xe={})=>({...Xe,...an,"data-slot":"description",className:Zt.description({class:Bt(O?.description,Xe?.className)})}),[Zt,O?.description]),Wf=S.useCallback((Xe={})=>({...Xe,..._t,"data-slot":"error-message",className:Zt.errorMessage({class:Bt(O?.errorMessage,Xe?.className)})}),[Zt,_t,O?.errorMessage]),Hf=S.useCallback((Xe={})=>({...Xe,type:"button",tabIndex:-1,disabled:e.isDisabled,"aria-label":"clear input","data-slot":"clear-button","data-focus-visible":Ae(lt),className:Zt.clearButton({class:Bt(O?.clearButton,Xe?.className)}),...nn(Bn,nt)}),[Zt,lt,Bn,nt,O?.clearButton]);return{Component:V,classNames:O,domRef:M,label:P,description:A,startContent:$,endContent:Y,labelPlacement:Pt,isClearable:Ft,hasHelper:ms,hasStartContent:Vr,isLabelOutside:cl,isOutsideLeft:di,isOutsideTop:pi,isLabelOutsideAsPlaceholder:fl,shouldLabelBeOutside:ul,shouldLabelBeInside:Mu,hasPlaceholder:ln,isInvalid:Jt,errorMessage:Pr,getBaseProps:vs,getLabelProps:ys,getInputProps:dl,getMainWrapperProps:ua,getInputWrapperProps:bs,getInnerWrapperProps:la,getHelperWrapperProps:pl,getDescriptionProps:Kf,getErrorMessageProps:Wf,getClearButtonProps:Hf}}function Rb(){return Rb=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{Component:d,label:h,description:m,startContent:g,endContent:b,hasHelper:x,shouldLabelBeOutside:k,shouldLabelBeInside:P,isInvalid:T,errorMessage:_,getBaseProps:A,getLabelProps:L,getInputProps:O,getInnerWrapperProps:j,getInputWrapperProps:$,getHelperWrapperProps:Y,getDescriptionProps:te,getErrorMessageProps:ie,isClearable:B,getClearButtonProps:W}=az({...a,ref:c,isMultiline:!0}),[G,ee]=S.useState(t>1),[H,le]=S.useState(!1),J=h?D.jsx("label",{...L(),children:h}):null,X=O(),V=(me,Ce)=>{if(t===1&&ee(me>=Ce.rowHeight*2),n>t){const ye=me>=n*Ce.rowHeight;le(ye)}s?.(me,Ce)},ae=i?D.jsx("textarea",{...X,style:nn(X.style,e??{})}):D.jsx(Cz,{...X,cacheMeasurements:r,"data-hide-scroll":Ae(!H),maxRows:n,minRows:t,style:nn(X.style,e??{}),onHeightChange:V}),M=S.useMemo(()=>B?D.jsx("button",{...W(),children:D.jsx(N_,{})}):null,[B,W]),U=S.useMemo(()=>g||b?D.jsxs("div",{...j(),children:[g,ae,b]}):D.jsx("div",{...j(),children:ae}),[g,X,b,j]),oe=T&&_,z=oe||m;return D.jsxs(d,{...A(),children:[k?J:null,D.jsxs("div",{...$(),"data-has-multiple-rows":Ae(G),children:[P?J:null,U,M]}),x&&z?D.jsx("div",{...Y(),children:oe?D.jsx("div",{...ie(),children:_}):D.jsx("div",{...te(),children:m})}):null]})});s2.displayName="HeroUI.Textarea";var Ez=s2;function Pz(e,t){let{role:n="dialog"}=e,r=W0();r=e["aria-label"]?void 0:r;let i=S.useRef(!1);return S.useEffect(()=>{if(t.current&&!t.current.contains(document.activeElement)){Cu(t.current);let s=setTimeout(()=>{document.activeElement===t.current&&(i.current=!0,t.current&&(t.current.blur(),Cu(t.current)),i.current=!1)},500);return()=>{clearTimeout(s)}}},[t]),v_(),{dialogProps:{...$u(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||r,onBlur:s=>{i.current&&s.stopPropagation()}},titleProps:{id:r}}}function Tz(e){var t,n;const r=ci(),[i,s]=oa(e,wk.variantKeys),{ref:a,as:c,src:d,className:h,classNames:m,loading:g,isBlurred:b,fallbackSrc:x,isLoading:k,disableSkeleton:P=!!x,removeWrapper:T=!1,onError:_,onLoad:A,srcSet:L,sizes:O,crossOrigin:j,...$}=i,Y=S6({src:d,loading:g,onError:_,onLoad:A,ignoreFallback:!1,srcSet:L,sizes:O,crossOrigin:j,shouldBypassImageLoad:c!==void 0}),te=(n=(t=e.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,ie=Y==="loaded"&&!k,B=Y==="loading"||k,W=e.isZoomed,G=c||"img",ee=Ii(a),{w:H,h:le}=S.useMemo(()=>({w:i.width?typeof i.width=="number"?`${i.width}px`:i.width:"fit-content",h:i.height?typeof i.height=="number"?`${i.height}px`:i.height:"auto"}),[i?.width,i?.height]),J=(!d||!ie)&&!!x,X=B&&!P,V=S.useMemo(()=>wk({...s,disableAnimation:te,showSkeleton:X}),[ds(s),te,X]),ae=Bt(h,m?.img),M=(z={})=>{const me=Bt(ae,z?.className);return{src:d,ref:ee,"data-loaded":Ae(ie),className:V.img({class:me}),loading:g,srcSet:L,sizes:O,crossOrigin:j,...$,style:{...$?.height&&{height:le},...z.style,...$.style}}},U=S.useCallback(()=>{const z=J?{backgroundImage:`url(${x})`}:{};return{className:V.wrapper({class:m?.wrapper}),style:{...z,maxWidth:H}}},[V,J,x,m?.wrapper,H]),oe=S.useCallback(()=>({src:d,"aria-hidden":Ae(!0),className:V.blurredImg({class:m?.blurredImg})}),[V,d,m?.blurredImg]);return{Component:G,domRef:ee,slots:V,classNames:m,isBlurred:b,disableSkeleton:P,fallbackSrc:x,removeWrapper:T,isZoomed:W,isLoading:B,getImgProps:M,getWrapperProps:U,getBlurredImgProps:oe}}var a2=jr((e,t)=>{const{Component:n,domRef:r,slots:i,classNames:s,isBlurred:a,isZoomed:c,fallbackSrc:d,removeWrapper:h,disableSkeleton:m,getImgProps:g,getWrapperProps:b,getBlurredImgProps:x}=Tz({...e,ref:t}),k=D.jsx(n,{ref:r,...g()});if(h)return k;const P=D.jsx("div",{className:i.zoomedWrapper({class:s?.zoomedWrapper}),children:k});return a?D.jsxs("div",{...b(),children:[c?P:k,S.cloneElement(k,x())]}):c||!m||d?D.jsxs("div",{...b(),children:[" ",c?P:k]}):k});a2.displayName="HeroUI.Image";var y0=a2,[_z,l2]=pv({name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),u2=jr((e,t)=>{const{as:n,children:r,className:i,...s}=e,{slots:a,classNames:c,bodyId:d,setBodyMounted:h}=l2(),m=Ii(t),g=n||"div";return S.useEffect(()=>(h(!0),()=>h(!1)),[h]),D.jsx(g,{ref:m,className:a.body({class:Bt(c?.body,i)}),id:d,...s,children:r})});u2.displayName="HeroUI.ModalBody";var Iz=u2,$z={enter:{scale:"var(--scale-enter)",y:"var(--slide-enter)",opacity:1,willChange:"auto",transition:{scale:{duration:.4,ease:Bp.ease},opacity:{duration:.4,ease:Bp.ease},y:{type:"spring",bounce:0,duration:.6}}},exit:{scale:"var(--scale-exit)",y:"var(--slide-exit)",opacity:0,willChange:"transform",transition:{duration:.3,ease:Bp.ease}}},ss=typeof document<"u"&&window.visualViewport,Az=He.createContext(!1);function Rz(){return!1}function Lz(){return!0}function Mz(e){return()=>{}}function Dz(){return typeof He.useSyncExternalStore=="function"?He.useSyncExternalStore(Mz,Rz,Lz):S.useContext(Az)}function Nz(){let e=Dz(),[t,n]=S.useState(()=>e?{width:0,height:0}:Bk());return S.useEffect(()=>{let r=()=>{n(i=>{let s=Bk();return s.width===i.width&&s.height===i.height?i:s})};return ss?ss.addEventListener("resize",r):window.addEventListener("resize",r),()=>{ss?ss.removeEventListener("resize",r):window.removeEventListener("resize",r)}},[]),t}function Bk(){return{width:ss&&ss?.width||window.innerWidth,height:ss&&ss?.height||window.innerHeight}}var Vk=()=>io(()=>import("./index-C_JcEI3R.js"),[]).then(e=>e.default),c2=e=>{const{as:t,children:n,role:r="dialog",...i}=e,{Component:s,domRef:a,slots:c,classNames:d,motionProps:h,backdrop:m,closeButton:g,hideCloseButton:b,disableAnimation:x,getDialogProps:k,getBackdropProps:P,getCloseButtonProps:T,onClose:_}=l2(),A=t||s||"div",L=Nz(),{dialogProps:O}=Pz({role:r},a),j=S.isValidElement(g)?S.cloneElement(g,T()):D.jsx("button",{...T(),children:D.jsx(e6,{})}),$=S.useCallback(G=>{G.key==="Tab"&&G.nativeEvent.isComposing&&(G.stopPropagation(),G.preventDefault())},[]),Y=k(nn(O,i)),te=D.jsxs(A,{...Y,onKeyDown:el(Y.onKeyDown,$),children:[D.jsx(ak,{onDismiss:_}),!b&&j,typeof n=="function"?n(_):n,D.jsx(ak,{onDismiss:_})]}),ie=S.useMemo(()=>m==="transparent"?null:x?D.jsx("div",{...P()}):D.jsx($f,{features:Vk,children:D.jsx(Af.div,{animate:"enter",exit:"exit",initial:"exit",variants:Zg.fade,...P()})}),[m,x,P]),B={"--visual-viewport-height":L.height+"px"},W=x?D.jsx("div",{className:c.wrapper({class:d?.wrapper}),"data-slot":"wrapper",style:B,children:te}):D.jsx($f,{features:Vk,children:D.jsx(Af.div,{animate:"enter",className:c.wrapper({class:d?.wrapper}),"data-slot":"wrapper",exit:"exit",initial:"exit",variants:$z,...h,style:B,children:te})});return D.jsxs("div",{tabIndex:-1,children:[ie,W]})};c2.displayName="HeroUI.ModalContent";var Fz=c2;function Oz(e={shouldBlockScroll:!0},t,n){let{overlayProps:r,underlayProps:i}=n2({...e,isOpen:t.isOpen,onClose:t.close},n);return dF({isDisabled:!t.isOpen||!e.shouldBlockScroll}),v_(),S.useEffect(()=>{if(t.isOpen&&n.current)return kF([n.current])},[t.isOpen,n]),{modalProps:Pn(r),underlayProps:i}}function zz(e){var t,n,r;const i=ci(),[s,a]=oa(e,xk.variantKeys),{ref:c,as:d,className:h,classNames:m,isOpen:g,defaultOpen:b,onOpenChange:x,motionProps:k,closeButton:P,isDismissable:T=!0,hideCloseButton:_=!1,shouldBlockScroll:A=!0,portalContainer:L,isKeyboardDismissDisabled:O=!1,onClose:j,...$}=s,Y=d||"section",te=Ii(c),ie=S.useRef(null),[B,W]=S.useState(!1),[G,ee]=S.useState(!1),H=(n=(t=e.disableAnimation)!=null?t:i?.disableAnimation)!=null?n:!1,le=S.useId(),J=S.useId(),X=S.useId(),V=t2({isOpen:g,defaultOpen:b,onOpenChange:_e=>{x?.(_e),_e||j?.()}}),{modalProps:ae,underlayProps:M}=Oz({isDismissable:T,shouldBlockScroll:A,isKeyboardDismissDisabled:O},V,te),{buttonProps:U}=B_({onPress:V.close},ie),{isFocusVisible:oe,focusProps:z}=Pu(),me=Bt(m?.base,h),Ce=S.useMemo(()=>xk({...a,disableAnimation:H}),[ds(a),H]),ye=(_e={},Qe=null)=>{var at;return{ref:gE(Qe,te),...nn(ae,$,_e),className:Ce.base({class:Bt(me,_e.className)}),id:le,"data-open":Ae(V.isOpen),"data-dismissable":Ae(T),"aria-modal":Ae(!0),"data-placement":(at=e?.placement)!=null?at:"right","aria-labelledby":B?J:void 0,"aria-describedby":G?X:void 0}},Oe=S.useCallback((_e={})=>({className:Ce.backdrop({class:m?.backdrop}),...M,..._e}),[Ce,m,M]),Ne=()=>({role:"button",tabIndex:0,"aria-label":"Close","data-focus-visible":Ae(oe),className:Ce.closeButton({class:m?.closeButton}),...nn(U,z)});return{Component:Y,slots:Ce,domRef:te,headerId:J,bodyId:X,motionProps:k,classNames:m,isDismissable:T,closeButton:P,hideCloseButton:_,portalContainer:L,shouldBlockScroll:A,backdrop:(r=e.backdrop)!=null?r:"opaque",isOpen:V.isOpen,onClose:V.close,disableAnimation:H,setBodyMounted:ee,setHeaderMounted:W,getDialogProps:ye,getBackdropProps:Oe,getCloseButtonProps:Ne}}var f2=jr((e,t)=>{const{children:n,...r}=e,i=zz({...r,ref:t}),s=D.jsx(CF,{portalContainer:i.portalContainer,children:n});return D.jsx(_z,{value:i,children:i.disableAnimation&&i.isOpen?s:D.jsx(ol,{children:i.isOpen?s:null})})});f2.displayName="HeroUI.Modal";var jz=f2;function Bz(e={}){const{id:t,defaultOpen:n,isOpen:r,onClose:i,onOpen:s,onChange:a=()=>{}}=e,c=Ab(s),d=Ab(i),[h,m]=Au(r,n||!1,a),g=S.useId(),b=t||g,x=r!==void 0,k=S.useCallback(()=>{x||m(!1),d?.()},[x,d]),P=S.useCallback(()=>{x||m(!0),c?.()},[x,c]),T=S.useCallback(()=>{(h?k:P)()},[h,P,k]);return{isOpen:!!h,onOpen:P,onClose:k,onOpenChange:T,isControlled:x,getButtonProps:(_={})=>({..._,"aria-expanded":h,"aria-controls":b,onClick:Tf(_.onClick,T)}),getDisclosureProps:(_={})=>({..._,hidden:!h,id:b})}}function Vz(e){var t,n;const r=ci(),[i,s]=oa(e,yk.variantKeys),{as:a,children:c,isLoaded:d=!1,className:h,classNames:m,...g}=i,b=a||"div",x=(n=(t=e.disableAnimation)!=null?t:r?.disableAnimation)!=null?n:!1,k=S.useMemo(()=>yk({...s,disableAnimation:x}),[ds(s),x,c]),P=Bt(m?.base,h);return{Component:b,children:c,slots:k,classNames:m,getSkeletonProps:(A={})=>({"data-loaded":Ae(d),className:k.base({class:Bt(P,A?.className)}),...g}),getContentProps:(A={})=>({className:k.content({class:Bt(m?.content,A?.className)})})}}var d2=jr((e,t)=>{const{Component:n,children:r,getSkeletonProps:i,getContentProps:s}=Vz({...e});return D.jsx(n,{ref:t,...i(),children:D.jsx("div",{...s(),children:r})})});d2.displayName="HeroUI.Skeleton";var Uz=d2;function Kz(e={}){const{domRef:t,isEnabled:n=!0,overflowCheck:r="vertical",visibility:i="auto",offset:s=0,onVisibilityChange:a,updateDeps:c=[]}=e,d=S.useRef(i);S.useEffect(()=>{const h=t?.current;if(!h||!n)return;const m=(x,k,P,T,_)=>{if(i==="auto"){const A=`${T}${gL(_)}Scroll`;k&&P?(h.dataset[A]="true",h.removeAttribute(`data-${T}-scroll`),h.removeAttribute(`data-${_}-scroll`)):(h.dataset[`${T}Scroll`]=k.toString(),h.dataset[`${_}Scroll`]=P.toString(),h.removeAttribute(`data-${T}-${_}-scroll`))}else{const A=k&&P?"both":k?T:P?_:"none";A!==d.current&&(a?.(A),d.current=A)}},g=()=>{var x,k;const P=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],T=h.querySelector('ul[data-slot="list"]'),_=+((x=T?.getAttribute("data-virtual-scroll-height"))!=null?x:h.scrollHeight),A=+((k=T?.getAttribute("data-virtual-scroll-top"))!=null?k:h.scrollTop);for(const{type:L,prefix:O,suffix:j}of P)if(r===L||r==="both"){const $=L==="vertical"?A>s:h.scrollLeft>s,Y=L==="vertical"?A+h.clientHeight+s<_:h.scrollLeft+h.clientWidth+s{["top","bottom","top-bottom","left","right","left-right"].forEach(x=>{h.removeAttribute(`data-${x}-scroll`)})};return g(),h.addEventListener("scroll",g,!0),i!=="auto"&&(b(),i==="both"?(h.dataset.topBottomScroll=String(r==="vertical"),h.dataset.leftRightScroll=String(r==="horizontal")):(h.dataset.topBottomScroll="false",h.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach(x=>{h.dataset[`${x}Scroll`]=String(i===x)}))),()=>{h.removeEventListener("scroll",g,!0),b()}},[...c,n,i,r,a,t])}function Wz(e){var t;const[n,r]=oa(e,vk.variantKeys),{ref:i,as:s,children:a,className:c,style:d,size:h=40,offset:m=0,visibility:g="auto",isEnabled:b=!0,onVisibilityChange:x,...k}=n,P=s||"div",T=Ii(i);Kz({domRef:T,offset:m,visibility:g,isEnabled:b,onVisibilityChange:x,updateDeps:[a],overflowCheck:(t=e.orientation)!=null?t:"vertical"});const _=S.useMemo(()=>vk({...r,className:c}),[ds(r),c]);return{Component:P,styles:_,domRef:T,children:a,getBaseProps:(L={})=>{var O;return{ref:T,className:_,"data-orientation":(O=e.orientation)!=null?O:"vertical",style:{"--scroll-shadow-size":`${h}px`,...d,...L.style},...k,...L}}}}var p2=jr((e,t)=>{const{Component:n,children:r,getBaseProps:i}=Wz({...e,ref:t});return D.jsx(n,{...i(),children:r})});p2.displayName="HeroUI.ScrollShadow";var h2=p2;const ZG={Like:"like",Dislike:"dislike"},Hz={Start:"START"},Sf={User:"user",Assistant:"assistant"},lf={Pending:"pending",InProgress:"in_progress",Completed:"completed"};class m2{constructor(t={}){if(this.chunkQueue=new Map,this.baseUrl=t.baseUrl??"",this.auth=t.auth,this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.slice(0,-1)),!!this.baseUrl)try{new URL(this.baseUrl)}catch{throw new Error(`Invalid base URL: ${this.baseUrl}. Please provide a valid URL.`)}}getBaseUrl(){return this.baseUrl}_buildApiUrl(t){return`${this.baseUrl}${t}`}async _makeRequest(t,n={}){const i={...{"Content-Type":"application/json"},...this.normalizeHeaders(n.headers)};this.auth?.getToken&&(i.Authorization=`Bearer ${this.auth.getToken()}`);const s=await fetch(t,{...n,headers:i});if(s.status===401&&this.auth?.onUnauthorized?.(),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s}async makeRequest(t,...n){const r=n[0],{method:i="GET",body:s,pathParams:a,queryParams:c,headers:d={},...h}=r||{},m={method:i,headers:d,...h};s&&i!=="GET"&&(m.body=typeof s=="string"?s:JSON.stringify(s));let g=t.toString();if(a&&typeof a=="object"&&(g=g.replace(/:([^/]+)/g,(x,k)=>{if(k in a){const P=a[k];return encodeURIComponent(String(P))}else throw new Error(`Path parameter ${k} is required`)})),c&&Object.keys(c).length>0){const x=new URLSearchParams;for(const[k,P]of Object.entries(c))P!=null&&x.append(k,String(P));g+=`?${x.toString()}`}return g=this._buildApiUrl(g),(await this._makeRequest(g,m)).json()}makeStreamRequest(t,n,r,i,s){let a=!1;const c=async h=>{const m=h.body?.pipeThrough(new TextDecoderStream).getReader();if(!m)throw new Error("Response body is null");let g="";for(;!a&&!i?.aborted;)try{const{value:b,done:x}=await m.read();if(x){r.onClose?.();break}g+=b;const k=g.split(` -`);g=k.pop()??"";for(const P of k)if(P.startsWith("data: "))try{const T=P.replace("data: ","").trim(),_=JSON.parse(T);if(!this.isChatResponse(_)){console.warn("Received response that isn't ChatResponse, skipping.",_);continue}if(_.type==="chunked_content"){this.handleChunkedContent(_,r);continue}await r.onMessage(_),await new Promise(A=>setTimeout(A,0))}catch(T){console.error("Error parsing JSON:",T),await r.onError(new Error("Error processing server response"))}}catch(b){if(i?.aborted)return;console.error("Stream error:",b),await r.onError(new Error("Error reading stream"));break}},d=async()=>{try{const m={...{"Content-Type":"application/json",Accept:"text/event-stream"},...s};this.auth?.getToken&&(m.Authorization=`Bearer ${this.auth.getToken()}`);const g=await fetch(this._buildApiUrl(t.toString()),{method:"POST",headers:m,body:JSON.stringify(n),signal:i});if(g.status===401&&this.auth?.onUnauthorized?.(),!g.ok)throw new Error(`HTTP error! status: ${g.status}`);await c(g)}catch(h){if(i?.aborted)return;console.error("Request error:",h);const m=h instanceof Error?h.message:"Error connecting to server";await r.onError(new Error(m))}};try{d()}catch(h){const m=h instanceof Error?h.message:"Failed to start stream";r.onError(new Error(m))}return()=>{a=!0}}isChatResponse(t){return t!==null&&typeof t=="object"&&"type"in t&&"content"in t}normalizeHeaders(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):t:{}}async handleChunkedContent(t,n){const i=t.content,{content_type:s,id:a,chunk_index:c,total_chunks:d,mime_type:h,data:m}=i;this.chunkQueue.has(a)||this.chunkQueue.set(a,{chunks:new Map,totalChunks:d,mimeType:h});const g=this.chunkQueue.get(a);if(g.chunks.set(c,m),g.chunks.size!==d)return;const x=Array.from({length:d},(k,P)=>g.chunks.get(P)).join("");try{atob(x)}catch(k){this.chunkQueue.delete(a),console.error("❌ Invalid base64 data: ",k),await n.onError(new Error("Error reading stream"))}if(s==="image"){const k={type:"image",content:{id:a,url:`${g.mimeType},${x}`}};await n.onMessage(k)}this.chunkQueue.delete(a)}}const g2=S.createContext(null);function Gz({children:e,...t}){const n=S.useMemo(()=>new m2(t),[t]),r=S.useMemo(()=>({client:n}),[n]);return D.jsx(g2.Provider,{value:r,children:e})}function nw(){const e=S.useContext(g2);if(!e)throw new Error("useRagbitsContext must be used within a RagbitsProvider");return e}function qz(e,t){const{client:n}=nw(),[r,i]=S.useState(null),[s,a]=S.useState(null),[c,d]=S.useState(!1),h=S.useRef(null),m=S.useCallback(()=>{if(!h.current)return null;h.current.abort(),h.current=null,d(!1)},[]),g=S.useCallback(async(...x)=>{const k=x[0];h.current&&c&&h.current.abort();const P=new AbortController;h.current=P,d(!0),a(null);try{const _={...{...t,...k||{},headers:{...t?.headers,...k?.headers||{}}},signal:P.signal},A=await n.makeRequest(e,_);return P.signal.aborted||(i(A),h.current=null),A}catch(T){if(!P.signal.aborted){const _=T instanceof Error?T:new Error("API call failed");throw a(_),h.current=null,_}throw T}finally{P.signal.aborted||d(!1)}},[n,e,t,c]),b=S.useCallback(()=>{m(),i(null),a(null),d(!1)},[m]);return{data:r,error:s,isLoading:c,call:g,reset:b,abort:m}}var To=(e=>(e.LIGHT="light",e.DARK="dark",e))(To||{});const v2=S.createContext(null),Yz="🐰",Xz="Ragbits Chat",Qz="by deepsense.ai",Jz="Loading...",y2="http://127.0.0.1:8000";function Zz(){return window.matchMedia("(prefers-color-scheme: dark)").matches?To.DARK:To.LIGHT}function Uk(){const e=window.localStorage.getItem("theme");return e===To.DARK||e===To.LIGHT?e:Zz()}function e8(e){return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}const t8=({children:e})=>{const t=S.useSyncExternalStore(e8,Uk,Uk),n=S.useRef(!1),r=new m2({baseUrl:y2});S.useEffect(()=>{if(n.current)return;(async()=>{try{const c=r.getBaseUrl(),d=await fetch(`${c}/api/theme`);if(d.ok){const h=await d.text(),m=document.getElementById("heroui-custom-theme");m&&m.remove();const g=document.createElement("style");g.id="heroui-custom-theme",g.textContent=h,document.head.appendChild(g),console.log("Custom HeroUI theme loaded successfully"),n.current=!0}}catch(c){console.warn("No custom theme available:",c),n.current=!0}})()},[]),S.useEffect(()=>{document.documentElement.classList.toggle("dark",t===To.DARK)},[t]);const i=S.useCallback(a=>{window.localStorage.setItem("theme",a),window.dispatchEvent(new Event("storage"))},[]),s=S.useMemo(()=>({theme:t,setTheme:i}),[t,i]);return D.jsx(v2.Provider,{value:s,children:e})},b2=Object.freeze({left:0,top:0,width:16,height:16}),nv=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),rw=Object.freeze({...b2,...nv}),Lb=Object.freeze({...rw,body:"",hidden:!1});function n8(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Kk(e,t){const n=n8(e,t);for(const r in Lb)r in nv?r in e&&!(r in n)&&(n[r]=nv[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function r8(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,d=c&&s(c);d&&(i[a]=[c].concat(d))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function i8(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=Kk(r[c]||i[c],s)}return a(t),n.forEach(a),Kk(e,s)}function x2(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=r8(e);for(const i in r){const s=r[i];s&&(t(i,i8(e,i,s)),n.push(i))}return n}const o8={provider:"",aliases:{},not_found:{},...b2};function b0(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function w2(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!b0(e,o8))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i||typeof s.body!="string"||!b0(s,Lb))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i||typeof a!="string"||!n[a]&&!r[a]||!b0(s,Lb))return null}return t}const S2=/^[a-z0-9]+(-[a-z0-9]+)*$/,Cv=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),d=i.pop(),h={provider:i.length>0?i[0]:r,prefix:d,name:c};return t&&!Dg(h)?null:h}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Dg(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Dg(c,n)?null:c}return null},Dg=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,Wk=Object.create(null);function s8(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Rf(e,t){const n=Wk[e]||(Wk[e]=Object.create(null));return n[t]||(n[t]=s8(e,t))}function k2(e,t){return w2(t)?x2(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function a8(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let ah=!1;function C2(e){return typeof e=="boolean"&&(ah=e),ah}function Hk(e){const t=typeof e=="string"?Cv(e,!0,ah):e;if(t){const n=Rf(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function l8(e,t){const n=Cv(e,!0,ah);if(!n)return!1;const r=Rf(n.provider,n.prefix);return t?a8(r,n.name,t):(r.missing.add(n.name),!0)}function u8(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ah&&!t&&!e.prefix){let i=!1;return w2(e)&&(e.prefix="",x2(e,(s,a)=>{l8(s,a)&&(i=!0)})),i}const n=e.prefix;if(!Dg({prefix:n,name:"a"}))return!1;const r=Rf(t,n);return!!k2(r,e)}const E2=Object.freeze({width:null,height:null}),P2=Object.freeze({...E2,...nv}),c8=/(-?[0-9.]*[0-9]+[0-9.]*)/g,f8=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Gk(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(c8);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=f8.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}function d8(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),s=e.indexOf("",s);if(a===-1)break;n+=e.slice(i+1,s).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:n,content:e}}function p8(e,t){return e?""+e+""+t:t}function h8(e,t,n){const r=d8(e);return p8(r.defs,t+r.content+n)}const m8=e=>e==="unset"||e==="undefined"||e==="none";function g8(e,t){const n={...rw,...e},r={...P2,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(P=>{const T=[],_=P.hFlip,A=P.vFlip;let L=P.rotate;_?A?L+=2:(T.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),T.push("scale(-1 1)"),i.top=i.left=0):A&&(T.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),T.push("scale(1 -1)"),i.top=i.left=0);let O;switch(L<0&&(L-=Math.floor(L/4)*4),L=L%4,L){case 1:O=i.height/2+i.top,T.unshift("rotate(90 "+O.toString()+" "+O.toString()+")");break;case 2:T.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:O=i.width/2+i.left,T.unshift("rotate(-90 "+O.toString()+" "+O.toString()+")");break}L%2===1&&(i.left!==i.top&&(O=i.left,i.left=i.top,i.top=O),i.width!==i.height&&(O=i.width,i.width=i.height,i.height=O)),T.length&&(s=h8(s,'',""))});const a=r.width,c=r.height,d=i.width,h=i.height;let m,g;a===null?(g=c===null?"1em":c==="auto"?h:c,m=Gk(g,d/h)):(m=a==="auto"?d:a,g=c===null?Gk(m,h/d):c==="auto"?h:c);const b={},x=(P,T)=>{m8(T)||(b[P]=T.toString())};x("width",m),x("height",g);const k=[i.left,i.top,d,h];return b.viewBox=k.join(" "),{attributes:b,viewBox:k,body:s}}const v8=/\sid="(\S+)"/g,y8="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let b8=0;function x8(e,t=y8){const n=[];let r;for(;r=v8.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(b8++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const Mb=Object.create(null);function w8(e,t){Mb[e]=t}function Db(e){return Mb[e]||Mb[""]}function iw(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ow=Object.create(null),wp=["https://api.simplesvg.com","https://api.unisvg.com"],Ng=[];for(;wp.length>0;)wp.length===1||Math.random()>.5?Ng.push(wp.shift()):Ng.push(wp.pop());ow[""]=iw({resources:["https://api.iconify.design"].concat(Ng)});function S8(e,t){const n=iw(t);return n===null?!1:(ow[e]=n,!0)}function sw(e){return ow[e]}const k8=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let qk=k8();function C8(e,t){const n=sw(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function E8(e){return e===404}const P8=(e,t,n)=>{const r=[],i=C8(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((d,h)=>{c+=d.length+1,c>=i&&h>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=d.length),a.icons.push(d)}),r.push(a),r};function T8(e){if(typeof e=="string"){const t=sw(e);if(t)return t.path}return"/"}const _8=(e,t,n)=>{if(!qk){n("abort",424);return}let r=T8(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),d=new URLSearchParams({icons:c});r+=s+".json?"+d.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;qk(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(E8(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},I8={prepare:P8,send:_8};function $8(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,d=n[s]||(n[s]=Object.create(null)),h=d[a]||(d[a]=Rf(s,a));let m;c in h.icons?m=t.loaded:a===""||h.missing.has(c)?m=t.missing:m=t.pending;const g={provider:s,prefix:a,name:c};m.push(g)}),t}function T2(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function A8(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const h=d.name;if(e.icons[h])a.loaded.push({provider:r,prefix:i,name:h});else if(e.missing.has(h))a.missing.push({provider:r,prefix:i,name:h});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||T2([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let R8=0;function L8(e,t,n){const r=R8++,i=T2.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function M8(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?Cv(i,t,n):i;s&&r.push(s)}),r}var D8={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function N8(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let $=e.resources.slice(0);for(a=[];$.length>1;){const Y=Math.floor(Math.random()*$.length);a.push($[Y]),$=$.slice(0,Y).concat($.slice(Y+1))}a=a.concat($)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let d="pending",h=0,m,g=null,b=[],x=[];typeof r=="function"&&x.push(r);function k(){g&&(clearTimeout(g),g=null)}function P(){d==="pending"&&(d="aborted"),k(),b.forEach($=>{$.status==="pending"&&($.status="aborted")}),b=[]}function T($,Y){Y&&(x=[]),typeof $=="function"&&x.push($)}function _(){return{startTime:c,payload:t,status:d,queriesSent:h,queriesPending:b.length,subscribe:T,abort:P}}function A(){d="failed",x.forEach($=>{$(void 0,m)})}function L(){b.forEach($=>{$.status==="pending"&&($.status="aborted")}),b=[]}function O($,Y,te){const ie=Y!=="success";switch(b=b.filter(B=>B!==$),d){case"pending":break;case"failed":if(ie||!e.dataAfterTimeout)return;break;default:return}if(Y==="abort"){m=te,A();return}if(ie){m=te,b.length||(a.length?j():A());return}if(k(),L(),!e.random){const B=e.resources.indexOf($.resource);B!==-1&&B!==e.index&&(e.index=B)}d="completed",x.forEach(B=>{B(te)})}function j(){if(d!=="pending")return;k();const $=a.shift();if($===void 0){if(b.length){g=setTimeout(()=>{k(),d==="pending"&&(L(),A())},e.timeout);return}A();return}const Y={status:"pending",resource:$,callback:(te,ie)=>{O(Y,te,ie)}};b.push(Y),h++,g=setTimeout(j,e.rotate),n($,t,Y.callback)}return setTimeout(j),_}function _2(e){const t={...D8,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,d,h){const m=N8(t,c,d,(g,b)=>{r(),h&&h(g,b)});return n.push(m),m}function s(c){return n.find(d=>c(d))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Yk(){}const x0=Object.create(null);function F8(e){if(!x0[e]){const t=sw(e);if(!t)return;const n=_2(t),r={config:t,redundancy:n};x0[e]=r}return x0[e]}function O8(e,t,n){let r,i;if(typeof e=="string"){const s=Db(e);if(!s)return n(void 0,424),Yk;i=s.send;const a=F8(e);a&&(r=a.redundancy)}else{const s=iw(e);if(s){r=_2(s);const a=e.resources?e.resources[0]:"",c=Db(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),Yk):r.query(t,i,n)().abort}function Xk(){}function z8(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,A8(e)}))}function j8(e){const t=[],n=[];return e.forEach(r=>{(r.match(S2)?t:n).push(r)}),{valid:t,invalid:n}}function Sp(e,t,n){function r(){const i=e.pendingIcons;t.forEach(s=>{i&&i.delete(s),e.icons[s]||e.missing.add(s)})}if(n&&typeof n=="object")try{if(!k2(e,n).length){r();return}}catch(i){console.error(i)}r(),z8(e)}function Qk(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function B8(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const s=e.loadIcon;if(e.loadIcons&&(i.length>1||!s)){Qk(e.loadIcons(i,r,n),m=>{Sp(e,i,m)});return}if(s){i.forEach(m=>{const g=s(m,r,n);Qk(g,b=>{const x=b?{prefix:r,icons:{[m]:b}}:null;Sp(e,[m],x)})});return}const{valid:a,invalid:c}=j8(i);if(c.length&&Sp(e,c,null),!a.length)return;const d=r.match(S2)?Db(n):null;if(!d){Sp(e,a,null);return}d.prepare(n,r,a).forEach(m=>{O8(n,m,g=>{Sp(e,m.icons,g)})})}))}const I2=(e,t)=>{const n=M8(e,!0,C2()),r=$8(n);if(!r.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(r.loaded,r.missing,r.pending,Xk)}),()=>{d=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(d=>{const{provider:h,prefix:m}=d;if(m===c&&h===a)return;a=h,c=m,s.push(Rf(h,m));const g=i[h]||(i[h]=Object.create(null));g[m]||(g[m]=[])}),r.pending.forEach(d=>{const{provider:h,prefix:m,name:g}=d,b=Rf(h,m),x=b.pendingIcons||(b.pendingIcons=new Set);x.has(g)||(x.add(g),i[h][m].push(g))}),s.forEach(d=>{const h=i[d.provider][d.prefix];h.length&&B8(d,h)}),t?L8(t,r,s):Xk};function V8(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in E2?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const U8=/[\s,]+/;function K8(e,t){t.split(U8).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function W8(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function H8(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'"+e+""}function G8(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function q8(e){return"data:image/svg+xml,"+G8(e)}function Y8(e){return'url("'+q8(e)+'")'}let Vp;function X8(){try{Vp=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Vp=null}}function Q8(e){return Vp===void 0&&X8(),Vp?Vp.createHTML(e):e}const $2={...P2,inline:!1},J8={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Z8={display:"inline-block"},Nb={backgroundColor:"currentColor"},A2={backgroundColor:"transparent"},Jk={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Zk={WebkitMask:Nb,mask:Nb,background:A2};for(const e in Zk){const t=Zk[e];for(const n in Jk)t[e+n]=Jk[n]}const e7={...$2,inline:!0};function eC(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const t7=(e,t,n)=>{const r=t.inline?e7:$2,i=V8(r,t),s=t.mode||"svg",a={},c=t.style||{},d={...s==="svg"?J8:{}};if(n){const T=Cv(n,!1,!0);if(T){const _=["iconify"],A=["provider","prefix"];for(const L of A)T[L]&&_.push("iconify--"+T[L]);d.className=_.join(" ")}}for(let T in t){const _=t[T];if(_!==void 0)switch(T){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":d.ref=_;break;case"className":d[T]=(d[T]?d[T]+" ":"")+_;break;case"inline":case"hFlip":case"vFlip":i[T]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&K8(i,_);break;case"color":a.color=_;break;case"rotate":typeof _=="string"?i[T]=W8(_):typeof _=="number"&&(i[T]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete d["aria-hidden"];break;default:r[T]===void 0&&(d[T]=_)}}const h=g8(e,i),m=h.attributes;if(i.inline&&(a.verticalAlign="-0.125em"),s==="svg"){d.style={...a,...c},Object.assign(d,m);let T=0,_=t.id;return typeof _=="string"&&(_=_.replace(/-/g,"_")),d.dangerouslySetInnerHTML={__html:Q8(x8(h.body,_?()=>_+"ID"+T++:"iconifyReact"))},S.createElement("svg",d)}const{body:g,width:b,height:x}=e,k=s==="mask"||(s==="bg"?!1:g.indexOf("currentColor")!==-1),P=H8(g,{...m,width:b+"",height:x+""});return d.style={...a,"--svg":Y8(P),width:eC(m.width),height:eC(m.height),...Z8,...k?Nb:A2,...c},S.createElement("span",d)};C2(!0);w8("",I8);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!u8(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;S8(n,i)||console.error(r)}catch{console.error(r)}}}}function R2(e){const[t,n]=S.useState(!!e.ssr),[r,i]=S.useState({});function s(x){if(x){const k=e.icon;if(typeof k=="object")return{name:"",data:k};const P=Hk(k);if(P)return{name:k,data:P}}return{name:""}}const[a,c]=S.useState(s(!!e.ssr));function d(){const x=r.callback;x&&(x(),i({}))}function h(x){if(JSON.stringify(a)!==JSON.stringify(x))return d(),c(x),!0}function m(){var x;const k=e.icon;if(typeof k=="object"){h({name:"",data:k});return}const P=Hk(k);if(h({name:k,data:P}))if(P===void 0){const T=I2([k],m);i({callback:T})}else P&&((x=e.onLoad)===null||x===void 0||x.call(e,k))}S.useEffect(()=>(n(!0),d),[]),S.useEffect(()=>{t&&m()},[e.icon,t]);const{name:g,data:b}=a;return b?t7({...rw,...b},e,g):e.children?e.children:e.fallback?e.fallback:S.createElement("span",{})}const ui=S.forwardRef((e,t)=>R2({...e,_ref:t}));S.forwardRef((e,t)=>R2({inline:!0,...e,_ref:t}));var Lp={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */var n7=Lp.exports,tC;function r7(){return tC||(tC=1,function(e,t){(function(){var n,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",g=1,b=2,x=4,k=1,P=2,T=1,_=2,A=4,L=8,O=16,j=32,$=64,Y=128,te=256,ie=512,B=30,W="...",G=800,ee=16,H=1,le=2,J=3,X=1/0,V=9007199254740991,ae=17976931348623157e292,M=NaN,U=4294967295,oe=U-1,z=U>>>1,me=[["ary",Y],["bind",T],["bindKey",_],["curry",L],["curryRight",O],["flip",ie],["partial",j],["partialRight",$],["rearg",te]],Ce="[object Arguments]",ye="[object Array]",Oe="[object AsyncFunction]",Ne="[object Boolean]",_e="[object Date]",Qe="[object DOMException]",at="[object Error]",Ie="[object Function]",mt="[object GeneratorFunction]",pt="[object Map]",Ut="[object Number]",Ue="[object Null]",it="[object Object]",Kt="[object Promise]",er="[object Proxy]",an="[object RegExp]",_t="[object Set]",Rt="[object String]",Tn="[object Symbol]",Er="[object Undefined]",Nt="[object WeakMap]",pe="[object WeakSet]",Se="[object ArrayBuffer]",ze="[object DataView]",nt="[object Float32Array]",lt="[object Float64Array]",Wt="[object Int8Array]",Bn="[object Int16Array]",Jt="[object Int32Array]",Pt="[object Uint8Array]",Pr="[object Uint8ClampedArray]",Ft="[object Uint16Array]",tr="[object Uint32Array]",ln=/\b__p \+= '';/g,aa=/\b(__p \+=) '' \+/g,ms=/(__e\(.*?\)|\b__t\)) \+\n'';/g,di=/&(?:amp|lt|gt|quot|#39);/g,pi=/[&<>"']/g,ul=RegExp(di.source),Mu=RegExp(pi.source),gs=/<%-([\s\S]+?)%>/g,Vr=/<%([\s\S]+?)%>/g,cl=/<%=([\s\S]+?)%>/g,fl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zt=/^\w*$/,vs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ys=/[\\^$.*+?()[\]{}|]/g,Ro=RegExp(ys.source),dl=/^\s+/,bs=/\s/,la=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ua=/\{\n\/\* \[wrapped with (.+)\] \*/,pl=/,? & /,Kf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Wf=/[()=,{}\[\]\/\s]/,Hf=/\\(\\)?/g,Xe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,so=/\w*$/,$h=/^[-+]0x[0-9a-f]+$/i,Ov=/^0b[01]+$/i,Ah=/^\[object .+?Constructor\]$/,Rh=/^0o[0-7]+$/i,Lh=/^(?:0|[1-9]\d*)$/,Mh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Du=/($^)/,zv=/['\n\r\u2028\u2029\\]/g,Ht="\\ud800-\\udfff",jv="\\u0300-\\u036f",Gf="\\ufe20-\\ufe2f",Dh="\\u20d0-\\u20ff",hl=jv+Gf+Dh,Nh="\\u2700-\\u27bf",qf="a-z\\xdf-\\xf6\\xf8-\\xff",Nu="\\xac\\xb1\\xd7\\xf7",Li="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bv="\\u2000-\\u206f",hi=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Fh="A-Z\\xc0-\\xd6\\xd8-\\xde",Oh="\\ufe0e\\ufe0f",zh=Nu+Li+Bv+hi,ca="['’]",Fu="["+Ht+"]",fa="["+zh+"]",xs="["+hl+"]",jh="\\d+",Vv="["+Nh+"]",Ou="["+qf+"]",Yf="[^"+Ht+zh+jh+Nh+qf+Fh+"]",ml="\\ud83c[\\udffb-\\udfff]",gl="(?:"+xs+"|"+ml+")",Bh="[^"+Ht+"]",vl="(?:\\ud83c[\\udde6-\\uddff]){2}",Et="[\\ud800-\\udbff][\\udc00-\\udfff]",ws="["+Fh+"]",Xf="\\u200d",zu="(?:"+Ou+"|"+Yf+")",Vh="(?:"+ws+"|"+Yf+")",Qf="(?:"+ca+"(?:d|ll|m|re|s|t|ve))?",Jf="(?:"+ca+"(?:D|LL|M|RE|S|T|VE))?",ju=gl+"?",yl="["+Oh+"]?",Lo="(?:"+Xf+"(?:"+[Bh,vl,Et].join("|")+")"+yl+ju+")*",Mo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Do="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",da=yl+ju+Lo,bl="(?:"+[Vv,vl,Et].join("|")+")"+da,No="(?:"+[Bh+xs+"?",xs,vl,Et,Fu].join("|")+")",Uv=RegExp(ca,"g"),Uh=RegExp(xs,"g"),Ss=RegExp(ml+"(?="+ml+")|"+No+da,"g"),Kv=RegExp([ws+"?"+Ou+"+"+Qf+"(?="+[fa,ws,"$"].join("|")+")",Vh+"+"+Jf+"(?="+[fa,ws+zu,"$"].join("|")+")",ws+"?"+zu+"+"+Qf,ws+"+"+Jf,Do,Mo,jh,bl].join("|"),"g"),Kh=RegExp("["+Xf+Ht+hl+Oh+"]"),Bu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Wv=-1,It={};It[nt]=It[lt]=It[Wt]=It[Bn]=It[Jt]=It[Pt]=It[Pr]=It[Ft]=It[tr]=!0,It[Ce]=It[ye]=It[Se]=It[Ne]=It[ze]=It[_e]=It[at]=It[Ie]=It[pt]=It[Ut]=It[it]=It[an]=It[_t]=It[Rt]=It[Nt]=!1;var Tt={};Tt[Ce]=Tt[ye]=Tt[Se]=Tt[ze]=Tt[Ne]=Tt[_e]=Tt[nt]=Tt[lt]=Tt[Wt]=Tt[Bn]=Tt[Jt]=Tt[pt]=Tt[Ut]=Tt[it]=Tt[an]=Tt[_t]=Tt[Rt]=Tt[Tn]=Tt[Pt]=Tt[Pr]=Tt[Ft]=Tt[tr]=!0,Tt[at]=Tt[Ie]=Tt[Nt]=!1;var pa={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Vu={"&":"&","<":"<",">":">",'"':""","'":"'"},Hv={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zf=parseFloat,Uu=parseInt,Ku=typeof ig=="object"&&ig&&ig.Object===Object&&ig,Hh=typeof self=="object"&&self&&self.Object===Object&&self,Gt=Ku||Hh||Function("return this")(),xl=t&&!t.nodeType&&t,Mi=xl&&!0&&e&&!e.nodeType&&e,ed=Mi&&Mi.exports===xl,ha=ed&&Ku.process,nr=function(){try{var re=Mi&&Mi.require&&Mi.require("util").types;return re||ha&&ha.binding&&ha.binding("util")}catch{}}(),td=nr&&nr.isArrayBuffer,dr=nr&&nr.isDate,ks=nr&&nr.isMap,Wu=nr&&nr.isRegExp,ma=nr&&nr.isSet,Gh=nr&&nr.isTypedArray;function rr(re,he,fe){switch(fe.length){case 0:return re.call(he);case 1:return re.call(he,fe[0]);case 2:return re.call(he,fe[0],fe[1]);case 3:return re.call(he,fe[0],fe[1],fe[2])}return re.apply(he,fe)}function nd(re,he,fe,Re){for(var rt=-1,wt=re==null?0:re.length;++rt-1}function id(re,he,fe){for(var Re=-1,rt=re==null?0:re.length;++Re-1;);return fe}function fd(re,he){for(var fe=re.length;fe--&&ga(he,re[fe],0)>-1;);return fe}function tm(re,he){for(var fe=re.length,Re=0;fe--;)re[fe]===he&&++Re;return Re}var nm=Yu(pa),rm=Yu(Vu);function im(re){return"\\"+Gv[re]}function va(re,he){return re==null?n:re[he]}function ya(re){return Kh.test(re)}function Zv(re){return Bu.test(re)}function ey(re){for(var he,fe=[];!(he=re.next()).done;)fe.push(he.value);return fe}function Xu(re){var he=-1,fe=Array(re.size);return re.forEach(function(Re,rt){fe[++he]=[rt,Re]}),fe}function dd(re,he){return function(fe){return re(he(fe))}}function Ur(re,he){for(var fe=-1,Re=re.length,rt=0,wt=[];++fe-1}function mm(u,f){var y=this.__data__,E=Gn(y,u);return E<0?(++this.size,y.push([u,f])):y[E][1]=f,this}ir.prototype.clear=Ia,ir.prototype.delete=mr,ir.prototype.get=cc,ir.prototype.has=hm,ir.prototype.set=mm;function Wr(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f=f?u:f)),u}function gr(u,f,y,E,I,F){var q,Z=f&g,se=f&b,ge=f&x;if(y&&(q=I?y(u,E,I,F):y(u)),q!==n)return q;if(!fn(u))return u;var ve=st(u);if(ve){if(q=Yl(u),!Z)return or(u,q)}else{var we=Fn(u),$e=we==Ie||we==mt;if(Ha(u))return Md(u,Z);if(we==it||we==Ce||$e&&!I){if(q=se||$e?{}:On(u),!Z)return se?ly(u,gi(q,u)):Tc(u,jt(q,u))}else{if(!Tt[we])return I?u:{};q=uy(u,we,Z)}}F||(F=new Hn);var Ke=F.get(u);if(Ke)return Ke;F.set(u,q),Vw(u)?u.forEach(function(et){q.add(gr(et,f,y,et,u,F))}):jw(u)&&u.forEach(function(et,gt){q.set(gt,gr(et,f,y,gt,u,F))});var Ze=ge?se?Hl:Wl:se?ni:Xn,dt=ve?n:Ze(u);return Vn(dt||u,function(et,gt){dt&&(gt=et,et=u[gt]),As(q,gt,gr(et,f,y,gt,u,F))}),q}function bm(u){var f=Xn(u);return function(y){return Ll(y,u,f)}}function Ll(u,f,y){var E=y.length;if(u==null)return!E;for(u=$t(u);E--;){var I=y[E],F=f[I],q=u[I];if(q===n&&!(I in u)||!F(q))return!1}return!0}function xd(u,f,y){if(typeof u!="function")throw new Kr(a);return Ua(function(){u.apply(n,y)},f)}function Bi(u,f,y,E){var I=-1,F=Gu,q=!0,Z=u.length,se=[],ge=f.length;if(!Z)return se;y&&(f=Lt(f,Tr(y))),E?(F=id,q=!1):f.length>=i&&(F=ao,q=!1,f=new _s(f));e:for(;++II?0:I+y),E=E===n||E>I?I:ct(E),E<0&&(E+=I),E=y>E?0:Kw(E);y0&&y(Z)?f>1?on(Z,f-1,y,E,I):Oo(I,Z):E||(I[I.length]=Z)}return I}var mc=Ic(),Dl=Ic(!0);function Ar(u,f){return u&&mc(u,f,Xn)}function Ho(u,f){return u&&Dl(u,f,Xn)}function Aa(u,f){return Fo(f,function(y){return Ws(u[y])})}function ho(u,f){f=Wi(f,u);for(var y=0,E=f.length;u!=null&&yf}function qr(u,f){return u!=null&&St.call(u,f)}function Ls(u,f){return u!=null&&f in $t(u)}function Sd(u,f,y){return u>=Un(f,y)&&u=120&&ve.length>=120)?new _s(q&&ve):n}ve=u[0];var we=-1,$e=Z[0];e:for(;++we-1;)Z!==u&&rc.call(Z,se,1),rc.call(u,se,1);return u}function bn(u,f){for(var y=u?f.length:0,E=y-1;y--;){var I=f[y];if(y==E||I!==F){var F=I;Yt(I)?rc.call(u,I,1):Cc(u,I)}}return u}function Ma(u,f){return u+jo(_l()*(f-u+1))}function zl(u,f,y,E){for(var I=-1,F=hn(Ps((f-u)/(y||1)),0),q=fe(F);F--;)q[E?F:++I]=u,u+=y;return q}function Ds(u,f){var y="";if(!u||f<1||f>V)return y;do f%2&&(y+=u),f=jo(f/2),f&&(u+=u);while(f);return y}function ut(u,f){return Rr(Oc(u,f,ri),u+"")}function qn(u){return zi(rf(u))}function _d(u,f){var y=rf(u);return zc(y,po(f,0,y.length))}function Ns(u,f,y,E){if(!fn(u))return u;f=Wi(f,u);for(var I=-1,F=f.length,q=F-1,Z=u;Z!=null&&++II?0:I+f),y=y>I?I:y,y<0&&(y+=I),I=f>y?0:y-f>>>0,f>>>=0;for(var F=fe(I);++E>>1,q=u[F];q!==null&&!Ci(q)&&(y?q<=f:q=i){var ge=f?null:Rm(u);if(ge)return zo(ge);q=!1,I=ao,se=new _s}else se=f?[]:Z;e:for(;++E=E?u:Yn(u,f,y)}var Ld=fm||function(u){return Gt.clearTimeout(u)};function Md(u,f){if(f)return u.slice();var y=u.length,E=hd?hd(y):new u.constructor(y);return u.copy(E),E}function Vl(u){var f=new u.constructor(u.byteLength);return new Pl(f).set(new Pl(u)),f}function Em(u,f){var y=f?Vl(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function Pm(u){var f=new u.constructor(u.source,so.exec(u));return f.lastIndex=u.lastIndex,f}function Tm(u){return Ir?$t(Ir.call(u)):{}}function _m(u,f){var y=f?Vl(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function Dd(u,f){if(u!==f){var y=u!==n,E=u===null,I=u===u,F=Ci(u),q=f!==n,Z=f===null,se=f===f,ge=Ci(f);if(!Z&&!ge&&!F&&u>f||F&&q&&se&&!Z&&!ge||E&&q&&se||!y&&se||!I)return 1;if(!E&&!F&&!ge&&u=Z)return se;var ge=y[E];return se*(ge=="desc"?-1:1)}}return u.index-f.index}function Im(u,f,y,E){for(var I=-1,F=u.length,q=y.length,Z=-1,se=f.length,ge=hn(F-q,0),ve=fe(se+ge),we=!E;++Z1?y[I-1]:n,q=I>2?y[2]:n;for(F=u.length>3&&typeof F=="function"?(I--,F):n,q&&ar(y[0],y[1],q)&&(F=I<3?n:F,I=1),f=$t(f);++E-1?I[F?f[q]:q]:n}}function Ac(u){return Gi(function(f){var y=f.length,E=y,I=Kn.prototype.thru;for(u&&f.reverse();E--;){var F=f[E];if(typeof F!="function")throw new Kr(a);if(I&&!q&&Ba(F)=="wrapper")var q=new Kn([],!0)}for(E=q?E:y;++E1&&xt.reverse(),ve&&seZ))return!1;var ge=F.get(u),ve=F.get(f);if(ge&&ve)return ge==f&&ve==u;var we=-1,$e=!0,Ke=y&P?new _s:n;for(F.set(u,f),F.set(f,u);++we1?"& ":"")+f[E],f=f.join(y>2?", ":" "),u.replace(la,`{ -/* [wrapped with `+f+`] */ -`)}function Nc(u){return st(u)||ou(u)||!!(cm&&u&&u[cm])}function Yt(u,f){var y=typeof u;return f=f??V,!!f&&(y=="number"||y!="symbol"&&Lh.test(u))&&u>-1&&u%1==0&&u0){if(++f>=G)return arguments[0]}else f=0;return u.apply(n,arguments)}}function zc(u,f){var y=-1,E=u.length,I=E-1;for(f=f===n?E:f;++y1?u[f-1]:n;return y=typeof y=="function"?(u.pop(),y):n,tn(u,y)});function qc(u){var f=N(u);return f.__chain__=!0,f}function xy(u,f){return f(u),u}function ki(u,f){return f(u)}var Yc=Gi(function(u){var f=u.length,y=f?u[0]:0,E=this.__wrapped__,I=function(F){return hc(F,u)};return f>1||this.__actions__.length||!(E instanceof ot)||!Yt(y)?this.thru(I):(E=E.slice(y,+y+(f?1:0)),E.__actions__.push({func:ki,args:[I],thisArg:n}),new Kn(E,this.__chain__).thru(function(F){return f&&!F.length&&F.push(n),F}))});function Us(){return qc(this)}function Xc(){return new Kn(this.value(),this.__chain__)}function ap(){this.__values__===n&&(this.__values__=Uw(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function lp(){return this}function wy(u){for(var f,y=this;y instanceof Fi;){var E=Bm(y);E.__index__=0,E.__values__=n,f?I.__wrapped__=E:f=E;var I=E;y=y.__wrapped__}return I.__wrapped__=u,f}function up(){var u=this.__wrapped__;if(u instanceof ot){var f=u;return this.__actions__.length&&(f=new ot(this)),f=f.reverse(),f.__actions__.push({func:ki,args:[Wc],thisArg:n}),new Kn(f,this.__chain__)}return this.thru(Wc)}function Sy(){return Na(this.__wrapped__,this.__actions__)}var Xm=_c(function(u,f,y){St.call(u,y)?++u[y]:ji(u,y,1)});function Qm(u,f,y){var E=st(u)?rd:Ml;return y&&ar(u,f,y)&&(f=n),E(u,qe(f,3))}function Qc(u,f){var y=st(u)?Fo:wd;return y(u,qe(f,3))}var Jc=Os(Jo),Jm=Os(Zl);function cp(u,f){return on(Ks(u,f),1)}function ky(u,f){return on(Ks(u,f),X)}function Zm(u,f,y){return y=y===n?1:ct(y),on(Ks(u,f),y)}function Zc(u,f){var y=st(u)?Vn:Vi;return y(u,qe(f,3))}function ru(u,f){var y=st(u)?Hu:xm;return y(u,qe(f,3))}var fp=_c(function(u,f,y){St.call(u,y)?u[y].push(f):ji(u,y,[f])});function ef(u,f,y,E){u=ti(u)?u:rf(u),y=y&&!E?ct(y):0;var I=u.length;return y<0&&(y=hn(I+y,0)),ng(u)?y<=I&&u.indexOf(f,y)>-1:!!I&&ga(u,f,y)>-1}var eg=ut(function(u,f,y){var E=-1,I=typeof f=="function",F=ti(u)?fe(u.length):[];return Vi(u,function(q){F[++E]=I?rr(f,q,y):Yr(q,f,y)}),F}),Cy=_c(function(u,f,y){ji(u,y,f)});function Ks(u,f){var y=st(u)?Lt:Ed;return y(u,qe(f,3))}function Ey(u,f,y,E){return u==null?[]:(st(f)||(f=f==null?[]:[f]),y=E?n:y,st(y)||(y=y==null?[]:[y]),Ol(u,f,y))}var iu=_c(function(u,f,y){u[y?0:1].push(f)},function(){return[[],[]]});function Py(u,f,y){var E=st(u)?od:Jh,I=arguments.length<3;return E(u,qe(f,4),y,I,Vi)}function tf(u,f,y){var E=st(u)?qv:Jh,I=arguments.length<3;return E(u,qe(f,4),y,I,xm)}function o(u,f){var y=st(u)?Fo:wd;return y(u,Ee(qe(f,3)))}function l(u){var f=st(u)?zi:qn;return f(u)}function p(u,f,y){(y?ar(u,f,y):f===n)?f=1:f=ct(f);var E=st(u)?$s:_d;return E(u,f)}function v(u){var f=st(u)?ym:Qr;return f(u)}function w(u){if(u==null)return 0;if(ti(u))return ng(u)?Cs(u):u.length;var f=Fn(u);return f==pt||f==_t?u.size:vo(u).length}function C(u,f,y){var E=st(u)?sd:Id;return y&&ar(u,f,y)&&(f=n),E(u,qe(f,3))}var R=ut(function(u,f){if(u==null)return[];var y=f.length;return y>1&&ar(u,f[0],f[1])?f=[]:y>2&&ar(f[0],f[1],f[2])&&(f=[f[0]]),Ol(u,on(f,1),[])}),K=Ot||function(){return Gt.Date.now()};function Q(u,f){if(typeof f!="function")throw new Kr(a);return u=ct(u),function(){if(--u<1)return f.apply(this,arguments)}}function de(u,f,y){return f=y?n:f,f=u&&f==null?u.length:f,Hi(u,Y,n,n,n,n,f)}function xe(u,f){var y;if(typeof f!="function")throw new Kr(a);return u=ct(u),function(){return--u>0&&(y=f.apply(this,arguments)),u<=1&&(f=n),y}}var ke=ut(function(u,f,y){var E=T;if(y.length){var I=Ur(y,xo(ke));E|=j}return Hi(u,E,f,y,I)}),be=ut(function(u,f,y){var E=T|_;if(y.length){var I=Ur(y,xo(be));E|=j}return Hi(f,E,u,y,I)});function Le(u,f,y){f=y?n:f;var E=Hi(u,L,n,n,n,n,n,f);return E.placeholder=Le.placeholder,E}function De(u,f,y){f=y?n:f;var E=Hi(u,O,n,n,n,n,n,f);return E.placeholder=De.placeholder,E}function Fe(u,f,y){var E,I,F,q,Z,se,ge=0,ve=!1,we=!1,$e=!0;if(typeof u!="function")throw new Kr(a);f=Yi(f)||0,fn(y)&&(ve=!!y.leading,we="maxWait"in y,F=we?hn(Yi(y.maxWait)||0,f):F,$e="trailing"in y?!!y.trailing:$e);function Ke(Sn){var Co=E,Gs=I;return E=I=n,ge=Sn,q=u.apply(Gs,Co),q}function Ze(Sn){return ge=Sn,Z=Ua(gt,f),ve?Ke(Sn):q}function dt(Sn){var Co=Sn-se,Gs=Sn-ge,n1=f-Co;return we?Un(n1,F-Gs):n1}function et(Sn){var Co=Sn-se,Gs=Sn-ge;return se===n||Co>=f||Co<0||we&&Gs>=F}function gt(){var Sn=K();if(et(Sn))return xt(Sn);Z=Ua(gt,dt(Sn))}function xt(Sn){return Z=n,$e&&E?Ke(Sn):(E=I=n,q)}function Ei(){Z!==n&&Ld(Z),ge=0,E=se=I=Z=n}function Mr(){return Z===n?q:xt(K())}function Pi(){var Sn=K(),Co=et(Sn);if(E=arguments,I=this,se=Sn,Co){if(Z===n)return Ze(se);if(we)return Ld(Z),Z=Ua(gt,f),Ke(se)}return Z===n&&(Z=Ua(gt,f)),q}return Pi.cancel=Ei,Pi.flush=Mr,Pi}var cn=ut(function(u,f){return xd(u,1,f)}),ue=ut(function(u,f,y){return xd(u,Yi(f)||0,y)});function ne(u){return Hi(u,ie)}function ce(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new Kr(a);var y=function(){var E=arguments,I=f?f.apply(this,E):E[0],F=y.cache;if(F.has(I))return F.get(I);var q=u.apply(this,E);return y.cache=F.set(I,q)||F,q};return y.cache=new(ce.Cache||Wr),y}ce.Cache=Wr;function Ee(u){if(typeof u!="function")throw new Kr(a);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function Ve(u){return xe(2,u)}var Ge=Cm(function(u,f){f=f.length==1&&st(f[0])?Lt(f[0],Tr(qe())):Lt(on(f,1),Tr(qe()));var y=f.length;return ut(function(E){for(var I=-1,F=Un(E.length,y);++I=f}),ou=yc(function(){return arguments}())?yc:function(u){return gn(u)&&St.call(u,"callee")&&!nc.call(u,"callee")},st=fe.isArray,K$=td?Tr(td):Sm;function ti(u){return u!=null&&tg(u.length)&&!Ws(u)}function wn(u){return gn(u)&&ti(u)}function W$(u){return u===!0||u===!1||gn(u)&&Dn(u)==Ne}var Ha=gd||Oy,H$=dr?Tr(dr):go;function G$(u){return gn(u)&&u.nodeType===1&&!dp(u)}function q$(u){if(u==null)return!0;if(ti(u)&&(st(u)||typeof u=="string"||typeof u.splice=="function"||Ha(u)||nf(u)||ou(u)))return!u.length;var f=Fn(u);if(f==pt||f==_t)return!u.size;if(wo(u))return!vo(u).length;for(var y in u)if(St.call(u,y))return!1;return!0}function Y$(u,f){return Xr(u,f)}function X$(u,f,y){y=typeof y=="function"?y:n;var E=y?y(u,f):n;return E===n?Xr(u,f,n,y):!!E}function _y(u){if(!gn(u))return!1;var f=Dn(u);return f==at||f==Qe||typeof u.message=="string"&&typeof u.name=="string"&&!dp(u)}function Q$(u){return typeof u=="number"&&Sa(u)}function Ws(u){if(!fn(u))return!1;var f=Dn(u);return f==Ie||f==mt||f==Oe||f==er}function zw(u){return typeof u=="number"&&u==ct(u)}function tg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=V}function fn(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function gn(u){return u!=null&&typeof u=="object"}var jw=ks?Tr(ks):km;function J$(u,f){return u===f||Ra(u,f,ql(f))}function Z$(u,f,y){return y=typeof y=="function"?y:n,Ra(u,f,ql(f),y)}function eA(u){return Bw(u)&&u!=+u}function tA(u){if(fy(u))throw new rt(s);return kd(u)}function nA(u){return u===null}function rA(u){return u==null}function Bw(u){return typeof u=="number"||gn(u)&&Dn(u)==Ut}function dp(u){if(!gn(u)||Dn(u)!=it)return!1;var f=mi(u);if(f===null)return!0;var y=St.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&kl.call(y)==ec}var Iy=Wu?Tr(Wu):Nl;function iA(u){return zw(u)&&u>=-V&&u<=V}var Vw=ma?Tr(ma):Ui;function ng(u){return typeof u=="string"||!st(u)&&gn(u)&&Dn(u)==Rt}function Ci(u){return typeof u=="symbol"||gn(u)&&Dn(u)==Tn}var nf=Gh?Tr(Gh):Fl;function oA(u){return u===n}function sA(u){return gn(u)&&Fn(u)==Nt}function aA(u){return gn(u)&&Dn(u)==pe}var lA=Lc(qo),uA=Lc(function(u,f){return u<=f});function Uw(u){if(!u)return[];if(ti(u))return ng(u)?_r(u):or(u);if(co&&u[co])return ey(u[co]());var f=Fn(u),y=f==pt?Xu:f==_t?zo:rf;return y(u)}function Hs(u){if(!u)return u===0?u:0;if(u=Yi(u),u===X||u===-X){var f=u<0?-1:1;return f*ae}return u===u?u:0}function ct(u){var f=Hs(u),y=f%1;return f===f?y?f-y:f:0}function Kw(u){return u?po(ct(u),0,U):0}function Yi(u){if(typeof u=="number")return u;if(Ci(u))return M;if(fn(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=fn(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=Zh(u);var y=Ov.test(u);return y||Rh.test(u)?Uu(u.slice(2),y?2:8):$h.test(u)?M:+u}function Ww(u){return vi(u,ni(u))}function cA(u){return u?po(ct(u),-V,V):u===0?u:0}function At(u){return u==null?"":vr(u)}var fA=Oa(function(u,f){if(wo(f)||ti(f)){vi(f,Xn(f),u);return}for(var y in f)St.call(f,y)&&As(u,y,f[y])}),Hw=Oa(function(u,f){vi(f,ni(f),u)}),rg=Oa(function(u,f,y,E){vi(f,ni(f),u,E)}),dA=Oa(function(u,f,y,E){vi(f,Xn(f),u,E)}),pA=Gi(hc);function hA(u,f){var y=Ta(u);return f==null?y:jt(y,f)}var mA=ut(function(u,f){u=$t(u);var y=-1,E=f.length,I=E>2?f[2]:n;for(I&&ar(f[0],f[1],I)&&(E=1);++y1),F}),vi(u,Hl(u),y),E&&(y=gr(y,g|b|x,Ud));for(var I=f.length;I--;)Cc(y,f[I]);return y});function LA(u,f){return qw(u,Ee(qe(f)))}var MA=Gi(function(u,f){return u==null?{}:Td(u,f)});function qw(u,f){if(u==null)return{};var y=Lt(Hl(u),function(E){return[E]});return f=qe(f),Yo(u,y,function(E,I){return f(E,I[0])})}function DA(u,f,y){f=Wi(f,u);var E=-1,I=f.length;for(I||(I=1,u=n);++Ef){var E=u;u=f,f=E}if(y||u%1||f%1){var I=_l();return Un(u+I*(f-u+Zf("1e-"+((I+"").length-1))),f)}return Ma(u,f)}var HA=Fs(function(u,f,y){return f=f.toLowerCase(),u+(y?Qw(f):f)});function Qw(u){return Ry(At(u).toLowerCase())}function Jw(u){return u=At(u),u&&u.replace(Mh,nm).replace(Uh,"")}function GA(u,f,y){u=At(u),f=vr(f);var E=u.length;y=y===n?E:po(ct(y),0,E);var I=y;return y-=f.length,y>=0&&u.slice(y,I)==f}function qA(u){return u=At(u),u&&Mu.test(u)?u.replace(pi,rm):u}function YA(u){return u=At(u),u&&Ro.test(u)?u.replace(ys,"\\$&"):u}var XA=Fs(function(u,f,y){return u+(y?"-":"")+f.toLowerCase()}),QA=Fs(function(u,f,y){return u+(y?" ":"")+f.toLowerCase()}),JA=Fd("toLowerCase");function ZA(u,f,y){u=At(u),f=ct(f);var E=f?Cs(u):0;if(!f||E>=f)return u;var I=(f-E)/2;return Kl(jo(I),y)+u+Kl(Ps(I),y)}function eR(u,f,y){u=At(u),f=ct(f);var E=f?Cs(u):0;return f&&E>>0,y?(u=At(u),u&&(typeof f=="string"||f!=null&&!Iy(f))&&(f=vr(f),!f&&ya(u))?bo(_r(u),0,y):u.split(f,y)):[]}var aR=Fs(function(u,f,y){return u+(y?" ":"")+Ry(f)});function lR(u,f,y){return u=At(u),y=y==null?0:po(ct(y),0,u.length),f=vr(f),u.slice(y,y+f.length)==f}function uR(u,f,y){var E=N.templateSettings;y&&ar(u,f,y)&&(f=n),u=At(u),f=rg({},f,E,Bd);var I=rg({},f.imports,E.imports,Bd),F=Xn(I),q=wl(I,F),Z,se,ge=0,ve=f.interpolate||Du,we="__p += '",$e=Sl((f.escape||Du).source+"|"+ve.source+"|"+(ve===cl?Xe:Du).source+"|"+(f.evaluate||Du).source+"|$","g"),Ke="//# sourceURL="+(St.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Wv+"]")+` -`;u.replace($e,function(et,gt,xt,Ei,Mr,Pi){return xt||(xt=Ei),we+=u.slice(ge,Pi).replace(zv,im),gt&&(Z=!0,we+=`' + -__e(`+gt+`) + -'`),Mr&&(se=!0,we+=`'; -`+Mr+`; -__p += '`),xt&&(we+=`' + -((__t = (`+xt+`)) == null ? '' : __t) + -'`),ge=Pi+et.length,et}),we+=`'; -`;var Ze=St.call(f,"variable")&&f.variable;if(!Ze)we=`with (obj) { -`+we+` -} -`;else if(Wf.test(Ze))throw new rt(c);we=(se?we.replace(ln,""):we).replace(aa,"$1").replace(ms,"$1;"),we="function("+(Ze||"obj")+`) { -`+(Ze?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(Z?", __e = _.escape":"")+(se?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+we+`return __p -}`;var dt=e1(function(){return wt(F,Ke+"return "+we).apply(n,q)});if(dt.source=we,_y(dt))throw dt;return dt}function cR(u){return At(u).toLowerCase()}function fR(u){return At(u).toUpperCase()}function dR(u,f,y){if(u=At(u),u&&(y||f===n))return Zh(u);if(!u||!(f=vr(f)))return u;var E=_r(u),I=_r(f),F=em(E,I),q=fd(E,I)+1;return bo(E,F,q).join("")}function pR(u,f,y){if(u=At(u),u&&(y||f===n))return u.slice(0,Ju(u)+1);if(!u||!(f=vr(f)))return u;var E=_r(u),I=fd(E,_r(f))+1;return bo(E,0,I).join("")}function hR(u,f,y){if(u=At(u),u&&(y||f===n))return u.replace(dl,"");if(!u||!(f=vr(f)))return u;var E=_r(u),I=em(E,_r(f));return bo(E,I).join("")}function mR(u,f){var y=B,E=W;if(fn(f)){var I="separator"in f?f.separator:I;y="length"in f?ct(f.length):y,E="omission"in f?vr(f.omission):E}u=At(u);var F=u.length;if(ya(u)){var q=_r(u);F=q.length}if(y>=F)return u;var Z=y-Cs(E);if(Z<1)return E;var se=q?bo(q,0,Z).join(""):u.slice(0,Z);if(I===n)return se+E;if(q&&(Z+=se.length-Z),Iy(I)){if(u.slice(Z).search(I)){var ge,ve=se;for(I.global||(I=Sl(I.source,At(so.exec(I))+"g")),I.lastIndex=0;ge=I.exec(ve);)var we=ge.index;se=se.slice(0,we===n?Z:we)}}else if(u.indexOf(vr(I),Z)!=Z){var $e=se.lastIndexOf(I);$e>-1&&(se=se.slice(0,$e))}return se+E}function gR(u){return u=At(u),u&&ul.test(u)?u.replace(di,om):u}var vR=Fs(function(u,f,y){return u+(y?" ":"")+f.toUpperCase()}),Ry=Fd("toUpperCase");function Zw(u,f,y){return u=At(u),f=y?n:f,f===n?Zv(u)?ry(u):Xv(u):u.match(f)||[]}var e1=ut(function(u,f){try{return rr(u,n,f)}catch(y){return _y(y)?y:new rt(y)}}),yR=Gi(function(u,f){return Vn(f,function(y){y=wi(y),ji(u,y,ke(u[y],u))}),u});function bR(u){var f=u==null?0:u.length,y=qe();return u=f?Lt(u,function(E){if(typeof E[1]!="function")throw new Kr(a);return[y(E[0]),E[1]]}):[],ut(function(E){for(var I=-1;++IV)return[];var y=U,E=Un(u,U);f=qe(f),u-=U;for(var I=cd(E,f);++y0||f<0)?new ot(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),f!==n&&(f=ct(f),y=f<0?y.dropRight(-f):y.take(f-u)),y)},ot.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},ot.prototype.toArray=function(){return this.take(U)},Ar(ot.prototype,function(u,f){var y=/^(?:filter|find|map|reject)|While$/.test(f),E=/^(?:head|last)$/.test(f),I=N[E?"take"+(f=="last"?"Right":""):f],F=E||/^find/.test(f);I&&(N.prototype[f]=function(){var q=this.__wrapped__,Z=E?[1]:arguments,se=q instanceof ot,ge=Z[0],ve=se||st(q),we=function(gt){var xt=I.apply(N,Oo([gt],Z));return E&&$e?xt[0]:xt};ve&&y&&typeof ge=="function"&&ge.length!=1&&(se=ve=!1);var $e=this.__chain__,Ke=!!this.__actions__.length,Ze=F&&!$e,dt=se&&!Ke;if(!F&&ve){q=dt?q:new ot(this);var et=u.apply(q,Z);return et.__actions__.push({func:ki,args:[we],thisArg:n}),new Kn(et,$e)}return Ze&&dt?u.apply(this,Z):(et=this.thru(we),Ze?E?et.value()[0]:et.value():et)})}),Vn(["pop","push","shift","sort","splice","unshift"],function(u){var f=lo[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);N.prototype[u]=function(){var I=arguments;if(E&&!this.__chain__){var F=this.value();return f.apply(st(F)?F:[],I)}return this[y](function(q){return f.apply(st(q)?q:[],I)})}}),Ar(ot.prototype,function(u,f){var y=N[f];if(y){var E=y.name+"";St.call(Ea,E)||(Ea[E]=[]),Ea[E].push({name:f,func:y})}}),Ea[ja(n,_).name]=[{name:"wrapper",func:n}],ot.prototype.clone=uc,ot.prototype.reverse=yd,ot.prototype.value=_a,N.prototype.at=Yc,N.prototype.chain=Us,N.prototype.commit=Xc,N.prototype.next=ap,N.prototype.plant=wy,N.prototype.reverse=up,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=Sy,N.prototype.first=N.prototype.head,co&&(N.prototype[co]=lp),N},ba=iy();Mi?((Mi.exports=ba)._=ba,xl._=ba):Gt._=ba}).call(n7)}(Lp,Lp.exports)),Lp.exports}var L2=r7();class i7{plugins={};activePlugins=[];listeners=new Set;register(t){this.plugins[t.name]={isActivated:!1,config:t},this.notify()}activate(t){const n=this.plugins[t];!n||n.isActivated||(n.isActivated=!0,n.config.onActivate&&n.config.onActivate(),this.produceActivePlugins(),this.notify())}deactivate(t){const n=this.plugins[t];!n||!n.isActivated||(n.isActivated=!1,n.config.onDeactivate&&n.config.onDeactivate(),this.produceActivePlugins(),this.notify())}isPluginActivated(t){const n=this.plugins[t];return!!n&&n.isActivated}getPlugin(t){const n=this.plugins[t];return!n||!n.isActivated?null:n}getActivePlugins(){return this.activePlugins}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t())}produceActivePlugins(){this.activePlugins=L2.transform(this.plugins,(t,n)=>{n.isActivated&&t.push(n.config)},[])}}const xr=new i7;const M2="FeedbackFormPlugin",D2={name:M2,components:{FeedbackForm:S.lazy(()=>io(()=>import("./FeedbackForm-CmRSbYPS.js"),__vite__mapDeps([0,1,2,3,4,5,6])))}},N2="ChatOptionsPlugin",F2={name:N2,components:{ChatOptionsForm:S.lazy(()=>io(()=>import("./ChatOptionsForm-CNjzbIqN.js"),__vite__mapDeps([7,1,2,3,4,5,6])))}},O2=S.createContext(void 0),z2="SharePluginName",j2={name:z2,components:{ShareButton:S.lazy(()=>io(()=>import("./ShareButton-lYj0v67r.js"),__vite__mapDeps([8,6])))}},nC=e=>{let t;const n=new Set,r=(h,m)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const b=t;t=m??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(x=>x(t,b))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,i,c);return c},rC=e=>e?nC(e):nC,o7=e=>e;function B2(e,t=o7){const n=He.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return He.useDebugValue(n),n}const cr=[];for(let e=0;e<256;++e)cr.push((e+256).toString(16).slice(1));function s7(e,t=0){return(cr[e[t+0]]+cr[e[t+1]]+cr[e[t+2]]+cr[e[t+3]]+"-"+cr[e[t+4]]+cr[e[t+5]]+"-"+cr[e[t+6]]+cr[e[t+7]]+"-"+cr[e[t+8]]+cr[e[t+9]]+"-"+cr[e[t+10]]+cr[e[t+11]]+cr[e[t+12]]+cr[e[t+13]]+cr[e[t+14]]+cr[e[t+15]]).toLowerCase()}let w0;const a7=new Uint8Array(16);function l7(){if(!w0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");w0=crypto.getRandomValues.bind(crypto)}return w0(a7)}const u7=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),iC={randomUUID:u7};function V2(e,t,n){if(iC.randomUUID&&!e)return iC.randomUUID();e=e||{};const r=e.random??e.rng?.()??l7();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,s7(r)}function oC(e){return Object.values(e).map(t=>({role:t.role,content:t.content,extra:t.extra||null}))}var U2=Symbol.for("immer-nothing"),sC=Symbol.for("immer-draftable"),Ai=Symbol.for("immer-state");function _o(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Lf=Object.getPrototypeOf;function Mf(e){return!!e&&!!e[Ai]}function Tu(e){return e?K2(e)||Array.isArray(e)||!!e[sC]||!!e.constructor?.[sC]||Pv(e)||Tv(e):!1}var c7=Object.prototype.constructor.toString();function K2(e){if(!e||typeof e!="object")return!1;const t=Lf(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===c7}function rv(e,t){Ev(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Ev(e){const t=e[Ai];return t?t.type_:Array.isArray(e)?1:Pv(e)?2:Tv(e)?3:0}function Fb(e,t){return Ev(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function W2(e,t,n){const r=Ev(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function f7(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Pv(e){return e instanceof Map}function Tv(e){return e instanceof Set}function hu(e){return e.copy_||e.base_}function Ob(e,t){if(Pv(e))return new Map(e);if(Tv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=K2(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ai];let i=Reflect.ownKeys(r);for(let s=0;s1&&(e.set=e.add=e.clear=e.delete=d7),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>aw(r,!0))),e}function d7(){_o(2)}function _v(e){return Object.isFrozen(e)}var p7={};function _u(e){const t=p7[e];return t||_o(0,e),t}var lh;function H2(){return lh}function h7(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function aC(e,t){t&&(_u("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function zb(e){jb(e),e.drafts_.forEach(m7),e.drafts_=null}function jb(e){e===lh&&(lh=e.parent_)}function lC(e){return lh=h7(lh,e)}function m7(e){const t=e[Ai];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function uC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ai].modified_&&(zb(t),_o(4)),Tu(e)&&(e=iv(t,e),t.parent_||ov(t,e)),t.patches_&&_u("Patches").generateReplacementPatches_(n[Ai].base_,e,t.patches_,t.inversePatches_)):e=iv(t,n,[]),zb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==U2?e:void 0}function iv(e,t,n){if(_v(t))return t;const r=t[Ai];if(!r)return rv(t,(i,s)=>cC(e,r,t,i,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ov(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let s=i,a=!1;r.type_===3&&(s=new Set(i),i.clear(),a=!0),rv(s,(c,d)=>cC(e,r,i,c,d,n,a)),ov(e,i,!1),n&&e.patches_&&_u("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function cC(e,t,n,r,i,s,a){if(Mf(i)){const c=s&&t&&t.type_!==3&&!Fb(t.assigned_,r)?s.concat(r):void 0,d=iv(e,i,c);if(W2(n,r,d),Mf(d))e.canAutoFreeze_=!1;else return}else a&&n.add(i);if(Tu(i)&&!_v(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;iv(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&ov(e,i)}}function ov(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&aw(t,n)}function g7(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:H2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=lw;n&&(i=[r],s=uh);const{revoke:a,proxy:c}=Proxy.revocable(i,s);return r.draft_=c,r.revoke_=a,c}var lw={get(e,t){if(t===Ai)return e;const n=hu(e);if(!Fb(n,t))return v7(e,n,t);const r=n[t];return e.finalized_||!Tu(r)?r:r===S0(e.base_,t)?(k0(e),e.copy_[t]=Vb(r,e)):r},has(e,t){return t in hu(e)},ownKeys(e){return Reflect.ownKeys(hu(e))},set(e,t,n){const r=G2(hu(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=S0(hu(e),t),s=i?.[Ai];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(f7(n,i)&&(n!==void 0||Fb(e.base_,t)))return!0;k0(e),Bb(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return S0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,k0(e),Bb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=hu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){_o(11)},getPrototypeOf(e){return Lf(e.base_)},setPrototypeOf(){_o(12)}},uh={};rv(lw,(e,t)=>{uh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});uh.deleteProperty=function(e,t){return uh.set.call(this,e,t,void 0)};uh.set=function(e,t,n){return lw.set.call(this,e[0],t,n,e[0])};function S0(e,t){const n=e[Ai];return(n?hu(n):e)[t]}function v7(e,t,n){const r=G2(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function G2(e,t){if(!(t in e))return;let n=Lf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Lf(n)}}function Bb(e){e.modified_||(e.modified_=!0,e.parent_&&Bb(e.parent_))}function k0(e){e.copy_||(e.copy_=Ob(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var y7=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const a=this;return function(d=s,...h){return a.produce(d,m=>n.call(this,m,...h))}}typeof n!="function"&&_o(6),r!==void 0&&typeof r!="function"&&_o(7);let i;if(Tu(t)){const s=lC(this),a=Vb(t,void 0);let c=!0;try{i=n(a),c=!1}finally{c?zb(s):jb(s)}return aC(s,r),uC(i,s)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===U2&&(i=void 0),this.autoFreeze_&&aw(i,!0),r){const s=[],a=[];_u("Patches").generateReplacementPatches_(t,i,s,a),r(s,a)}return i}else _o(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(a,...c)=>this.produceWithPatches(a,d=>t(d,...c));let r,i;return[this.produce(t,n,(a,c)=>{r=a,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Tu(e)||_o(8),Mf(e)&&(e=b7(e));const t=lC(this),n=Vb(e,void 0);return n[Ai].isManual_=!0,jb(t),n}finishDraft(e,t){const n=e&&e[Ai];(!n||!n.isManual_)&&_o(9);const{scope_:r}=n;return aC(r,t),uC(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=_u("Patches").applyPatches_;return Mf(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Vb(e,t){const n=Pv(e)?_u("MapSet").proxyMap_(e,t):Tv(e)?_u("MapSet").proxySet_(e,t):g7(e,t);return(t?t.scope_:H2()).drafts_.push(n),n}function b7(e){return Mf(e)||_o(10,e),q2(e)}function q2(e){if(!Tu(e)||_v(e))return e;const t=e[Ai];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ob(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ob(e,!0);return rv(n,(r,i)=>{W2(n,r,q2(i))}),t&&(t.finalized_=!1),n}var Ri=new y7,kh=Ri.produce;Ri.produceWithPatches.bind(Ri);Ri.setAutoFreeze.bind(Ri);Ri.setUseStrictShallowCopy.bind(Ri);Ri.applyPatches.bind(Ri);Ri.createDraft.bind(Ri);Ri.finishDraft.bind(Ri);const x7=e=>(t,n,r)=>(r.setState=(i,s,...a)=>{const c=typeof i=="function"?kh(i):i;return t(c,s,...a)},e(r.setState,n,r)),w7=x7,S7=({content:e},t)=>{t.serverState=e},k7=({content:e},t,n)=>{const r=n.conversationIdRef.current;return t.conversationId=e.conversation_id,n.conversationIdRef.current=e.conversation_id,{originalConversationId:r}},C7=(e,t,{originalConversationId:n,conversationIdRef:r})=>{const i=t.conversations[n];if(!i)throw new Error("Received events for non-existent conversation");t.conversations[r.current]=i,t.currentConversation===n&&(t.currentConversation=r.current),delete t.conversations[n]},E7=({content:e},t)=>{t.followupMessages=e.messages},P7=({content:e},t)=>{t.summary=e.summary},T7=(e,t,n)=>{const r=t.history[n.messageId];r.hasConfirmationBreak&&(r.hasConfirmationBreak=!1,r.content.endsWith(` - -`)||(r.content+=` - -`)),r.content+=e.content.text},_7=(e,t,n)=>{const r=t.history[n.messageId];r.references=[...r.references??[],e.content]},I7=(e,t,n)=>{const r=t.history[n.messageId];r.serverId=e.content.message_id},$7=(e,t,n)=>{const r=t.history[n.messageId],{update_id:i,content:s,type:a}=e.content,c=kh(r.liveUpdates??{},d=>{a===Hz.Start&&i in d&&console.error(`Got duplicate start event for update_id: ${i}. Ignoring the event.`),d[i]=s});r.liveUpdates=c},A7=(e,t,n)=>{const r=t.history[n.messageId],i=e.content;r.images=kh(r.images??{},s=>{s[i.id]&&console.error(`Got duplicate image event for image_id: ${i.id}. Ignoring the event.`),s[i.id]=i.url})},R7=(e,t,n)=>{const r=t.history[n.messageId];t.history[n.messageId]={id:r.id,role:r.role,content:""}},L7=(e,t,n)=>{const r=t.history[n.messageId];r.usage=e.content.usage},M7=({content:e},t,n)=>{const r=t.history[n.messageId],i=r.tasks??[],s=e.task,a=kh(i,c=>{const d=c.findIndex(h=>h.id===s.id);d===-1?c.push(s):c[d]=s});r.tasks=a},D7=(e,t,n)=>{const r=t.history[n.messageId],i=e.content.confirmation_request.confirmation_id;r.confirmationRequests||(r.confirmationRequests={}),r.confirmationStates||(r.confirmationStates={}),!(i in r.confirmationRequests)&&(r.confirmationRequests[i]=e.content.confirmation_request,r.confirmationStates[i]="pending")},N7=(e,t,n)=>{const r=t.history[n.messageId];r.error=e.content.message};class F7{handlers=new Map;register(t,n){this.handlers.has(t)&&console.warn(`Handler for ${String(t)} already registered - overwriting.`),this.handlers.set(t,n)}get(t){const n=this.handlers.get(t);return n||(console.warn(`No handler registered for type: ${String(t)}`),console.warn("Continuing with empty handler..."),{handle:()=>{},after:()=>{}})}}const Br=new F7;Br.register("state_update",{handle:S7});Br.register("conversation_id",{handle:k7,after:C7});Br.register("followup_messages",{handle:E7});Br.register("text",{handle:T7});Br.register("reference",{handle:_7});Br.register("message_id",{handle:I7});Br.register("live_update",{handle:$7});Br.register("image",{handle:A7});Br.register("clear_message",{handle:R7});Br.register("usage",{handle:L7});Br.register("todo_item",{handle:M7});Br.register("conversation_summary",{handle:P7});Br.register("confirmation_request",{handle:D7});Br.register("error",{handle:N7});const Y2="temp-",X2=()=>`${Y2}${V2()}`,Ub=()=>({history:{},followupMessages:null,serverState:null,conversationId:X2(),eventsLog:[],lastMessageId:null,context:void 0,chatOptions:void 0,isLoading:!1,abortController:null}),O7=()=>{const e=Ub();return{conversations:{[e.conversationId]:e},currentConversation:e.conversationId}},Ti=(e,t)=>n=>{const r=n.conversations[e];if(!r)throw new Error(`Conversation with ID '${e}' does not exist`);t(r)},fC=e=>e.startsWith(Y2),dC=w7((e,t)=>({...O7(),computed:{getContext:()=>{const{primitives:{getCurrentConversation:n}}=t(),r=n(),{serverState:i,conversationId:s,chatOptions:a}=r;return{...i??{},...s&&!fC(r.conversationId)?{conversation_id:s}:{},...a?{user_settings:a}:{}}}},_internal:{_hasHydrated:!1,_setHasHydrated:n=>{e(r=>{r._internal._hasHydrated=n})},handleResponse:(n,r,i)=>{let s;const a=Br.get(i.type);e(Ti(n.current,c=>{if(!c.history[r])throw new Error(`Message ID ${r} not found in history`);s=a.handle(i,c,{conversationIdRef:n,messageId:r})})),e(c=>{a.after?.(i,c,{conversationIdRef:n,messageId:r,...s})}),e(Ti(n.current,c=>{c.eventsLog[c.eventsLog.length-1].push(i)}))}},primitives:{getCurrentConversation:()=>{const{currentConversation:n,conversations:r}=t(),i=r[n];if(!i)throw new Error("Tried to get conversation that doesn't exist.");return i},restore:(n,r,i,s)=>{const a=X2(),c={...Ub(),followupMessages:r,chatOptions:i,serverState:s,history:n,conversationId:a},d=Object.values(n).filter(h=>h.role!==Sf.User);c.eventsLog=d.map(()=>[]),e(h=>{h.conversations[a]=c,h.currentConversation=a})},addMessage:(n,r)=>{const i=V2(),s={...r,id:i};return e(Ti(n,a=>{a.followupMessages=null,a.lastMessageId=i,a.history[i]=s})),i},deleteMessage:(n,r)=>{e(Ti(n,i=>{const{history:s}=i,a=Object.keys(s);a.at(-1)===r&&(i.lastMessageId=a.at(-2)??null),delete i.history[r]}))},stopAnswering:n=>{const r=t().conversations[n];if(!r)throw new Error("Tried to stop answering for conversation that doesn't exist");r.abortController?.abort(),e(Ti(n,i=>{i.abortController=null,i.isLoading=!1}))}},actions:{selectConversation:n=>{e(r=>{if(r.currentConversation===n)return;if(!r.conversations[n])throw new Error(`Tried to select conversation that doesn't exist, id: ${n}`);r.currentConversation=n})},deleteConversation:n=>{const{actions:{newConversation:r},primitives:{stopAnswering:i},currentConversation:s}=t();if(i(n),e(a=>{delete a.conversations[n]}),n===s)return r()},mergeExtensions:(n,r)=>{const{currentConversation:i}=t();e(Ti(i,s=>{if(!(n in s.history))throw new Error("Attempted to set extensions for a message that does not exist.");const a=s.history[n];a.extensions={...a.extensions,...r},s.history[n]=a}))},initializeChatOptions:n=>{const{currentConversation:r}=t();e(Ti(r,i=>{const s=i.chatOptions??{};Object.keys(s).forEach(a=>{a in n||delete s[a]}),Object.keys(n).forEach(a=>{a in s||(s[a]=n[a])}),i.chatOptions=s}))},setConversationProperties:(n,r)=>{e(Ti(n,i=>{Object.assign(i,r)}))},stopAnswering:()=>{const{currentConversation:n,primitives:{stopAnswering:r}}=t();r(n)},newConversation:()=>{const n=Ub();return e(r=>{r.conversations[n.conversationId]=n,r.currentConversation=n.conversationId,r.conversations=L2.omitBy(r.conversations,i=>fC(i.conversationId)&&i.conversationId!==r.currentConversation)}),n.conversationId},sendMessage:(n,r,i)=>{const{_internal:{handleResponse:s},primitives:{addMessage:a,getCurrentConversation:c,stopAnswering:d},computed:{getContext:h}}=t(),{history:m,conversationId:g}=c();a(g,{role:Sf.User,content:n});const b=a(g,{role:Sf.Assistant,content:""}),x={message:n,history:oC(m),context:{...h(),...i}};e(Ti(g,T=>{T.eventsLog.push([])}));const k=new AbortController,P={current:g};e(Ti(g,T=>{T.abortController=k,T.isLoading=!0})),r.makeStreamRequest("/api/chat",x,{onMessage:T=>s(P,b,T),onError:T=>{s(P,b,{type:"text",content:{text:T.message}}),d(P.current)},onClose:()=>{d(P.current)}},k.signal)},sendSilentConfirmation:(n,r,i,s)=>{const{_internal:{handleResponse:a},primitives:{getCurrentConversation:c,stopAnswering:d},computed:{getContext:h}}=t(),{history:m,conversationId:g}=c(),b=Array.isArray(r)?r:[r],x=typeof i=="boolean"?b.reduce((L,O)=>({...L,[O]:i}),{}):i;e(Ti(g,L=>{const O=L.history[n];O&&O.confirmationStates&&(b.forEach(j=>{j in O.confirmationStates&&(O.confirmationStates[j]=x[j]?"confirmed":"declined")}),O.hasConfirmationBreak=!0,O.liveUpdates=void 0)}));const k=n,P=b.map(L=>({confirmation_id:L,confirmed:x[L]})),T={message:"",history:oC(m),context:{...h(),confirmed_tools:P}};e(Ti(g,L=>{L.eventsLog.push([])}));const _=new AbortController,A={current:g};e(Ti(g,L=>{L.abortController=_,L.isLoading=!0})),s.makeStreamRequest("/api/chat",T,{onMessage:L=>a(A,k,L),onError:L=>{a(A,k,{type:"text",content:{text:L.message}}),d(A.current)},onClose:()=>{d(A.current)}},_.signal)}}}));function Q2(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const a=d=>d===null?null:JSON.parse(d,void 0),c=(s=n.getItem(i))!=null?s:null;return c instanceof Promise?c.then(a):a(c)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,void 0)),removeItem:i=>n.removeItem(i)}}const Kb=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Kb(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Kb(r)(n)}}}},z7=(e,t)=>(n,r,i)=>{let s={storage:Q2(()=>localStorage),partialize:P=>P,version:0,merge:(P,T)=>({...T,...P}),...t},a=!1;const c=new Set,d=new Set;let h=s.storage;if(!h)return e((...P)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...P)},r,i);const m=()=>{const P=s.partialize({...r()});return h.setItem(s.name,{state:P,version:s.version})},g=i.setState;i.setState=(P,T)=>{g(P,T),m()};const b=e((...P)=>{n(...P),m()},r,i);i.getInitialState=()=>b;let x;const k=()=>{var P,T;if(!h)return;a=!1,c.forEach(A=>{var L;return A((L=r())!=null?L:b)});const _=((T=s.onRehydrateStorage)==null?void 0:T.call(s,(P=r())!=null?P:b))||void 0;return Kb(h.getItem.bind(h))(s.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==s.version){if(s.migrate){const L=s.migrate(A.state,A.version);return L instanceof Promise?L.then(O=>[!0,O]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var L;const[O,j]=A;if(x=s.merge(j,(L=r())!=null?L:b),n(x,!0),O)return m()}).then(()=>{_?.(x,void 0),x=r(),a=!0,d.forEach(A=>A(x))}).catch(A=>{_?.(void 0,A)})};return i.persist={setOptions:P=>{s={...s,...P},P.storage&&(h=P.storage)},clearStorage:()=>{h?.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>k(),hasHydrated:()=>a,onHydrate:P=>(c.add(P),()=>{c.delete(P)}),onFinishHydration:P=>(d.add(P),()=>{d.delete(P)})},s.skipHydration||k(),x||b},j7=z7;function Iv(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function B7(e,t){let n;const r=()=>{if(n)return n;const i=indexedDB.open(e);return i.onupgradeneeded=()=>i.result.createObjectStore(t),n=Iv(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(t,i).objectStore(t)))}let C0;function uw(){return C0||(C0=B7("keyval-store","keyval")),C0}function V7(e,t=uw()){return t("readonly",n=>Iv(n.get(e)))}function U7(e,t,n=uw()){return n("readwrite",r=>(r.put(t,e),Iv(r.transaction)))}function K7(e,t=uw()){return t("readwrite",n=>(n.delete(e),Iv(n.transaction)))}const W7={getItem:async e=>await V7(e)||null,setItem:async(e,t)=>{await U7(e,t)},removeItem:async e=>{await K7(e)}},J2=S.createContext(null);function Z2(){return D.jsx("div",{className:yn("bg-background flex h-screen w-screen items-start justify-center"),children:D.jsxs("div",{className:"text-default-900 m-auto flex flex-col items-center gap-4",children:[D.jsx(o2,{size:"lg","aria-label":"Progress indicator"}),D.jsx("p",{children:"Initializing..."})]})})}const pC="ragbits-history-store";function H7(e,t){if(e)return rC(j7(dC,{name:t,partialize:r=>({conversations:r.conversations}),onRehydrateStorage:r=>()=>r._internal._setHasHydrated(!0),merge:(r,i)=>{const s=r?.conversations??{},{conversations:a,currentConversation:c}=i,d=Object.values(s).reduce((h,m)=>(m.conversationId===null||(h[m.conversationId]={...m,isLoading:!1,abortController:null}),h),{});return{...i,currentConversation:c,conversations:{...d,...a}}},storage:Q2(()=>W7)}));const n=rC(dC);return n.getState()._internal._setHasHydrated(!0),n}function G7({children:e,shouldStoreHistory:t}){const[n,r]=S.useState(pC),i=S.useMemo(()=>H7(t,n),[t,n]),s=B2(i,d=>d._internal._hasHydrated),a=d=>{r(`${pC}-${d}`)},c=S.useMemo(()=>({store:i,initializeUserStore:a}),[i]);return t&&!s?D.jsx(Z2,{}):D.jsx(J2.Provider,{value:c,children:e})}/** - * react-router v7.7.1 - * - * 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 - */var hC="popstate";function q7(e={}){function t(r,i){let{pathname:s,search:a,hash:c}=r.location;return Wb("",{pathname:s,search:a,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ch(i)}return X7(t,n,null,e)}function Mn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $o(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Y7(){return Math.random().toString(36).substring(2,10)}function mC(e,t){return{usr:e.state,key:e.key,idx:t}}function Wb(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ch(t):t,state:n,key:t&&t.key||r||Y7()}}function ch({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ch(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function X7(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,c="POP",d=null,h=m();h==null&&(h=0,a.replaceState({...a.state,idx:h},""));function m(){return(a.state||{idx:null}).idx}function g(){c="POP";let T=m(),_=T==null?null:T-h;h=T,d&&d({action:c,location:P.location,delta:_})}function b(T,_){c="PUSH";let A=Wb(P.location,T,_);h=m()+1;let L=mC(A,h),O=P.createHref(A);try{a.pushState(L,"",O)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(O)}s&&d&&d({action:c,location:P.location,delta:1})}function x(T,_){c="REPLACE";let A=Wb(P.location,T,_);h=m();let L=mC(A,h),O=P.createHref(A);a.replaceState(L,"",O),s&&d&&d({action:c,location:P.location,delta:0})}function k(T){return Q7(T)}let P={get action(){return c},get location(){return e(i,a)},listen(T){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(hC,g),d=T,()=>{i.removeEventListener(hC,g),d=null}},createHref(T){return t(i,T)},createURL:k,encodeLocation(T){let _=k(T);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:b,replace:x,go(T){return a.go(T)}};return P}function Q7(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Mn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ch(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function eI(e,t,n="/"){return J7(e,t,n,!1)}function J7(e,t,n,r){let i=typeof t=="string"?Ch(t):t,s=ra(i.pathname||"/",n);if(s==null)return null;let a=tI(e);Z7(a);let c=null;for(let d=0;c==null&&d{let d={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};d.relativePath.startsWith("/")&&(Mn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length));let h=ea([r,d.relativePath]),m=n.concat(d);s.children&&s.children.length>0&&(Mn(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),tI(s.children,t,m,h)),!(s.path==null&&!s.index)&&t.push({path:h,score:sj(h,s.index),routesMeta:m})};return e.forEach((s,a)=>{if(s.path===""||!s.path?.includes("?"))i(s,a);else for(let c of nI(s.path))i(s,a,c)}),t}function nI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=nI(r.join("/")),c=[];return c.push(...a.map(d=>d===""?s:[s,d].join("/"))),i&&c.push(...a),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function Z7(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:aj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var ej=/^:[\w-]+$/,tj=3,nj=2,rj=1,ij=10,oj=-2,gC=e=>e==="*";function sj(e,t){let n=e.split("/"),r=n.length;return n.some(gC)&&(r+=oj),t&&(r+=nj),n.filter(i=>!gC(i)).reduce((i,s)=>i+(ej.test(s)?tj:s===""?rj:ij),r)}function aj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function lj(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",a=[];for(let c=0;c{if(m==="*"){let k=c[b]||"";a=s.slice(0,s.length-k.length).replace(/(.)\/+$/,"$1")}const x=c[b];return g&&!x?h[m]=void 0:h[m]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:a,pattern:e}}function uj(e,t=!1,n=!0){$o(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function cj(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $o(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ra(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)||"/"}function fj(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ch(e):e;return{pathname:n?n.startsWith("/")?n:dj(n,t):t,search:mj(r),hash:gj(i)}}function dj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function E0(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 and the router will parse it for you.`}function pj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function cw(e){let t=pj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function fw(e,t,n,r=!1){let i;typeof e=="string"?i=Ch(e):(i={...e},Mn(!i.pathname||!i.pathname.includes("?"),E0("?","pathname","search",i)),Mn(!i.pathname||!i.pathname.includes("#"),E0("#","pathname","hash",i)),Mn(!i.search||!i.search.includes("#"),E0("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,c;if(a==null)c=n;else{let g=t.length-1;if(!r&&a.startsWith("..")){let b=a.split("/");for(;b[0]==="..";)b.shift(),g-=1;i.pathname=b.join("/")}c=g>=0?t[g]:"/"}let d=fj(i,c),h=a&&a!=="/"&&a.endsWith("/"),m=(s||a===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||m)&&(d.pathname+="/"),d}var ea=e=>e.join("/").replace(/\/\/+/g,"/"),hj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),mj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function vj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var rI=["POST","PUT","PATCH","DELETE"];new Set(rI);var yj=["GET",...rI];new Set(yj);var jf=S.createContext(null);jf.displayName="DataRouter";var $v=S.createContext(null);$v.displayName="DataRouterState";S.createContext(!1);var iI=S.createContext({isTransitioning:!1});iI.displayName="ViewTransition";var bj=S.createContext(new Map);bj.displayName="Fetchers";var xj=S.createContext(null);xj.displayName="Await";var Ao=S.createContext(null);Ao.displayName="Navigation";var Av=S.createContext(null);Av.displayName="Location";var oo=S.createContext({outlet:null,matches:[],isDataRoute:!1});oo.displayName="Route";var dw=S.createContext(null);dw.displayName="RouteError";function wj(e,{relative:t}={}){Mn(Bf(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=S.useContext(Ao),{hash:i,pathname:s,search:a}=Eh(e,{relative:t}),c=s;return n!=="/"&&(c=s==="/"?n:ea([n,s])),r.createHref({pathname:c,search:a,hash:i})}function Bf(){return S.useContext(Av)!=null}function al(){return Mn(Bf(),"useLocation() may be used only in the context of a component."),S.useContext(Av).location}var oI="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function sI(e){S.useContext(Ao).static||S.useLayoutEffect(e)}function pw(){let{isDataRoute:e}=S.useContext(oo);return e?Nj():Sj()}function Sj(){Mn(Bf(),"useNavigate() may be used only in the context of a component.");let e=S.useContext(jf),{basename:t,navigator:n}=S.useContext(Ao),{matches:r}=S.useContext(oo),{pathname:i}=al(),s=JSON.stringify(cw(r)),a=S.useRef(!1);return sI(()=>{a.current=!0}),S.useCallback((d,h={})=>{if($o(a.current,oI),!a.current)return;if(typeof d=="number"){n.go(d);return}let m=fw(d,JSON.parse(s),i,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ea([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,s,i,e])}var kj=S.createContext(null);function Cj(e){let t=S.useContext(oo).outlet;return t&&S.createElement(kj.Provider,{value:e},t)}function aI(){let{matches:e}=S.useContext(oo),t=e[e.length-1];return t?t.params:{}}function Eh(e,{relative:t}={}){let{matches:n}=S.useContext(oo),{pathname:r}=al(),i=JSON.stringify(cw(n));return S.useMemo(()=>fw(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Ej(e,t){return lI(e)}function lI(e,t,n,r){Mn(Bf(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=S.useContext(Ao),{matches:s}=S.useContext(oo),a=s[s.length-1],c=a?a.params:{},d=a?a.pathname:"/",h=a?a.pathnameBase:"/",m=a&&a.route;{let _=m&&m.path||"";uI(d,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${d}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let g=al(),b;b=g;let x=b.pathname||"/",k=x;if(h!=="/"){let _=h.replace(/^\//,"").split("/");k="/"+x.replace(/^\//,"").split("/").slice(_.length).join("/")}let P=eI(e,{pathname:k});return $o(m||P!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),$o(P==null||P[P.length-1].route.element!==void 0||P[P.length-1].route.Component!==void 0||P[P.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),$j(P&&P.map(_=>Object.assign({},_,{params:Object.assign({},c,_.params),pathname:ea([h,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?h:ea([h,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),s,n,r)}function Pj(){let e=Dj(),t=vj(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:s},"ErrorBoundary")," or"," ",S.createElement("code",{style:s},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:i},n):null,a)}var Tj=S.createElement(Pj,null),_j=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?S.createElement(oo.Provider,{value:this.props.routeContext},S.createElement(dw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Ij({routeContext:e,match:t,children:n}){let r=S.useContext(jf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(oo.Provider,{value:e},n)}function $j(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,s=n?.errors;if(s!=null){let d=i.findIndex(h=>h.route.id&&s?.[h.route.id]!==void 0);Mn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,d+1))}let a=!1,c=-1;if(n)for(let d=0;d=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((d,h,m)=>{let g,b=!1,x=null,k=null;n&&(g=s&&h.route.id?s[h.route.id]:void 0,x=h.route.errorElement||Tj,a&&(c<0&&m===0?(uI("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,k=null):c===m&&(b=!0,k=h.route.hydrateFallbackElement||null)));let P=t.concat(i.slice(0,m+1)),T=()=>{let _;return g?_=x:b?_=k:h.route.Component?_=S.createElement(h.route.Component,null):h.route.element?_=h.route.element:_=d,S.createElement(Ij,{match:h,routeContext:{outlet:d,matches:P,isDataRoute:n!=null},children:_})};return n&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?S.createElement(_j,{location:n.location,revalidation:n.revalidation,component:x,error:g,children:T(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):T()},null)}function hw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Aj(e){let t=S.useContext(jf);return Mn(t,hw(e)),t}function Rj(e){let t=S.useContext($v);return Mn(t,hw(e)),t}function Lj(e){let t=S.useContext(oo);return Mn(t,hw(e)),t}function mw(e){let t=Lj(e),n=t.matches[t.matches.length-1];return Mn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Mj(){return mw("useRouteId")}function Dj(){let e=S.useContext(dw),t=Rj("useRouteError"),n=mw("useRouteError");return e!==void 0?e:t.errors?.[n]}function Nj(){let{router:e}=Aj("useNavigate"),t=mw("useNavigate"),n=S.useRef(!1);return sI(()=>{n.current=!0}),S.useCallback(async(i,s={})=>{$o(n.current,oI),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var vC={};function uI(e,t,n){!t&&!vC[e]&&(vC[e]=!0,$o(!1,n))}S.memo(Fj);function Fj({routes:e,future:t,state:n}){return lI(e,void 0,n,t)}function eq({to:e,replace:t,state:n,relative:r}){Mn(Bf()," may be used only in the context of a component.");let{static:i}=S.useContext(Ao);$o(!i," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:s}=S.useContext(oo),{pathname:a}=al(),c=pw(),d=fw(e,cw(s),a,r==="path"),h=JSON.stringify(d);return S.useEffect(()=>{c(JSON.parse(h),{replace:t,state:n,relative:r})},[c,h,r,t,n]),null}function Oj(e){return Cj(e.context)}function zj({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){Mn(!Bf(),"You cannot render a inside another . You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),c=S.useMemo(()=>({basename:a,navigator:i,static:s,future:{}}),[a,i,s]);typeof n=="string"&&(n=Ch(n));let{pathname:d="/",search:h="",hash:m="",state:g=null,key:b="default"}=n,x=S.useMemo(()=>{let k=ra(d,a);return k==null?null:{location:{pathname:k,search:h,hash:m,state:g,key:b},navigationType:r}},[a,d,h,m,g,b,r]);return $o(x!=null,` is not able to match the URL "${d}${h}${m}" because it does not start with the basename, so the won't render anything.`),x==null?null:S.createElement(Ao.Provider,{value:c},S.createElement(Av.Provider,{children:t,value:x}))}var Fg="get",Og="application/x-www-form-urlencoded";function Rv(e){return e!=null&&typeof e.tagName=="string"}function jj(e){return Rv(e)&&e.tagName.toLowerCase()==="button"}function Bj(e){return Rv(e)&&e.tagName.toLowerCase()==="form"}function Vj(e){return Rv(e)&&e.tagName.toLowerCase()==="input"}function Uj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kj(e,t){return e.button===0&&(!t||t==="_self")&&!Uj(e)}var Sg=null;function Wj(){if(Sg===null)try{new FormData(document.createElement("form"),0),Sg=!1}catch{Sg=!0}return Sg}var Hj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function P0(e){return e!=null&&!Hj.has(e)?($o(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Og}"`),null):e}function Gj(e,t){let n,r,i,s,a;if(Bj(e)){let c=e.getAttribute("action");r=c?ra(c,t):null,n=e.getAttribute("method")||Fg,i=P0(e.getAttribute("enctype"))||Og,s=new FormData(e)}else if(jj(e)||Vj(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a