diff --git a/admin/index.html b/admin/index.html
new file mode 100644
index 0000000..57f6d17
--- /dev/null
+++ b/admin/index.html
@@ -0,0 +1,575 @@
+
+
+
+
+
+ Navi — Admin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/debug/eval/index.html b/debug/eval/index.html
index 24aabb1..51e803b 100644
--- a/debug/eval/index.html
+++ b/debug/eval/index.html
@@ -248,6 +248,7 @@
diff --git a/debug/index.html b/debug/index.html
index c56543b..569d37a 100644
--- a/debug/index.html
+++ b/debug/index.html
@@ -86,6 +86,12 @@
align-items: center;
gap: 8px;
}
+ .header-right a {
+ color: var(--text2);
+ text-decoration: none;
+ font-size: 12px;
+ }
+ .header-right a:hover { color: var(--text); }
input, button, select {
font-family: inherit;
@@ -425,11 +431,15 @@
+ Admin
+ Eval
diff --git a/navi/api/routes/admin.py b/navi/api/routes/admin.py
index beaa760..4fa7b85 100644
--- a/navi/api/routes/admin.py
+++ b/navi/api/routes/admin.py
@@ -22,22 +22,82 @@
async def admin_list_sessions(
store: Annotated[SessionStore, Depends(get_session_store)],
user: Annotated[User, Depends(require_admin)],
+ limit: int = 50,
+ offset: int = 0,
+ search: str | None = None,
+ sort_by: str = "last_active",
+ sort_order: str = "desc",
):
- """Return all sessions across all users."""
- sessions = await store.list_all(user_id=user.id, is_admin=True)
- return [
- {
- "session_id": s.id,
- "profile_id": s.profile_id,
- "user_id": s.user_id,
- "name": s.name,
- "message_count": len(s.messages),
- "pinned": s.pinned,
- "created_at": s.created_at.isoformat(),
- "last_active": s.last_active.isoformat(),
- }
- for s in sessions
- ]
+ """Return all sessions across all users with pagination, search and sorting."""
+ sessions = await store.search_list(
+ limit=limit,
+ offset=offset,
+ user_id=user.id,
+ is_admin=True,
+ search=search or None,
+ sort_by=sort_by,
+ sort_order=sort_order,
+ )
+ total = await store.count_all(
+ user_id=user.id, is_admin=True, search=search or None
+ )
+ return {
+ "total": total,
+ "limit": limit,
+ "offset": offset,
+ "items": [
+ {
+ "session_id": s.id,
+ "profile_id": s.profile_id,
+ "user_id": s.user_id,
+ "name": s.name,
+ "message_count": len(s.messages),
+ "pinned": s.pinned,
+ "created_at": s.created_at.isoformat(),
+ "last_active": s.last_active.isoformat(),
+ }
+ for s in sessions
+ ],
+ }
+
+
+@router.get("/sessions/{session_id}")
+async def admin_get_session(
+ session_id: str,
+ store: Annotated[SessionStore, Depends(get_session_store)],
+ user: Annotated[User, Depends(require_admin)],
+) -> dict:
+ """Return full session details including messages."""
+ session = await store.get(session_id)
+ if session is None:
+ raise HTTPException(status_code=404, detail="Session not found")
+ return {
+ "session_id": session.id,
+ "profile_id": session.profile_id,
+ "user_id": session.user_id,
+ "name": session.name,
+ "messages": [m.model_dump(mode="json", exclude_none=True) for m in session.messages],
+ "context_token_count": session.context_token_count,
+ "max_context_tokens": settings.ollama_num_ctx,
+ "pinned": session.pinned,
+ "created_at": session.created_at.isoformat(),
+ "last_active": session.last_active.isoformat(),
+ }
+
+
+@router.delete("/sessions/{session_id}", status_code=204)
+async def admin_delete_session(
+ session_id: str,
+ store: Annotated[SessionStore, Depends(get_session_store)],
+ user: Annotated[User, Depends(require_admin)],
+) -> None:
+ """Delete any session (bypass ownership)."""
+ from navi.session_files import delete_session_dir
+
+ deleted = await store.delete(session_id)
+ if not deleted:
+ raise HTTPException(status_code=404, detail="Session not found")
+ await delete_session_dir(session_id)
@router.get("/users")
@@ -65,6 +125,55 @@
]
+@router.get("/users/{user_id}")
+async def admin_get_user(
+ user_id: str,
+ store: Annotated[SessionStore, Depends(get_session_store)],
+ user: Annotated[User, Depends(require_admin)],
+) -> dict:
+ """Return single user details."""
+ pool = await store._get_pool()
+ async with pool.acquire() as conn:
+ row = await conn.fetchrow(
+ "SELECT id, email, display_name, role, permissions, created_at, updated_at FROM navi_users WHERE id = $1",
+ user_id,
+ )
+ if row is None:
+ raise HTTPException(status_code=404, detail="User not found")
+ return {
+ "id": row["id"],
+ "email": row["email"],
+ "display_name": row["display_name"],
+ "role": row["role"],
+ "permissions": row["permissions"],
+ "created_at": row["created_at"].isoformat(),
+ "updated_at": row["updated_at"].isoformat(),
+ }
+
+
+@router.get("/users/{user_id}/sessions")
+async def admin_get_user_sessions(
+ user_id: str,
+ store: Annotated[SessionStore, Depends(get_session_store)],
+ user: Annotated[User, Depends(require_admin)],
+):
+ """Return sessions owned by a specific user."""
+ sessions = await store.list_all(user_id=user.id, is_admin=True)
+ user_sessions = [s for s in sessions if s.user_id == user_id]
+ return [
+ {
+ "session_id": s.id,
+ "profile_id": s.profile_id,
+ "name": s.name,
+ "message_count": len(s.messages),
+ "pinned": s.pinned,
+ "created_at": s.created_at.isoformat(),
+ "last_active": s.last_active.isoformat(),
+ }
+ for s in user_sessions
+ ]
+
+
@router.get("/memory")
async def admin_list_memory(
store: Annotated[SessionStore, Depends(get_session_store)],
@@ -124,18 +233,32 @@
async def admin_update_profile_availability(
profile_id: str,
body: dict,
+ store: Annotated[SessionStore, Depends(get_session_store)],
user: Annotated[User, Depends(require_permission("navi.profiles.manage"))],
):
- """Toggle admin-only visibility for a profile."""
+ """Toggle admin-only visibility for a profile and persist to DB."""
is_admin_only = body.get("is_admin_only")
if not isinstance(is_admin_only, bool):
raise HTTPException(status_code=400, detail="is_admin_only must be a boolean")
- # Profile configuration is loaded from navi/profiles/ config files.
- # For now this is a no-op endpoint; actual persistence requires editing profile JSON.
+
+ from navi.api.deps import get_profile_registry
+ from navi.profiles._overrides import save_override
+
+ pool = await store._get_pool()
+ await save_override(pool, profile_id, is_admin_only)
+
+ # Mutate the in-memory profile so the change is effective immediately
+ # without a server restart.
+ try:
+ profile = get_profile_registry().get(profile_id)
+ profile.is_admin_only = is_admin_only
+ except Exception:
+ pass # profile may not be loaded; DB value is the source of truth anyway
+
log.info(
"admin.profile_availability",
profile_id=profile_id,
is_admin_only=is_admin_only,
admin_id=user.id,
)
- return {"ok": True, "note": "Profile availability is managed via profile config files"}
+ return {"ok": True}
diff --git a/navi/core/pg_session_store.py b/navi/core/pg_session_store.py
index dcbe4a5..54e6684 100644
--- a/navi/core/pg_session_store.py
+++ b/navi/core/pg_session_store.py
@@ -173,6 +173,83 @@
result = await conn.execute("DELETE FROM sessions WHERE id = $1", session_id)
return result == "DELETE 1"
+ async def count_all(
+ self,
+ *,
+ user_id: str | None = None,
+ is_admin: bool = False,
+ search: str | None = None,
+ ) -> int:
+ pool = await self._get_pool()
+ async with pool.acquire() as conn:
+ conditions = []
+ params: list = []
+ param_idx = 0
+
+ def add_param(value):
+ nonlocal param_idx
+ param_idx += 1
+ params.append(value)
+ return f"${param_idx}"
+
+ if not is_admin and user_id is not None:
+ conditions.append(f"user_id = {add_param(user_id)}")
+ if search:
+ like = f"%{search}%"
+ conditions.append(
+ f"(id ILIKE {add_param(like)} OR name ILIKE {add_param(like)} OR user_id ILIKE {add_param(like)} OR profile_id ILIKE {add_param(like)})"
+ )
+
+ where = "WHERE " + " AND ".join(conditions) if conditions else ""
+ row = await conn.fetchrow(f"SELECT COUNT(*) FROM sessions {where}", *params)
+ return row["count"] if row else 0
+
+ async def search_list(
+ self,
+ *,
+ limit: int,
+ offset: int,
+ user_id: str | None = None,
+ is_admin: bool = False,
+ search: str | None = None,
+ sort_by: str = "last_active",
+ sort_order: str = "desc",
+ ) -> list[Session]:
+ pool = await self._get_pool()
+ async with pool.acquire() as conn:
+ conditions = []
+ params: list = []
+ param_idx = 0
+
+ def add_param(value):
+ nonlocal param_idx
+ param_idx += 1
+ params.append(value)
+ return f"${param_idx}"
+
+ if not is_admin and user_id is not None:
+ conditions.append(f"user_id = {add_param(user_id)}")
+ if search:
+ like = f"%{search}%"
+ conditions.append(
+ f"(id ILIKE {add_param(like)} OR name ILIKE {add_param(like)} OR user_id ILIKE {add_param(like)} OR profile_id ILIKE {add_param(like)})"
+ )
+
+ where = "WHERE " + " AND ".join(conditions) if conditions else ""
+
+ allowed_cols = {"created_at", "last_active", "name", "profile_id", "user_id", "pinned"}
+ col = sort_by if sort_by in allowed_cols else "last_active"
+ order = "DESC" if sort_order == "desc" else "ASC"
+ # secondary sort by pinned DESC for stability
+ order_clause = f"ORDER BY pinned DESC, {col} {order} LIMIT {add_param(limit)} OFFSET {add_param(offset)}"
+
+ rows = await conn.fetch(
+ "SELECT id, profile_id, user_id, messages, context, pinned, created_at, last_active, context_token_count, name, planning_logs "
+ f"FROM sessions {where} {order_clause}",
+ *params,
+ )
+ return [self._row_to_session(r) for r in rows]
+
def _row_to_session(self, row: asyncpg.Record) -> Session:
messages = _deserialize(row["messages"])
context_json = row["context"]
diff --git a/navi/core/session.py b/navi/core/session.py
index 686f256..969e9d2 100644
--- a/navi/core/session.py
+++ b/navi/core/session.py
@@ -48,6 +48,28 @@
) -> list[Session]: ...
@abstractmethod
+ async def count_all(
+ self,
+ *,
+ user_id: str | None = None,
+ is_admin: bool = False,
+ search: str | None = None,
+ ) -> int: ...
+
+ @abstractmethod
+ async def search_list(
+ self,
+ *,
+ limit: int,
+ offset: int,
+ user_id: str | None = None,
+ is_admin: bool = False,
+ search: str | None = None,
+ sort_by: str = "last_active",
+ sort_order: str = "desc",
+ ) -> list[Session]: ...
+
+ @abstractmethod
async def delete(self, session_id: str) -> bool: ...
@abstractmethod
@@ -97,6 +119,53 @@
sessions = [s for s in sessions if s.profile_id == profile_id]
return sessions[offset:offset + limit]
+ async def count_all(
+ self,
+ *,
+ user_id: str | None = None,
+ is_admin: bool = False,
+ search: str | None = None,
+ ) -> int:
+ sessions = await self.search_list(
+ limit=10000, offset=0, user_id=user_id, is_admin=is_admin, search=search
+ )
+ return len(sessions)
+
+ async def search_list(
+ self,
+ *,
+ limit: int,
+ offset: int,
+ user_id: str | None = None,
+ is_admin: bool = False,
+ search: str | None = None,
+ sort_by: str = "last_active",
+ sort_order: str = "desc",
+ ) -> list[Session]:
+ sessions = list(self._sessions.values())
+ if not is_admin and user_id is not None:
+ sessions = [s for s in sessions if s.user_id == user_id]
+ if search:
+ q = search.lower()
+ sessions = [
+ s
+ for s in sessions
+ if (s.id and q in s.id.lower())
+ or (s.name and q in s.name.lower())
+ or (s.user_id and q in s.user_id.lower())
+ or (s.profile_id and q in s.profile_id.lower())
+ ]
+ key_map = {
+ "created_at": lambda s: s.created_at,
+ "last_active": lambda s: s.last_active,
+ "name": lambda s: (s.name or "").lower(),
+ "message_count": lambda s: len(s.messages),
+ }
+ key = key_map.get(sort_by, key_map["last_active"])
+ reverse = sort_order == "desc"
+ sessions = sorted(sessions, key=key, reverse=reverse)
+ return sessions[offset:offset + limit]
+
async def delete(self, session_id: str) -> bool:
if session_id in self._sessions:
del self._sessions[session_id]
diff --git a/navi/main.py b/navi/main.py
index 1f2a53c..9e6434b 100644
--- a/navi/main.py
+++ b/navi/main.py
@@ -59,6 +59,7 @@
@app.on_event("startup")
async def _on_startup() -> None:
+ log = structlog.get_logger()
from navi.api.deps import get_registries, get_session_store
from navi.content_store import ensure_tables
from navi.session_files import cleanup_loop
@@ -71,7 +72,6 @@
await ensure_tables()
break
except Exception as e:
- log = structlog.get_logger()
if attempt < 5:
log.warning("startup.ensure_tables_retry", attempt=attempt, error=str(e))
await asyncio.sleep(2)
@@ -80,11 +80,29 @@
# Initialize registries before embed health check. The memory store gets its
# embedding backend wired during registry construction.
get_registries()
+ # Apply persisted profile overrides (e.g. is_admin_only) to in-memory profiles.
+ from navi.api.deps import get_profile_registry, get_session_store
+ from navi.profiles._overrides import ensure_table, load_overrides
+
+ try:
+ pool = await get_session_store()._get_pool()
+ await ensure_table(pool)
+ overrides = await load_overrides(pool)
+ if overrides:
+ profiles = get_profile_registry()
+ for pid, is_admin_only in overrides.items():
+ try:
+ profile = profiles.get(pid)
+ profile.is_admin_only = is_admin_only
+ except Exception:
+ pass # stale override for removed profile
+ log.info("startup.profile_overrides_applied", count=len(overrides))
+ except Exception:
+ log.warning("startup.profile_overrides_failed", exc_info=True)
# Check embedding backend health and log status
from navi.api.routes.health import _check_embed
embed_status = await _check_embed()
- log = structlog.get_logger()
if embed_status["ok"]:
log.info("startup.embed_ready", backend=embed_status["backend"])
else:
@@ -114,3 +132,8 @@
@app.get("/debug/eval", include_in_schema=False)
async def debug_eval() -> FileResponse:
return FileResponse("debug/eval/index.html", headers={"Cache-Control": "no-store"})
+
+
+@app.get("/admin", include_in_schema=False)
+async def admin_panel() -> FileResponse:
+ return FileResponse("admin/index.html", headers={"Cache-Control": "no-store"})
diff --git a/navi/profiles/_overrides.py b/navi/profiles/_overrides.py
new file mode 100644
index 0000000..c83c0de
--- /dev/null
+++ b/navi/profiles/_overrides.py
@@ -0,0 +1,50 @@
+"""Runtime profile overrides persisted in PostgreSQL.
+
+Currently stores only `is_admin_only` per profile. Base config comes from
+JSON files on disk; this layer applies runtime changes made via the admin API.
+"""
+
+from datetime import datetime, timezone
+
+import asyncpg
+import structlog
+
+log = structlog.get_logger()
+
+_DDL = """
+CREATE TABLE IF NOT EXISTS profile_overrides (
+ profile_id TEXT PRIMARY KEY,
+ is_admin_only BOOLEAN NOT NULL DEFAULT FALSE,
+ updated_at TIMESTAMPTZ NOT NULL
+)
+"""
+
+
+async def ensure_table(pool: asyncpg.Pool) -> None:
+ async with pool.acquire() as conn:
+ await conn.execute(_DDL)
+
+
+async def load_overrides(pool: asyncpg.Pool) -> dict[str, bool]:
+ """Return mapping profile_id -> is_admin_only from DB."""
+ async with pool.acquire() as conn:
+ rows = await conn.fetch("SELECT profile_id, is_admin_only FROM profile_overrides")
+ return {r["profile_id"]: r["is_admin_only"] for r in rows}
+
+
+async def save_override(
+ pool: asyncpg.Pool, profile_id: str, is_admin_only: bool
+) -> None:
+ now = datetime.now(timezone.utc)
+ async with pool.acquire() as conn:
+ await conn.execute(
+ """INSERT INTO profile_overrides (profile_id, is_admin_only, updated_at)
+ VALUES ($1, $2, $3)
+ ON CONFLICT (profile_id) DO UPDATE SET
+ is_admin_only = EXCLUDED.is_admin_only,
+ updated_at = EXCLUDED.updated_at""",
+ profile_id,
+ is_admin_only,
+ now,
+ )
+ log.info("profile.override_saved", profile_id=profile_id, is_admin_only=is_admin_only)
diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py
index 7c53a5a..e4b0e80 100644
--- a/tests/integration/conftest.py
+++ b/tests/integration/conftest.py
@@ -53,6 +53,18 @@
backends = BackendRegistry()
backends.register("ollama", FakeLLMBackend())
+ # Wire a FakePool onto the in-memory store so admin endpoints that call
+ # store._get_pool() can work in integration tests.
+ from tests.conftest_factory import FakeConnection, FakePool
+ _fake_conn = FakeConnection()
+ _fake_pool = FakePool(_fake_conn)
+
+ async def _fake_get_pool():
+ return _fake_pool
+
+ store._get_pool = _fake_get_pool
+ store._pool = _fake_pool
+
# Patch internal singletons so original getter functions return our fakes
monkeypatch.setattr(deps, "_session_store", store)
monkeypatch.setattr(deps, "_memory_store", None)
@@ -92,6 +104,8 @@
"tools": tools,
"backends": backends,
"agent": fake_agent,
+ "fake_conn": _fake_conn,
+ "fake_pool": _fake_pool,
}
diff --git a/tests/integration/test_api_routes.py b/tests/integration/test_api_routes.py
index 66859a2..065ab3d 100644
--- a/tests/integration/test_api_routes.py
+++ b/tests/integration/test_api_routes.py
@@ -178,3 +178,131 @@
def test_send_message_not_found(self, client):
response = client.post("/sessions/nonexistent/messages", json={"content": "hi"})
assert response.status_code == 404
+
+
+class TestAdmin:
+ def test_list_users(self, client, mock_deps):
+ mock_deps["fake_conn"].enqueue([
+ {"id": "u1", "email": "a@b.com", "display_name": "A", "role": "admin",
+ "permissions": "[]", "created_at": __import__("datetime").datetime.now(__import__("datetime").timezone.utc),
+ "updated_at": __import__("datetime").datetime.now(__import__("datetime").timezone.utc)}
+ ])
+ response = client.get("/admin/users")
+ assert response.status_code == 200
+ data = response.json()
+ assert isinstance(data, list)
+ assert data[0]["id"] == "u1"
+
+ @pytest.mark.anyio
+ async def test_get_session_detail(self, client, make_session):
+ session = await make_session("secretary", [Message(role="user", content="hi")])
+ response = client.get(f"/admin/sessions/{session.id}")
+ assert response.status_code == 200
+ data = response.json()
+ assert data["session_id"] == session.id
+ assert "messages" in data
+
+ def test_get_session_detail_not_found(self, client):
+ response = client.get("/admin/sessions/nonexistent")
+ assert response.status_code == 404
+
+ @pytest.mark.anyio
+ async def test_delete_session(self, client, make_session):
+ session = await make_session("secretary")
+ response = client.delete(f"/admin/sessions/{session.id}")
+ assert response.status_code == 204
+ assert client.get(f"/admin/sessions/{session.id}").status_code == 404
+
+ def test_delete_session_not_found(self, client):
+ response = client.delete("/admin/sessions/nonexistent")
+ assert response.status_code == 404
+
+ @pytest.mark.anyio
+ async def test_get_user_sessions(self, client, make_session):
+ session = await make_session("secretary")
+ response = client.get(f"/admin/users/{session.user_id}/sessions")
+ assert response.status_code == 200
+ data = response.json()
+ assert isinstance(data, list)
+
+ def test_get_user_detail_not_found(self, client, mock_deps):
+ mock_deps["fake_conn"].enqueue(None)
+ response = client.get("/admin/users/nonexistent")
+ assert response.status_code == 404
+
+ def test_list_profiles(self, client):
+ response = client.get("/admin/profiles")
+ assert response.status_code == 200
+ data = response.json()
+ assert isinstance(data, list)
+ assert any(p["id"] == "secretary" for p in data)
+
+ def test_update_profile_availability(self, client, mock_deps):
+ mock_deps["fake_conn"].enqueue("INSERT 0 1")
+ response = client.patch("/admin/profiles/secretary/availability", json={"is_admin_only": True})
+ assert response.status_code == 200
+ data = response.json()
+ assert data["ok"] is True
+
+ @pytest.mark.anyio
+ async def test_list_sessions_pagination(self, client, make_session):
+ sessions = [await make_session("secretary") for _ in range(5)]
+ response = client.get("/admin/sessions?limit=2&offset=0")
+ assert response.status_code == 200
+ data = response.json()
+ assert data["total"] == 5
+ assert len(data["items"]) == 2
+ assert data["limit"] == 2
+ assert data["offset"] == 0
+
+ @pytest.mark.anyio
+ async def test_list_sessions_pagination_offset(self, client, make_session):
+ sessions = [await make_session("secretary") for _ in range(5)]
+ response = client.get("/admin/sessions?limit=2&offset=4")
+ assert response.status_code == 200
+ data = response.json()
+ assert data["total"] == 5
+ assert len(data["items"]) == 1
+
+ @pytest.mark.anyio
+ async def test_list_sessions_search(self, client, make_session, mock_deps):
+ store = mock_deps["session_store"]
+ s1 = await make_session("secretary")
+ s1.name = "alpha session"
+ await store.save(s1)
+ s2 = await make_session("developer")
+ s2.name = "beta session"
+ await store.save(s2)
+ # search by name
+ response = client.get("/admin/sessions?search=alpha")
+ assert response.status_code == 200
+ data = response.json()
+ ids = {i["session_id"] for i in data["items"]}
+ assert s1.id in ids
+ assert s2.id not in ids
+ # search by profile
+ response = client.get("/admin/sessions?search=developer")
+ assert response.status_code == 200
+ data = response.json()
+ ids = {i["session_id"] for i in data["items"]}
+ assert s2.id in ids
+
+ @pytest.mark.anyio
+ async def test_list_sessions_sort(self, client, make_session, mock_deps):
+ store = mock_deps["session_store"]
+ s1 = await make_session("secretary")
+ s1.name = "aaa"
+ await store.save(s1)
+ s2 = await make_session("secretary")
+ s2.name = "zzz"
+ await store.save(s2)
+ response = client.get("/admin/sessions?sort_by=name&sort_order=asc")
+ assert response.status_code == 200
+ data = response.json()
+ names = [i["name"] for i in data["items"]]
+ assert names.index("aaa") < names.index("zzz")
+ response = client.get("/admin/sessions?sort_by=name&sort_order=desc")
+ assert response.status_code == 200
+ data = response.json()
+ names = [i["name"] for i in data["items"]]
+ assert names.index("zzz") < names.index("aaa")
diff --git a/tests/unit/profiles/conftest.py b/tests/unit/profiles/conftest.py
new file mode 100644
index 0000000..5b94757
--- /dev/null
+++ b/tests/unit/profiles/conftest.py
@@ -0,0 +1,11 @@
+"""Fixtures for profile unit tests."""
+
+import pytest
+
+from tests.conftest_factory import FakeConnection, FakePool
+
+
+@pytest.fixture
+def fake_pool():
+ conn = FakeConnection()
+ return FakePool(conn)
diff --git a/tests/unit/profiles/test_overrides.py b/tests/unit/profiles/test_overrides.py
new file mode 100644
index 0000000..3ddce71
--- /dev/null
+++ b/tests/unit/profiles/test_overrides.py
@@ -0,0 +1,26 @@
+"""Unit tests for profile_overrides persistence."""
+
+import pytest
+
+from navi.profiles._overrides import ensure_table, load_overrides, save_override
+
+
+class TestProfileOverrides:
+ async def test_ensure_table_creates_table(self, fake_pool):
+ await ensure_table(fake_pool)
+ assert any("profile_overrides" in c[1] for c in fake_pool._conn.calls)
+
+ async def test_save_and_load_override(self, fake_pool):
+ await ensure_table(fake_pool)
+ fake_pool._conn.enqueue("INSERT 0 1")
+ await save_override(fake_pool, "secretary", True)
+
+ fake_pool._conn.enqueue([{"profile_id": "secretary", "is_admin_only": True}])
+ overrides = await load_overrides(fake_pool)
+ assert overrides == {"secretary": True}
+
+ async def test_load_overrides_empty(self, fake_pool):
+ await ensure_table(fake_pool)
+ fake_pool._conn.enqueue([])
+ overrides = await load_overrides(fake_pool)
+ assert overrides == {}
diff --git a/webclient/dist/assets/index-BSatN9tx.js b/webclient/dist/assets/index-BSatN9tx.js
deleted file mode 100644
index dbca455..0000000
--- a/webclient/dist/assets/index-BSatN9tx.js
+++ /dev/null
@@ -1,93 +0,0 @@
-var eS=Object.defineProperty;var tS=(t,e,n)=>e in t?eS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var dt=(t,e,n)=>tS(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();/**
-* @vue/shared v3.5.32
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/function yc(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const ut={},Sr=[],En=()=>{},ng=()=>!1,Ui=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Fi=t=>t.startsWith("onUpdate:"),yt=Object.assign,Ic=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},nS=Object.prototype.hasOwnProperty,it=(t,e)=>nS.call(t,e),Ae=Array.isArray,fr=t=>jr(t)==="[object Map]",rg=t=>jr(t)==="[object Set]",E_=t=>jr(t)==="[object Date]",Ue=t=>typeof t=="function",Et=t=>typeof t=="string",Vt=t=>typeof t=="symbol",at=t=>t!==null&&typeof t=="object",ig=t=>(at(t)||Ue(t))&&Ue(t.then)&&Ue(t.catch),ag=Object.prototype.toString,jr=t=>ag.call(t),rS=t=>jr(t).slice(8,-1),og=t=>jr(t)==="[object Object]",Bi=t=>Et(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,kr=yc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gi=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},iS=/-\w/g,Gt=Gi(t=>t.replace(iS,e=>e.slice(1).toUpperCase())),aS=/\B([A-Z])/g,Gn=Gi(t=>t.replace(aS,"-$1").toLowerCase()),Yi=Gi(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ei=Gi(t=>t?`on${Yi(t)}`:""),mn=(t,e)=>!Object.is(t,e),Si=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},Ac=t=>{const e=parseFloat(t);return isNaN(e)?t:e},oS=t=>{const e=Et(t)?Number(t):NaN;return isNaN(e)?t:e};let S_;const qi=()=>S_||(S_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ar(t){if(Ae(t)){const e={};for(let n=0;n{if(n){const r=n.split(lS);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Ze(t){let e="";if(Et(t))e=t;else if(Ae(t))for(let n=0;n!!(t&&t.__v_isRef===!0),xe=t=>Et(t)?t:t==null?"":Ae(t)||at(t)&&(t.toString===ag||!Ue(t.toString))?cg(t)?xe(t.value):JSON.stringify(t,_g,2):String(t),_g=(t,e)=>cg(e)?_g(t,e.value):fr(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,i],a)=>(n[la(r,a)+" =>"]=i,n),{})}:rg(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>la(n))}:Vt(e)?la(e):at(e)&&!Ae(e)&&!og(e)?String(e):e,la=(t,e="")=>{var n;return Vt(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
-* @vue/reactivity v3.5.32
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/let Mt;class dg{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Mt,!e&&Mt&&(this.index=(Mt.scopes||(Mt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0&&--this._on===0&&(Mt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n0)return;if(Fr){let e=Fr;for(Fr=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Ur;){let e=Ur;for(Ur=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function Eg(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Sg(t){let e,n=t.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),wc(r),ES(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}t.deps=e,t.depsTail=n}function ic(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(fg(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function fg(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===$r)||(t.globalVersion=$r,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!ic(t))))return;t.flags|=2;const e=t.dep,n=pt,r=tn;pt=t,tn=!0;try{Eg(t);const i=t.fn(t._value);(e.version===0||mn(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{pt=n,tn=r,Sg(t),t.flags&=-3}}function wc(t,e=!1){const{dep:n,prevSub:r,nextSub:i}=t;if(r&&(r.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)wc(a,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function ES(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let tn=!0;const Tg=[];function Dn(){Tg.push(tn),tn=!1}function Mn(){const t=Tg.pop();tn=t===void 0?!0:t}function f_(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=pt;pt=void 0;try{e()}finally{pt=n}}}let $r=0;class SS{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Pc{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!pt||!tn||pt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pt)n=this.activeLink=new SS(pt,this),pt.deps?(n.prevDep=pt.depsTail,pt.depsTail.nextDep=n,pt.depsTail=n):pt.deps=pt.depsTail=n,bg(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=pt.depsTail,n.nextDep=void 0,pt.depsTail.nextDep=n,pt.depsTail=n,pt.deps===n&&(pt.deps=r)}return n}trigger(e){this.version++,$r++,this.notify(e)}notify(e){xc();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Lc()}}}function bg(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)bg(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const hi=new WeakMap,jn=Symbol(""),ac=Symbol(""),Vr=Symbol("");function xt(t,e,n){if(tn&&pt){let r=hi.get(t);r||hi.set(t,r=new Map);let i=r.get(n);i||(r.set(n,i=new Pc),i.map=r,i.key=n),i.track()}}function Nn(t,e,n,r,i,a){const s=hi.get(t);if(!s){$r++;return}const o=c=>{c&&c.trigger()};if(xc(),e==="clear")s.forEach(o);else{const c=Ae(t),_=c&&Bi(n);if(c&&n==="length"){const l=Number(r);s.forEach((d,u)=>{(u==="length"||u===Vr||!Vt(u)&&u>=l)&&o(d)})}else switch((n!==void 0||s.has(void 0))&&o(s.get(n)),_&&o(s.get(Vr)),e){case"add":c?_&&o(s.get("length")):(o(s.get(jn)),fr(t)&&o(s.get(ac)));break;case"delete":c||(o(s.get(jn)),fr(t)&&o(s.get(ac)));break;case"set":fr(t)&&o(s.get(jn));break}}Lc()}function fS(t,e){const n=hi.get(t);return n&&n.get(e)}function _r(t){const e=Xe(t);return e===t?e:(xt(e,"iterate",Vr),$t(t)?e:e.map(nn))}function Hi(t){return xt(t=Xe(t),"iterate",Vr),t}function un(t,e){return xn(t)?Rr(An(t)?nn(e):e):nn(e)}const TS={__proto__:null,[Symbol.iterator](){return _a(this,Symbol.iterator,t=>un(this,t))},concat(...t){return _r(this).concat(...t.map(e=>Ae(e)?_r(e):e))},entries(){return _a(this,"entries",t=>(t[1]=un(this,t[1]),t))},every(t,e){return Rn(this,"every",t,e,void 0,arguments)},filter(t,e){return Rn(this,"filter",t,e,n=>n.map(r=>un(this,r)),arguments)},find(t,e){return Rn(this,"find",t,e,n=>un(this,n),arguments)},findIndex(t,e){return Rn(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Rn(this,"findLast",t,e,n=>un(this,n),arguments)},findLastIndex(t,e){return Rn(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Rn(this,"forEach",t,e,void 0,arguments)},includes(...t){return da(this,"includes",t)},indexOf(...t){return da(this,"indexOf",t)},join(t){return _r(this).join(t)},lastIndexOf(...t){return da(this,"lastIndexOf",t)},map(t,e){return Rn(this,"map",t,e,void 0,arguments)},pop(){return Ar(this,"pop")},push(...t){return Ar(this,"push",t)},reduce(t,...e){return T_(this,"reduce",t,e)},reduceRight(t,...e){return T_(this,"reduceRight",t,e)},shift(){return Ar(this,"shift")},some(t,e){return Rn(this,"some",t,e,void 0,arguments)},splice(...t){return Ar(this,"splice",t)},toReversed(){return _r(this).toReversed()},toSorted(t){return _r(this).toSorted(t)},toSpliced(...t){return _r(this).toSpliced(...t)},unshift(...t){return Ar(this,"unshift",t)},values(){return _a(this,"values",t=>un(this,t))}};function _a(t,e,n){const r=Hi(t),i=r[e]();return r!==t&&!$t(t)&&(i._next=i.next,i.next=()=>{const a=i._next();return a.done||(a.value=n(a.value)),a}),i}const bS=Array.prototype;function Rn(t,e,n,r,i,a){const s=Hi(t),o=s!==t&&!$t(t),c=s[e];if(c!==bS[e]){const d=c.apply(t,a);return o?nn(d):d}let _=n;s!==t&&(o?_=function(d,u){return n.call(this,un(t,d),u,t)}:n.length>2&&(_=function(d,u){return n.call(this,d,u,t)}));const l=c.call(s,_,r);return o&&i?i(l):l}function T_(t,e,n,r){const i=Hi(t),a=i!==t&&!$t(t);let s=n,o=!1;i!==t&&(a?(o=r.length===0,s=function(_,l,d){return o&&(o=!1,_=un(t,_)),n.call(this,_,un(t,l),d,t)}):n.length>3&&(s=function(_,l,d){return n.call(this,_,l,d,t)}));const c=i[e](s,...r);return o?un(t,c):c}function da(t,e,n){const r=Xe(t);xt(r,"iterate",Vr);const i=r[e](...n);return(i===-1||i===!1)&&$i(n[0])?(n[0]=Xe(n[0]),r[e](...n)):i}function Ar(t,e,n=[]){Dn(),xc();const r=Xe(t)[e].apply(t,n);return Lc(),Mn(),r}const RS=yc("__proto__,__v_isRef,__isVue"),Rg=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Vt));function hS(t){Vt(t)||(t=String(t));const e=Xe(this);return xt(e,"has",t),e.hasOwnProperty(t)}class hg{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const i=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return a;if(n==="__v_raw")return r===(i?a?xS:Og:a?Ng:vg).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const s=Ae(e);if(!i){let c;if(s&&(c=TS[n]))return c;if(n==="hasOwnProperty")return hS}const o=Reflect.get(e,n,bt(e)?e:r);if((Vt(n)?Rg.has(n):RS(n))||(i||xt(e,"get",n),a))return o;if(bt(o)){const c=s&&Bi(n)?o:o.value;return i&&at(c)?sc(c):c}return at(o)?i?sc(o):ei(o):o}}class Cg extends hg{constructor(e=!1){super(!1,e)}set(e,n,r,i){let a=e[n];const s=Ae(e)&&Bi(n);if(!this._isShallow){const _=xn(a);if(!$t(r)&&!xn(r)&&(a=Xe(a),r=Xe(r)),!s&&bt(a)&&!bt(r))return _||(a.value=r),!0}const o=s?Number(n)t,ci=t=>Reflect.getPrototypeOf(t);function yS(t,e,n){return function(...r){const i=this.__v_raw,a=Xe(i),s=fr(a),o=t==="entries"||t===Symbol.iterator&&s,c=t==="keys"&&s,_=i[t](...r),l=n?oc:e?Rr:nn;return!e&&xt(a,"iterate",c?ac:jn),yt(Object.create(_),{next(){const{value:d,done:u}=_.next();return u?{value:d,done:u}:{value:o?[l(d[0]),l(d[1])]:l(d),done:u}}})}}function _i(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function IS(t,e){const n={get(i){const a=this.__v_raw,s=Xe(a),o=Xe(i);t||(mn(i,o)&&xt(s,"get",i),xt(s,"get",o));const{has:c}=ci(s),_=e?oc:t?Rr:nn;if(c.call(s,i))return _(a.get(i));if(c.call(s,o))return _(a.get(o));a!==s&&a.get(i)},get size(){const i=this.__v_raw;return!t&&xt(Xe(i),"iterate",jn),i.size},has(i){const a=this.__v_raw,s=Xe(a),o=Xe(i);return t||(mn(i,o)&&xt(s,"has",i),xt(s,"has",o)),i===o?a.has(i):a.has(i)||a.has(o)},forEach(i,a){const s=this,o=s.__v_raw,c=Xe(o),_=e?oc:t?Rr:nn;return!t&&xt(c,"iterate",jn),o.forEach((l,d)=>i.call(a,_(l),_(d),s))}};return yt(n,t?{add:_i("add"),set:_i("set"),delete:_i("delete"),clear:_i("clear")}:{add(i){const a=Xe(this),s=ci(a),o=Xe(i),c=!e&&!$t(i)&&!xn(i)?o:i;return s.has.call(a,c)||mn(i,c)&&s.has.call(a,i)||mn(o,c)&&s.has.call(a,o)||(a.add(c),Nn(a,"add",c,c)),this},set(i,a){!e&&!$t(a)&&!xn(a)&&(a=Xe(a));const s=Xe(this),{has:o,get:c}=ci(s);let _=o.call(s,i);_||(i=Xe(i),_=o.call(s,i));const l=c.call(s,i);return s.set(i,a),_?mn(a,l)&&Nn(s,"set",i,a):Nn(s,"add",i,a),this},delete(i){const a=Xe(this),{has:s,get:o}=ci(a);let c=s.call(a,i);c||(i=Xe(i),c=s.call(a,i)),o&&o.call(a,i);const _=a.delete(i);return c&&Nn(a,"delete",i,void 0),_},clear(){const i=Xe(this),a=i.size!==0,s=i.clear();return a&&Nn(i,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=yS(i,t,e)}),n}function kc(t,e){const n=IS(t,e);return(r,i,a)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(it(n,i)&&i in r?n:r,i,a)}const AS={get:kc(!1,!1)},DS={get:kc(!1,!0)},MS={get:kc(!0,!1)};const vg=new WeakMap,Ng=new WeakMap,Og=new WeakMap,xS=new WeakMap;function LS(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function wS(t){return t.__v_skip||!Object.isExtensible(t)?0:LS(rS(t))}function ei(t){return xn(t)?t:Uc(t,!1,vS,AS,vg)}function yg(t){return Uc(t,!1,OS,DS,Ng)}function sc(t){return Uc(t,!0,NS,MS,Og)}function Uc(t,e,n,r,i){if(!at(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const a=wS(t);if(a===0)return t;const s=i.get(t);if(s)return s;const o=new Proxy(t,a===2?r:n);return i.set(t,o),o}function An(t){return xn(t)?An(t.__v_raw):!!(t&&t.__v_isReactive)}function xn(t){return!!(t&&t.__v_isReadonly)}function $t(t){return!!(t&&t.__v_isShallow)}function $i(t){return t?!!t.__v_raw:!1}function Xe(t){const e=t&&t.__v_raw;return e?Xe(e):t}function Vi(t){return!it(t,"__v_skip")&&Object.isExtensible(t)&&sg(t,"__v_skip",!0),t}const nn=t=>at(t)?ei(t):t,Rr=t=>at(t)?sc(t):t;function bt(t){return t?t.__v_isRef===!0:!1}function le(t){return Ig(t,!1)}function Er(t){return Ig(t,!0)}function Ig(t,e){return bt(t)?t:new PS(t,e)}class PS{constructor(e,n){this.dep=new Pc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Xe(e),this._value=n?e:nn(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||$t(e)||xn(e);e=r?e:Xe(e),mn(e,n)&&(this._rawValue=e,this._value=r?e:nn(e),this.dep.trigger())}}function X(t){return bt(t)?t.value:t}function ue(t){return Ue(t)?t():X(t)}const kS={get:(t,e,n)=>e==="__v_raw"?t:X(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const i=t[e];return bt(i)&&!bt(n)?(i.value=n,!0):Reflect.set(t,e,n,r)}};function Ag(t){return An(t)?t:new Proxy(t,kS)}function US(t){const e=Ae(t)?new Array(t.length):{};for(const n in t)e[n]=BS(t,n);return e}class FS{constructor(e,n,r){this._object=e,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._key=Vt(n)?n:String(n),this._raw=Xe(e);let i=!0,a=e;if(!Ae(e)||Vt(this._key)||!Bi(this._key))do i=!$i(a)||$t(a);while(i&&(a=a.__v_raw));this._shallow=i}get value(){let e=this._object[this._key];return this._shallow&&(e=X(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&bt(this._raw[this._key])){const n=this._object[this._key];if(bt(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return fS(this._raw,this._key)}}function BS(t,e,n){return new FS(t,e,n)}class GS{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Pc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=$r-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pt!==this)return gg(this,!0),!0}get value(){const e=this.dep.track();return fg(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function YS(t,e,n=!1){let r,i;return Ue(t)?r=t:(r=t.get,i=t.set),new GS(r,i,n)}const di={},Ci=new WeakMap;let Qn;function qS(t,e=!1,n=Qn){if(n){let r=Ci.get(n);r||Ci.set(n,r=[]),r.push(t)}}function HS(t,e,n=ut){const{immediate:r,deep:i,once:a,scheduler:s,augmentJob:o,call:c}=n,_=C=>i?C:$t(C)||i===!1||i===0?On(C,1):On(C);let l,d,u,m,p=!1,E=!1;if(bt(t)?(d=()=>t.value,p=$t(t)):An(t)?(d=()=>_(t),p=!0):Ae(t)?(E=!0,p=t.some(C=>An(C)||$t(C)),d=()=>t.map(C=>{if(bt(C))return C.value;if(An(C))return _(C);if(Ue(C))return c?c(C,2):C()})):Ue(t)?e?d=c?()=>c(t,2):t:d=()=>{if(u){Dn();try{u()}finally{Mn()}}const C=Qn;Qn=l;try{return c?c(t,3,[m]):t(m)}finally{Qn=C}}:d=En,e&&i){const C=d,A=i===!0?1/0:i;d=()=>On(C(),A)}const f=ug(),T=()=>{l.stop(),f&&f.active&&Ic(f.effects,l)};if(a&&e){const C=e;e=(...A)=>{C(...A),T()}}let b=E?new Array(t.length).fill(di):di;const v=C=>{if(!(!(l.flags&1)||!l.dirty&&!C))if(e){const A=l.run();if(i||p||(E?A.some((N,x)=>mn(N,b[x])):mn(A,b))){u&&u();const N=Qn;Qn=l;try{const x=[A,b===di?void 0:E&&b[0]===di?[]:b,m];b=A,c?c(e,3,x):e(...x)}finally{Qn=N}}}else l.run()};return o&&o(v),l=new pg(d),l.scheduler=s?()=>s(v,!1):v,m=C=>qS(C,!1,l),u=l.onStop=()=>{const C=Ci.get(l);if(C){if(c)c(C,4);else for(const A of C)A();Ci.delete(l)}},e?r?v(!0):b=l.run():s?s(v.bind(null,!0),!0):l.run(),T.pause=l.pause.bind(l),T.resume=l.resume.bind(l),T.stop=T,T}function On(t,e=1/0,n){if(e<=0||!at(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,bt(t))On(t.value,e,n);else if(Ae(t))for(let r=0;r{On(r,e,n)});else if(og(t)){for(const r in t)On(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&On(t[r],e,n)}return t}/**
-* @vue/runtime-core v3.5.32
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/function ti(t,e,n,r){try{return r?t(...r):t()}catch(i){zi(i,e,n)}}function rn(t,e,n,r){if(Ue(t)){const i=ti(t,e,n,r);return i&&ig(i)&&i.catch(a=>{zi(a,e,n)}),i}if(Ae(t)){const i=[];for(let a=0;a>>1,i=Ut[r],a=zr(i);a=zr(n)?Ut.push(t):Ut.splice(VS(e),0,t),t.flags|=1,Mg()}}function Mg(){vi||(vi=Dg.then(Lg))}function zS(t){Ae(t)?Tr.push(...t):Fn&&t.id===-1?Fn.splice(ur+1,0,t):t.flags&1||(Tr.push(t),t.flags|=1),Mg()}function b_(t,e,n=_n+1){for(;nzr(n)-zr(r));if(Tr.length=0,Fn){Fn.push(...e);return}for(Fn=e,ur=0;urt.id==null?t.flags&2?-1:1/0:t.id;function Lg(t){try{for(_n=0;_n{r._d&&Ii(-1);const a=Ni(e);let s;try{s=t(...i)}finally{Ni(a),r._d&&Ii(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function Pg(t,e){if(It===null)return t;const n=Ji(It),r=t.dirs||(t.dirs=[]);for(let i=0;i1)return n&&Ue(e)?e.call(r&&r.proxy):e}}function WS(){return!!(Vc()||tr)}const KS=Symbol.for("v-scx"),QS=()=>er(KS);function Ye(t,e,n){return kg(t,e,n)}function kg(t,e,n=ut){const{immediate:r,deep:i,flush:a,once:s}=n,o=yt({},n),c=e&&r||!e&&a!=="post";let _;if(Xr){if(a==="sync"){const m=QS();_=m.__watcherHandles||(m.__watcherHandles=[])}else if(!c){const m=()=>{};return m.stop=En,m.resume=En,m.pause=En,m}}const l=wt;o.call=(m,p,E)=>rn(m,l,p,E);let d=!1;a==="post"?o.scheduler=m=>{kt(m,l&&l.suspense)}:a!=="sync"&&(d=!0,o.scheduler=(m,p)=>{p?m():Fc(m)}),o.augmentJob=m=>{e&&(m.flags|=4),d&&(m.flags|=2,l&&(m.id=l.uid,m.i=l))};const u=HS(t,e,o);return Xr&&(_?_.push(u):c&&u()),u}function XS(t,e,n){const r=this.proxy,i=Et(t)?t.includes(".")?Ug(r,t):()=>r[t]:t.bind(r,r);let a;Ue(e)?a=e:(a=e.handler,n=e);const s=ri(this),o=kg(i,a.bind(r),n);return s(),o}function Ug(t,e){const n=e.split(".");return()=>{let r=t;for(let i=0;it.__isTeleport,Xn=t=>t&&(t.disabled||t.disabled===""),ZS=t=>t&&(t.defer||t.defer===""),R_=t=>typeof SVGElement<"u"&&t instanceof SVGElement,h_=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,lc=(t,e)=>{const n=t&&t.to;return Et(n)?e?e(n):null:n},JS={name:"Teleport",__isTeleport:!0,process(t,e,n,r,i,a,s,o,c,_){const{mc:l,pc:d,pbc:u,o:{insert:m,querySelector:p,createText:E,createComment:f}}=_,T=Xn(e.props);let{dynamicChildren:b}=e;const v=(N,x,O)=>{N.shapeFlag&16&&l(N.children,x,O,i,a,s,o,c)},C=(N=e)=>{const x=Xn(N.props),O=N.target=lc(N.props,p),M=cc(O,N,E,m);O&&(s!=="svg"&&R_(O)?s="svg":s!=="mathml"&&h_(O)&&(s="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(O),x||(v(N,O,M),wr(N,!1)))},A=N=>{const x=()=>{Vn.get(N)===x&&(Vn.delete(N),Xn(N.props)&&(v(N,n,N.anchor),wr(N,!0)),C(N))};Vn.set(N,x),kt(x,a)};if(t==null){const N=e.el=E(""),x=e.anchor=E("");if(m(N,n,r),m(x,n,r),ZS(e.props)||a&&a.pendingBranch){A(e);return}T&&(v(e,n,x),wr(e,!0)),C()}else{e.el=t.el;const N=e.anchor=t.anchor,x=Vn.get(t);if(x){x.flags|=8,Vn.delete(t),A(e);return}e.targetStart=t.targetStart;const O=e.target=t.target,M=e.targetAnchor=t.targetAnchor,q=Xn(t.props),V=q?n:O,y=q?N:M;if(s==="svg"||R_(O)?s="svg":(s==="mathml"||h_(O))&&(s="mathml"),b?(u(t.dynamicChildren,b,V,i,a,s,o),Hc(t,e,!0)):c||d(t,e,V,y,i,a,s,o,!1),T)q?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):ui(e,n,N,_,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const Z=e.target=lc(e.props,p);Z&&ui(e,Z,null,_,0)}else q&&ui(e,O,M,_,1);wr(e,T)}},remove(t,e,n,{um:r,o:{remove:i}},a){const{shapeFlag:s,children:o,anchor:c,targetStart:_,targetAnchor:l,target:d,props:u}=t;let m=a||!Xn(u);const p=Vn.get(t);if(p&&(p.flags|=8,Vn.delete(t),m=!1),d&&(i(_),i(l)),a&&i(c),s&16)for(let E=0;E{t.isMounted=!0}),or(()=>{t.isUnmounting=!0}),t}const Jt=[Function,Array],Gg={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Jt,onEnter:Jt,onAfterEnter:Jt,onEnterCancelled:Jt,onBeforeLeave:Jt,onLeave:Jt,onAfterLeave:Jt,onLeaveCancelled:Jt,onBeforeAppear:Jt,onAppear:Jt,onAfterAppear:Jt,onAppearCancelled:Jt},Yg=t=>{const e=t.subTree;return e.component?Yg(e.component):e},tf={name:"BaseTransition",props:Gg,setup(t,{slots:e}){const n=Vc(),r=ef();return()=>{const i=e.default&&$g(e.default(),!0);if(!i||!i.length)return;const a=qg(i),s=Xe(t),{mode:o}=s;if(r.isLeaving)return ua(a);const c=C_(a);if(!c)return ua(a);let _=_c(c,s,r,n,d=>_=d);c.type!==Lt&&Wr(c,_);let l=n.subTree&&C_(n.subTree);if(l&&l.type!==Lt&&!Zn(l,c)&&Yg(n).type!==Lt){let d=_c(l,s,r,n);if(Wr(l,d),o==="out-in"&&c.type!==Lt)return r.isLeaving=!0,d.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,l=void 0},ua(a);o==="in-out"&&c.type!==Lt?d.delayLeave=(u,m,p)=>{const E=Hg(r,l);E[String(l.key)]=l,u[dn]=()=>{m(),u[dn]=void 0,delete _.delayedLeave,l=void 0},_.delayedLeave=()=>{p(),delete _.delayedLeave,l=void 0}}:l=void 0}else l&&(l=void 0);return a}}};function qg(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==Lt){e=n;break}}return e}const nf=tf;function Hg(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function _c(t,e,n,r,i){const{appear:a,mode:s,persisted:o=!1,onBeforeEnter:c,onEnter:_,onAfterEnter:l,onEnterCancelled:d,onBeforeLeave:u,onLeave:m,onAfterLeave:p,onLeaveCancelled:E,onBeforeAppear:f,onAppear:T,onAfterAppear:b,onAppearCancelled:v}=e,C=String(t.key),A=Hg(n,t),N=(M,q)=>{M&&rn(M,r,9,q)},x=(M,q)=>{const V=q[1];N(M,q),Ae(M)?M.every(y=>y.length<=1)&&V():M.length<=1&&V()},O={mode:s,persisted:o,beforeEnter(M){let q=c;if(!n.isMounted)if(a)q=f||c;else return;M[dn]&&M[dn](!0);const V=A[C];V&&Zn(t,V)&&V.el[dn]&&V.el[dn](),N(q,[M])},enter(M){if(A[C]===t)return;let q=_,V=l,y=d;if(!n.isMounted)if(a)q=T||_,V=b||l,y=v||d;else return;let Z=!1;M[Dr]=Se=>{Z||(Z=!0,Se?N(y,[M]):N(V,[M]),O.delayedLeave&&O.delayedLeave(),M[Dr]=void 0)};const ne=M[Dr].bind(null,!1);q?x(q,[M,ne]):ne()},leave(M,q){const V=String(t.key);if(M[Dr]&&M[Dr](!0),n.isUnmounting)return q();N(u,[M]);let y=!1;M[dn]=ne=>{y||(y=!0,q(),ne?N(E,[M]):N(p,[M]),M[dn]=void 0,A[V]===t&&delete A[V])};const Z=M[dn].bind(null,!1);A[V]=t,m?x(m,[M,Z]):Z()},clone(M){const q=_c(M,e,n,r,i);return i&&i(q),q}};return O}function ua(t){if(Wi(t))return t=Bn(t),t.children=null,t}function C_(t){if(!Wi(t))return Bg(t.type)&&t.children?qg(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&Ue(n.default))return n.default()}}function Wr(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Wr(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function $g(t,e=!1,n){let r=[],i=0;for(let a=0;a1)for(let a=0;aBr(E,e&&(Ae(e)?e[f]:e),n,r,i));return}if(br(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Br(t,e,n,r.component.subTree);return}const a=r.shapeFlag&4?Ji(r.component):r.el,s=i?null:a,{i:o,r:c}=t,_=e&&e.r,l=o.refs===ut?o.refs={}:o.refs,d=o.setupState,u=Xe(d),m=d===ut?ng:E=>v_(l,E)?!1:it(u,E),p=(E,f)=>!(f&&v_(l,f));if(_!=null&&_!==c){if(N_(e),Et(_))l[_]=null,m(_)&&(d[_]=null);else if(bt(_)){const E=e;p(_,E.k)&&(_.value=null),E.k&&(l[E.k]=null)}}if(Ue(c))ti(c,o,12,[s,l]);else{const E=Et(c),f=bt(c);if(E||f){const T=()=>{if(t.f){const b=E?m(c)?d[c]:l[c]:p()||!t.k?c.value:l[t.k];if(i)Ae(b)&&Ic(b,a);else if(Ae(b))b.includes(a)||b.push(a);else if(E)l[c]=[a],m(c)&&(d[c]=l[c]);else{const v=[a];p(c,t.k)&&(c.value=v),t.k&&(l[t.k]=v)}}else E?(l[c]=s,m(c)&&(d[c]=s)):f&&(p(c,t.k)&&(c.value=s),t.k&&(l[t.k]=s))};if(s){const b=()=>{T(),Oi.delete(t)};b.id=-1,Oi.set(t,b),kt(b,n)}else N_(t),T()}}}function N_(t){const e=Oi.get(t);e&&(e.flags|=8,Oi.delete(t))}qi().requestIdleCallback;qi().cancelIdleCallback;const br=t=>!!t.type.__asyncLoader,Wi=t=>t.type.__isKeepAlive;function Gc(t,e){Wg(t,"a",e)}function zg(t,e){Wg(t,"da",e)}function Wg(t,e,n=wt){const r=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(Ki(e,r,n),n){let i=n.parent;for(;i&&i.parent;)Wi(i.parent.vnode)&&rf(r,e,n,i),i=i.parent}}function rf(t,e,n,r){const i=Ki(e,t,r,!0);Yn(()=>{Ic(r[e],i)},n)}function Ki(t,e,n=wt,r=!1){if(n){const i=n[t]||(n[t]=[]),a=e.__weh||(e.__weh=(...s)=>{Dn();const o=ri(n),c=rn(e,n,t,s);return o(),Mn(),c});return r?i.unshift(a):i.push(a),a}}const Ln=t=>(e,n=wt)=>{(!Xr||t==="sp")&&Ki(t,(...r)=>e(...r),n)},af=Ln("bm"),Sn=Ln("m"),of=Ln("bu"),sf=Ln("u"),or=Ln("bum"),Yn=Ln("um"),lf=Ln("sp"),cf=Ln("rtg"),_f=Ln("rtc");function df(t,e=wt){Ki("ec",t,e)}const uf="components",Kg=Symbol.for("v-ndc");function Qi(t){return Et(t)?pf(uf,t,!1)||t:t||Kg}function pf(t,e,n=!0,r=!1){const i=It||wt;if(i){const a=i.type;{const o=Jf(a,!1);if(o&&(o===e||o===Gt(e)||o===Yi(Gt(e))))return a}const s=O_(i[t]||a[t],e)||O_(i.appContext[t],e);return!s&&r?a:s}}function O_(t,e){return t&&(t[e]||t[Gt(e)]||t[Yi(Gt(e))])}function an(t,e,n,r){let i;const a=n,s=Ae(t);if(s||Et(t)){const o=s&&An(t);let c=!1,_=!1;o&&(c=!$t(t),_=xn(t),t=Hi(t)),i=new Array(t.length);for(let l=0,d=t.length;le(o,c,void 0,a));else{const o=Object.keys(t);i=new Array(o.length);for(let c=0,_=o.length;c<_;c++){const l=o[c];i[c]=e(t[l],l,c,a)}}else i=[];return i}function mf(t,e){for(let n=0;n{const a=r.fn(...i);return a&&(a.key=r.key),a}:r.fn)}return t}function gn(t,e,n={},r,i){if(It.ce||It.parent&&br(It.parent)&&It.parent.ce){const _=Object.keys(n).length>0;return e!=="default"&&(n.name=e),w(),gt(ct,null,[Qe("slot",n,r)],_?-2:64)}let a=t[e];a&&a._c&&(a._d=!1),w();const s=a&&Qg(a(n)),o=n.key||s&&s.key,c=gt(ct,{key:(o&&!Vt(o)?o:`_${e}`)+(!s&&r?"_fb":"")},s||[],s&&t._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),a&&a._c&&(a._d=!0),c}function Qg(t){return t.some(e=>Qr(e)?!(e.type===Lt||e.type===ct&&!Qg(e.children)):!0)?t:null}function gf(t,e){const n={};for(const r in t)n[Ei(r)]=t[r];return n}const dc=t=>t?gE(t)?Ji(t):dc(t.parent):null,Gr=yt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>dc(t.parent),$root:t=>dc(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Zg(t),$forceUpdate:t=>t.f||(t.f=()=>{Fc(t.update)}),$nextTick:t=>t.n||(t.n=Ft.bind(t.proxy)),$watch:t=>XS.bind(t)}),pa=(t,e)=>t!==ut&&!t.__isScriptSetup&&it(t,e),Ef={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:a,accessCache:s,type:o,appContext:c}=t;if(e[0]!=="$"){const u=s[e];if(u!==void 0)switch(u){case 1:return r[e];case 2:return i[e];case 4:return n[e];case 3:return a[e]}else{if(pa(r,e))return s[e]=1,r[e];if(i!==ut&&it(i,e))return s[e]=2,i[e];if(it(a,e))return s[e]=3,a[e];if(n!==ut&&it(n,e))return s[e]=4,n[e];uc&&(s[e]=0)}}const _=Gr[e];let l,d;if(_)return e==="$attrs"&&xt(t.attrs,"get",""),_(t);if((l=o.__cssModules)&&(l=l[e]))return l;if(n!==ut&&it(n,e))return s[e]=4,n[e];if(d=c.config.globalProperties,it(d,e))return d[e]},set({_:t},e,n){const{data:r,setupState:i,ctx:a}=t;return pa(i,e)?(i[e]=n,!0):r!==ut&&it(r,e)?(r[e]=n,!0):it(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(a[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:i,props:a,type:s}},o){let c;return!!(n[o]||t!==ut&&o[0]!=="$"&&it(t,o)||pa(e,o)||it(a,o)||it(r,o)||it(Gr,o)||it(i.config.globalProperties,o)||(c=s.__cssModules)&&c[o])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:it(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function y_(t){return Ae(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let uc=!0;function Sf(t){const e=Zg(t),n=t.proxy,r=t.ctx;uc=!1,e.beforeCreate&&I_(e.beforeCreate,t,"bc");const{data:i,computed:a,methods:s,watch:o,provide:c,inject:_,created:l,beforeMount:d,mounted:u,beforeUpdate:m,updated:p,activated:E,deactivated:f,beforeDestroy:T,beforeUnmount:b,destroyed:v,unmounted:C,render:A,renderTracked:N,renderTriggered:x,errorCaptured:O,serverPrefetch:M,expose:q,inheritAttrs:V,components:y,directives:Z,filters:ne}=e;if(_&&ff(_,r,null),s)for(const se in s){const be=s[se];Ue(be)&&(r[se]=be.bind(n))}if(i){const se=i.call(n,n);at(se)&&(t.data=ei(se))}if(uc=!0,a)for(const se in a){const be=a[se],me=Ue(be)?be.bind(n,n):Ue(be.get)?be.get.bind(n,n):En,Le=!Ue(be)&&Ue(be.set)?be.set.bind(n):En,Be=fe({get:me,set:Le});Object.defineProperty(r,se,{enumerable:!0,configurable:!0,get:()=>Be.value,set:He=>Be.value=He})}if(o)for(const se in o)Xg(o[se],r,n,se);if(c){const se=Ue(c)?c.call(n):c;Reflect.ownKeys(se).forEach(be=>{pr(be,se[be])})}l&&I_(l,t,"c");function oe(se,be){Ae(be)?be.forEach(me=>se(me.bind(n))):be&&se(be.bind(n))}if(oe(af,d),oe(Sn,u),oe(of,m),oe(sf,p),oe(Gc,E),oe(zg,f),oe(df,O),oe(_f,N),oe(cf,x),oe(or,b),oe(Yn,C),oe(lf,M),Ae(q))if(q.length){const se=t.exposed||(t.exposed={});q.forEach(be=>{Object.defineProperty(se,be,{get:()=>n[be],set:me=>n[be]=me,enumerable:!0})})}else t.exposed||(t.exposed={});A&&t.render===En&&(t.render=A),V!=null&&(t.inheritAttrs=V),y&&(t.components=y),Z&&(t.directives=Z),M&&Vg(t)}function ff(t,e,n=En){Ae(t)&&(t=pc(t));for(const r in t){const i=t[r];let a;at(i)?"default"in i?a=er(i.from||r,i.default,!0):a=er(i.from||r):a=er(i),bt(a)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>a.value,set:s=>a.value=s}):e[r]=a}}function I_(t,e,n){rn(Ae(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function Xg(t,e,n,r){let i=r.includes(".")?Ug(n,r):()=>n[r];if(Et(t)){const a=e[t];Ue(a)&&Ye(i,a)}else if(Ue(t))Ye(i,t.bind(n));else if(at(t))if(Ae(t))t.forEach(a=>Xg(a,e,n,r));else{const a=Ue(t.handler)?t.handler.bind(n):e[t.handler];Ue(a)&&Ye(i,a,t)}}function Zg(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:i,optionsCache:a,config:{optionMergeStrategies:s}}=t.appContext,o=a.get(e);let c;return o?c=o:!i.length&&!n&&!r?c=e:(c={},i.length&&i.forEach(_=>yi(c,_,s,!0)),yi(c,e,s)),at(e)&&a.set(e,c),c}function yi(t,e,n,r=!1){const{mixins:i,extends:a}=e;a&&yi(t,a,n,!0),i&&i.forEach(s=>yi(t,s,n,!0));for(const s in e)if(!(r&&s==="expose")){const o=Tf[s]||n&&n[s];t[s]=o?o(t[s],e[s]):e[s]}return t}const Tf={data:A_,props:D_,emits:D_,methods:Pr,computed:Pr,beforeCreate:Pt,created:Pt,beforeMount:Pt,mounted:Pt,beforeUpdate:Pt,updated:Pt,beforeDestroy:Pt,beforeUnmount:Pt,destroyed:Pt,unmounted:Pt,activated:Pt,deactivated:Pt,errorCaptured:Pt,serverPrefetch:Pt,components:Pr,directives:Pr,watch:Rf,provide:A_,inject:bf};function A_(t,e){return e?t?function(){return yt(Ue(t)?t.call(this,this):t,Ue(e)?e.call(this,this):e)}:e:t}function bf(t,e){return Pr(pc(t),pc(e))}function pc(t){if(Ae(t)){const e={};for(let n=0;ne==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Gt(e)}Modifiers`]||t[`${Gn(e)}Modifiers`];function Nf(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||ut;let i=n;const a=e.startsWith("update:"),s=a&&vf(r,e.slice(7));s&&(s.trim&&(i=n.map(l=>Et(l)?l.trim():l)),s.number&&(i=n.map(Ac)));let o,c=r[o=Ei(e)]||r[o=Ei(Gt(e))];!c&&a&&(c=r[o=Ei(Gn(e))]),c&&rn(c,t,6,i);const _=r[o+"Once"];if(_){if(!t.emitted)t.emitted={};else if(t.emitted[o])return;t.emitted[o]=!0,rn(_,t,6,i)}}const Of=new WeakMap;function jg(t,e,n=!1){const r=n?Of:e.emitsCache,i=r.get(t);if(i!==void 0)return i;const a=t.emits;let s={},o=!1;if(!Ue(t)){const c=_=>{const l=jg(_,e,!0);l&&(o=!0,yt(s,l))};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!a&&!o?(at(t)&&r.set(t,null),null):(Ae(a)?a.forEach(c=>s[c]=null):yt(s,a),at(t)&&r.set(t,s),s)}function Xi(t,e){return!t||!Ui(e)?!1:(e=e.slice(2).replace(/Once$/,""),it(t,e[0].toLowerCase()+e.slice(1))||it(t,Gn(e))||it(t,e))}function M_(t){const{type:e,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:o,emit:c,render:_,renderCache:l,props:d,data:u,setupState:m,ctx:p,inheritAttrs:E}=t,f=Ni(t);let T,b;try{if(n.shapeFlag&4){const C=i||r,A=C;T=pn(_.call(A,C,l,d,m,u,p)),b=o}else{const C=e;T=pn(C.length>1?C(d,{attrs:o,slots:s,emit:c}):C(d,null)),b=e.props?o:yf(o)}}catch(C){Yr.length=0,zi(C,t,1),T=Qe(Lt)}let v=T;if(b&&E!==!1){const C=Object.keys(b),{shapeFlag:A}=v;C.length&&A&7&&(a&&C.some(Fi)&&(b=If(b,a)),v=Bn(v,b,!1,!0))}return n.dirs&&(v=Bn(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Wr(v,n.transition),T=v,Ni(f),T}const yf=t=>{let e;for(const n in t)(n==="class"||n==="style"||Ui(n))&&((e||(e={}))[n]=t[n]);return e},If=(t,e)=>{const n={};for(const r in t)(!Fi(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function Af(t,e,n){const{props:r,children:i,component:a}=t,{props:s,children:o,patchFlag:c}=e,_=a.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?x_(r,s,_):!!s;if(c&8){const l=e.dynamicProps;for(let d=0;dObject.create(tE),rE=t=>Object.getPrototypeOf(t)===tE;function Mf(t,e,n,r=!1){const i={},a=nE();t.propsDefaults=Object.create(null),iE(t,e,i,a);for(const s in t.propsOptions[0])s in i||(i[s]=void 0);n?t.props=r?i:yg(i):t.type.props?t.props=i:t.props=a,t.attrs=a}function xf(t,e,n,r){const{props:i,attrs:a,vnode:{patchFlag:s}}=t,o=Xe(i),[c]=t.propsOptions;let _=!1;if((r||s>0)&&!(s&16)){if(s&8){const l=t.vnode.dynamicProps;for(let d=0;d{c=!0;const[u,m]=aE(d,e,!0);yt(s,u),m&&o.push(...m)};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}if(!a&&!c)return at(t)&&r.set(t,Sr),Sr;if(Ae(a))for(let l=0;lt==="_"||t==="_ctx"||t==="$stable",qc=t=>Ae(t)?t.map(pn):[pn(t)],wf=(t,e,n)=>{if(e._n)return e;const r=At((...i)=>qc(e(...i)),n);return r._c=!1,r},oE=(t,e,n)=>{const r=t._ctx;for(const i in t){if(Yc(i))continue;const a=t[i];if(Ue(a))e[i]=wf(i,a,r);else if(a!=null){const s=qc(a);e[i]=()=>s}}},sE=(t,e)=>{const n=qc(e);t.slots.default=()=>n},lE=(t,e,n)=>{for(const r in e)(n||!Yc(r))&&(t[r]=e[r])},Pf=(t,e,n)=>{const r=t.slots=nE();if(t.vnode.shapeFlag&32){const i=e._;i?(lE(r,e,n),n&&sg(r,"_",i,!0)):oE(e,r)}else e&&sE(t,e)},kf=(t,e,n)=>{const{vnode:r,slots:i}=t;let a=!0,s=ut;if(r.shapeFlag&32){const o=e._;o?n&&o===1?a=!1:lE(i,e,n):(a=!e.$stable,oE(e,i)),s=e}else e&&(sE(t,e),s={default:1});if(a)for(const o in i)!Yc(o)&&s[o]==null&&delete i[o]},kt=Yf;function Uf(t){return Ff(t)}function Ff(t,e){const n=qi();n.__VUE__=!0;const{insert:r,remove:i,patchProp:a,createElement:s,createText:o,createComment:c,setText:_,setElementText:l,parentNode:d,nextSibling:u,setScopeId:m=En,insertStaticContent:p}=t,E=(g,S,I,F=null,B=null,G=null,Q=void 0,j=null,J=!!S.dynamicChildren)=>{if(g===S)return;g&&!Zn(g,S)&&(F=D(g),He(g,B,G,!0),g=null),S.patchFlag===-2&&(J=!1,S.dynamicChildren=null);const{type:W,ref:Ce,shapeFlag:_e}=S;switch(W){case Zi:f(g,S,I,F);break;case Lt:T(g,S,I,F);break;case fi:g==null&&b(S,I,F,Q);break;case ct:y(g,S,I,F,B,G,Q,j,J);break;default:_e&1?A(g,S,I,F,B,G,Q,j,J):_e&6?Z(g,S,I,F,B,G,Q,j,J):(_e&64||_e&128)&&W.process(g,S,I,F,B,G,Q,j,J,ee)}Ce!=null&&B?Br(Ce,g&&g.ref,G,S||g,!S):Ce==null&&g&&g.ref!=null&&Br(g.ref,null,G,g,!0)},f=(g,S,I,F)=>{if(g==null)r(S.el=o(S.children),I,F);else{const B=S.el=g.el;S.children!==g.children&&_(B,S.children)}},T=(g,S,I,F)=>{g==null?r(S.el=c(S.children||""),I,F):S.el=g.el},b=(g,S,I,F)=>{[g.el,g.anchor]=p(g.children,S,I,F,g.el,g.anchor)},v=({el:g,anchor:S},I,F)=>{let B;for(;g&&g!==S;)B=u(g),r(g,I,F),g=B;r(S,I,F)},C=({el:g,anchor:S})=>{let I;for(;g&&g!==S;)I=u(g),i(g),g=I;i(S)},A=(g,S,I,F,B,G,Q,j,J)=>{if(S.type==="svg"?Q="svg":S.type==="math"&&(Q="mathml"),g==null)N(S,I,F,B,G,Q,j,J);else{const W=g.el&&g.el._isVueCE?g.el:null;try{W&&W._beginPatch(),M(g,S,B,G,Q,j,J)}finally{W&&W._endPatch()}}},N=(g,S,I,F,B,G,Q,j)=>{let J,W;const{props:Ce,shapeFlag:_e,transition:ce,dirs:ve}=g;if(J=g.el=s(g.type,G,Ce&&Ce.is,Ce),_e&8?l(J,g.children):_e&16&&O(g.children,J,null,F,B,ma(g,G),Q,j),ve&&$n(g,null,F,"created"),x(J,g,g.scopeId,Q,F),Ce){for(const qe in Ce)qe!=="value"&&!kr(qe)&&a(J,qe,null,Ce[qe],G,F);"value"in Ce&&a(J,"value",null,Ce.value,G),(W=Ce.onVnodeBeforeMount)&&ln(W,F,g)}ve&&$n(g,null,F,"beforeMount");const Me=Bf(B,ce);Me&&ce.beforeEnter(J),r(J,S,I),((W=Ce&&Ce.onVnodeMounted)||Me||ve)&&kt(()=>{try{W&&ln(W,F,g),Me&&ce.enter(J),ve&&$n(g,null,F,"mounted")}finally{}},B)},x=(g,S,I,F,B)=>{if(I&&m(g,I),F)for(let G=0;G{for(let W=J;W{const j=S.el=g.el;let{patchFlag:J,dynamicChildren:W,dirs:Ce}=S;J|=g.patchFlag&16;const _e=g.props||ut,ce=S.props||ut;let ve;if(I&&zn(I,!1),(ve=ce.onVnodeBeforeUpdate)&&ln(ve,I,S,g),Ce&&$n(S,g,I,"beforeUpdate"),I&&zn(I,!0),(_e.innerHTML&&ce.innerHTML==null||_e.textContent&&ce.textContent==null)&&l(j,""),W?q(g.dynamicChildren,W,j,I,F,ma(S,B),G):Q||be(g,S,j,null,I,F,ma(S,B),G,!1),J>0){if(J&16)V(j,_e,ce,I,B);else if(J&2&&_e.class!==ce.class&&a(j,"class",null,ce.class,B),J&4&&a(j,"style",_e.style,ce.style,B),J&8){const Me=S.dynamicProps;for(let qe=0;qe{ve&&ln(ve,I,S,g),Ce&&$n(S,g,I,"updated")},F)},q=(g,S,I,F,B,G,Q)=>{for(let j=0;j{if(S!==I){if(S!==ut)for(const G in S)!kr(G)&&!(G in I)&&a(g,G,S[G],null,B,F);for(const G in I){if(kr(G))continue;const Q=I[G],j=S[G];Q!==j&&G!=="value"&&a(g,G,j,Q,B,F)}"value"in I&&a(g,"value",S.value,I.value,B)}},y=(g,S,I,F,B,G,Q,j,J)=>{const W=S.el=g?g.el:o(""),Ce=S.anchor=g?g.anchor:o("");let{patchFlag:_e,dynamicChildren:ce,slotScopeIds:ve}=S;ve&&(j=j?j.concat(ve):ve),g==null?(r(W,I,F),r(Ce,I,F),O(S.children||[],I,Ce,B,G,Q,j,J)):_e>0&&_e&64&&ce&&g.dynamicChildren&&g.dynamicChildren.length===ce.length?(q(g.dynamicChildren,ce,I,B,G,Q,j),(S.key!=null||B&&S===B.subTree)&&Hc(g,S,!0)):be(g,S,I,Ce,B,G,Q,j,J)},Z=(g,S,I,F,B,G,Q,j,J)=>{S.slotScopeIds=j,g==null?S.shapeFlag&512?B.ctx.activate(S,I,F,Q,J):ne(S,I,F,B,G,Q,J):Se(g,S,J)},ne=(g,S,I,F,B,G,Q)=>{const j=g.component=Wf(g,F,B);if(Wi(g)&&(j.ctx.renderer=ee),Kf(j,!1,Q),j.asyncDep){if(B&&B.registerDep(j,oe,Q),!g.el){const J=j.subTree=Qe(Lt);T(null,J,S,I),g.placeholder=J.el}}else oe(j,g,S,I,B,G,Q)},Se=(g,S,I)=>{const F=S.component=g.component;if(Af(g,S,I))if(F.asyncDep&&!F.asyncResolved){se(F,S,I);return}else F.next=S,F.update();else S.el=g.el,F.vnode=S},oe=(g,S,I,F,B,G,Q)=>{const j=()=>{if(g.isMounted){let{next:_e,bu:ce,u:ve,parent:Me,vnode:qe}=g;{const H=cE(g);if(H){_e&&(_e.el=qe.el,se(g,_e,Q)),H.asyncDep.then(()=>{kt(()=>{g.isUnmounted||W()},B)});return}}let We=_e,nt;zn(g,!1),_e?(_e.el=qe.el,se(g,_e,Q)):_e=qe,ce&&Si(ce),(nt=_e.props&&_e.props.onVnodeBeforeUpdate)&&ln(nt,Me,_e,qe),zn(g,!0);const Ke=M_(g),k=g.subTree;g.subTree=Ke,E(k,Ke,d(k.el),D(k),g,B,G),_e.el=Ke.el,We===null&&Df(g,Ke.el),ve&&kt(ve,B),(nt=_e.props&&_e.props.onVnodeUpdated)&&kt(()=>ln(nt,Me,_e,qe),B)}else{let _e;const{el:ce,props:ve}=S,{bm:Me,m:qe,parent:We,root:nt,type:Ke}=g,k=br(S);zn(g,!1),Me&&Si(Me),!k&&(_e=ve&&ve.onVnodeBeforeMount)&&ln(_e,We,S),zn(g,!0);{nt.ce&&nt.ce._hasShadowRoot()&&nt.ce._injectChildStyle(Ke,g.parent?g.parent.type:void 0);const H=g.subTree=M_(g);E(null,H,I,F,g,B,G),S.el=H.el}if(qe&&kt(qe,B),!k&&(_e=ve&&ve.onVnodeMounted)){const H=S;kt(()=>ln(_e,We,H),B)}(S.shapeFlag&256||We&&br(We.vnode)&&We.vnode.shapeFlag&256)&&g.a&&kt(g.a,B),g.isMounted=!0,S=I=F=null}};g.scope.on();const J=g.effect=new pg(j);g.scope.off();const W=g.update=J.run.bind(J),Ce=g.job=J.runIfDirty.bind(J);Ce.i=g,Ce.id=g.uid,J.scheduler=()=>Fc(Ce),zn(g,!0),W()},se=(g,S,I)=>{S.component=g;const F=g.vnode.props;g.vnode=S,g.next=null,xf(g,S.props,F,I),kf(g,S.children,I),Dn(),b_(g),Mn()},be=(g,S,I,F,B,G,Q,j,J=!1)=>{const W=g&&g.children,Ce=g?g.shapeFlag:0,_e=S.children,{patchFlag:ce,shapeFlag:ve}=S;if(ce>0){if(ce&128){Le(W,_e,I,F,B,G,Q,j,J);return}else if(ce&256){me(W,_e,I,F,B,G,Q,j,J);return}}ve&8?(Ce&16&&K(W,B,G),_e!==W&&l(I,_e)):Ce&16?ve&16?Le(W,_e,I,F,B,G,Q,j,J):K(W,B,G,!0):(Ce&8&&l(I,""),ve&16&&O(_e,I,F,B,G,Q,j,J))},me=(g,S,I,F,B,G,Q,j,J)=>{g=g||Sr,S=S||Sr;const W=g.length,Ce=S.length,_e=Math.min(W,Ce);let ce;for(ce=0;ce<_e;ce++){const ve=S[ce]=J?vn(S[ce]):pn(S[ce]);E(g[ce],ve,I,null,B,G,Q,j,J)}W>Ce?K(g,B,G,!0,!1,_e):O(S,I,F,B,G,Q,j,J,_e)},Le=(g,S,I,F,B,G,Q,j,J)=>{let W=0;const Ce=S.length;let _e=g.length-1,ce=Ce-1;for(;W<=_e&&W<=ce;){const ve=g[W],Me=S[W]=J?vn(S[W]):pn(S[W]);if(Zn(ve,Me))E(ve,Me,I,null,B,G,Q,j,J);else break;W++}for(;W<=_e&&W<=ce;){const ve=g[_e],Me=S[ce]=J?vn(S[ce]):pn(S[ce]);if(Zn(ve,Me))E(ve,Me,I,null,B,G,Q,j,J);else break;_e--,ce--}if(W>_e){if(W<=ce){const ve=ce+1,Me=vece)for(;W<=_e;)He(g[W],B,G,!0),W++;else{const ve=W,Me=W,qe=new Map;for(W=Me;W<=ce;W++){const Ee=S[W]=J?vn(S[W]):pn(S[W]);Ee.key!=null&&qe.set(Ee.key,W)}let We,nt=0;const Ke=ce-Me+1;let k=!1,H=0;const ae=new Array(Ke);for(W=0;W=Ke){He(Ee,B,G,!0);continue}let he;if(Ee.key!=null)he=qe.get(Ee.key);else for(We=Me;We<=ce;We++)if(ae[We-Me]===0&&Zn(Ee,S[We])){he=We;break}he===void 0?He(Ee,B,G,!0):(ae[he-Me]=W+1,he>=H?H=he:k=!0,E(Ee,S[he],I,null,B,G,Q,j,J),nt++)}const ye=k?Gf(ae):Sr;for(We=ye.length-1,W=Ke-1;W>=0;W--){const Ee=Me+W,he=S[Ee],we=S[Ee+1],ze=Ee+1{const{el:G,type:Q,transition:j,children:J,shapeFlag:W}=g;if(W&6){Be(g.component.subTree,S,I,F);return}if(W&128){g.suspense.move(S,I,F);return}if(W&64){Q.move(g,S,I,ee);return}if(Q===ct){r(G,S,I);for(let _e=0;_ej.enter(G),B);else{const{leave:_e,delayLeave:ce,afterLeave:ve}=j,Me=()=>{g.ctx.isUnmounted?i(G):r(G,S,I)},qe=()=>{G._isLeaving&&G[dn](!0),_e(G,()=>{Me(),ve&&ve()})};ce?ce(G,Me,qe):qe()}else r(G,S,I)},He=(g,S,I,F=!1,B=!1)=>{const{type:G,props:Q,ref:j,children:J,dynamicChildren:W,shapeFlag:Ce,patchFlag:_e,dirs:ce,cacheIndex:ve,memo:Me}=g;if(_e===-2&&(B=!1),j!=null&&(Dn(),Br(j,null,I,g,!0),Mn()),ve!=null&&(S.renderCache[ve]=void 0),Ce&256){S.ctx.deactivate(g);return}const qe=Ce&1&&ce,We=!br(g);let nt;if(We&&(nt=Q&&Q.onVnodeBeforeUnmount)&&ln(nt,S,g),Ce&6)$(g.component,I,F);else{if(Ce&128){g.suspense.unmount(I,F);return}qe&&$n(g,null,S,"beforeUnmount"),Ce&64?g.type.remove(g,S,I,ee,F):W&&!W.hasOnce&&(G!==ct||_e>0&&_e&64)?K(W,S,I,!1,!0):(G===ct&&_e&384||!B&&Ce&16)&&K(J,S,I),F&&st(g)}const Ke=Me!=null&&ve==null;(We&&(nt=Q&&Q.onVnodeUnmounted)||qe||Ke)&&kt(()=>{nt&&ln(nt,S,g),qe&&$n(g,null,S,"unmounted"),Ke&&(g.el=null)},I)},st=g=>{const{type:S,el:I,anchor:F,transition:B}=g;if(S===ct){L(I,F);return}if(S===fi){C(g);return}const G=()=>{i(I),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(g.shapeFlag&1&&B&&!B.persisted){const{leave:Q,delayLeave:j}=B,J=()=>Q(I,G);j?j(g.el,G,J):J()}else G()},L=(g,S)=>{let I;for(;g!==S;)I=u(g),i(g),g=I;i(S)},$=(g,S,I)=>{const{bum:F,scope:B,job:G,subTree:Q,um:j,m:J,a:W}=g;w_(J),w_(W),F&&Si(F),B.stop(),G&&(G.flags|=8,He(Q,g,S,I)),j&&kt(j,S),kt(()=>{g.isUnmounted=!0},S)},K=(g,S,I,F=!1,B=!1,G=0)=>{for(let Q=G;Q{if(g.shapeFlag&6)return D(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const S=u(g.anchor||g.el),I=S&&S[Fg];return I?u(I):S};let P=!1;const z=(g,S,I)=>{let F;g==null?S._vnode&&(He(S._vnode,null,null,!0),F=S._vnode.component):E(S._vnode||null,g,S,null,null,null,I),S._vnode=g,P||(P=!0,b_(F),xg(),P=!1)},ee={p:E,um:He,m:Be,r:st,mt:ne,mc:O,pc:be,pbc:q,n:D,o:t};return{render:z,hydrate:void 0,createApp:Cf(z)}}function ma({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function zn({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Bf(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Hc(t,e,n=!1){const r=t.children,i=e.children;if(Ae(r)&&Ae(i))for(let a=0;a>1,t[n[o]]<_?a=o+1:s=o;_0&&(e[r]=n[a-1]),n[a]=r)}}for(a=n.length,s=n[a-1];a-- >0;)n[a]=s,s=e[s];return n}function cE(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:cE(e)}function w_(t){if(t)for(let e=0;et.__isSuspense;function Yf(t,e){e&&e.pendingBranch?Ae(t)?e.effects.push(...t):e.effects.push(t):zS(t)}const ct=Symbol.for("v-fgt"),Zi=Symbol.for("v-txt"),Lt=Symbol.for("v-cmt"),fi=Symbol.for("v-stc"),Yr=[];let Ht=null;function w(t=!1){Yr.push(Ht=t?null:[])}function qf(){Yr.pop(),Ht=Yr[Yr.length-1]||null}let Kr=1;function Ii(t,e=!1){Kr+=t,t<0&&Ht&&e&&(Ht.hasOnce=!0)}function uE(t){return t.dynamicChildren=Kr>0?Ht||Sr:null,qf(),Kr>0&&Ht&&Ht.push(t),t}function U(t,e,n,r,i,a){return uE(h(t,e,n,r,i,a,!0))}function gt(t,e,n,r,i){return uE(Qe(t,e,n,r,i,!0))}function Qr(t){return t?t.__v_isVNode===!0:!1}function Zn(t,e){return t.type===e.type&&t.key===e.key}const pE=({key:t})=>t??null,Ti=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Et(t)||bt(t)||Ue(t)?{i:It,r:t,k:e,f:!!n}:t:null);function h(t,e=null,n=null,r=0,i=null,a=t===ct?0:1,s=!1,o=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&pE(e),ref:e&&Ti(e),scopeId:wg,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:It};return o?($c(c,n),a&128&&t.normalize(c)):n&&(c.shapeFlag|=Et(n)?8:16),Kr>0&&!s&&Ht&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Ht.push(c),c}const Qe=Hf;function Hf(t,e=null,n=null,r=0,i=null,a=!1){if((!t||t===Kg)&&(t=Lt),Qr(t)){const o=Bn(t,e,!0);return n&&$c(o,n),Kr>0&&!a&&Ht&&(o.shapeFlag&6?Ht[Ht.indexOf(t)]=o:Ht.push(o)),o.patchFlag=-2,o}if(jf(t)&&(t=t.__vccOpts),e){e=mE(e);let{class:o,style:c}=e;o&&!Et(o)&&(e.class=Ze(o)),at(c)&&($i(c)&&!Ae(c)&&(c=yt({},c)),e.style=ar(c))}const s=Et(t)?1:dE(t)?128:Bg(t)?64:at(t)?4:Ue(t)?2:0;return h(t,e,n,r,i,s,a,!0)}function mE(t){return t?$i(t)||rE(t)?yt({},t):t:null}function Bn(t,e,n=!1,r=!1){const{props:i,ref:a,patchFlag:s,children:o,transition:c}=t,_=e?Ai(i||{},e):i,l={__v_isVNode:!0,__v_skip:!0,type:t.type,props:_,key:_&&pE(_),ref:e&&e.ref?n&&a?Ae(a)?a.concat(Ti(e)):[a,Ti(e)]:Ti(e):a,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ct?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Bn(t.ssContent),ssFallback:t.ssFallback&&Bn(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&r&&Wr(l,c.clone(l)),l}function Ct(t=" ",e=0){return Qe(Zi,null,t,e)}function $f(t,e){const n=Qe(fi,null,t);return n.staticCount=e,n}function Ie(t="",e=!1){return e?(w(),gt(Lt,null,t)):Qe(Lt,null,t)}function pn(t){return t==null||typeof t=="boolean"?Qe(Lt):Ae(t)?Qe(ct,null,t.slice()):Qr(t)?vn(t):Qe(Zi,null,String(t))}function vn(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Bn(t)}function $c(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(Ae(e))n=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),$c(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!rE(e)?e._ctx=It:i===3&&It&&(It.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Ue(e)?(e={default:e,_ctx:It},n=32):(e=String(e),r&64?(n=16,e=[Ct(e)]):n=8);t.children=e,t.shapeFlag|=n}function Ai(...t){const e={};for(let n=0;nwt||It;let Di,gc;{const t=qi(),e=(n,r)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(r),a=>{i.length>1?i.forEach(s=>s(a)):i[0](a)}};Di=e("__VUE_INSTANCE_SETTERS__",n=>wt=n),gc=e("__VUE_SSR_SETTERS__",n=>Xr=n)}const ri=t=>{const e=wt;return Di(t),t.scope.on(),()=>{t.scope.off(),Di(e)}},P_=()=>{wt&&wt.scope.off(),Di(null)};function gE(t){return t.vnode.shapeFlag&4}let Xr=!1;function Kf(t,e=!1,n=!1){e&&gc(e);const{props:r,children:i}=t.vnode,a=gE(t);Mf(t,r,a,e),Pf(t,i,n||e);const s=a?Qf(t,e):void 0;return e&&gc(!1),s}function Qf(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Ef);const{setup:r}=n;if(r){Dn();const i=t.setupContext=r.length>1?Zf(t):null,a=ri(t),s=ti(r,t,0,[t.props,i]),o=ig(s);if(Mn(),a(),(o||t.sp)&&!br(t)&&Vg(t),o){if(s.then(P_,P_),e)return s.then(c=>{k_(t,c)}).catch(c=>{zi(c,t,0)});t.asyncDep=s}else k_(t,s)}else EE(t)}function k_(t,e,n){Ue(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:at(e)&&(t.setupState=Ag(e)),EE(t)}function EE(t,e,n){const r=t.type;t.render||(t.render=r.render||En);{const i=ri(t);Dn();try{Sf(t)}finally{Mn(),i()}}}const Xf={get(t,e){return xt(t,"get",""),t[e]}};function Zf(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,Xf),slots:t.slots,emit:t.emit,expose:e}}function Ji(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Ag(Vi(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Gr)return Gr[n](t)},has(e,n){return n in e||n in Gr}})):t.proxy}function Jf(t,e=!0){return Ue(t)?t.displayName||t.name:t.name||e&&t.__name}function jf(t){return Ue(t)&&"__vccOpts"in t}const fe=(t,e)=>YS(t,e,Xr);function eT(t,e,n){try{Ii(-1);const r=arguments.length;return r===2?at(e)&&!Ae(e)?Qr(e)?Qe(t,null,[e]):Qe(t,e):Qe(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Qr(n)&&(n=[n]),Qe(t,e,n))}finally{Ii(1)}}const tT="3.5.32";/**
-* @vue/runtime-dom v3.5.32
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/let Ec;const U_=typeof window<"u"&&window.trustedTypes;if(U_)try{Ec=U_.createPolicy("vue",{createHTML:t=>t})}catch{}const SE=Ec?t=>Ec.createHTML(t):t=>t,nT="http://www.w3.org/2000/svg",rT="http://www.w3.org/1998/Math/MathML",Cn=typeof document<"u"?document:null,F_=Cn&&Cn.createElement("template"),iT={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const i=e==="svg"?Cn.createElementNS(nT,t):e==="mathml"?Cn.createElementNS(rT,t):n?Cn.createElement(t,{is:n}):Cn.createElement(t);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Cn.createTextNode(t),createComment:t=>Cn.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Cn.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,i,a){const s=n?n.previousSibling:e.lastChild;if(i&&(i===a||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{F_.innerHTML=SE(r==="svg"?``:r==="mathml"?``:t);const o=F_.content;if(r==="svg"||r==="mathml"){const c=o.firstChild;for(;c.firstChild;)o.appendChild(c.firstChild);o.removeChild(c)}e.insertBefore(o,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},kn="transition",Mr="animation",Zr=Symbol("_vtc"),fE={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},aT=yt({},Gg,fE),oT=t=>(t.displayName="Transition",t.props=aT,t),hr=oT((t,{slots:e})=>eT(nf,sT(t),e)),Wn=(t,e=[])=>{Ae(t)?t.forEach(n=>n(...e)):t&&t(...e)},B_=t=>t?Ae(t)?t.some(e=>e.length>1):t.length>1:!1;function sT(t){const e={};for(const y in t)y in fE||(e[y]=t[y]);if(t.css===!1)return e;const{name:n="v",type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:o=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:_=s,appearToClass:l=o,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:u=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=t,p=lT(i),E=p&&p[0],f=p&&p[1],{onBeforeEnter:T,onEnter:b,onEnterCancelled:v,onLeave:C,onLeaveCancelled:A,onBeforeAppear:N=T,onAppear:x=b,onAppearCancelled:O=v}=e,M=(y,Z,ne,Se)=>{y._enterCancelled=Se,Kn(y,Z?l:o),Kn(y,Z?_:s),ne&&ne()},q=(y,Z)=>{y._isLeaving=!1,Kn(y,d),Kn(y,m),Kn(y,u),Z&&Z()},V=y=>(Z,ne)=>{const Se=y?x:b,oe=()=>M(Z,y,ne);Wn(Se,[Z,oe]),G_(()=>{Kn(Z,y?c:a),hn(Z,y?l:o),B_(Se)||Y_(Z,r,E,oe)})};return yt(e,{onBeforeEnter(y){Wn(T,[y]),hn(y,a),hn(y,s)},onBeforeAppear(y){Wn(N,[y]),hn(y,c),hn(y,_)},onEnter:V(!1),onAppear:V(!0),onLeave(y,Z){y._isLeaving=!0;const ne=()=>q(y,Z);hn(y,d),y._enterCancelled?(hn(y,u),$_(y)):($_(y),hn(y,u)),G_(()=>{y._isLeaving&&(Kn(y,d),hn(y,m),B_(C)||Y_(y,r,f,ne))}),Wn(C,[y,ne])},onEnterCancelled(y){M(y,!1,void 0,!0),Wn(v,[y])},onAppearCancelled(y){M(y,!0,void 0,!0),Wn(O,[y])},onLeaveCancelled(y){q(y),Wn(A,[y])}})}function lT(t){if(t==null)return null;if(at(t))return[ga(t.enter),ga(t.leave)];{const e=ga(t);return[e,e]}}function ga(t){return oS(t)}function hn(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Zr]||(t[Zr]=new Set)).add(e)}function Kn(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[Zr];n&&(n.delete(e),n.size||(t[Zr]=void 0))}function G_(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let cT=0;function Y_(t,e,n,r){const i=t._endId=++cT,a=()=>{i===t._endId&&r()};if(n!=null)return setTimeout(a,n);const{type:s,timeout:o,propCount:c}=_T(t,e);if(!s)return r();const _=s+"end";let l=0;const d=()=>{t.removeEventListener(_,u),a()},u=m=>{m.target===t&&++l>=c&&d()};setTimeout(()=>{l(n[p]||"").split(", "),i=r(`${kn}Delay`),a=r(`${kn}Duration`),s=q_(i,a),o=r(`${Mr}Delay`),c=r(`${Mr}Duration`),_=q_(o,c);let l=null,d=0,u=0;e===kn?s>0&&(l=kn,d=s,u=a.length):e===Mr?_>0&&(l=Mr,d=_,u=c.length):(d=Math.max(s,_),l=d>0?s>_?kn:Mr:null,u=l?l===kn?a.length:c.length:0);const m=l===kn&&/\b(?:transform|all)(?:,|$)/.test(r(`${kn}Property`).toString());return{type:l,timeout:d,propCount:u,hasTransform:m}}function q_(t,e){for(;t.lengthH_(n)+H_(t[r])))}function H_(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function $_(t){return(t?t.ownerDocument:document).body.offsetHeight}function dT(t,e,n){const r=t[Zr];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const V_=Symbol("_vod"),uT=Symbol("_vsh"),pT=Symbol(""),mT=/(?:^|;)\s*display\s*:/;function gT(t,e,n){const r=t.style,i=Et(n);let a=!1;if(n&&!i){if(e)if(Et(e))for(const s of e.split(";")){const o=s.slice(0,s.indexOf(":")).trim();n[o]==null&&bi(r,o,"")}else for(const s in e)n[s]==null&&bi(r,s,"");for(const s in n)s==="display"&&(a=!0),bi(r,s,n[s])}else if(i){if(e!==n){const s=r[pT];s&&(n+=";"+s),r.cssText=n,a=mT.test(n)}}else e&&t.removeAttribute("style");V_ in t&&(t[V_]=a?r.display:"",t[uT]&&(r.display="none"))}const z_=/\s*!important$/;function bi(t,e,n){if(Ae(n))n.forEach(r=>bi(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=ET(t,e);z_.test(n)?t.setProperty(Gn(r),n.replace(z_,""),"important"):t[r]=n}}const W_=["Webkit","Moz","ms"],Ea={};function ET(t,e){const n=Ea[e];if(n)return n;let r=Gt(e);if(r!=="filter"&&r in t)return Ea[e]=r;r=Yi(r);for(let i=0;iSa||(bT.then(()=>Sa=0),Sa=Date.now());function hT(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;rn(CT(r,n.value),e,5,[r])};return n.value=t,n.attached=RT(),n}function CT(t,e){if(Ae(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const j_=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,vT=(t,e,n,r,i,a)=>{const s=i==="svg";e==="class"?dT(t,r,s):e==="style"?gT(t,n,r):Ui(e)?Fi(e)||fT(t,e,n,r,a):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):NT(t,e,r,s))?(X_(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Q_(t,e,r,s,a,e!=="value")):t._isVueCE&&(OT(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!Et(r)))?X_(t,Gt(e),r,a,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),Q_(t,e,r,s))};function NT(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&j_(e)&&Ue(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return j_(e)&&Et(n)?!1:e in t}function OT(t,e){const n=t._def.props;if(!n)return!1;const r=Gt(e);return Array.isArray(n)?n.some(i=>Gt(i)===r):Object.keys(n).some(i=>Gt(i)===r)}const ed=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Ae(e)?n=>Si(e,n):e};function yT(t){t.target.composing=!0}function td(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const fa=Symbol("_assign");function nd(t,e,n){return e&&(t=t.trim()),n&&(t=Ac(t)),t}const IT={created(t,{modifiers:{lazy:e,trim:n,number:r}},i){t[fa]=ed(i);const a=r||i.props&&i.props.type==="number";mr(t,e?"change":"input",s=>{s.target.composing||t[fa](nd(t.value,n,a))}),(n||a)&&mr(t,"change",()=>{t.value=nd(t.value,n,a)}),e||(mr(t,"compositionstart",yT),mr(t,"compositionend",td),mr(t,"change",td))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},s){if(t[fa]=ed(s),t.composing)return;const o=(a||t.type==="number")&&!/^0\d/.test(t.value)?Ac(t.value):t.value,c=e??"";if(o===c)return;const _=t.getRootNode();(_ instanceof Document||_ instanceof ShadowRoot)&&_.activeElement===t&&t.type!=="range"&&(r&&e===n||i&&t.value.trim()===c)||(t.value=c)}},AT=["ctrl","shift","alt","meta"],DT={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>AT.some(n=>t[`${n}Key`]&&!e.includes(n))},rr=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=((i,...a)=>{for(let s=0;s{const n=t._withKeys||(t._withKeys={}),r=e.join(".");return n[r]||(n[r]=(i=>{if(!("key"in i))return;const a=Gn(i.key);if(e.some(s=>s===a||MT[s]===a))return t(i)}))},xT=yt({patchProp:vT},iT);let id;function LT(){return id||(id=Uf(xT))}const wT=((...t)=>{const e=LT().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=kT(r);if(!i)return;const a=e._component;!Ue(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,PT(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},e});function PT(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function kT(t){return Et(t)?document.querySelector(t):t}/*!
- * pinia v3.0.4
- * (c) 2025 Eduardo San Martin Morote
- * @license MIT
- */let TE;const ji=t=>TE=t,bE=Symbol();function Sc(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var qr;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(qr||(qr={}));function UT(){const t=Mc(!0),e=t.run(()=>le({}));let n=[],r=[];const i=Vi({install(a){ji(i),i._a=a,a.provide(bE,i),a.config.globalProperties.$pinia=i,r.forEach(s=>n.push(s)),r=[]},use(a){return this._a?n.push(a):r.push(a),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return i}const RE=()=>{};function ad(t,e,n,r=RE){t.add(e);const i=()=>{t.delete(e)&&r()};return!n&&ug()&&gS(i),i}function dr(t,...e){t.forEach(n=>{n(...e)})}const FT=t=>t(),od=Symbol(),Ta=Symbol();function fc(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,r)=>t.set(r,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],i=t[n];Sc(i)&&Sc(r)&&t.hasOwnProperty(n)&&!bt(r)&&!An(r)?t[n]=fc(i,r):t[n]=r}return t}const BT=Symbol();function GT(t){return!Sc(t)||!Object.prototype.hasOwnProperty.call(t,BT)}const{assign:Un}=Object;function YT(t){return!!(bt(t)&&t.effect)}function qT(t,e,n,r){const{state:i,actions:a,getters:s}=e,o=n.state.value[t];let c;function _(){o||(n.state.value[t]=i?i():{});const l=US(n.state.value[t]);return Un(l,a,Object.keys(s||{}).reduce((d,u)=>(d[u]=Vi(fe(()=>{ji(n);const m=n._s.get(t);return s[u].call(m,m)})),d),{}))}return c=hE(t,_,e,n,r,!0),c}function hE(t,e,n={},r,i,a){let s;const o=Un({actions:{}},n),c={deep:!0};let _,l,d=new Set,u=new Set,m;const p=r.state.value[t];!a&&!p&&(r.state.value[t]={});let E;function f(O){let M;_=l=!1,typeof O=="function"?(O(r.state.value[t]),M={type:qr.patchFunction,storeId:t,events:m}):(fc(r.state.value[t],O),M={type:qr.patchObject,payload:O,storeId:t,events:m});const q=E=Symbol();Ft().then(()=>{E===q&&(_=!0)}),l=!0,dr(d,M,r.state.value[t])}const T=a?function(){const{state:M}=n,q=M?M():{};this.$patch(V=>{Un(V,q)})}:RE;function b(){s.stop(),d.clear(),u.clear(),r._s.delete(t)}const v=(O,M="")=>{if(od in O)return O[Ta]=M,O;const q=function(){ji(r);const V=Array.from(arguments),y=new Set,Z=new Set;function ne(se){y.add(se)}function Se(se){Z.add(se)}dr(u,{args:V,name:q[Ta],store:A,after:ne,onError:Se});let oe;try{oe=O.apply(this&&this.$id===t?this:A,V)}catch(se){throw dr(Z,se),se}return oe instanceof Promise?oe.then(se=>(dr(y,se),se)).catch(se=>(dr(Z,se),Promise.reject(se))):(dr(y,oe),oe)};return q[od]=!0,q[Ta]=M,q},C={_p:r,$id:t,$onAction:ad.bind(null,u),$patch:f,$reset:T,$subscribe(O,M={}){const q=ad(d,O,M.detached,()=>V()),V=s.run(()=>Ye(()=>r.state.value[t],y=>{(M.flush==="sync"?l:_)&&O({storeId:t,type:qr.direct,events:m},y)},Un({},c,M)));return q},$dispose:b},A=ei(C);r._s.set(t,A);const x=(r._a&&r._a.runWithContext||FT)(()=>r._e.run(()=>(s=Mc()).run(()=>e({action:v}))));for(const O in x){const M=x[O];if(bt(M)&&!YT(M)||An(M))a||(p&>(M)&&(bt(M)?M.value=p[O]:fc(M,p[O])),r.state.value[t][O]=M);else if(typeof M=="function"){const q=v(M,O);x[O]=q,o.actions[O]=M}}return Un(A,x),Un(Xe(A),x),Object.defineProperty(A,"$state",{get:()=>r.state.value[t],set:O=>{f(M=>{Un(M,O)})}}),r._p.forEach(O=>{Un(A,s.run(()=>O({store:A,app:r._a,pinia:r,options:o})))}),p&&a&&n.hydrate&&n.hydrate(A.$state,p),_=!0,l=!0,A}/*! #__NO_SIDE_EFFECTS__ */function ea(t,e,n){let r;const i=typeof e=="function";r=i?n:e;function a(s,o){const c=WS();return s=s||(c?er(bE,null):null),s&&ji(s),s=TE,s._s.has(t)||(i?hE(t,e,r,s):qT(t,r,s)),s._s.get(t)}return a.$id=t,a}const CE="";window.addEventListener("unhandledrejection",t=>{console.error("[API] Unhandled rejection:",t.reason)});async function zt(t,e,n){const r={method:t,headers:{},credentials:"include"};n!==void 0&&(r.headers["Content-Type"]="application/json",r.body=JSON.stringify(n));const i=await fetch(`${CE}${e}`,r);if(!i.ok){const a=await i.text().catch(()=>"");throw new Error(`${t} ${e} → ${i.status}: ${a}`)}return i.status===204?null:i.json()}function HT(){return zt("GET","/auth/me")}function $T(){return zt("POST","/auth/logout")}function VT(){return zt("GET","/agents/profiles")}function sd({limit:t=30,offset:e=0,profileId:n=null}={}){const r=new URLSearchParams({limit:String(t),offset:String(e)});return n&&r.set("profile_id",n),zt("GET",`/sessions?${r.toString()}`)}function ld(t){return zt("GET",`/sessions/${t}`)}function zT(t){return zt("POST","/sessions",{profile_id:t})}function WT(t){return zt("DELETE",`/sessions/${t}`)}function KT(t,e){return zt("PATCH",`/sessions/${t}/pin`,{pinned:e})}function QT(t){return zt("POST",`/sessions/${t}/stop`)}function XT(t){return zt("POST",`/sessions/${t}/generate-name`)}function ZT(t){return zt("GET",`/sessions/${t}/content`)}function JT(t){return zt("GET",`/eval/feedback/${t}`)}function jT(t,e,n){return zt("POST","/eval/feedback",{session_id:t,message_index:e,rating:n})}async function eb(t,e){const n=new FormData;n.append("file",e);const r=await fetch(`${CE}/sessions/${t}/files`,{method:"POST",credentials:"include",body:n});if(!r.ok){const i=await r.text().catch(()=>"");throw new Error(`Upload failed: ${r.status}: ${i}`)}return r.json()}const sr=ea("sessions",()=>{const e=le([]),n=le(!1),r=le(!1),i=le(!0),a=le(0),s=le(null);async function o(p=null){s.value=p,n.value=!0;try{const E=await sd({limit:30,offset:0,profileId:p}),f=Array.isArray(E)?E:E.items;e.value=f,i.value=Array.isArray(E)?!1:E.has_more,a.value=Array.isArray(E)?f.length:E.next_offset}finally{n.value=!1}}async function c(){if(!(n.value||r.value||!i.value)){r.value=!0;try{const p=await sd({limit:30,offset:a.value,profileId:s.value}),E=Array.isArray(p)?p:p.items,f=new Set(e.value.map(T=>T.session_id));e.value=[...e.value,...E.filter(T=>!f.has(T.session_id))],i.value=Array.isArray(p)?!1:p.has_more,a.value=Array.isArray(p)?e.value.length:p.next_offset}finally{r.value=!1}}}async function _(p){const E=await zT(p);return e.value.unshift({session_id:E.session_id,profile_id:E.profile_id,created_at:E.created_at,last_active:E.created_at,message_count:0,preview:"",pinned:!1}),a.value+=1,E}async function l(p){await WT(p),e.value=e.value.filter(E=>E.session_id!==p),a.value=Math.max(0,a.value-1)}async function d(p,E){await KT(p,E);const f=e.value.map(T=>T.session_id===p?{...T,pinned:E}:T);f.sort((T,b)=>(b.pinned?1:0)-(T.pinned?1:0)),e.value=f}function u(p,E){const f=e.value.find(T=>T.session_id===p);f&&(f.preview=E)}function m(p,E){const f=e.value.find(T=>T.session_id===p);f&&(f.name=E)}return{sessions:e,loading:n,loadingMore:r,hasMore:i,currentProfileId:s,fetchSessions:o,fetchMoreSessions:c,createSession:_,deleteSession:l,pinSession:d,updatePreview:u,updateName:m}}),ii=ea("profiles",()=>{const t=le([]),e=le(null),n=le(!1);async function r(){n.value=!0;try{t.value=await VT(),t.value.length&&!e.value&&(e.value=t.value[0].id)}finally{n.value=!1}}function i(a){return t.value.find(s=>s.id===a)??null}return{profiles:t,selectedProfileId:e,loading:n,fetchProfiles:r,getProfile:i}});let cd=null;async function tb(t){try{const e=sr(),n=e.sessions.find(i=>i.session_id===t);if(n!=null&&n.name)return;const{name:r}=await XT(t);r&&e.updateName(t,r)}catch{}}const qt=ea("chat",()=>{const t=le(null),e=le(null),n=le([]),r=le(!1),i=le([]),a=le([]),s=le([]),o=le(0),c=le(0),_=le(!1),l=Er(null),d=le(!1);async function u(L){if(t.value!==L){cd=L,_.value=!0,n.value=[],s.value=[],r.value=!1,l.value=null,o.value=0,c.value=0;try{const $=await ld(L);if(cd!==L)return;e.value=$.profile_id??null,n.value=st($.messages??[]),await E(L),await f(L),$.context_token_count&&(o.value=$.context_token_count),$.max_context_tokens&&(c.value=$.max_context_tokens),t.value=L,location.hash=L}finally{_.value=!1}}}function m(){t.value=null,e.value=null,n.value=[],s.value=[],r.value=!1,l.value=null,o.value=0,c.value=0,location.hash=""}async function p(L){if(L)try{const $=await ld(L);e.value=$.profile_id??null,n.value=st($.messages??[]),await E(L),await f(L),$.context_token_count&&(o.value=$.context_token_count),$.max_context_tokens&&(c.value=$.max_context_tokens),l.value=null,r.value=!1}catch{}}async function E(L){var $,K;try{const{feedback:D=[]}=await JT(L);if(!D.length)return;const P=new Map(D.map(z=>[z.message_index,z.rating]));for(const z of n.value){if(z.role!=="assistant")continue;const ee=(K=($=z.id)==null?void 0:$.startsWith)!=null&&K.call($,"h_")?Number(z.id.slice(2)):NaN;Number.isInteger(ee)&&P.has(ee)&&(z.rating=P.get(ee))}}catch{}}async function f(L=t.value){if(!L){s.value=[];return}try{const{content:$=[]}=await ZT(L);s.value=$}catch{s.value=[]}}function T(L){if(!(L!=null&&L.filename))return;const $=L.id||L.filename,K=s.value.findIndex(P=>(P.id||P.filename)===$),D={...L};K===-1?s.value.unshift(D):s.value.splice(K,1,{...s.value[K],...D})}async function b(L,$){var z,ee;if(!t.value||!L)return;const K=(ee=(z=L.id)==null?void 0:z.startsWith)!=null&&ee.call(z,"h_")?Number(L.id.slice(2)):NaN;if(!Number.isInteger(K))return;const D=L.rating===$?0:$,P=L.rating??0;L.rating=D;try{await jT(t.value,K,D)}catch(ge){throw L.rating=P,ge}}function v(L){t.value&&(L?localStorage.setItem(`draft:${t.value}`,L):localStorage.removeItem(`draft:${t.value}`))}function C(L){return localStorage.getItem(`draft:${L}`)??""}function A(){if(l.value){const $=n.value.indexOf(l.value);$!==-1&&n.value.splice($,1),l.value=null}r.value=!0;const L={id:`stream_${Date.now()}`,role:"assistant",type:"stream",thinking:null,tools:[],text:"",done:!1,time:new Date().toISOString(),animate:!d.value,statusLabel:null};n.value.push(L),l.value=n.value[n.value.length-1]}function N(){d.value=!0}function x(){d.value=!1,l.value&&(l.value.animate=!0)}function O(L){const $=l.value;$&&($.thinking||($.thinking={text:"",done:!1}),$.thinking.text+=L)}function M(){const L=l.value;L!=null&&L.thinking&&(L.thinking.done=!0)}function q(L){for(let $=L.tools.length-1;$>=0;$--){const K=L.tools[$];if(K.kind==="tool"&&K.name==="spawn_agent")return K}}function V(L){const $=l.value;if(!$)return;const K={kind:"turn_thinking",isSubagent:L.is_subagent??!1,thinking:{text:L.thinking??"",done:!0}};if(L.is_subagent){const D=q($);if(D){D.steps.push(K);return}}$.tools.push(K)}function y(L){const $=l.value;if($){if(L.is_subagent){const K=q($);K&&(K.planningLabel=L.label??"");return}$.statusLabel=L.label??""}}function Z(L){const $=l.value;if($){if(L.is_subagent){const K=q($);K&&(K.planningLabel=null,K.steps.push({kind:"plan",text:L.plan??""}));return}$.statusLabel=null,$.tools.push({kind:"plan",text:L.plan??""})}}function ne(L){const $=l.value;if(!$)return;const K={kind:"tool",id:`tool_${Date.now()}`,name:L.tool,args:L.args,result:null,success:null,pending:!0,startedAt:Date.now(),isSubagent:L.is_subagent??!1,steps:[]};if(L.is_subagent){const D=q($);if(D){D.steps.push(K);return}}$.tools.push(K)}function Se(L){var D;const $=l.value;if(!$)return;if(L.is_subagent){const P=q($);if(P){let z=null;for(let ee=P.steps.length-1;ee>=0;ee--){const ge=P.steps[ee];if(ge.kind==="tool"&&ge.name===L.tool&&ge.pending){z=ge;break}}if(z){z.result=L.result,z.success=L.success!==!1,z.pending=!1;return}}}let K=null;for(let P=$.tools.length-1;P>=0;P--){const z=$.tools[P];if(z.kind==="tool"&&z.name===L.tool&&z.pending){K=z;break}}if(K&&(K.result=L.result,K.success=L.success!==!1,K.pending=!1,L.metadata&&(K.metadata=L.metadata),L.tool==="content_publish"&&K.success&&L.metadata&&T(L.metadata),L.tool==="filesystem"&&K.success&&t.value)){const P=typeof K.args=="object"?(D=K.args)==null?void 0:D.action:null;["write","edit"].includes(P)&&f(t.value)}}function oe(L){const $=l.value;$&&($.statusLabel&&($.statusLabel=null),$.text+=L)}function se(L){const $=l.value;$&&($.done=!0,$.elapsed_seconds=(L==null?void 0:L.elapsed_seconds)??null,$.tool_call_count=(L==null?void 0:L.tool_call_count)??null,$.token_count=(L==null?void 0:L.token_count)??null,l.value=null,!$.thinking&&!$.tools.length&&!$.text&&(n.value=n.value.filter(K=>K!==$))),r.value=!1,(L==null?void 0:L.context_tokens)!=null&&(o.value=L.context_tokens),(L==null?void 0:L.max_context_tokens)!=null&&(c.value=L.max_context_tokens),t.value&&($!=null&&$.text)&&sr().updatePreview(t.value,$.text.slice(0,80)),t.value&&tb(t.value)}function be(){const L=l.value;L&&(L.done=!0,l.value=null,!L.thinking&&!L.tools.length&&!L.text&&(n.value=n.value.filter($=>$!==L))),r.value=!1}function me(L){e.value=L.profile_id}function Le(L){(L==null?void 0:L.context_tokens)!=null&&(o.value=L.context_tokens),(L==null?void 0:L.max_context_tokens)!=null&&(c.value=L.max_context_tokens),n.value.push({id:`compress_${Date.now()}`,role:"system",type:"compression_notice",before:L.messages_before,after:L.messages_after,summary:L.summary??""})}function Be(L){r.value=!1,l.value=null,n.value.push({id:`err_${Date.now()}`,role:"system",type:"error",text:L.message??"An error occurred"})}function He(L,$,K){n.value.push({id:`user_${Date.now()}`,role:"user",text:L,images:[...$],files:[...K],time:new Date().toISOString(),animate:!0})}function st(L){var D,P;const $=[];let K=0;for(;Ktypeof ge=="string"&&ge.startsWith("data:")?ge:`data:image/jpeg;base64,${String(ge??"")}`);$.push({id:`h_${K}`,role:"user",text:z.content??"",images:ee,files:z.files??[],time:z.created_at??null}),K++;continue}if(z.role==="assistant"){const ee=`h_${K}`,ge=[];let g=null,S="",I=null;for(;K=L.length||L[K].role!=="assistant")break}}if(g||ge.length||S){let F=null,B=null,G=null;const Q=Number(ee.slice(2));for(let j=Q;j{const t=le(null),e=le(!1),n=le(!1),r=fe(()=>t.value!==null),i=fe(()=>{var l;return((l=t.value)==null?void 0:l.role)==="admin"});function a(l){return t.value?t.value.role==="admin"?!0:(t.value.permissions||[]).includes(l):!1}async function s(){var l;console.log("[auth] fetchMe start"),e.value=!0;try{t.value=await HT(),console.log("[auth] fetchMe success",t.value)}catch(d){throw console.log("[auth] fetchMe error",d.message),(l=d.message)!=null&&l.includes("401")&&(t.value=null),d}finally{e.value=!1,console.log("[auth] fetchMe loading=false")}}async function o(){console.log("[auth] fetchStatus start");try{const l=await fetch("/auth/status");if(console.log("[auth] fetchStatus response",l.status,l.ok),l.ok){const d=await l.json();console.log("[auth] fetchStatus data",d),n.value=!!d.configured,console.log("[auth] fetchStatus authConfigured set to",n.value)}else console.log("[auth] fetchStatus not ok"),n.value=!1}catch(l){console.log("[auth] fetchStatus error",l),n.value=!1}}function c(){window.location.href="/auth/login"}async function _(){try{await $T()}catch{}t.value=null,window.location.reload()}return{user:t,loading:e,authConfigured:n,isAuthenticated:r,isAdmin:i,hasPermission:a,fetchMe:s,fetchStatus:o,login:c,logout:_}}),zc="/images/logo.svg";function nb(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r&&r.push(n)||t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(e,n){(t.get(e)||[]).slice().map(function(r){r(n)}),(t.get("*")||[]).slice().map(function(r){r(e,n)})}}}function Wc(t,e,n){if(!n)return e;const r=t==null?void 0:t[n];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${n}')`);return r}function Jn(t,e){return t.map((n,r)=>Wc(n,r,e))}function rb(t,e,n){const r=[],i=[];for(let a=0;a0?c:null)}return{keys:r,sizes:i}}function ib(t,e,n){if(!t||t.keys.length!==e.length||t.sizes.length!==e.length)return!1;for(let r=0;r0&&(r[t.keys[i]]=a)}return r}function NE(t,e){if(!t.length||e.length<=t.length)return 0;const n=t[0],r=e.indexOf(n);if(r<=0||r+t.lengthe.length-r)return 0;for(let i=0;i=n&&c<=o?null:t{}:n.onVscrollUpdate(f),d=fe(()=>{const y=ue(t);if(n.vscrollData.simpleArray){if(y.index==null)throw new Error("index is required when using simple-array mode with dynamic item measurement");return y.index}if(n.vscrollData.keyField in y.item)return y.item[n.vscrollData.keyField];throw new Error(`keyField '${n.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)}),u=fe(()=>n.vscrollData.sizes[d.value]||0),m=fe(()=>ue(t).active&&n.vscrollData.active);function p(){m.value?a!==d.value&&(a=d.value,i=null,s=null,C(d.value)):i=d.value}function E(){ue(t).watchData&&!n.resizeObserver?c=Ye(()=>ue(t).item,()=>{T()},{deep:!0}):c&&(c(),c=null)}function f({force:y}){!m.value&&y&&(s=d.value),(i===d.value||y||!u.value)&&p()}function T(){p()}function b(y){n.undefinedMap[y]&&n.undefinedSizeCount.value--,n.undefinedMap[y]=void 0}function v(y,Z){if(n.vscrollData.sizes[y]){b(y);return}if(Z){n.undefinedMap[y]||n.undefinedSizeCount.value++,n.undefinedMap[y]=!0;return}n.undefinedMap[y]&&(n.undefinedSizeCount.value--,n.undefinedMap[y]=!1)}function C(y){Ft(()=>{if(d.value===y){const Z=ue(e);if(!Z)return;const ne=Z.offsetWidth,Se=Z.offsetHeight;A(ne,Se)}a=null})}function A(y,Z){const ne=~~(n.direction.value==="vertical"?Z:y);ne&&u.value!==ne&&N(ne)}function N(y){var Z,ne;b(d.value),n.vscrollData.sizes[d.value]=y,ue(t).emitResize&&((ne=(Z=ue(r))==null?void 0:Z.onResize)==null||ne.call(Z,d.value))}function x(){if(!n.resizeObserver||o)return;const y=ue(e);y&&(n.resizeObserver.observe(y),y.$_vs_id=d.value,y.$_vs_onResize=M,o=!0)}function O(){if(!n.resizeObserver||!o)return;const y=ue(e);y&&(n.resizeObserver.unobserve(y),y.$_vs_onResize=void 0,o=!1)}function M(y,Z,ne){d.value===y&&A(Z,ne)}_.push(Ye(()=>ue(t).watchData,()=>{E()})),n.resizeObserver||_.push(Ye(()=>ue(t).sizeDependencies,()=>{T()},{deep:!0})),_.push(Ye(d,(y,Z)=>{const ne=ue(e);ne&&(ne.$_vs_id=y),b(Z),v(y,m.value);const Se=n.vscrollData.sizes[y];if(!Se){i=y,T();return}b(y),o&&(n.vscrollData.sizes[y]=Se)})),_.push(Ye(m,y=>{v(d.value,y),n.resizeObserver?y?x():O():y&&s===d.value&&p()})),E();function q(){m.value&&(p(),x())}function V(){l(),O(),b(d.value);const y=ue(e);y&&(y.$_vs_id=void 0,y.$_vs_onResize=void 0),c&&(c(),c=null);for(const Z of _)Z();_.length=0}return{id:d,size:u,finalActive:m,updateSize:p,mount:q,unmount:V}}const ab={itemsLimit:1e3};function yE(t){return typeof window<"u"&&t===window}const ob=(()=>{if(typeof document>"u")return"negative";const t=document.createElement("div"),e=document.createElement("div");t.style.width="4px",t.style.height="1px",t.style.overflow="auto",t.style.direction="rtl",e.style.width="8px",e.style.height="1px",t.appendChild(e),document.body.appendChild(t),t.scrollLeft=-1;const n=t.scrollLeft<0;return document.body.removeChild(t),n?"negative":"default"})();function gr(t,e,n){return e!=="horizontal"||!n||yE(n)||getComputedStyle(n).direction!=="rtl"?t:ob==="negative"?-t:t}function sb(t,e,n){return gr(t,e,n)}function ba(t,e,n,r){const i=sb(n,e,t),a=!!(r!=null&&r.smooth);if(yE(t)){e==="vertical"?t.scrollTo({top:i,behavior:a?"smooth":"auto"}):t.scrollTo({left:i,behavior:a?"smooth":"auto"});return}if(typeof t.scrollTo=="function"){t.scrollTo(e==="vertical"?{top:i,behavior:a?"smooth":"auto"}:{left:i,behavior:a?"smooth":"auto"});return}e==="vertical"?t.scrollTop=i:t.scrollLeft=i}function lb(t,e,n){return n?e==="vertical"?window.innerHeight:window.innerWidth:e==="vertical"?t.clientHeight:t.clientWidth}const cb=/auto|scroll/;function IE(t,e){return t.parentNode===null?e:IE(t.parentNode,[...e,t])}function Ra(t,e){return getComputedStyle(t,null).getPropertyValue(e)}function _b(t){return Ra(t,"overflow")+Ra(t,"overflow-y")+Ra(t,"overflow-x")}function db(t){return cb.test(_b(t))}function pi(t){if(!(t instanceof HTMLElement||t instanceof SVGElement))return;const e=IE(t.parentNode,[]);for(let n=0;n{const k=ue(t);return k.items.length>0&&typeof k.items[0]!="object"}),Z=fe(()=>{const k=ue(t);if(k.itemSize===null){const H={[-1]:{accumulator:0}},ae=k.items,ye=k.sizeField??"size",Ee=k.minItemSize,he=V.value;let we=1e4,ze=0,vt;for(let Pe=0,St=ae.length;Pea.value.filter(k=>k.nr.used).sort((k,H)=>k.nr.index-H.nr.index)),Se=fe(()=>{const k=ue(t),H=y.value?null:k.keyField;return rb(k.items,H,(ae,ye,Ee)=>k.itemSize!=null?k.itemSize:V.value[Ee]||(ae==null?void 0:ae[k.sizeField??"size"])||void 0)});function oe(k){const H=ue(t);return V.value=Tc(k,H.items,y.value?null:H.keyField),Object.keys(V.value).length>0}function se(k){let H=d.get(k);return H||(H=[],d.set(k,H)),H}function be(k,H,ae,ye,Ee){const he=Vi({id:pb++,index:H,used:!0,key:ye,type:Ee}),we=yg({item:ae,position:0,offset:0,nr:he,_vs_styleStamp:0});return k.push(we),we}function me(k){const H=se(k);if(H&&H.length){const ae=H.pop();return ae.nr.used=!0,ha(ae),ae}}function Le(k){const H=k.nr.type;se(H).push(k),k.nr.used=!1,k.position=-9999,ha(k),l.delete(k.nr.key)}function Be(){l.clear(),d.clear();for(let k=0,H=a.value.length;k{q.delete(H),k()}),q.add(H),H}function st(){for(const k of q)cancelAnimationFrame(k);q.clear()}function L(){f&&(clearTimeout(f),f=null),T&&(clearTimeout(T),T=null),b&&(clearTimeout(b),b=null),x&&(clearTimeout(x),x=null),O&&(clearTimeout(O),O=null)}function $(){var k;(k=i==null?void 0:i.onResize)==null||k.call(i),o.value&&ce(!1)}function K(){N&&!M&&F();const k=ue(t);if(!u){if(u=!0,f)return;const H=()=>He(()=>{u=!1;const{continuous:ae}=ce(!1,!0);ae||(T&&clearTimeout(T),T=setTimeout(K,k.updateInterval+100))});H(),k.updateInterval&&(f=setTimeout(()=>{f=null,u&&H()},k.updateInterval))}}function D(k,H){var ae,ye;o.value&&(k||H.boundingClientRect.width!==0||H.boundingClientRect.height!==0?((ae=i==null?void 0:i.onVisible)==null||ae.call(i),He(()=>{ce(!1)})):(ye=i==null?void 0:i.onHidden)==null||ye.call(i))}function P(){const k=ue(e),H=k?pi(k):void 0;return window.document&&(H===window.document.documentElement||H===window.document.body)?window:H||window}function z(){const k=ue(n);return k?ue(t).direction==="vertical"?k.scrollHeight:k.scrollWidth:0}function ee(){const k=ue(e);if(!k)return{start:0,end:0};const H=ue(t),ae=H.direction==="vertical";let ye;if(H.pageMode){const Ee=k.getBoundingClientRect(),he=ae?Ee.height:Ee.width;let we=-(ae?Ee.top:Ee.left),ze=ae?window.innerHeight:window.innerWidth;we<0&&(ze+=we,we=0),we+ze>he&&(ze=he-we),ye={start:we,end:we+ze}}else ae?ye={start:k.scrollTop,end:k.scrollTop+k.clientHeight}:ye={start:gr(k.scrollLeft,H.direction,k),end:gr(k.scrollLeft,H.direction,k)+k.clientWidth};return ye}function ge(){const k=ue(e);if(!k)return{start:0,end:0};if(ue(t).direction==="vertical"){const H=gr(k.scrollLeft,"horizontal",k);return{start:H,end:H+k.clientWidth}}return{start:k.scrollTop,end:k.scrollTop+k.clientHeight}}function g(k){const H=ue(t);if(H.itemSize!=null)return H.itemSize;const ae=Z.value[k];return(ae==null?void 0:ae.size)||Number(H.minItemSize)||0}function S(k){var H;const ae=ue(t),ye=ae.gridItems||1;return k<=0?0:ae.itemSize!=null?Math.floor(k/ye)*ae.itemSize:((H=Z.value[k-1])==null?void 0:H.accumulator)||0}function I(k){const H=ue(t),ae=H.items.length,ye=H.gridItems||1;if(!ae)return 0;if(H.itemSize!=null){const ze=Math.floor(k/H.itemSize)*ye;return Math.min(Math.max(ze,0),ae-1)}let Ee=0,he=ae-1,we=0;for(;Ee<=he;){const ze=Math.floor((Ee+he)/2);S(ze)<=k?(we=ze,Ee=ze+1):he=ze-1}return we}function F(){x&&(clearTimeout(x),x=null),N=null}function B(){x&&clearTimeout(x),x=setTimeout(()=>{N=null,x=null},150)}function G(k,H){if(!k.length){F();return}const ae=Math.max(ee().start-z(),0),ye=Math.min(I(ae),k.length-1),Ee=k[ye],he=H?Ee==null?void 0:Ee[H]:ye;if(he==null){F();return}const we=z()+S(ye);N={key:he,offset:ee().start-we}}function Q(k){if(!N)return!1;const H=ue(t),ae=k??H.items,ye=y.value?null:H.keyField,Ee=Jn(ae,ye).indexOf(N.key);if(Ee===-1)return F(),!1;const he=z()+S(Ee)+N.offset,we=ee().start;return Math.abs(he-we)<.5?!1:(M=!0,nt(he),He(()=>{M=!1}),!0)}function j(){ue(t).pageMode?J():W()}function J(){C=P(),C.addEventListener("scroll",K,ub()?{passive:!0}:!1),C.addEventListener("resize",$)}function W(){C&&(C.removeEventListener("scroll",K),C.removeEventListener("resize",$),C=null)}function Ce(k,H,ae,ye,Ee,he){const we=Math.ceil(k/H)*ae,ze=Math.max(0,Math.floor(Ee.start/ae)),vt=Math.min(Math.ceil(Ee.end/ae),Math.ceil(k/H)),Pe=Math.max(0,Math.floor(he.start/ye)),St=Math.min(Math.ceil(he.end/ye),H),ft=[];for(let Y=ze;Y=k)break;ft.push(je)}}const Je=ft[0]??0,R=ft.at(-1)??-1;return{renderedIndices:ft,startIndex:Je,endIndex:R+1,visibleStartIndex:Je,visibleEndIndex:R,totalSize:we}}function _e(){const k=ue(t);if(!k.gridItems||k.itemSize==null)return!1;const H=ue(e);if(!H)return!1;const ae=k.itemSecondarySize||k.itemSize,ye=k.direction==="vertical"?H.clientWidth:H.clientHeight;return ae*k.gridItems>ye}function ce(k,H=!1){var ae,ye;const Ee=ue(t),he=Ee.itemSize,we=Ee.gridItems||1,ze=Ee.itemSecondarySize||he,vt=v,Pe=Ee.typeField,St=y.value?null:Ee.keyField,ft=Ee.items,Je=ft.length,R=Z.value,Y=l,re=a.value;let Ne=null,je=null,Ge,ie,pe,Re,rt;if(!Je)Ge=ie=Re=rt=pe=0;else if(E)Ge=Re=0,ie=rt=Math.min(Ee.prerender,ft.length),pe=0;else{const $e=ee(),Rt=ge();if(H){let Tt=$e.start-m;Tt<0&&(Tt=-Tt);let on=Rt.start-p;on<0&&(on=-on);const qn=he===null&&Tt>=vt||he!==null&&Tt>=he,mt=we>1&&he!=null&&on>=ze;if(!qn&&!mt)return{continuous:!0}}m=$e.start,p=Rt.start;const Kt=Ee.buffer;$e.start-=Kt,$e.end+=Kt,Rt.start-=Kt,Rt.end+=Kt;let jt=0;const wn=ue(n);wn&&(jt=wn.scrollHeight,$e.start-=jt);const Pn=ue(r);if(Pn){const Tt=Pn.scrollHeight;$e.end+=Tt}if(he===null){let Tt,on=0,qn=Je-1,mt=~~(Je/2),cr;do cr=mt,Tt=R[mt].accumulator,Tt<$e.start?on=mt:mt$e.start&&(qn=mt),mt=~~((on+qn)/2);while(mt!==cr);for(mt<0&&(mt=0),Ge=mt,pe=R[Je-1].accumulator,ie=mt;ieJe&&(ie=Je)),Re=Ge;Re1){const Tt=Ce(Je,we,he,ze,$e,Rt);Ne=Tt.renderedIndices,je=new Set(Ne),Ge=Tt.startIndex,ie=Tt.endIndex,Re=Tt.visibleStartIndex,rt=Tt.visibleEndIndex,pe=Tt.totalSize}else{Ge=~~($e.start/he*we);const Tt=Ge%we;Ge-=Tt,ie=Math.ceil($e.end/he*we),Re=Math.max(0,Math.floor(($e.start-jt)/he*we)),rt=Math.floor(($e.end-jt)/he*we),Ge<0&&(Ge=0),ie>Je&&(ie=Je),Re<0&&(Re=0),rt>Je&&(rt=Je),pe=Math.ceil(Je/we)*he}}ie-Ge>ab.itemsLimit&&ve(),s.value=pe;let De;const fn=Ge<=_&&ie>=c;if(!fn||k)Be();else for(let $e=0,Rt=re.length;$e