diff --git a/docs/superpowers/plans/2026-11-03-lan-serving.md b/docs/superpowers/plans/2026-11-03-lan-serving.md new file mode 100644 index 0000000..ad84fcf --- /dev/null +++ b/docs/superpowers/plans/2026-11-03-lan-serving.md @@ -0,0 +1,292 @@ +# LAN Serving Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Add `--host` (default `0.0.0.0`) to the ProFiles CLI and a status-bar LAN on/off switch backed by a runtime rebind endpoint. + +**Architecture:** The CLI resolves a bind host that flows through `ProFileApp` into `BackgroundServer` (desktop) for both GUI and `--server-only` modes. The running server registers itself on the FastAPI `app.state`; routes expose bind state and rebind through a structural `BindableServer` Protocol to avoid a server→desktop layering inversion. The frontend reflects/commands that state from the StatusBar identity pill. + +**Tech Stack:** Python 3.11+/FastAPI/uvicorn/socket; React + TypeScript (vitest + @testing-library/react). + +**Spec:** `docs/superpowers/specs/2026-11-03-lan-serving-design.md` + +## Global Constraints + +- `from __future__ import annotations` at the top of every modified Python file. +- Type hints on every public signature; no `Any`, no `# type: ignore` (tests/AGENTS.md). +- Bind values allowed: `"0.0.0.0"`, `"127.0.0.1"`, or a literal IPv4 address (no hostnames, no IPv6). +- Prefer `uv run pytest`, `uv run ruff check`, `uv run pylint` exactly as the repo Makefile does. +- Frontend tests run in `src/profiles/web` with `npx vitest run`. +- Test files mirror the package tree 1:1; every new directory needs `__init__.py`; update `tests/AGENTS.md` tree and `tests/README.md` when adding test files. +- The suite gate is 85% coverage (`--cov-fail-under=85`). + +## Review Focus + +The five conditions the review must not miss, each pinned by its owning task: + +1. **Rebind while a UI client is connected** — the operator expects the open page (and any queued work) to keep working after LAN flips on; test: `tests/desktop/test_lifecycle.py::test_rebind_changes_host_and_reverses` re-issuing `GET /api/health` after `rebind`. +2. **Rebind failure (bind denied)** — the user expects the app still reachable at the original address, not dead; test: `tests/desktop/test_lifecycle.py::test_rebind_failure_reverts`. +3. **Invalid `--host` value** (e.g. `--host st-465`) — the user expects a clean argparse error and non-zero exit, not a traceback mid-launch; test: `tests/test_app_host.py::test_main_rejects_hostname`. Same review line covers `--host ::1` (IPv6): `tests/test_app_host.py::test_main_rejects_ipv6`. +4. **`GET /api/system` when no background server is registered** (test harness / static app factory) — `lan_enabled` must be `null` and the UI must hide/disable the toggle, not crash; test: `tests/server/routes/test_system.py::test_system_info_reports_unknown_bind_state`. +5. **PyWebView window URL on `0.0.0.0` bind** — the user expects the window to open (loopback URL), never `http://0.0.0.0:port`; test: `tests/desktop/test_launcher.py::test_webview_url_uses_loopback_for_wildcard_bind`. + +--- + +### Task 1: `--host` CLI option (default `0.0.0.0`) + +**Files:** +- Modify: `src/profiles/app.py` (parser ~570–650, `ProFileApp.__init__` ~91–109, `_run_web_gui` 308–338, `_run_server_only` 262–292) +- Test: `tests/test_app_host.py` (new) +- Modify: `tests/test_app_backend_selection.py:32-37` (default-host assertion flips) + +**Interfaces:** +- Consumes: existing `main()` → `ProFileApp(...)` wiring (app.py:642–649). +- Produces: + - `host_error(value: str) -> str | None` — module-level pure function; `None` when valid, else a human message (`"unsupported host '{value}' — use 0.0.0.0, 127.0.0.1, or an IPv4 address"`). + - `ProFileApp(config_path, headless, server_only, no_config_propose, gui_backend, host: str = "0.0.0.0")` — stores `self._host`. + - `_run_web_gui()` → calls `launch_desktop_window(self._config, port=, host=self._host)`. + - `_run_server_only()` → `BackgroundServer(config=self._config, host=self._host, port=)`. + - `main()` accepts `--host` (default `"0.0.0.0"`), validates via `host_error`, passes `host=args.host`. + +- [ ] **Step 1: Write the failing tests** in `tests/test_app_host.py`: + +```python +def test_host_error_accepts_wildcard_loopback_and_ipv4() -> None: + assert host_error("0.0.0.0") is None + assert host_error("127.0.0.1") is None + assert host_error("172.16.41.65") is None + + +def test_host_error_rejects_hostname_and_ipv6() -> None: + assert host_error("st-465") is not None + assert host_error("::1") is not None + + +def test_default_host_is_lan_wildcard() -> None: + app = ProFileApp(headless=False) + assert app._host == "0.0.0.0" + + +def test_explicit_loopback_host_is_kept() -> None: + app = ProFileApp(headless=False, host="127.0.0.1") + assert app._host == "127.0.0.1" + + +def test_main_rejects_hostname() -> None: + with patch.object(sys, "argv", ["profiles", "--host", "st-465"]): + with pytest.raises(SystemExit) as excinfo: + main() + assert excinfo.value.code == 2 + + +def test_main_rejects_ipv6() -> None: + with patch.object(sys, "argv", ["profiles", "--host", "::1"]): + with pytest.raises(SystemExit) as excinfo: + main() + assert excinfo.value.code == 2 + + +def test_main_passes_host_argument(mut: unittest.mock.MagicMock) -> None: + # mirror _resolved_backend() pattern from tests/test_app_backend_selection.py: + # patch profiles.app.ProFileApp, assert call.kwargs["host"] == "127.0.0.1" +``` + +- [ ] **Step 2: Run and verify failure** — `uv run pytest tests/test_app_host.py -v`. Expected: import error / all FAIL ("host_error", `--host` not defined yet). +- [ ] **Step 3: Implement** — add `host_error()` (validate with `ipaddress.ip_address`; require `.version == 4`; `"0.0.0.0"`/`"127.0.0.1"` are ordinary IPv4 literals), add `--host` argparse argument with `help` mentioning the default, post-parse: `error = host_error(args.host); parser.error(error)` when not None (argparse exit code is 2), add `host: str = "0.0.0.0"` to `ProFileApp.__init__` (store `self._host`), make `_run_web_gui()`/`_run_server_only()` use `self._host` instead of their loopback/wildcard literal defaults, pass `host=args.host` in the `ProFileApp` construction at main(), and append this line to the epilog examples block after the existing server-only example line: + ` profiles --host 127.0.0.1 Restrict serving to this machine (loopback only)` +- [ ] **Step 4: Update the superseded assertion** in `tests/test_app_backend_selection.py:37`: `mock_launch.assert_called_once_with(app._config, port=8088, host="0.0.0.0")`. +- [ ] **Step 5: Run** — `uv run pytest tests/test_app_host.py tests/test_app_backend_selection.py -v`. Expected: PASS. Run `uv run pytest -q` and see the whole suite green. +- [ ] **Step 6: Lint** — `uv run ruff check src/profiles/app.py tests/test_app_host.py && uv run ruff format src/profiles/app.py tests/test_app_host.py`. +- [ ] **Step 7: Update test docs** — add `test_app_host.py` to the `tests/AGENTS.md` tree and `tests/README.md`. +- [ ] **Step 8: Commit** — `git add src/profiles/app.py tests/test_app_host.py tests/test_app_backend_selection.py tests/AGENTS.md tests/README.md` then `git commit -m "feat: add --host CLI option (default 0.0.0.0, LAN serving)"`. + +### Task 2: Connectable window URL + URL banner for GUI launches + +**Files:** +- Modify: `src/profiles/desktop/launcher.py` (`launch_desktop_window` 63–89) +- Test: `tests/desktop/test_launcher.py` (new; also creates `tests/desktop/__init__.py` already exists — keep) + +**Interfaces:** +- Consumes: `BackgroundServer.start()` (unchanged), `profiles.utils.network.get_local_ip()`. +- Produces: `launch_desktop_window(config, port, host, debug)` behavior: + - window URL is `http://127.0.0.1:{server.port}` when `host == "0.0.0.0"`, else `http://{host}:{server.port}`; + - after a successful `server.start()` it prints, when `host == "0.0.0.0"`: + ``` + ProFiles web GUI running at: + Local: http://127.0.0.1:{port} + Network: http://{get_local_ip()}:{port} + ``` + and when bound to anything else, prints a single `Local: http://{host}:{port}` line (no Network line). + +- [ ] **Step 1: Write the failing tests** in `tests/desktop/test_launcher.py` (mock the whole `webview` module with `unittest.mock.MagicMock` via `patch.dict(sys.modules)` so no window system is touched, and patch `profiles.utils.network.get_local_ip`): + +```python +def test_webview_url_uses_loopback_for_wildcard_bind(...) -> None: + # launch_desktop_window(AppConfig(title="t"), port=find_available_port(8000), host="0.0.0.0") + # assert mocked webview.create_window called with url startswith "http://127.0.0.1:" + # assert capsys captured "Network:" line + +def test_webview_url_and_single_line_for_loopback_bind(...) -> None: + # same but host="127.0.0.1": url startswith "http://127.0.0.1:", capsys has exactly one + # "Local:" line and no "Network:" line +``` + +- [ ] **Step 2: Run** — `uv run pytest tests/desktop/test_launcher.py -v`. Expected: FAIL (no banner printed). +- [ ] **Step 3: Implement** in `launch_desktop_window` — compute `webview_url` per the rule above for `webview.create_window(url=...)`; print the banner after a successful `server.start()` per the rule above; keep the existing `ServerStartError` propagation untouched. +- [ ] **Step 4: Run** — `uv run pytest tests/desktop -v`. Expected: PASS (old lifecycle tests still green). +- [ ] **Step 5: Lint** + update `tests/AGENTS.md` (remove `launcher.py` from "Known coverage gaps") and `tests/README.md`. +- [ ] **Step 6: Commit** — `git commit -m "feat: connectable PyWebView URL and URL banner for LAN bind"`. + +### Task 3: `BackgroundServer.rebind` with revert-on-failure + +**Files:** +- Modify: `src/profiles/desktop/lifecycle.py` (register app state in `start()` ~123–157; add `rebind` after `stop()` ~206–218) +- Test: `tests/desktop/test_lifecycle.py` (extend) + +**Interfaces:** +- Consumes: existing `start()`, `stop()`, `is_running`, `self.host`, `self._app`. +- Produces: + - `rebind(self, host: str) -> None` — public method on `BackgroundServer`: + - returns without side effects when `host == self.host and self.is_running`; + - otherwise `stop()`, set `self.host = host`, `start()`; + - on `ServerStartError`: restore `self.host` to the previous host, `start()` again (the server is back serving the original address), then re-raise the original `ServerStartError`. + - `start()` sets `self._app.state.background_server = self` right after `_bind_listener()` succeeds (so later tasks can find the server from route code). + +- [ ] **Step 1: Write the failing tests** in `tests/desktop/test_lifecycle.py`: + +```python +def test_rebind_changes_host_and_reverses() -> None: + port = find_available_port(start_port=8000) + server = BackgroundServer(config=AppConfig(title="rebind"), host="127.0.0.1", port=port) + server.start() + try: + server.rebind("0.0.0.0") + assert server.host == "0.0.0.0" + response = httpx.get(f"http://127.0.0.1:{port}/api/health") + assert response.status_code == 200 + # app.state registration the next task relies on: + assert server._app.state.background_server is server + finally: + server.stop() + + +def test_rebind_failure_reverts(mocker) -> None: + mocker.patch( + "socket.socket.bind", + lambda sock, addr: _raise_or_delegate( + sock, addr + ), # OSError when addr[0] == "0.0.0.0"; real bind otherwise — capture socket.socket.bind BEFORE patching + ) + port = find_available_port(start_port=8000) + server = BackgroundServer(config=AppConfig(title="revert"), host="127.0.0.1", port=port) + server.start() + try: + with pytest.raises(ServerStartError): + server.rebind("0.0.0.0") + assert server.host == "127.0.0.1" + assert server.is_running + assert httpx.get(f"http://127.0.0.1:{port}/api/health").status_code == 200 + finally: + server.stop() +``` + +(The `_raise_or_delegate` helper must hold the real `socket.socket.bind` captured before `mocker.patch`, then call it for non-wildcard addresses — see tests/AGENTS.md "What to Mock": `socket.socket`.) + +- [ ] **Step 2: Run** — `uv run pytest tests/desktop/test_lifecycle.py -v`. Expected: FAIL (`AttributeError: rebind`). +- [ ] **Step 3: Implement** `rebind` exactly per the Produces contract above (docstring states the revert contract); add the `self._app.state.background_server = self` line in `start()`. +- [ ] **Step 4: Run** — `uv run pytest tests/desktop -v`. Expected: PASS. +- [ ] **Step 5: Lint** — `uv run ruff check src/profiles/desktop/lifecycle.py && uv run pylint src/profiles/desktop --fail-under=8.0`. +- [ ] **Step 6: Commit** — `git commit -m "feat: BackgroundServer.rebind with revert-on-failure"`. + +### Task 4: `/api/system` bind status + `POST /api/system/bind` + +**Files:** +- Modify: `src/profiles/server/state.py` (add Protocol) +- Modify: `src/profiles/server/routes/system.py` (both routes; request model) +- Test: `tests/server/routes/test_system.py` (extend) + +**Interfaces:** +- Consumes: `app.state.background_server: BindableServer | None` from Task 3; `ServerStartError` (function-level import from `profiles.desktop.lifecycle` inside the route's except — module-level import would create a server↔desktop import cycle). +- Produces: + - In `state.py`: `class BindableServer(Protocol)` with `host: str`, `@property is_running -> bool`, `def rebind(self, host: str) -> None`. + - `GET /api/system` response adds `"lan_enabled": bool | None` — `None` when no server registered, else `server.host == "0.0.0.0"`. + - `POST /api/system/bind` — pydantic request model `BindRequest(lan: bool)`; returns `{"host": str, "lan_enabled": bool}` on success; `HTTPException(503, "no running server to rebind")` when no `background_server`; `HTTPException(500, str(exc))` on `ServerStartError` (state is left on the original bind by Task 3's revert). + +- [ ] **Step 1: Write the failing tests** in `tests/server/routes/test_system.py` (existing `AsyncClient` + `create_app` pattern): + +```python +def test_system_info_reports_unknown_bind_state(test_state) -> None: + # GET /api/system → data["lan_enabled"] is None + +def test_bind_without_server_returns_503(test_state) -> None: + # POST /api/system/bind {"lan": true} → 503 + +def test_bind_runs_rebind_on_registered_server(test_state, mocker) -> None: + # app = create_app(test_state) + # stub: class implementing BindableServer with rebind recording the host and updating .host + # app.state.background_server = stub + # POST {"lan": true} → 200 {"host": "0.0.0.0", "lan_enabled": True} + +def test_bind_failure_returns_500_and_state_is_unchanged(test_state) -> None: + # stub whose rebind raises ServerStartError (function-level import in test is fine) + # POST {"lan": true} → 500, detail contains the message + # stub.host still "127.0.0.1"; GET /api/system → lan_enabled False +``` + +- [ ] **Step 2: Run** — `uv run pytest tests/server/routes/test_system.py -v`. Expected: FAIL (`lan_enabled` missing / 404 on bind). +- [ ] **Step 3: Implement** — `BindableServer` Protocol in `state.py`; rework `system_info(request)` to add the field; add `BindRequest` + `bind_route` (see signatures above; use `getattr(request.app.state, "background_server", None)` typed as `BindableServer | None`). +- [ ] **Step 4: Run** — `uv run pytest tests/server/routes/test_system.py -v`. Expected: PASS. Then `uv run pytest tests/server -v`. Expected: PASS (no route regression). +- [ ] **Step 5: Lint** — ruff + `uv run pylint src/profiles/server --fail-under=8.0`. +- [ ] **Step 6: Commit** — `git commit -m "feat: system bind-status endpoint and LAN rebind API"`. + +### Task 5: Frontend — LAN switch in the status bar + +**Files:** +- Modify: `src/profiles/web/src/api/types.ts:1-6` (`SystemInfo` gains `lan_enabled: boolean | null;`) +- Modify: `src/profiles/web/src/api/client.ts` (new export after `fetchSystemInfo`) +- Modify: `src/profiles/web/src/components/StatusBar.tsx` (identity pill; props) +- Modify: `src/profiles/web/src/App.tsx` (state, handler, ConfirmDialog + showToast) +- Test: `src/profiles/web/src/components/StatusBar.test.tsx` (new) + +**Interfaces:** +- Consumes: `GET /api/system` → `lan_enabled: boolean | null`; `POST /api/system/bind` (Task 4); `ConfirmDialog` props `{isOpen, title, message, confirmLabel, onConfirm, onCancel}`; App's `showToast(message, kind)`; App's existing systemInfo refetch blocks (App.tsx:300, 586). +- Produces: + - `setLanEnabled(lan: boolean): Promise<{ host: string; lan_enabled: boolean }>` in `client.ts` (POST `/api/system/bind`; on `!res.ok` read `detail` from the JSON body and throw `new Error(detail)` — mirroring `apiError`'s preference). + - `StatusBarProps` gains `lanEnabled?: boolean | null` and `onToggleLan?: (next: boolean) => void`; the pill renders a LAN toggle *only* when `onToggleLan` is provided: an `aria-pressed` icon-button (lucide `Network` icon + `LAN` label) with `Tooltip "LAN access"`; disabled and non-interactive when `lanEnabled === null`; visually on when `lanEnabled === true` (success color), muted otherwise. + - App wiring: clicking the switch opens an in-app `ConfirmDialog` (never `window.confirm` — webview no-op, issue #31): + - enabling — title `"Enable LAN access?"`, message `ProFiles will be reachable by anyone on this network:\nhttp://{hostname}:{port}\nhttp://{ip}:{port}`, confirmLabel `"Enable LAN"`; + - disabling — title `"Restrict to this machine?"`, message `ProFiles will be reachable only on this machine.`, confirmLabel `"Restrict"`; + - on confirm: `setLanEnabled(next)` → refetch `fetchSystemInfo()` → `showToast(next ? "ProFiles is now reachable on the local network." : "ProFiles is restricted to this machine.")` ("info"); + - on error: `showToast("Failed to update LAN binding: ", "error")` — never change the toggle state on failure (refetch decides it). + +- [ ] **Step 1: Write the failing component test** (`StatusBar.test.tsx`, mirroring `WorkflowRunnerModal.test.tsx`'s vitest + @testing-library conventions): + +```tsx +// render StatusBar with systemInfo={…}, lanEnabled={false}, onToggleLan={spy} +// → a button (accessible name contains "LAN") exists and is not disabled; click calls onToggleLan(true) (next=false → spy(true)) +// render with lanEnabled={true} → button has aria-pressed="true" +// render with lanEnabled={null} → button is disabled +// render without onToggleLan → no LAN button at all +``` + +- [ ] **Step 2: Run** — in `src/profiles/web`: `npx vitest run src/components/StatusBar.test.tsx`. Expected: FAIL (no LAN button). +- [ ] **Step 3: Implement** — widen `SystemInfo`, add `setLanEnabled` to `client.ts`, add the two props + toggle to `StatusBar.tsx` (place the toggle inside the identity pill, after the username segment, separated by the existing `|` divider style). +- [ ] **Step 4: Wire App.tsx** — `lanPending` state + `toggleLan(next)` handler + one more `` next to the existing ones; pass `lanEnabled={systemInfo ? systemInfo.lan_enabled : null}` and `onToggleLan={toggleLan}` to ``; also update the two existing `fetchSystemInfo` sites if their consumers need nothing new (they store the whole object — verify no type breakage). +- [ ] **Step 5: Run** — `npx vitest run`. Expected: PASS (all frontend tests). +- [ ] **Step 6: Commit** — `git commit -m "feat(web): LAN binding toggle in the status bar"`. + +### Task 6: Rebuild frontend, full verification, docs + +**Files:** +- Modify: `src/profiles/web/dist/**` (regenerated build artifacts, per the existing web-build convention) +- Possibly verify: `README*` / `docs/` CLI mentions — if and only if a CLI examples section exists, add the same `--host` line as the argparse epilog. + +**Interfaces:** +- Consumes: everything from Tasks 1–5. +- Produces: a rebuilt `web/dist` so the served PWA carries the new UI; a full green verification record. + +- [ ] **Step 1: Rebuild the web frontend** — `uv run python src/profiles/web/build.py` (or the repo's established build entry). Verify `src/profiles/web/dist/assets/*.js` contains the string `api/system/bind`. +- [ ] **Step 2: Full Python verification** — `uv run ruff check .`, `uv run ruff format --check .`, `uv run pylint src/profiles --fail-under=8.0`, `uv run pytest --cov` (green, ≥85%). +- [ ] **Step 3: Docs check** — `grep -rn -- "--server-only" README* docs/ | head` — if a real CLI-examples section exists, add the `--host 127.0.0.1` loopback line next to what's documented and commit it; otherwise record "no CLI docs section found" and skip. +- [ ] **Step 4: Commit remaining changes** — `git add -A && git commit -m "build: rebuild web frontend for LAN toggle" -- docs (only if changed)`. +- [ ] **Step 5: Manual verification note for the partner** (not automatable here): launch `ProFiles`, confirm the banner in console, confirm `http://:8088` loads from *another* machine or the same machine via IP, then check the LAN pill toggles and reverts on failure. diff --git a/docs/superpowers/specs/2026-11-03-lan-serving-design.md b/docs/superpowers/specs/2026-11-03-lan-serving-design.md new file mode 100644 index 0000000..0fcf06a --- /dev/null +++ b/docs/superpowers/specs/2026-11-03-lan-serving-design.md @@ -0,0 +1,51 @@ +# LAN Serving Design — `--host` CLI + Status-bar LAN toggle + +**Date:** 2026-11-03 +**Status:** Approved (conversation: design for `--host` approved, then UI toggle +approved with build order "CLI first, then the pill toggle"). + +## Intent + +Let any machine on the local network open `http://:8088/` right after +a normal `ProFiles` launch, while keeping a one-flag way to stay loopback-only — +and let the station operator flip that access at runtime from the web UI. + +## Goals + +- `ProFiles` (GUI, default) serves on `0.0.0.0` by default — LAN reachable. +- `--host` CLI option shared by GUI (desktop window) and `--server-only` mode. +- `--host 127.0.0.1` restores the old loopback-only behavior. +- The PyWebView window always opens on a connectable URL (`127.0.0.1` when the + bind host is `0.0.0.0`). +- Console shows `Local:` and `Network:` URLs on GUI launches too. +- StatusBar identity pill gains a LAN on/off switch (transient — not persisted + across restarts) with a in-app confirmation naming the exposed URLs. +- Runtime rebind reverts the bind on failure; the app must never end up dead. + +## Non-goals + +- No persistence of the runtime LAN choice (restart = launch default). +- No IPv6 binding and no hostname bind values (socket stays IPv4; see + `lifecycle.py` `_bind_listener` constraint comment). + +## Decisions (as made with the human partner) + +- Build order: (1) CLI, (2) status-bar toggle on top of the same rebind path. +- Accepted bind values: `0.0.0.0`, `127.0.0.1`, or a literal IPv4 address. + Hostnames and IPv6 literals are rejected with an argparse error. +- Toggle state comes from `GET /api/system` (`lan_enabled`), changes via + `POST /api/system/bind` (`{"lan": bool}`). A confirm dialog mentions the + exposed hostname/IP URLs. Failure surfaces a toast; state stays unchanged. +- UI-first caveat acknowledged: a colleague on another machine cannot toggle + LAN on a loopback-bound app (they can't open the UI) — that is why the CLI + default matters more. + +## Constraints + +- Layering: `server/` must not import `profiles.desktop.*` at module level + (desktop imports server). Route access to the running server cross-layer + goes through a structural Protocol (`BindableServer`) in `server/state.py`, + registered on `app.state` by `BackgroundServer.start()`. +- `window.confirm`/`window.alert` are no-ops inside webviews — the project + uses in-app `ConfirmDialog` and `showToast`. +- Test suite mirrors package tree 1:1; suite gate 85% coverage. diff --git a/makefile b/makefile index 58047a4..2e43678 100644 --- a/makefile +++ b/makefile @@ -28,6 +28,7 @@ install-system: ## Install system-wide (standard mode) install-system-dev: ## Install system-wide (development mode) @echo "📦 Installing ProFiles system-wide (development mode)..." + rm -rf src/profiles.egg-info pip install -e ".[dev]" @echo "✅ Development installation complete!" diff --git a/src/profiles/app.py b/src/profiles/app.py index 81a16b1..9450a75 100644 --- a/src/profiles/app.py +++ b/src/profiles/app.py @@ -7,6 +7,7 @@ from __future__ import annotations import argparse +import ipaddress import logging import platform import sys @@ -45,6 +46,29 @@ ) +def host_error(value: str) -> str | None: + """Validate a ``--host`` bind value; return an error message or ``None``. + + The server socket is IPv4 (see ``profiles.desktop.lifecycle``), so only + ``0.0.0.0``, ``127.0.0.1`` and plain IPv4 addresses are accepted — + hostnames and IPv6 literals cannot be used as bind targets. + + Args: + value: The bind address given on the command line. + + Returns: + ``None`` when the value can be bound, else a human-readable message. + """ + message = f"unsupported host '{value}' — use 0.0.0.0, 127.0.0.1, or an IPv4 address" + try: + ip = ipaddress.ip_address(value) + except ValueError: + return message + if ip.version != 4: + return message + return None + + def _stop_port_owner_command(port: int) -> str: """Build the OS-appropriate command to free a busy local *port*. @@ -91,6 +115,7 @@ def __init__( server_only: bool = False, no_config_propose: bool = False, gui_backend: str = "web", + host: str = "0.0.0.0", ) -> None: """Initialize the application. @@ -102,6 +127,7 @@ def __init__( server_only: Run only the web server without opening desktop window. no_config_propose: Do not offer to create a .profiles at startup. gui_backend: GUI backend to use ('tk' or 'web'). Defaults to 'web'. + host: Bind address for the web server ('0.0.0.0' serves the LAN). """ self._config_path = Path(config_path) if config_path is not None else None self._log_path = Path(log_path) if log_path is not None else default_log_path() @@ -109,6 +135,7 @@ def __init__( self._server_only = server_only self._no_config_propose = no_config_propose self._gui_backend = gui_backend.lower() + self._host = host self._config: AppConfig | None = None self._window: MainWindow | None = None self._logger: logging.Logger | None = None @@ -259,12 +286,16 @@ def run(self, file: str | Path | None = None) -> None: else: self._run_gui() - def _run_server_only(self, port: int = _DEFAULT_PORT, host: str = "0.0.0.0") -> None: + def _run_server_only(self, port: int = _DEFAULT_PORT, host: str | None = None) -> None: """Run only the FastAPI background server without opening PyWebView. A busy port is never fatal: the config is handed off to a running ProFiles instance when one owns the port, otherwise the server retries on the next free port. Nothing is killed automatically. + + Args: + port: TCP port to serve on. + host: Bind address; defaults to the ``--host`` CLI value. """ import time @@ -276,7 +307,7 @@ def _run_server_only(self, port: int = _DEFAULT_PORT, host: str = "0.0.0.0") -> from profiles.utils.network import get_local_ip assert self._config is not None - server = BackgroundServer(config=self._config, host=host, port=port) + server = BackgroundServer(config=self._config, host=host or self._host, port=port) try: server.start() except ServerStartError: @@ -285,7 +316,9 @@ def _run_server_only(self, port: int = _DEFAULT_PORT, host: str = "0.0.0.0") -> fallback_port = find_available_port(port) if fallback_port != port: self._announce_fallback_port(port, fallback_port) - server = BackgroundServer(config=self._config, host=host, port=fallback_port) + server = BackgroundServer( + config=self._config, host=host or self._host, port=fallback_port + ) try: server.start() except ServerStartError as exc: @@ -305,7 +338,7 @@ def _run_server_only(self, port: int = _DEFAULT_PORT, host: str = "0.0.0.0") -> finally: server.stop() - def _run_web_gui(self, port: int = _DEFAULT_PORT, host: str = "127.0.0.1") -> None: + def _run_web_gui(self, port: int = _DEFAULT_PORT, host: str | None = None) -> None: """Launch web backend via PyWebView desktop shell. A busy port is never fatal (issue #4): when a running ProFiles @@ -313,13 +346,18 @@ def _run_web_gui(self, port: int = _DEFAULT_PORT, host: str = "127.0.0.1") -> No launch exits 0; otherwise the server retries on the next free port. The manual "free the port" hint only appears when even the fallback port cannot be bound — nothing is killed automatically. + + Args: + port: TCP port to serve on. + host: Bind address; defaults to the ``--host`` CLI value. """ from profiles.desktop.launcher import launch_desktop_window from profiles.desktop.lifecycle import ServerStartError assert self._config is not None + effective_host = host or self._host try: - launch_desktop_window(self._config, port=port, host=host) + launch_desktop_window(self._config, port=port, host=effective_host) return except ServerStartError: pass # busy port — try handoff or a free port below @@ -333,7 +371,7 @@ def _run_web_gui(self, port: int = _DEFAULT_PORT, host: str = "127.0.0.1") -> No if fallback_port != port: self._announce_fallback_port(port, fallback_port) try: - launch_desktop_window(self._config, port=fallback_port, host=host) + launch_desktop_window(self._config, port=fallback_port, host=effective_host) except ServerStartError as exc: self._report_server_start_failure(fallback_port, exc) @@ -579,8 +617,18 @@ def main() -> None: profiles --headless Headless: scan & launch all profiles --headless file.mttl Headless: launch specific file profiles --init Generate default .profiles in CWD + profiles --host 127.0.0.1 Restrict serving to this machine (loopback only) """, ) + parser.add_argument( + "--host", + default="0.0.0.0", + type=str, + help=( + "Bind address for the web server (default: 0.0.0.0, reachable " + "from the local network; 127.0.0.1 restricts to this machine)" + ), + ) parser.add_argument( "--config", default=None, @@ -626,6 +674,10 @@ def main() -> None: args = parser.parse_args() + host_error_message = host_error(args.host) + if host_error_message is not None: + parser.error(host_error_message) + if args.init: init_default_config() return @@ -645,6 +697,7 @@ def main() -> None: server_only=args.server_only, no_config_propose=args.no_config_propose, gui_backend=gui_backend, + host=args.host, ) app.run(file=args.file) diff --git a/src/profiles/desktop/launcher.py b/src/profiles/desktop/launcher.py index ce6edf1..83f7ceb 100644 --- a/src/profiles/desktop/launcher.py +++ b/src/profiles/desktop/launcher.py @@ -70,15 +70,29 @@ def launch_desktop_window( The background server is stopped whenever the window closes, including when startup fails, so no orphaned process is left listening. + + The window always opens on a *connectable* URL: when the server is + bound to ``0.0.0.0`` (serve the LAN), that address is not routable in + a browser, so the window uses the loopback address instead. """ _configure_webview_permissions() server = BackgroundServer(config=config, host=host, port=port) window_title = f"ProFiles - {config.title}" if config.title else "ProFiles" - url = f"http://{host}:{server.port}" + webview_bind = "127.0.0.1" if host == "0.0.0.0" else host + url = f"http://{webview_bind}:{server.port}" try: server.start() + if host == "0.0.0.0": + from profiles.utils.network import get_local_ip + + print("ProFiles web GUI running at:") + print(f" Local: http://127.0.0.1:{server.port}") + print(f" Network: http://{get_local_ip()}:{server.port}") + else: + print("ProFiles web GUI running at:") + print(f" Local: http://{host}:{server.port}") webview.create_window( title=window_title, url=url, diff --git a/src/profiles/desktop/lifecycle.py b/src/profiles/desktop/lifecycle.py index 4617485..b393ed9 100644 --- a/src/profiles/desktop/lifecycle.py +++ b/src/profiles/desktop/lifecycle.py @@ -129,6 +129,10 @@ def start(self, timeout: float = _STARTUP_TIMEOUT_S) -> None: msg = f"ProFiles server failed to start on {self.host}:{self.port}: {exc}" raise ServerStartError(msg) from exc + # Route code reaches the running server through the app instance + # (structural BindableServer protocol in server/state.py). + self._app.state.background_server = self + uv_config = uvicorn.Config( app=self._app, host=self.host, @@ -216,3 +220,32 @@ def stop(self) -> None: if self._thread and self._thread.is_alive(): self._thread.join(timeout=3.0) self._reset() + + def rebind(self, host: str) -> None: + """Restart the server bound to a new address, in place. + + Used by the ``POST /api/system/bind`` route so the web UI can turn + LAN exposure on and off while a client is connected. When the new + bind fails, this server is brought back up on the *previous* host + and the original :class:`ServerStartError` is re-raised — the app + must never be left unreachable. + + Args: + host: New bind address (e.g. ``"0.0.0.0"`` or ``"127.0.0.1"``). + + Raises: + ServerStartError: The new bind could not be established. The + previous bind is still serving when this is raised. + """ + if host == self.host and self.is_running: + return + previous_host = self.host + self.stop() + self.host = host + try: + self.start() + except ServerStartError: + self.host = previous_host + with contextlib.suppress(ServerStartError): + self.start() + raise diff --git a/src/profiles/server/routes/system.py b/src/profiles/server/routes/system.py index befca5b..3f99cd0 100644 --- a/src/profiles/server/routes/system.py +++ b/src/profiles/server/routes/system.py @@ -1,16 +1,34 @@ -"""System and health check endpoints.""" +"""System, health and bind-status endpoints for the local FastAPI server.""" from __future__ import annotations import platform -from fastapi import APIRouter +from fastapi import APIRouter, HTTPException, Request +from pydantic import BaseModel from profiles.core.environment import system +from profiles.server.state import BindableServer router = APIRouter(prefix="/api", tags=["system"]) +class BindRequest(BaseModel): + """Body of ``POST /api/system/bind``.""" + + lan: bool + + +def _background_server(request: Request) -> BindableServer | None: + """Return the registered running server, or ``None`` when unknown. + + Registered by ``BackgroundServer.start()`` on ``app.state``; a bare + app factory (tests, static harnesses) has none. + """ + server: BindableServer | None = getattr(request.app.state, "background_server", None) + return server + + @router.get("/health") async def health_check() -> dict[str, str]: """Health check endpoint for process readiness.""" @@ -18,12 +36,37 @@ async def health_check() -> dict[str, str]: @router.get("/system") -async def system_info() -> dict[str, str]: - """Return local host and user diagnostic information.""" +async def system_info(request: Request) -> dict[str, object]: + """Return local host/user diagnostics and the current bind state.""" info = system.collect_system_info() + server = _background_server(request) return { "hostname": info.hostname, "ip": info.ip, "username": info.username, "os_release": platform.platform(), + "lan_enabled": None if server is None else server.host == "0.0.0.0", } + + +@router.post("/system/bind") +async def bind_server(payload: BindRequest, request: Request) -> dict[str, object]: + """Rebind the running server between LAN exposure and loopback-only. + + Transient on purpose: the choice resets to the launch default on the + next restart. The desktop lifecycle reverts a failed bind, so on error + the reported state is still the previous one. + """ + server = _background_server(request) + if server is None: + raise HTTPException(status_code=503, detail="no running server to rebind") + target_host = "0.0.0.0" if payload.lan else "127.0.0.1" + # Lazy import: desktop.lifecycle imports server.app at module level, so a + # top-level import here would create an import cycle. + from profiles.desktop.lifecycle import ServerStartError + + try: + server.rebind(target_host) + except ServerStartError as exc: + raise HTTPException(status_code=500, detail=str(exc)) from exc + return {"host": server.host, "lan_enabled": payload.lan} diff --git a/src/profiles/server/state.py b/src/profiles/server/state.py index 5f4bf62..e521705 100644 --- a/src/profiles/server/state.py +++ b/src/profiles/server/state.py @@ -4,7 +4,7 @@ from dataclasses import dataclass, field from pathlib import Path -from typing import Any +from typing import Any, Protocol from profiles.core.config.io.yaml_io import PRIMARY_CONFIG_NAME, find_config_file from profiles.core.config.models import AppConfig @@ -12,6 +12,23 @@ _MAX_EXTERNAL_EVENTS = 50 +class BindableServer(Protocol): + """The subset of ``BackgroundServer`` the route layer touches. + + Declared here so ``server/routes`` can type the registered server + without importing ``profiles.desktop`` (desktop imports server; the + reverse would be a layering cycle). + """ + + @property + def is_running(self) -> bool: ... + + @property + def host(self) -> str: ... + + def rebind(self, host: str) -> None: ... + + @dataclass class ServerState: """Holds active application configuration and cached scan results.""" diff --git a/src/profiles/web/build.py b/src/profiles/web/build.py index b622035..db9966b 100644 --- a/src/profiles/web/build.py +++ b/src/profiles/web/build.py @@ -138,10 +138,10 @@ def main() -> int: print("Building web frontend...") try: # Install dependencies - if not (WEB_ROOT / "node_modules").is_dir(): - command = "npm ci" - print(f"> {command}", flush=True) - subprocess.run(command, cwd=WEB_ROOT, check=True, shell=True, env=env) + # Use npm install instead of npm ci to handle lock file sync issues + command = "npm install" + print(f"> {command}", flush=True) + subprocess.run(command, cwd=WEB_ROOT, check=True, shell=True, env=env) # Build command = "npm run build" diff --git a/src/profiles/web/dist/.web-build-marker b/src/profiles/web/dist/.web-build-marker new file mode 100644 index 0000000..e69de29 diff --git a/src/profiles/web/dist/assets/index-859mEJTx.css b/src/profiles/web/dist/assets/index-859mEJTx.css deleted file mode 100644 index 6361739..0000000 --- a/src/profiles/web/dist/assets/index-859mEJTx.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-800:oklch(43.2% .095 166.913);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-900:oklch(20.8% .042 265.755);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-4xl:56rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.glass-panel{background:var(--app-glass-panel);-webkit-backdrop-filter:blur(24px)saturate(160%);backdrop-filter:blur(24px)saturate(160%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.glass-panel-strong{background:var(--app-glass-panel-strong);-webkit-backdrop-filter:blur(28px)saturate(180%);backdrop-filter:blur(28px)saturate(180%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.btn{justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-md);border-style:var(--tw-border-style);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-width:1px;display:inline-flex}.btn:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn:focus-visible{--tw-outline-style:none;outline-style:none}.btn:disabled{cursor:not-allowed;opacity:.4}.btn-primary{background-color:var(--color-indigo-600);color:var(--color-white);border-color:#0000}@media(hover:hover){.btn-primary:hover{background-color:var(--color-indigo-500)}}.btn-secondary{border-color:var(--app-border);background-color:var(--app-elevated);color:var(--app-text-secondary)}@media(hover:hover){.btn-secondary:hover{border-color:var(--color-indigo-500);color:var(--app-text-primary)}.btn-chip:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.btn-chip:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn-chip:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn-chip:focus-visible{--tw-outline-style:none;outline-style:none}.btn-chip:disabled{cursor:not-allowed;opacity:.4}.focus-ring:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.focus-ring:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.focus-ring:focus-visible{--tw-outline-style:none;outline-style:none}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.-right-1{right:calc(var(--spacing) * -1)}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.-bottom-0\.5{bottom:calc(var(--spacing) * -.5)}.-bottom-1{bottom:calc(var(--spacing) * -1)}.bottom-0{bottom:0}.bottom-2{bottom:calc(var(--spacing) * 2)}.-left-1{left:calc(var(--spacing) * -1)}.left-0{left:0}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-\[calc\(var\(--z-context-menu\)-1\)\]{z-index:calc(var(--z-context-menu) - 1)}.z-\[var\(--z-combobox-list\)\]{z-index:var(--z-combobox-list)}.z-\[var\(--z-context-menu\)\]{z-index:var(--z-context-menu)}.z-\[var\(--z-drop-overlay\)\]{z-index:var(--z-drop-overlay)}.z-\[var\(--z-modal\)\]{z-index:var(--z-modal)}.z-\[var\(--z-syntax-helper\)\]{z-index:var(--z-syntax-helper)}.z-\[var\(--z-toast\)\]{z-index:var(--z-toast)}.z-\[var\(--z-tooltip\)\]{z-index:var(--z-tooltip)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[80vh\]{height:80vh}.h-\[min\(84dvh\,760px\)\]{height:min(84dvh,760px)}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-1\.5rem\)\]{max-height:calc(100dvh - 1.5rem)}.max-h-\[calc\(100dvh-16px\)\]{max-height:calc(100dvh - 16px)}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-36{min-height:calc(var(--spacing) * 36)}.min-h-\[24px\]{min-height:24px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1\/3{width:33.3333%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-96{width:calc(var(--spacing) * 96)}.w-\[52px\]{width:52px}.w-\[138px\]{width:138px}.w-\[150px\]{width:150px}.w-\[400px\]{width:400px}.w-\[420px\]{width:420px}.w-\[450px\]{width:450px}.w-\[clamp\(560px\,85vw\,1500px\)\]{width:clamp(560px,85vw,1500px)}.w-\[min\(94vw\,960px\)\]{width:min(94vw,960px)}.w-full{width:100%}.w-max{width:max-content}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-\[min\(70vw\,560px\)\]{max-width:min(70vw,560px)}.max-w-\[min\(80vw\,640px\)\]{max-width:min(80vw,640px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[100px\]{min-width:100px}.min-w-\[220px\]{min-width:220px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.basis-64{flex-basis:calc(var(--spacing) * 64)}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-2{border-right-style:var(--tw-border-style);border-right-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-0{border-left-style:var(--tw-border-style);border-left-width:0}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-chip-amber-border{border-color:var(--chip-amber-border)}.border-chip-fuchsia-border{border-color:var(--chip-fuchsia-border)}.border-chip-indigo-border,.border-chip-indigo-border\/50{border-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-indigo-border\/50{border-color:color-mix(in oklab,var(--chip-indigo-border) 50%,transparent)}}.border-chip-purple-border,.border-chip-purple-border\/50{border-color:var(--chip-purple-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-purple-border\/50{border-color:color-mix(in oklab,var(--chip-purple-border) 50%,transparent)}}.border-chip-sky-border{border-color:var(--chip-sky-border)}.border-emerald-300\/50{border-color:#5ee9b580}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/50{border-color:color-mix(in oklab,var(--color-emerald-300) 50%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-frame-line{border-color:var(--app-frame-border)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-indigo-400\/80{border-color:#7d87ffcc}@supports (color:color-mix(in lab,red,red)){.border-indigo-400\/80{border-color:color-mix(in oklab,var(--color-indigo-400) 80%,transparent)}}.border-indigo-600{border-color:var(--color-indigo-600)}.border-line,.border-line\/40{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/40{border-color:color-mix(in oklab,var(--app-border) 40%,transparent)}}.border-line\/60{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/60{border-color:color-mix(in oklab,var(--app-border) 60%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-status-danger-border{border-color:var(--status-danger-border)}.border-status-success-border{border-color:var(--status-success-border)}.border-status-warning-border{border-color:var(--status-warning-border)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-app,.bg-app\/90{background-color:var(--app-bg)}@supports (color:color-mix(in lab,red,red)){.bg-app\/90{background-color:color-mix(in oklab,var(--app-bg) 90%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/65{background-color:#000000a6}@supports (color:color-mix(in lab,red,red)){.bg-black\/65{background-color:color-mix(in oklab,var(--color-black) 65%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-chip-amber-bg{background-color:var(--chip-amber-bg)}.bg-chip-fuchsia-bg{background-color:var(--chip-fuchsia-bg)}.bg-chip-indigo-bg,.bg-chip-indigo-bg\/20{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.bg-chip-indigo-bg\/20{background-color:color-mix(in oklab,var(--chip-indigo-bg) 20%,transparent)}}.bg-chip-purple-bg{background-color:var(--chip-purple-bg)}.bg-chip-sky-bg{background-color:var(--chip-sky-bg)}.bg-elevated,.bg-elevated\/30{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/30{background-color:color-mix(in oklab,var(--app-elevated) 30%,transparent)}}.bg-elevated\/50{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/50{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.bg-elevated\/60{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/60{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-emerald-800\/60{background-color:#005f4699}@supports (color:color-mix(in lab,red,red)){.bg-emerald-800\/60{background-color:color-mix(in oklab,var(--color-emerald-800) 60%,transparent)}}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-ink-faint{background-color:var(--app-text-faint)}.bg-slate-600\/20{background-color:#45556c33}@supports (color:color-mix(in lab,red,red)){.bg-slate-600\/20{background-color:color-mix(in oklab,var(--color-slate-600) 20%,transparent)}}.bg-status-danger-bg,.bg-status-danger-bg\/30{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/30{background-color:color-mix(in oklab,var(--status-danger-bg) 30%,transparent)}}.bg-status-danger-bg\/40{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/40{background-color:color-mix(in oklab,var(--status-danger-bg) 40%,transparent)}}.bg-status-success-bg{background-color:var(--status-success-bg)}.bg-status-warning-bg{background-color:var(--status-warning-bg)}.bg-surface{background-color:var(--app-surface)}.bg-surface-glass{background-color:var(--app-glass)}.bg-surface-strong,.bg-surface-strong\/20{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/20{background-color:color-mix(in oklab,var(--app-glass-strong) 20%,transparent)}}.bg-surface-strong\/30{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/30{background-color:color-mix(in oklab,var(--app-glass-strong) 30%,transparent)}}.bg-surface\/50{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/50{background-color:color-mix(in oklab,var(--app-surface) 50%,transparent)}}.bg-surface\/60{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--app-surface) 60%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-chip-indigo-bg{--tw-gradient-from:var(--chip-indigo-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-400\/90{--tw-gradient-from:#00d294e6}@supports (color:color-mix(in lab,red,red)){.from-emerald-400\/90{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-400) 90%, transparent)}}.from-emerald-400\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-chip-purple-bg{--tw-gradient-to:var(--chip-purple-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600\/90{--tw-gradient-to:#009767e6}@supports (color:color-mix(in lab,red,red)){.to-emerald-600\/90{--tw-gradient-to:color-mix(in oklab, var(--color-emerald-600) 90%, transparent)}}.to-emerald-600\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-px{padding-block:1px}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.align-\[1px\]{vertical-align:1px}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-chip-amber-text{color:var(--chip-amber-text)}.text-chip-fuchsia-text{color:var(--chip-fuchsia-text)}.text-chip-indigo-text{color:var(--chip-indigo-text)}.text-chip-purple-text{color:var(--chip-purple-text)}.text-chip-sky-text{color:var(--chip-sky-text)}.text-emerald-200{color:var(--color-emerald-200)}.text-ink{color:var(--app-text-primary)}.text-ink-faint{color:var(--app-text-faint)}.text-ink-muted,.text-ink-muted\/50{color:var(--app-text-muted)}@supports (color:color-mix(in lab,red,red)){.text-ink-muted\/50{color:color-mix(in oklab,var(--app-text-muted) 50%,transparent)}}.text-ink-secondary{color:var(--app-text-secondary)}.text-ink\/70{color:var(--app-text-primary)}@supports (color:color-mix(in lab,red,red)){.text-ink\/70{color:color-mix(in oklab,var(--app-text-primary) 70%,transparent)}}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-900{color:var(--color-slate-900)}.text-status-danger-text,.text-status-danger-text\/60{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/60{color:color-mix(in oklab,var(--status-danger-text) 60%,transparent)}}.text-status-danger-text\/70{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/70{color:color-mix(in oklab,var(--status-danger-text) 70%,transparent)}}.text-status-danger-text\/80{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/80{color:color-mix(in oklab,var(--status-danger-text) 80%,transparent)}}.text-status-danger-text\/90{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/90{color:color-mix(in oklab,var(--status-danger-text) 90%,transparent)}}.text-status-success-text{color:var(--status-success-text)}.text-status-warning-text{color:var(--status-warning-text)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-ink-faint::placeholder{color:var(--app-text-faint)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_9999px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 0 0 9999px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_6px_rgb\(0_0_0\/0\.35\)\]{--tw-shadow:0 2px 6px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.12\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff1f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-app{--tw-ring-color:var(--app-bg)}.ring-chip-indigo-border\/40{--tw-ring-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.ring-chip-indigo-border\/40{--tw-ring-color:color-mix(in oklab, var(--chip-indigo-border) 40%, transparent)}}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xs{--tw-backdrop-blur:blur(var(--blur-xs));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[filter\,box-shadow\,transform\]{transition-property:filter,box-shadow,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-40:is(:where(.group):hover *){opacity:.4}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\:bg-indigo-500 ::selection{background-color:var(--color-indigo-500)}.selection\:bg-indigo-500::selection{background-color:var(--color-indigo-500)}.selection\:text-white ::selection{color:var(--color-white)}.selection\:text-white::selection{color:var(--color-white)}.placeholder\:text-ink-faint::placeholder{color:var(--app-text-faint)}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.hover\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-chip-indigo-border:hover{border-color:var(--chip-indigo-border)}.hover\:border-indigo-400:hover{border-color:var(--color-indigo-400)}.hover\:border-indigo-500:hover{border-color:var(--color-indigo-500)}.hover\:border-status-warning-border:hover{border-color:var(--status-warning-border)}.hover\:bg-chip-indigo-bg\/40:hover{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-chip-indigo-bg\/40:hover{background-color:color-mix(in oklab,var(--chip-indigo-bg) 40%,transparent)}}.hover\:bg-elevated:hover,.hover\:bg-elevated\/50:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/50:hover{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.hover\:bg-elevated\/60:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/60:hover{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.hover\:bg-elevated\/70:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/70:hover{background-color:color-mix(in oklab,var(--app-elevated) 70%,transparent)}}.hover\:bg-elevated\/80:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/80:hover{background-color:color-mix(in oklab,var(--app-elevated) 80%,transparent)}}.hover\:bg-emerald-500:hover{background-color:var(--color-emerald-500)}.hover\:bg-hover-surface:hover{background-color:var(--app-hover)}.hover\:bg-indigo-500:hover{background-color:var(--color-indigo-500)}.hover\:bg-indigo-600:hover{background-color:var(--color-indigo-600)}.hover\:bg-status-danger-bg:hover,.hover\:bg-status-danger-bg\/60:hover{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-danger-bg\/60:hover{background-color:color-mix(in oklab,var(--status-danger-bg) 60%,transparent)}}.hover\:bg-status-warning-bg:hover,.hover\:bg-status-warning-bg\/40:hover{background-color:var(--status-warning-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-warning-bg\/40:hover{background-color:color-mix(in oklab,var(--status-warning-bg) 40%,transparent)}}.hover\:bg-surface:hover{background-color:var(--app-surface)}.hover\:bg-surface-strong:hover{background-color:var(--app-glass-strong)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:text-chip-indigo-text:hover{color:var(--chip-indigo-text)}.hover\:text-ink:hover{color:var(--app-text-primary)}.hover\:text-status-danger-text:hover{color:var(--status-danger-text)}.hover\:text-status-warning-text:hover{color:var(--status-warning-text)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-40:hover{opacity:.4}.hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_12px_30px_-6px_rgb\(16_185_129\/0\.7\)\]:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 12px 30px -6px var(--tw-shadow-color,#10b981b3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:brightness-95:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-indigo-400:focus-visible{border-color:var(--color-indigo-400)}.focus-visible\:border-indigo-500:focus-visible{border-color:var(--color-indigo-500)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-emerald-400:focus-visible{--tw-ring-color:var(--color-emerald-400)}.focus-visible\:ring-indigo-400:focus-visible{--tw-ring-color:var(--color-indigo-400)}.focus-visible\:ring-indigo-500:focus-visible{--tw-ring-color:var(--color-indigo-500)}.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 30%, transparent)}}.focus-visible\:ring-status-danger-border:focus-visible{--tw-ring-color:var(--status-danger-border)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-app:focus-visible{--tw-ring-offset-color:var(--app-bg)}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-indigo-500:focus-visible{outline-color:var(--color-indigo-500)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:hover\:text-ink-muted:disabled:hover{color:var(--app-text-muted)}.disabled\:hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]:disabled:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:hover\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(prefers-reduced-motion:reduce){.motion-reduce\:animate-none{animation:none}}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:basis-auto{flex-basis:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-xl{border-radius:var(--radius-xl)}.sm\:p-1\.5{padding:calc(var(--spacing) * 1.5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}}@media(min-width:64rem){.lg\:flex{display:flex}}.\[\&_code\]\:bg-transparent code{background-color:#0000}.\[\&_code\]\:px-0 code{padding-inline:0}.\[\&_code\]\:py-0 code{padding-block:0}.\[\&_code\]\:text-inherit code{color:inherit}.animate-modal-in{animation:.15s cubic-bezier(.2,.8,.2,1) modal-in}.animate-overlay-in{animation:.15s ease-out overlay-in}.animate-toast-in{animation:.12s ease-out toast-in}}:where(button,[role=button],input,select,textarea,a,summary,video[tabindex],[tabindex]):focus-visible{outline:2px solid var(--color-indigo-500,#6366f1);outline-offset:2px}:root{color-scheme:light dark;--z-combobox-list:60;--z-syntax-helper:65;--z-context-menu:70;--z-modal:80;--z-drop-overlay:85;--z-toast:90;--z-tooltip:100}:root,[data-theme=dark]{--app-bg:#020617;--app-surface:#0f172a;--app-elevated:#1e293b;--app-hover:#334155;--app-border:#334155;--app-frame-border:#94a3b84d;--app-text-primary:#f8fafc;--app-text-secondary:#cbd5e1;--app-text-muted:#94a3b8;--app-text-faint:#94a3b8;--app-glass:#0f172a99;--app-glass-strong:#020617e6;--app-glass-panel:#0f172ac7;--app-glass-panel-strong:#020617e0;--app-glass-highlight:#ffffff17;--app-panel-shadow:0 24px 60px -12px #0206178c;color-scheme:dark;--chip-indigo-bg:#6366f140;--chip-indigo-border:#818cf880;--chip-indigo-text:#c7d2fe;--chip-purple-bg:#a855f740;--chip-purple-border:#c084fc80;--chip-purple-text:#f3e8ff;--chip-fuchsia-bg:#c026d340;--chip-fuchsia-border:#e879f980;--chip-fuchsia-text:#f5d0fe;--chip-sky-bg:#0ea5e940;--chip-sky-border:#38bdf880;--chip-sky-text:#bae6fd;--chip-amber-bg:#f59e0b40;--chip-amber-border:#fbbf2480;--chip-amber-text:#fde68a;--status-success-bg:#10b98140;--status-success-border:#34d39980;--status-success-text:#a7f3d0;--status-warning-bg:#f59e0b40;--status-warning-border:#fbbf2480;--status-warning-text:#fde68a;--status-danger-bg:#f43f5e40;--status-danger-border:#fb718580;--status-danger-text:#fecdd3}[data-theme=light]{--chip-indigo-bg:#e0e7ff;--chip-indigo-border:#a5b4fc;--chip-indigo-text:#3730a3;--chip-purple-bg:#f3e8ff;--chip-purple-border:#d8b4fe;--chip-purple-text:#6b21a8;--chip-fuchsia-bg:#fae8ff;--chip-fuchsia-border:#f0abfc;--chip-fuchsia-text:#86198f;--chip-sky-bg:#e0f2fe;--chip-sky-border:#7dd3fc;--chip-sky-text:#0369a1;--chip-amber-bg:#fef3c7;--chip-amber-border:#fcd34d;--chip-amber-text:#92400e;--status-success-bg:#d1fae5;--status-success-border:#6ee7b7;--status-success-text:#065f46;--status-warning-bg:#fef3c7;--status-warning-border:#fcd34d;--status-warning-text:#92400e;--status-danger-bg:#ffe4e6;--status-danger-border:#fda4af;--status-danger-text:#9f1239;--app-bg:#f8fafc;--app-surface:#fff;--app-elevated:#f1f5f9;--app-hover:#e2e8f0;--app-border:#cbd5e1;--app-frame-border:#0f172a29;--app-text-primary:#0f172a;--app-text-secondary:#334155;--app-text-muted:#475569;--app-text-faint:#475569;--app-glass:#ffffffb3;--app-glass-strong:#f8fafcf2;--app-glass-panel:#fffc;--app-glass-panel-strong:#f8fafceb;--app-glass-highlight:#ffffffe6;--app-panel-shadow:0 24px 60px -18px #0f172a47;color-scheme:light}body{background-color:var(--app-bg);min-height:100vh;color:var(--app-text-primary);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;transition:background-color .2s,color .2s}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes modal-in{0%{opacity:0;transform:translateY(4px)scale(.995)}to{opacity:1;transform:none}}@keyframes overlay-in{0%{opacity:0}to{opacity:1}}@keyframes toast-in{0%{opacity:0;translate:-50% calc(6px - 50%)}to{opacity:1;translate:-50% -50%}}*{scrollbar-color:var(--app-border) transparent;scrollbar-width:thin}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:var(--app-border);background-clip:content-box;border:2px solid #0000;border-radius:9999px}::-webkit-scrollbar-thumb:hover{background-color:var(--app-text-faint)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/profiles/web/dist/assets/index-BJQkS9RK.js b/src/profiles/web/dist/assets/index-BJQkS9RK.js deleted file mode 100644 index bcb78a5..0000000 --- a/src/profiles/web/dist/assets/index-BJQkS9RK.js +++ /dev/null @@ -1,384 +0,0 @@ -var Qv=Object.defineProperty;var Xv=(n,r,a)=>r in n?Qv(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Vf=(n,r,a)=>Xv(n,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const d of s)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const d={};return s.integrity&&(d.integrity=s.integrity),s.referrerPolicy&&(d.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?d.credentials="include":s.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(s){if(s.ep)return;s.ep=!0;const d=a(s);fetch(s.href,d)}})();function Ld(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Yf={exports:{}},Ia={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var dx;function Iv(){if(dx)return Ia;dx=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(u,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var m in s)m!=="key"&&(d[m]=s[m])}else d=s;return s=d.ref,{$$typeof:n,type:u,key:f,ref:s!==void 0?s:null,props:d}}return Ia.Fragment=r,Ia.jsx=a,Ia.jsxs=a,Ia}var hx;function Kv(){return hx||(hx=1,Yf.exports=Iv()),Yf.exports}var h=Kv(),Gf={exports:{}},De={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var mx;function Zv(){if(mx)return De;mx=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,D={};function $(E,Y,oe){this.props=E,this.context=Y,this.refs=D,this.updater=oe||T}$.prototype.isReactComponent={},$.prototype.setState=function(E,Y){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,Y,"setState")},$.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function I(){}I.prototype=$.prototype;function J(E,Y,oe){this.props=E,this.context=Y,this.refs=D,this.updater=oe||T}var ie=J.prototype=new I;ie.constructor=J,L(ie,$.prototype),ie.isPureReactComponent=!0;var U=Array.isArray;function R(){}var Q={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function B(E,Y,oe){var he=oe.ref;return{$$typeof:n,type:E,key:Y,ref:he!==void 0?he:null,props:oe}}function ne(E,Y){return B(E.type,Y,E.props)}function V(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function se(E){var Y={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(oe){return Y[oe]})}var we=/\/+/g;function ae(E,Y){return typeof E=="object"&&E!==null&&E.key!=null?se(""+E.key):Y.toString(36)}function _(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(R,R):(E.status="pending",E.then(function(Y){E.status==="pending"&&(E.status="fulfilled",E.value=Y)},function(Y){E.status==="pending"&&(E.status="rejected",E.reason=Y)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function P(E,Y,oe,he,Ee){var ye=typeof E;(ye==="undefined"||ye==="boolean")&&(E=null);var _e=!1;if(E===null)_e=!0;else switch(ye){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(E.$$typeof){case n:case r:_e=!0;break;case y:return _e=E._init,P(_e(E._payload),Y,oe,he,Ee)}}if(_e)return Ee=Ee(E),_e=he===""?"."+ae(E,0):he,U(Ee)?(oe="",_e!=null&&(oe=_e.replace(we,"$&/")+"/"),P(Ee,Y,oe,"",function(Ot){return Ot})):Ee!=null&&(V(Ee)&&(Ee=ne(Ee,oe+(Ee.key==null||E&&E.key===Ee.key?"":(""+Ee.key).replace(we,"$&/")+"/")+_e)),Y.push(Ee)),1;_e=0;var pe=he===""?".":he+":";if(U(E))for(var ke=0;ke>>1,N=_[re];if(0>>1;res(M,le))Es(Y,M)?(_[re]=Y,_[E]=le,re=E):(_[re]=M,_[Ve]=le,re=Ve);else if(Es(Y,le))_[re]=Y,_[E]=le,re=E;else break e}}return P}function s(_,P){var le=_.sortIndex-P.sortIndex;return le!==0?le:_.id-P.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],x=[],y=1,g=null,w=3,v=!1,S=!1,T=!1,L=!1,D=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function J(_){for(var P=a(x);P!==null;){if(P.callback===null)u(x);else if(P.startTime<=_)u(x),P.sortIndex=P.expirationTime,r(p,P);else break;P=a(x)}}function ie(_){if(T=!1,J(_),!S)if(a(p)!==null)S=!0,U||(U=!0,V());else{var P=a(x);P!==null&&ae(ie,P.startTime-_)}}var U=!1,R=-1,Q=5,fe=-1;function B(){return L?!0:!(n.unstable_now()-fe_&&B());){var re=g.callback;if(typeof re=="function"){g.callback=null,w=g.priorityLevel;var N=re(g.expirationTime<=_);if(_=n.unstable_now(),typeof N=="function"){g.callback=N,J(_),P=!0;break t}g===a(p)&&u(p),J(_)}else u(p);g=a(p)}if(g!==null)P=!0;else{var He=a(x);He!==null&&ae(ie,He.startTime-_),P=!1}}break e}finally{g=null,w=le,v=!1}P=void 0}}finally{P?V():U=!1}}}var V;if(typeof I=="function")V=function(){I(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,we=se.port2;se.port1.onmessage=ne,V=function(){we.postMessage(null)}}else V=function(){D(ne,0)};function ae(_,P){R=D(function(){_(n.unstable_now())},P)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(_){_.callback=null},n.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<_?Math.floor(1e3/_):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_next=function(_){switch(w){case 1:case 2:case 3:var P=3;break;default:P=w}var le=w;w=P;try{return _()}finally{w=le}},n.unstable_requestPaint=function(){L=!0},n.unstable_runWithPriority=function(_,P){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var le=w;w=_;try{return P()}finally{w=le}},n.unstable_scheduleCallback=function(_,P,le){var re=n.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0re?(_.sortIndex=le,r(x,_),a(p)===null&&_===a(x)&&(T?($(R),R=-1):T=!0,ae(ie,le-re))):(_.sortIndex=N,r(p,_),S||v||(S=!0,U||(U=!0,V()))),_},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(_){var P=w;return function(){var le=w;w=P;try{return _.apply(this,arguments)}finally{w=le}}}})(If)),If}var xx;function Pv(){return xx||(xx=1,Xf.exports=Jv()),Xf.exports}var Kf={exports:{}},$t={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var yx;function Wv(){if(yx)return $t;yx=1;var n=Ud();function r(y){var g="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Kf.exports=Wv(),Kf.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var vx;function e2(){if(vx)return Ka;vx=1;var n=Pv(),r=Ud(),a=Fy();function u(e){var t="https://react.dev/errors/"+e;if(1Vt||(e.current=Ut[Vt],Ut[Vt]=null,Vt--)}function Ke(e,t){Vt++,Ut[Vt]=e.current,e.current=t}var Wt=kt(null),Sn=kt(null),en=kt(null),Bt=kt(null);function ge(e,t){switch(Ke(en,t),Ke(Sn,e),Ke(Wt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wg(t),e=kg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}tt(Wt),Ke(Wt,e)}function Re(){tt(Wt),tt(Sn),tt(en)}function Me(e){var t=e.memoizedState;t!==null&&(Yr._currentValue=t.memoizedState,Ke(Bt,e)),t=Wt.current;var l=kg(t,e.type);t!==l&&(Ke(Sn,e),Ke(Wt,l))}function lt(e){Sn.current===e&&(tt(Wt),tt(Sn)),Bt.current===e&&(tt(Bt),Yr._currentValue=Ot)}var Z,ue;function be(e){if(Z===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Z=t&&t[1]||"",ue=-1)":-1o||j[i]!==F[o]){var K=` -`+j[i].replace(" at new "," at ");return e.displayName&&K.includes("")&&(K=K.replace("",e.displayName)),K}while(1<=i&&0<=o);break}}}finally{Ae=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?be(l):""}function it(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be("Lazy");case 13:return e.child!==t&&t!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return St(e.type,!1);case 11:return St(e.type.render,!1);case 1:return St(e.type,!0);case 31:return be("Activity");case 30:return be("ViewTransition");default:return""}}function jt(e){try{var t="",l=null;do t+=it(e,l),l=e,e=e.return;while(e);return t}catch(i){return` -Error generating stack: `+i.message+` -`+i.stack}}var Yt=Object.prototype.hasOwnProperty,hn=n.unstable_scheduleCallback,an=n.unstable_cancelCallback,Gn=n.unstable_shouldYield,ll=n.unstable_requestPaint,Rt=n.unstable_now,Ct=n.unstable_getCurrentPriorityLevel,un=n.unstable_ImmediatePriority,de=n.unstable_UserBlockingPriority,er=n.unstable_NormalPriority,Nn=n.unstable_LowPriority,yt=n.unstable_IdlePriority,mn=n.log,pn=n.unstable_setDisableYieldValue,st=null,on=null;function Qn(e){if(typeof mn=="function"&&pn(e),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(st,e)}catch{}}var gt=Math.clz32?Math.clz32:ta,gs=Math.log,ou=Math.LN2;function ta(e){return e>>>=0,e===0?32:31-(gs(e)/ou|0)|0}var tr=256,nr=262144,Ll=4194304;function On(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ul(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var k=i&134217727;return k!==0?(i=k&~c,i!==0?o=On(i):(b&=k,b!==0?o=On(b):l||(l=k&~e,l!==0&&(o=On(l))))):(k=i&~c,k!==0?o=On(k):b!==0?o=On(b):l||(l=i&~e,l!==0&&(o=On(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function bi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lr(e,t){(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0l;l++)t.push(e);return t}function vi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function fu(e,t,l,i,o,c){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,j=e.expirationTimes,F=e.hiddenUpdates;for(l=b&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ns=!1;if(kl)try{var aa={};Object.defineProperty(aa,"passive",{get:function(){Ns=!0}}),window.addEventListener("test",aa,aa),window.removeEventListener("test",aa,aa)}catch{Ns=!1}var Vl=null,Es=null,Nu=null;function xh(){if(Nu)return Nu;var e,t=Es,l=t.length,i,o="value"in Vl?Vl.value:Vl.textContent,c=o.length;for(e=0;e=sa),Sh=" ",Nh=!1;function Eh(e,t){switch(e){case"keyup":return Vb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fr=!1;function Gb(e,t){switch(e){case"compositionend":return jh(t);case"keypress":return t.which!==32?null:(Nh=!0,Sh);case"textInput":return e=t.data,e===Sh&&Nh?null:e;default:return null}}function Qb(e,t){if(fr)return e==="compositionend"||!As&&Eh(e,t)?(e=xh(),Nu=Es=Vl=null,fr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rh(e,t){var l=Oh(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Oh(l)}}function Lh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ms(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ms(e.document)}return t}function Os(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Wb=kl&&"documentMode"in document&&11>=document.documentMode,dr=null,Rs=null,ha=null,Ls=!1;function Bh(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ls||dr==null||dr!==Ms(i)||(i=dr,"selectionStart"in i&&Os(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ha&&da(ha,i)||(ha=i,i=Ao(Rs,"onSelect"),0>=b,o-=b,al=1<<32-gt(t)+o|l<ze?(Dt=Ne,Ne=null):Dt=Ne.sibling;var Pe=H(q,Ne,G[ze],ee);if(Pe===null){Ne===null&&(Ne=Dt);break}e&&Ne&&Pe.alternate===null&&t(q,Ne),O=c(Pe,O,ze),Ie===null?xe=Pe:Ie.sibling=Pe,Ie=Pe,Ne=Dt}if(ze===G.length)return l(q,Ne),qe&&jl(q,ze),xe;if(Ne===null){for(;zeze?(Dt=Ne,Ne=null):Dt=Ne.sibling;var hi=H(q,Ne,Pe.value,ee);if(hi===null){Ne===null&&(Ne=Dt);break}e&&Ne&&hi.alternate===null&&t(q,Ne),O=c(hi,O,ze),Ie===null?xe=hi:Ie.sibling=hi,Ie=hi,Ne=Dt}if(Pe.done)return l(q,Ne),qe&&jl(q,ze),xe;if(Ne===null){for(;!Pe.done;ze++,Pe=G.next())Pe=te(q,Pe.value,ee),Pe!==null&&(O=c(Pe,O,ze),Ie===null?xe=Pe:Ie.sibling=Pe,Ie=Pe);return qe&&jl(q,ze),xe}for(Ne=i(Ne);!Pe.done;ze++,Pe=G.next())Pe=X(Ne,q,ze,Pe.value,ee),Pe!==null&&(e&&(Dt=Pe.alternate,Dt!==null&&Ne.delete(Dt.key===null?ze:Dt.key)),O=c(Pe,O,ze),Ie===null?xe=Pe:Ie.sibling=Pe,Ie=Pe);return e&&Ne.forEach(function(Gv){return t(q,Gv)}),qe&&jl(q,ze),xe}function Ue(q,O,G,ee){if(typeof G=="object"&&G!==null&&G.type===ne&&G.key===null&&G.props.ref===void 0&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case fe:e:{for(var xe=G.key;O!==null;){if(O.key===xe){if(xe=G.type,xe===ne){if(O.tag===7){l(q,O.sibling),ee=o(O,G.props.children),Kl(ee,G),ee.return=q,q=ee;break e}}else if(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===N&&Ri(xe)===O.type){l(q,O.sibling),ee=o(O,G.props),Kl(ee,G),ee.return=q,q=ee;break e}l(q,O);break}else t(q,O);O=O.sibling}G.type===ne?(ee=Ti(G.props.children,q.mode,ee,G.key),Kl(ee,G),ee.return=q,q=ee):(ee=Ou(G.type,G.key,G.props,null,q.mode,ee),Kl(ee,G),ee.return=q,q=ee)}return b(q);case B:e:{for(xe=G.key;O!==null;){if(O.key===xe)if(O.tag===4&&O.stateNode.containerInfo===G.containerInfo&&O.stateNode.implementation===G.implementation){l(q,O.sibling),ee=o(O,G.children||[]),ee.return=q,q=ee;break e}else{l(q,O);break}else t(q,O);O=O.sibling}ee=Ys(G,q.mode,ee),ee.return=q,q=ee}return b(q);case N:return G=Ri(G),Ue(q,O,G,ee)}if(_e(G))return me(q,O,G,ee);if(he(G)){if(xe=he(G),typeof xe!="function")throw Error(u(150));return G=xe.call(G),ve(q,O,G,ee)}if(typeof G.then=="function")return Ue(q,O,Gu(G),ee);if(G.$$typeof===ae)return Ue(q,O,qu(q,G),ee);Qu(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,O!==null&&O.tag===6?(l(q,O.sibling),ee=o(O,G),ee.return=q,q=ee):(l(q,O),ee=Vs(G,q.mode,ee),ee.return=q,q=ee),b(q)):l(q,O)}return function(q,O,G,ee){try{ba=0;var xe=Ue(q,O,G,ee);return wr=null,xe}catch(Ne){if(Ne===vr||Ne===Vu)throw Ne;var Ie=gn(29,Ne,null,q.mode);return Ie.lanes=ee,Ie.return=q,Ie}finally{}}}var Ui=om(!0),sm=om(!1),Zl=!1;function Ws(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ec(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function $l(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Jl(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(et&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=Mu(e),Xh(e,null,l),t}return Du(e,i,t,l),Mu(e)}function va(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,bl(e,l)}}function tc(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=b:c=c.next=b,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var nc=!1;function wa(){if(nc){var e=br;if(e!==null)throw e}}function ka(e,t,l,i){nc=!1;var o=e.updateQueue;Zl=!1;var c=o.firstBaseUpdate,b=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var j=k,F=j.next;j.next=null,b===null?c=F:b.next=F,b=j;var K=e.alternate;K!==null&&(K=K.updateQueue,k=K.lastBaseUpdate,k!==b&&(k===null?K.firstBaseUpdate=F:k.next=F,K.lastBaseUpdate=j))}if(c!==null){var te=o.baseState;b=0,K=F=j=null,k=c;do{var H=k.lane&-536870913,X=H!==k.lane;if(X?(Xe&H)===H:(i&H)===H){H!==0&&H===Mi&&(nc=!0),K!==null&&(K=K.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var me=e,ve=k;H=t;var Ue=l;switch(ve.tag){case 1:if(me=ve.payload,typeof me=="function"){te=me.call(Ue,te,H);break e}te=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ve.payload,H=typeof me=="function"?me.call(Ue,te,H):me,H==null)break e;te=R({},te,H);break e;case 2:Zl=!0}}H=k.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=o.callbacks,X===null?o.callbacks=[H]:X.push(H))}else X={lane:H,tag:k.tag,payload:k.payload,callback:k.callback,next:null},K===null?(F=K=X,j=te):K=K.next=X,b|=H;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;X=k,k=X.next,X.next=null,o.lastBaseUpdate=X,o.shared.pending=null}}while(!0);K===null&&(j=te),o.baseState=j,o.firstBaseUpdate=F,o.lastBaseUpdate=K,c===null&&(o.shared.lanes=0),ii|=b,e.lanes=b,e.memoizedState=te}}function cm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function fm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ec?c:8;var b=pe.T,k={};k.types=b!==null?b.types:null,pe.T=k,kc(e,!1,t,l);try{var j=o(),F=pe.S;if(F!==null&&F(k,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var K=c1(j,i);ja(e,t,K,An(e))}else ja(e,t,i,An(e))}catch(te){ja(e,t,{then:function(){},status:"rejected",reason:te},An())}finally{ke.p=c,b!==null&&k.types!==null&&(b.types=k.types),pe.T=b}}function g1(){}function vc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var o=Ym(e).queue;Vm(e,o,t,Ot,l===null?g1:function(){return Gm(e),l(i)})}function Ym(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ot,baseState:Ot,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Al,lastRenderedState:Ot},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Al,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gm(e){var t=Ym(e);t.next===null&&(t=e.alternate.memoizedState),ja(e,t.next.queue,{},An())}function wc(){return Qt(Yr)}function Qm(){return Et().memoizedState}function Xm(){return Et().memoizedState}function x1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=An();e=$l(l);var i=Jl(t,e,l);i!==null&&(vn(i,t,l),va(i,t,l)),t={cache:Zs()},e.payload=t;return}t=t.return}}function y1(e,t,l){var i=An();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},to(e)?Km(t,l):(l=qs(e,t,l,i),l!==null&&(vn(l,e,i),Zm(l,t,i)))}function Im(e,t,l){var i=An();ja(e,t,l,i)}function ja(e,t,l,i){var o={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(to(e))Km(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var b=t.lastRenderedState,k=c(b,l);if(o.hasEagerState=!0,o.eagerState=k,En(k,b))return Du(e,t,o,0),ft===null&&zu(),!1}catch{}finally{}if(l=qs(e,t,o,i),l!==null)return vn(l,e,i),Zm(l,t,i),!0}return!1}function kc(e,t,l,i){if(i={lane:2,revertLane:hf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},to(e)){if(t)throw Error(u(479))}else t=qs(e,l,i,2),t!==null&&vn(t,e,2)}function to(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Km(e,t){kr=Ku=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Zm(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,bl(e,l)}}var no={readContext:Qt,use:Ju,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt,useEffectEvent:vt},$m={readContext:Qt,use:Ju,useCallback:function(e,t){return cn().memoizedState=[e,t===void 0?null:t],e},useContext:Qt,useEffect:Mm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Wu(4194308,4,Um.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var l=cn();t=t===void 0?null:t;var i=e();if(Bi){Qn(!0);try{e()}finally{Qn(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=cn();if(l!==void 0){var o=l(t);if(Bi){Qn(!0);try{l(t)}finally{Qn(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=y1.bind(null,Le,e),[i.memoizedState,e]},useRef:function(e){var t=cn();return e={current:e},t.memoizedState=e},useState:function(e){e=pc(e);var t=e.queue,l=Im.bind(null,Le,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:yc,useDeferredValue:function(e,t){var l=cn();return bc(l,e,t)},useTransition:function(){var e=pc(!1);return e=Vm.bind(null,Le,e.queue,!0,!1),cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Le,o=cn();if(qe){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),ft===null)throw Error(u(349));(Xe&127)!==0||xm(i,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Mm(bm.bind(null,i,c,e),[e]),i.flags|=2048,Nr(9,{destroy:void 0},ym.bind(null,i,c,l,t),null),l},useId:function(){var e=cn(),t=ft.identifierPrefix;if(qe){var l=ul,i=al;l=(i&~(1<<32-gt(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Zu++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?b.createElement(o,{is:i.is}):b.createElement(o)}}c[Tt]=t,c[nn]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)c.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=c;e:switch(Zt(c,o,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Dl(t)}}return pt(t),t.subtreeFlags&=-33554433,Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Dl(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=en.current,yr(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,o=Ht,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||bg(e.nodeValue,l)),e||Xl(t,!0)}else e=Ha(e).createTextNode(i),e[Tt]=t,t.stateNode=e}return pt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=yr(t),l!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Tt]=t}else _i(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),e=!1}else l=Xs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(jn(t),t):(jn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return pt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=yr(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Tt]=t}else _i(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),o=!1}else o=Xs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(jn(t),t):(jn(t),null)}return jn(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),oo(t,t.updateQueue),pt(t),null);case 4:return Re(),e===null&&xf(t.stateNode.containerInfo),t.flags|=67108864,pt(t),null;case 10:return Tl(t.type),pt(t),null;case 19:if(ac(t),i=t.memoizedState,i===null)return pt(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)Ta(i,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Iu(e),c!==null){for(t.flags|=128,Ta(i,!1),e=c.updateQueue,t.updateQueue=e,oo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Ih(l,e),l=l.sibling;return Sa(t,It.current&1|2),qe&&jl(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Rt()>wo&&(t.flags|=128,o=!0,Ta(i,!1),t.lanes=4194304)}else{if(!o)if(e=Iu(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,oo(t,e),Ta(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!c.alternate&&!qe)return pt(t),null}else 2*Rt()-i.renderingStartTime>wo&&l!==536870912&&(t.flags|=128,o=!0,Ta(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}if(i.tail!==null){e=i.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Rt(),e.sibling=null,c=It.current,c=o?c&1|2:c&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!l||qe?Sa(t,c):(l=c,Ke(Xt,t),Ke(It,l),ln===null&&(ln=t)),qe&&jl(t,i.treeForkCount),e}return pt(t),null;case 22:case 23:return jn(t),ic(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),l=t.updateQueue,l!==null&&oo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&tt(Oi),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Tl(_t),pt(t),null;case 25:return null;case 30:return t.flags|=33554432,pt(t),null}throw Error(u(156,t.tag))}function E1(e,t){switch(Gs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Tl(_t),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lt(t),null;case 31:if(t.memoizedState!==null){if(jn(t),t.alternate===null)throw Error(u(340));_i()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));_i()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ac(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Re(),null;case 10:return Tl(t.type),null;case 22:case 23:return jn(t),ic(),e!==null&&tt(Oi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Tl(_t),null;case 25:return null;default:return null}}function wp(e,t){switch(Gs(t),t.tag){case 3:Tl(_t),Re();break;case 26:case 27:case 5:lt(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&jn(t);break;case 13:jn(t);break;case 19:ac(t);break;case 10:Tl(t.type);break;case 22:case 23:jn(t),ic(),e!==null&&tt(Oi);break;case 24:Tl(_t)}}function _a(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){i=void 0;var c=l.create,b=l.inst;i=c(),b.destroy=i}l=l.next}while(l!==o)}}catch(k){ut(t,t.return,k)}}function ti(e,t,l){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var b=i.inst,k=b.destroy;if(k!==void 0){b.destroy=void 0,o=t;var j=l,F=k;try{F()}catch(K){ut(o,j,K)}}}i=i.next}while(i!==c)}}catch(K){ut(t,t.return,K)}}function kp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{fm(t,l)}catch(i){ut(e,e.return,i)}}}function Sp(e,t,l){l.props=Hi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){ut(e,t,i)}}function ol(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var o=e.stateNode,c=Sl(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=Ag(c)),i=o.ref;break;case 7:if(e.stateNode===null){var b=new zn(e);g(e.child,!1,pv,b,void 0,void 0),e.stateNode=b}i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(k){ut(e,t,k)}}function Kt(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(o){ut(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){ut(e,t,o)}else l.current=null}function so(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var l=0;l title"))),Zt(i,t,l),i[Tt]=e,Nt(i),t=i;break e;case"link":if(c=Ig("link","href",o).get(t+(l.href||""))){for(b=0;bUe&&(b=Ue,Ue=ve,ve=b);var q=Rh(k,ve),O=Rh(k,Ue);if(q&&O&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==O.node||X.focusOffset!==O.offset)){var G=te.createRange();G.setStart(q.node,q.offset),X.removeAllRanges(),ve>Ue?(X.addRange(G),X.extend(O.node,O.offset)):(G.setEnd(O.node,O.offset),X.addRange(G))}}}}for(te=[],X=k;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;kl?32:l,pe.T=null,l=nf,nf=null;var c=Jn,b=ml;if(bt=0,Yi=Jn=null,ml=0,(et&6)!==0)throw Error(u(331));var k=et;if(et|=4,Xp(c.current),Yp(c,c.current,b,l),et=k,La(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(st,c)}catch{}return!0}finally{ke.p=o,pe.T=i,ug(e,t)}}function og(e,t,l){t=Ln(l,t),t=Ec(e.stateNode,t,2),e=Jl(e,t,2),e!==null&&(vi(e,2),pl(e))}function ut(e,t,l){if(e.tag===3)og(e,e,l);else for(;t!==null;){if(t.tag===3){og(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ri===null||!ri.has(i))){e=Ln(l,e),l=ip(2),i=Jl(t,l,2),i!==null&&(rp(l,i,t,e),vi(i,2),pl(i));break}}t=t.return}}function cf(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new _1;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(l)||(Wc=!0,o.add(l),e=U1.bind(null,e,t,l),t.then(e,e))}function U1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,ft===e&&(Xe&l)===l&&((wt===4||wt===3&&(Xe&62914560)===Xe&&300>Rt()-vo)&&(et&2)===0?Rr(e,0):bo|=l,Ar===Xe&&(Ar=0)),pl(e)}function sg(e,t){t===0&&(t=cu()),e=Ci(e,t),e!==null&&(vi(e,t),pl(e))}function B1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),sg(e,l)}function H1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),sg(e,l)}function q1(e,t){return hn(e,t)}var Ur=null,Br=null,ff=!1,To=!1,df=!1,ui=0;function pl(e){e!==Br&&e.next===null&&(Br===null?Ur=Br=e:Br=Br.next=e),To=!0,ff||(ff=!0,V1())}function La(e,t){if(!df&&To){df=!0;do for(var l=!1,i=Ur;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var b=i.suspendedLanes,k=i.pingedLanes;c=(1<<31-gt(42|e)+1)-1,c&=o&~(b&~k),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,hg(i,c))}else c=Xe,c=Ul(i,i===ft?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||bi(i,c)||(l=!0,hg(i,c));i=i.next}while(l);df=!1}}function F1(){cg()}function cg(){To=ff=!1;var e=0;ui!==0&&W1()&&(e=ui);for(var t=Rt(),l=null,i=Ur;i!==null;){var o=i.next,c=fg(i,t);c===0?(i.next=null,l===null?Ur=o:l.next=o,o===null&&(Br=l)):(l=i,(e!==0||(c&3)!==0)&&(To=!0)),i=o}bt!==0&&bt!==5||La(e),ui!==0&&(ui=0)}function fg(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0k)break;var K=j.transferSize,te=j.initiatorType;K&&vg(te)&&(j=j.responseEnd,b+=K*(jMo){ve.length=me;break}G=new Promise(rv.bind(G)),ve.push(G)}}}if(0"u"?null:document;function Yg(e,t,l){var i=qr;if(i&&typeof t=="string"&&t){var o=Ce(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Vg.has(o)||(Vg.add(o),e={rel:e,crossOrigin:l,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),Zt(t,"link",e),Nt(t),i.head.appendChild(t)))}}function Nv(e){Ol.D(e),Yg("dns-prefetch",e,null)}function Ev(e,t){Ol.C(e,t),Yg("preconnect",e,t)}function jv(e,t,l){Ol.L(e,t,l);var i=qr;if(i&&e&&t){var o='link[rel="preload"][as="'+Ce(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Ce(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Ce(l.imageSizes)+'"]')):o+='[href="'+Ce(e)+'"]';var c=o;switch(t){case"style":c=Fr(e);break;case"script":c=Vr(e)}if(!(Vn.has(c)||(e=R({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Vn.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(Fa(c))||t==="script"&&i.querySelector(Va(c))))){var b=i.createElement("link");Zt(b,"link",e),t==="style"&&(b[ir]=!0,b.onload=b.onerror=function(){gu(b)}),Nt(b),i.head.appendChild(b)}}}function Cv(e,t){Ol.m(e,t);var l=qr;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Ce(i)+'"][href="'+Ce(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Vr(e)}if(!Vn.has(c)&&(e=R({rel:"modulepreload",href:e},t),Vn.set(c,e),l.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Va(c)))return}i=l.createElement("link"),Zt(i,"link",e),Nt(i),l.head.appendChild(i)}}}function Tv(e,t,l){Ol.S(e,t,l);var i=qr;if(i&&e){var o=ql(i).hoistableStyles,c=Fr(e);t=t||"default";var b=o.get(c);if(!b){var k={loading:0,preload:null};if(b=i.querySelector(Fa(c)))k.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vn.get(c))&&Mf(e,l);var j=b=i.createElement("link");Nt(j),Zt(j,"link",e),j._p=new Promise(function(F,K){j.onload=F,j.onerror=K}),j.addEventListener("load",function(){k.loading|=1}),j.addEventListener("error",function(){k.loading|=2}),k.loading|=4,zo(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:k},o.set(c,b)}}}function _v(e,t){Ol.X(e,t);var l=qr;if(l&&e){var i=ql(l).hoistableScripts,o=Vr(e),c=i.get(o);c||(c=l.querySelector(Va(o)),c||(e=R({src:e,async:!0},t),(t=Vn.get(o))&&Of(e,t),c=l.createElement("script"),Nt(c),Zt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Av(e,t){Ol.M(e,t);var l=qr;if(l&&e){var i=ql(l).hoistableScripts,o=Vr(e),c=i.get(o);c||(c=l.querySelector(Va(o)),c||(e=R({src:e,async:!0,type:"module"},t),(t=Vn.get(o))&&Of(e,t),c=l.createElement("script"),Nt(c),Zt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Gg(e,t,l,i){var o=(o=en.current)?qa(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Fr(l.href),t=ql(o).hoistableStyles,i=t.get(l),i||(i={type:"style",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Fr(l.href);var c=ql(o).hoistableStyles,b=c.get(e);if(b||(o=o.ownerDocument||o,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,b),(c=o.querySelector(Fa(e)))?c._p||(b.instance=c,b.state.loading=5):(c=Vn.get(e),c||(c={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Vn.set(e,c)),zv(o,e,c,b.state))),t&&i===null)throw Error(u(528,""));return b}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(l=Vr(l),t=ql(o).hoistableScripts,i=t.get(l),i||(i={type:"script",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Fr(e){return'href="'+Ce(e)+'"'}function Fa(e){return'link[rel="stylesheet"]['+e+"]"}function Qg(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function zv(e,t,l,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[ir]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[ir]=!0,t.onload=t.onerror=gu.bind(null,t),Zt(t,"link",l),Nt(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Vr(e){return'[src="'+Ce(e)+'"]'}function Va(e){return"script[async]"+e}function Xg(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Ce(l.href)+'"]');if(i)return t.instance=i,Nt(i),i;var o=R({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Nt(i),Zt(i,"style",o),zo(i,l.precedence,e),t.instance=i;case"stylesheet":o=Fr(l.href);var c=e.querySelector(Fa(o));if(c)return t.state.loading|=4,t.instance=c,Nt(c),c;i=Qg(l),(o=Vn.get(o))&&Mf(i,o),c=(e.ownerDocument||e).createElement("link"),Nt(c);var b=c;return b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),Zt(c,"link",i),t.state.loading|=4,zo(c,l.precedence,e),t.instance=c;case"script":return c=Vr(l.src),(o=e.querySelector(Va(c)))?(t.instance=o,Nt(o),o):(i=l,(o=Vn.get(c))&&(i=R({},l),Of(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),Nt(o),Zt(o,"link",i),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,zo(i,l.precedence,e));return t.instance}function zo(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,b=0;b title"):null)}function Dv(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Kg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Zg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $g(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Jg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=$g(t),e.suspenseyImages.push(t)),e=Rv.bind(e),t.decode().then(e,e))}function Mv(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=Fr(i.href),c=t.querySelector(Fa(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ya.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,Nt(c);return}c=t.ownerDocument||t,i=Qg(i),(o=Vn.get(o))&&Mf(i,o),c=c.createElement("link"),Nt(c);var b=c;b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),Zt(c,"link",i),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Ya.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function Ov(e,t){return e.stylesheets&&e.count===0&&Ro(e,e.stylesheets),0Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Pg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ro(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Ya(){this.count--,Pg(this)}function Rv(){this.imgCount--,Pg(this)}var Oo=null;function Ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(Lv,e),Oo=null,Ya.call(e))}function Lv(e,t){if(!(t.state.loading&4)){var l=Oo.get(e);if(l)var i=l.get(null);else{l=new Map,Oo.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Qf.exports=e2(),Qf.exports}var n2=t2();const l2=Ld(n2);class i2 extends Error{constructor(a,u){super(a);Vf(this,"status");this.name="ApiError",this.status=u}}async function Bd(n,r){let a=r;try{const u=await n.json();u!=null&&u.detail&&(a=u.detail)}catch{}return new i2(a,n.status)}async function r2(n){const r=await fetch(`/api/notifications?after=${n}`);if(!r.ok)throw new Error("Failed to fetch notifications");return r.json()}async function a2(){const n=await fetch("/api/actions/open-log",{method:"POST"});if(!n.ok)throw new Error("Failed to open log file");return n.json()}async function u2(n){const r=new URLSearchParams;r.set("limit",String(n.limit)),n!=null&&n.level&&r.set("level",n.level),n!=null&&n.search&&r.set("search",n.search);const a=await fetch(`/api/logs?${r.toString()}`);if(!a.ok)throw new Error("Failed to fetch log entries");return a.json()}async function kx(){const n=await fetch("/api/system");if(!n.ok)throw new Error("Failed to fetch system info");return n.json()}async function Sx(){const n=await fetch("/api/config");if(!n.ok)throw new Error("Failed to fetch app configuration");return n.json()}async function Nx(n){const r=await fetch("/api/config/select-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to select directory");return r.json()}async function o2(n){const r=await fetch("/api/config/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config_path:n})});if(!r.ok)throw new Error("Failed to load config file");return r.json()}async function s2(n,r){const a=await fetch("/api/config/load-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:n,content:r})});if(!a.ok){let u=`Failed to apply dropped config (${n})`;try{const s=await a.json();s!=null&&s.detail&&(u=s.detail)}catch{}throw new Error(u)}return a.json()}async function c2(){const n=await fetch("/api/config/reload",{method:"POST"});if(!n.ok){let r="Failed to reload configuration";try{const a=await n.json();a!=null&&a.detail&&(r=a.detail)}catch{}throw new Error(r)}return n.json()}async function f2(n){const r=await fetch("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to create config file");return r.json()}async function d2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}&include_hidden=true`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse config files");return a.json()}async function h2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse directory");return a.json()}async function Ex(n,r){const a=await fetch("/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});if(!a.ok)throw new Error("Failed to execute scan");return a.json()}async function Zf(n){const r=new URLSearchParams;(n==null?void 0:n.offset)!=null&&r.set("offset",String(n.offset)),(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),n!=null&&n.sort_by&&r.set("sort_by",n.sort_by),n!=null&&n.sort_dir&&r.set("sort_dir",n.sort_dir);const a=r.toString(),u=`/api/scan/results${a?`?${a}`:""}`,s=await fetch(u,{signal:n==null?void 0:n.signal});if(!s.ok)throw new Error("Failed to fetch scan results");return s.json()}async function m2(n){const r=await fetch("/api/actions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error("Failed to launch file");return r.json()}async function Vy(n){const r=await fetch("/api/actions/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to reveal file");return r.json()}async function pd(n){const r=await fetch("/api/actions/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open folder");return r.json()}async function jx(n){const r=await fetch("/api/actions/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open terminal");return r.json()}async function Cx(n,r){const a=await fetch("/api/actions/hash",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n,algorithm:r})});if(!a.ok)throw new Error("Failed to compute hash");return a.json()}async function Tx(){const n=await fetch("/api/actions/open-config",{method:"POST"});if(!n.ok)throw new Error("Failed to open config file");return n.json()}async function _x(n){const r={file_path:n.file_path||n.filePath,content:n.content},a=await fetch("/api/actions/barcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error("Failed to generate barcode");return a.json()}async function p2(n){const r=await fetch("/api/actions/barcode/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n.imageBase64,formats:n.formats})});if(!r.ok)throw r.status===503?new Error("Server-side barcode decoding is unavailable"):new Error(`Failed to decode frame (HTTP ${r.status})`);return r.json()}async function g2(n,r){const a=await fetch("/api/actions/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n}),signal:r});if(!a.ok)throw new Error("Failed to fetch metadata");return a.json()}async function x2(n,r){const a=await fetch("/api/actions/export-csv",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,filename:r})});if(!a.ok)throw new Error("Failed to export CSV");return a.json()}async function y2(n,r){const a=await fetch("/api/actions/save-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n,filename:r})});if(!a.ok)throw new Error("Failed to save image");return a.json()}async function b2(n){const r=await fetch("/api/workflow/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw await Bd(r,"Failed to start workflow session");return r.json()}async function v2(n,r){const a=await fetch(`/api/workflow/${n}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r})});if(!a.ok)throw await Bd(a,"Failed to respond to workflow prompt");return a.json()}async function w2(n){const r=await fetch(`/api/workflow/${n}/abort`,{method:"POST"});if(!r.ok)throw await Bd(r,"Failed to abort workflow session");return r.json()}const k2=[".profiles",".profiles.yaml",".profiles.yml",".yaml",".yml"];function S2(n){const r=n.toLowerCase();return k2.some(a=>r.endsWith(a))}function N2(n){for(const r of n)if(S2(r.name))return r;return null}function Po(){return{depth:0,overlayVisible:!1}}function Ax(n,r,a){switch(r){case"enter":return a?{depth:n.depth+1,overlayVisible:!0}:n;case"leave":{const u=Math.max(0,n.depth-1);return{depth:u,overlayVisible:n.depth>0&&u>0}}case"drop":return Po()}}function zx(n){return n==="light"?"light":"dark"}/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const E2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yy=(...n)=>n.filter((r,a,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===a).join(" ").trim();/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var j2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const C2=z.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:u,className:s="",children:d,iconNode:f,...m},p)=>z.createElement("svg",{ref:p,...j2,width:r,height:r,stroke:n,strokeWidth:u?Number(a)*24/Number(r):a,className:Yy("lucide",s),...m},[...f.map(([x,y])=>z.createElement(x,y)),...Array.isArray(d)?d:[d]]));/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const je=(n,r)=>{const a=z.forwardRef(({className:u,...s},d)=>z.createElement(C2,{ref:d,iconNode:r,className:Yy(`lucide-${E2(n)}`,u),...s}));return a.displayName=`${n}`,a};/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const T2=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],_2=je("Activity",T2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const A2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Gy=je("ArrowDown",A2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z2=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],D2=je("ArrowLeftRight",z2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const M2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],O2=je("ArrowRight",M2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const R2=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Dx=je("ArrowUpDown",R2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const L2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],U2=je("ArrowUp",L2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B2=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],H2=je("Bug",B2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q2=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],F2=je("Calendar",q2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const V2=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Qy=je("Camera",V2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],gi=je("Check",Y2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Q2=je("ChevronDown",G2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const X2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hd=je("ChevronRight",X2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const I2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],eu=je("CircleAlert",I2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mx=je("CircleCheck",K2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Z2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],$2=je("CirclePause",Z2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const J2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],P2=je("CirclePlay",J2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const W2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],gd=je("CircleX",W2);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ew=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],tw=je("Clock",ew);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Mn=je("Copy",nw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lw=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Xy=je("Download",lw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iw=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],rw=je("ExternalLink",iw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aw=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],uw=je("EyeOff",aw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ow=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],xd=je("Eye",ow);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sw=[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]],cw=je("FastForward",sw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fw=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],yd=je("FileCode",fw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dw=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]],Ir=je("FileCog",dw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hw=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Jr=je("FileText",hw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mw=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],$f=je("File",mw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pw=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Ki=je("FolderOpen",pw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gw=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],os=je("Folder",gw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yw=je("Globe",xw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bw=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Kr=je("Hash",bw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vw=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],qd=je("House",vw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ww=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Iy=je("Info",ww);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kw=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Ky=je("Keyboard",kw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sw=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Nw=je("Link2",Sw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ew=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],$i=je("LoaderCircle",Ew);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jw=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Cw=je("Lock",jw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tw=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],_w=je("Moon",Tw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Aw=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Ji=je("Play",Aw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Dw=je("Plus",zw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mw=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Fd=je("QrCode",Mw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ow=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ss=je("RefreshCw",Ow);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rw=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Lw=je("Rocket",Rw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Zy=je("Search",Uw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bw=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Hw=je("Settings",Bw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Fw=je("Sun",qw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vw=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],bd=je("Terminal",Vw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yw=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],$y=je("Timer",Yw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gw=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Jy=je("Trash2",Gw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qw=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Py=je("TriangleAlert",Qw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xw=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Iw=je("User",Xw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kw=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Wy=je("Webhook",Kw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zw=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],$w=je("Workflow",Zw);/** - * @license lucide-react v0.477.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nl=je("X",Jw);function Pw(n){if(n<60)return`${n}s`;const r=Math.floor(n/60),a=n%60;return`${r}m${a.toString().padStart(2,"0")}s`}function Ww(n){if(!n)return{label:"",cut:!1};const r=n.replace(/\\/g,"/").split("/").filter(Boolean);return r.length===0?{label:n,cut:!1}:{label:r[r.length-1],cut:r.length>1}}function ek({directory:n}){const[r,a]=z.useState(0);z.useEffect(()=>{a(0);const d=window.setInterval(()=>{a(f=>f+1)},1e3);return()=>window.clearInterval(d)},[]);const{label:u,cut:s}=Ww(n);return h.jsxs("div",{"data-testid":"scan-status-strip",className:"flex min-w-0 items-center gap-1.5 text-[11px] text-ink-muted",children:[h.jsx($i,{className:"h-3 w-3 shrink-0 animate-spin text-chip-indigo-text motion-reduce:animate-none","aria-hidden":"true"}),h.jsxs("span",{className:"min-w-0 truncate",children:["Scanning",n&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("span",{className:"font-mono text-ink-secondary",title:n,children:[s?"…/":"",u]})]})," — ",h.jsx("span",{className:"font-mono tabular-nums text-ink-secondary",children:Pw(r)})]})]})}function tk({onExecute:n,scanning:r,hasSelection:a,fileCount:u,totalCount:s,scanningDirectory:d="",toastMessage:f,onToastDismiss:m}){const p=(f==null?void 0:f.kind)==="error";return h.jsxs("div",{className:"relative flex items-center justify-between border-t border-line bg-surface-glass px-4 py-2.5 text-xs transition-colors duration-200",children:[f&&h.jsx("div",{role:"status","aria-live":p?"assertive":"polite","aria-atomic":"true",className:`animate-toast-in absolute left-1/2 top-1/2 z-[var(--z-toast)] max-w-[min(80vw,640px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border px-4 py-2 text-xs font-medium glass-panel-strong ${p?"pointer-events-auto flex max-w-[min(70vw,560px)] items-center gap-2.5 border-status-danger-border text-left text-ink":"pointer-events-none max-w-[min(70vw,560px)] text-center text-ink"}`,children:p?h.jsxs(h.Fragment,{children:[h.jsx(gd,{className:"h-3.5 w-3.5 shrink-0 text-status-danger-text/80","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:f.message}),m&&h.jsx("button",{type:"button",onClick:m,"aria-label":"Dismiss error",className:"shrink-0 rounded-md p-0.5 text-status-danger-text/60 hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-status-danger-border transition-colors",children:h.jsx(nl,{className:"h-3.5 w-3.5"})})]}):f.message}),h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[r&&h.jsx(ek,{directory:d}),s!==void 0&&s!==u&&h.jsxs("span",{"data-testid":"action-bar-count",className:"text-ink-muted",children:["Showing ",u," of ",s]})]}),h.jsxs("button",{onClick:n,disabled:!a||r,className:"flex shrink-0 items-center gap-2 rounded-xl border border-emerald-300/50 bg-gradient-to-b from-emerald-400/90 to-emerald-600/90 px-5 py-2 font-semibold text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] transition-[filter,box-shadow,transform] hover:-translate-y-px hover:brightness-110 hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_12px_30px_-6px_rgb(16_185_129/0.7)] disabled:opacity-40 disabled:hover:translate-y-0 disabled:hover:brightness-100 disabled:hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400",children:[h.jsx(Ji,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:"Execute"}),h.jsx("kbd",{className:"rounded bg-emerald-800/60 px-1.5 py-0.5 text-[10px] text-emerald-200 shadow-[inset_0_1px_0_rgb(255_255_255/0.12)]",children:"↵"})]})]})}function nk({position:n,onClose:r,onLaunch:a,onLaunchWithArgs:u,onReveal:s,onOpenFolder:d,onOpenTerminal:f,onScanDirectory:m,onFilterFolder:p,onFilterExtension:x,onCopyPath:y,onCopyFilename:g,onCopyUri:w,onComputeHash:v,onVerifyHash:S,onProperties:T,onClearFile:L,onGenerateBarcode:D,showToast:$}){const[I,J]=z.useState(!1),[ie,U]=z.useState(""),R=z.useRef(null),Q=z.useRef(null),fe=z.useRef(null),[B,ne]=z.useState(null);if(z.useEffect(()=>{var re;I&&((re=Q.current)==null||re.showModal())},[I]),z.useLayoutEffect(()=>{if(!n){ne(null);return}const re=()=>{const N=R.current;if(!N)return;const He=N.getBoundingClientRect(),Ve=8;ne({left:Math.max(Ve,Math.min(n.x,window.innerWidth-He.width-Ve)),top:Math.max(Ve,Math.min(n.y,window.innerHeight-He.height-Ve))})};return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[n]),z.useEffect(()=>{if(!n)return;fe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const re=window.requestAnimationFrame(()=>{var N,He;(He=(N=R.current)==null?void 0:N.querySelector("[role='menuitem']"))==null||He.focus()});return()=>{var N;window.cancelAnimationFrame(re),(N=fe.current)==null||N.focus()}},[n]),!n)return null;const{file:V,x:se,y:we}=n,ae=()=>{u(V,ie),J(!1),r()},_=re=>{const N=re.lastIndexOf(".");return N!==-1?re.slice(N):""},P=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):re},le=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):""};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[calc(var(--z-context-menu)-1)]",onClick:r,onContextMenu:re=>{re.preventDefault(),r()},"aria-hidden":"true"}),h.jsxs("div",{ref:R,role:"menu","aria-label":`Actions for ${V.filename}`,tabIndex:0,onKeyDown:re=>{var Ve,M,E,Y;["Escape","ArrowDown","ArrowUp","Home","End"].includes(re.key)&&re.stopPropagation();const N=Array.from(((Ve=R.current)==null?void 0:Ve.querySelectorAll("[role='menuitem']"))??[]),He=N.indexOf(document.activeElement);if(re.key==="Escape")re.preventDefault(),r();else if(re.key==="ArrowDown"||re.key==="ArrowUp"){re.preventDefault();const oe=re.key==="ArrowDown"?1:-1;(M=N[(He+oe+N.length)%N.length])==null||M.focus()}else re.key==="Home"?(re.preventDefault(),(E=N[0])==null||E.focus()):re.key==="End"&&(re.preventDefault(),(Y=N.at(-1))==null||Y.focus())},className:"animate-modal-in fixed z-[var(--z-context-menu)] max-h-[calc(100dvh-16px)] w-56 max-w-[calc(100vw-16px)] overflow-y-auto rounded-lg border border-line bg-surface-glass py-1 text-xs text-ink shadow-2xl backdrop-blur-md",style:B??{left:se,top:we,visibility:"hidden"},children:[h.jsx("div",{className:"border-b border-line px-3 py-2 font-medium text-ink-muted truncate",children:V.filename}),h.jsxs("button",{role:"menuitem",onClick:()=>{a(V),r()},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename}`,children:[h.jsx(Ji,{className:"h-3.5 w-3.5 fill-current text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Launch"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{J(!0)},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename} with arguments`,children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Launch with arguments..."})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{s(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Reveal ${V.filename} in file manager`,children:[h.jsx(xd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Reveal in File Manager"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{d(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open folder containing ${V.filename}`,children:[h.jsx(Ki,{className:"h-3.5 w-3.5 text-chip-amber-text group-hover:text-white"}),h.jsx("span",{children:"Open Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{f(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open terminal in directory containing ${V.filename}`,children:[h.jsx(bd,{className:"h-3.5 w-3.5 text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Open Terminal in Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{D(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Generate QR Code",children:[h.jsx(Fd,{className:"h-3.5 w-3.5 text-chip-fuchsia-text group-hover:text-white"}),h.jsx("span",{children:"Generate QR Code"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=P(V.path);m(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Scan to Directory",children:[h.jsx(Ki,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Scan to Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=le(V.rel_path);re&&p(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view to folder ${V.filename} is in`,children:[h.jsx(yd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter to Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=_(V.filename);re&&x(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view by extension ${_(V.filename)}`,children:[h.jsx(yd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter by Extension"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy full path of ${V.filename}`,children:[h.jsx(Mn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Full Path"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy path of ${V.filename} with forward slashes`,children:[h.jsx(Mn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Path (Forward Slashes)"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename}`,children:[h.jsx(Mn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename} without extension`,children:[h.jsx(Mn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename (no ext)"})]}),h.jsxs("button",{role:"menuitem",onClick:async()=>{const re=P(V.path);r();try{await navigator.clipboard.writeText(re),$==null||$(`Copied: ${re}`)}catch(N){$==null||$(`Copy failed: ${(N==null?void 0:N.message)??N}`,"error")}},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Copy Directory",children:[h.jsx(Mn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{w(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy URI of ${V.filename}`,children:[h.jsx(Mn,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy URI"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute MD5 hash of ${V.filename}`,children:[h.jsx(Kr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute SHA256 hash of ${V.filename}`,children:[h.jsx(Kr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute SHA256 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify MD5 hash of ${V.filename}`,children:[h.jsx(Kr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify SHA256 hash of ${V.filename}`,children:[h.jsx(Kr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify SHA256 Hash"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{T(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`View properties of ${V.filename}`,children:[h.jsx(xd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Properties"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{L(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Remove ${V.filename} from list`,children:[h.jsx(Jy,{className:"h-3.5 w-3.5 text-status-danger-text group-hover:text-white"}),h.jsx("span",{children:"Delete"})]})]}),I&&h.jsx("dialog",{ref:Q,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 rounded-xl","aria-labelledby":"args-modal-title",onClick:re=>{re.target===Q.current&&J(!1)},onCancel:re=>{re.preventDefault(),J(!1)},children:h.jsxs("div",{className:"animate-modal-in w-96 rounded-xl border border-frame-line glass-panel p-4",children:[h.jsx("h3",{id:"args-modal-title",className:"mb-2 text-sm font-semibold text-ink",children:"Launch with Arguments"}),h.jsx("p",{className:"mb-3 text-xs text-ink-muted truncate",children:V.filename}),h.jsx("input",{type:"text",autoFocus:!0,placeholder:"Arguments (e.g. --verbose --port 80)",value:ie,onChange:re=>U(re.target.value),onKeyDown:re=>{re.key==="Enter"&&ae(),re.key==="Escape"&&J(!1)},className:"mb-4 w-full rounded-md border border-line bg-elevated px-3 py-2 text-xs text-ink outline-none focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500","aria-label":"Command line arguments"}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>J(!1),className:"rounded-md px-3 py-1.5 text-xs text-ink-muted hover:bg-elevated hover:text-ink focus:outline-none focus:ring-2 focus:ring-indigo-500","aria-label":"Cancel launch",children:"Cancel"}),h.jsx("button",{onClick:ae,className:"btn btn-primary px-3 py-1.5","aria-label":`Launch ${V.filename} with arguments`,children:"Launch"})]})]})})]})}var lk=Fy();const xl=8,pi=8,ik=400,Ox={top:"bottom",bottom:"top",left:"right",right:"left"},rk={top:"-bottom-1 left-1/2 -translate-x-1/2",bottom:"-top-1 left-1/2 -translate-x-1/2",left:"-right-1 top-1/2 -translate-y-1/2",right:"-left-1 top-1/2 -translate-y-1/2"},ak={top:"border-b border-r",bottom:"border-t border-l",left:"border-t border-r",right:"border-b border-l"},Rx=(n,r,a)=>{switch(n){case"top":return r.top-pi-a.h>=xl;case"bottom":return r.bottom+pi+a.h<=window.innerHeight-xl;case"left":return r.left-pi-a.w>=xl;default:return r.right+pi+a.w<=window.innerWidth-xl}},uk=(n,r,a)=>{if(n==="top"||n==="bottom"){const f=r.left+r.width/2-a.w/2,m=window.innerWidth-a.w-xl;return{x:Math.min(Math.max(f,xl),Math.max(xl,m))-f,y:0}}const u=r.top+r.height/2-a.h/2,s=window.innerHeight-a.h-xl;return{x:0,y:Math.min(Math.max(u,xl),Math.max(xl,s))-u}},Be=({text:n,children:r,block:a=!0,placement:u="top",suppress:s=!1})=>{const d=z.useRef(null),f=z.useRef(null),m=z.useId(),p=z.useRef(null),[x,y]=z.useState(!1),[g,w]=z.useState(u),[v,S]=z.useState({x:0,y:0}),[T,L]=z.useState({left:-9999,top:-9999}),D=()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)};z.useEffect(()=>{s&&(D(),y(!1))},[s]),z.useEffect(()=>()=>D(),[]);const $=z.useCallback(()=>{const U=d.current,R=f.current;if(!U||!R)return;const Q=U.getBoundingClientRect(),fe={w:R.offsetWidth,h:R.offsetHeight},B=Rx(u,Q,fe)?u:Rx(Ox[u],Q,fe)?Ox[u]:u,ne=uk(B,Q,fe);w(B),S(ne);const V=Q.left+Q.width/2,se=Q.top+Q.height/2;L(B==="top"?{left:V,top:Q.top-pi-fe.h}:B==="bottom"?{left:V,top:Q.bottom+pi}:B==="left"?{left:Q.left-pi-fe.w,top:se}:{left:Q.right+pi,top:se})},[u]);z.useEffect(()=>{if(!x)return;const U=()=>y(!1);return window.addEventListener("resize",U),window.addEventListener("scroll",U,!0),()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)}},[x]);const I=U=>{if(s)return;D();const R=()=>{$(),y(!0)};U?R():p.current=window.setTimeout(R,ik)},J=()=>{D(),y(!1)};z.useEffect(()=>{if(!x)return;const U=R=>{R.key==="Escape"&&y(!1)};return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[x]),z.useEffect(()=>{if(!x)return;const U=()=>!!document.querySelector('[role="dialog"][aria-modal="true"], dialog[open]');if(U()){y(!1);return}const R=new MutationObserver(()=>{U()&&y(!1)});return R.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","open","class"]}),()=>R.disconnect()},[x]);const ie={onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,"aria-describedby":m};return h.jsxs("div",{ref:d,className:`group relative ${a?"flex min-w-0 flex-1 items-center":"inline-flex shrink-0 items-center"}`,onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,children:[z.cloneElement(r,ie),lk.createPortal(h.jsxs("span",{ref:f,id:m,role:"tooltip",className:`pointer-events-none invisible fixed z-[var(--z-tooltip)] w-max max-w-[calc(100vw-16px)] rounded-md border border-line bg-elevated px-2 py-1 text-left text-[11px] leading-relaxed text-ink shadow-lg ${x?"visible opacity-100":"opacity-0"}`,style:{left:T.left,top:T.top,transform:g==="top"||g==="bottom"?`translateX(calc(-50% + ${v.x}px))`:`translateY(calc(-50% + ${v.y}px))`},children:[n,h.jsx("span",{className:`absolute h-2 w-2 rotate-45 border-line bg-elevated ${rk[g]} ${ak[g]}`,style:g==="top"||g==="bottom"?{left:`calc(50% - ${v.x}px)`}:void 0})]}),document.body)]})};function ok({isOpen:n,initialPath:r,onClose:a,onSelect:u}){const[s,d]=z.useState(null),[f,m]=z.useState(null),[p,x]=z.useState(""),[y,g]=z.useState(!1),[w,v]=z.useState(null),S=z.useRef(null),T=z.useRef(null),L=z.useRef(null);z.useEffect(()=>{var ie;if(!n){(ie=L.current)==null||ie.focus();return}L.current=document.activeElement instanceof HTMLElement?document.activeElement:null,v(null),D(r||"");const J=requestAnimationFrame(()=>{var U;return(U=T.current)==null?void 0:U.focus()});return()=>{var U;cancelAnimationFrame(J),(U=L.current)==null||U.focus()}},[n]);const D=async J=>{g(!0),v(null);try{const ie=await fetch(`/api/fs/browse?path=${encodeURIComponent(J)}`);if(!ie.ok)throw new Error("Failed to browse directory");const U=await ie.json();d(U),m(U.current_path),x(U.current_path)}catch(ie){v(ie.message||"Navigation failed")}finally{g(!1)}},$=()=>{const J=p.trim()||f;J&&(u(J),a())},I=J=>{var Q;if(J.key==="Escape"){J.preventDefault(),a();return}if(J.key!=="Tab")return;const ie=(Q=S.current)==null?void 0:Q.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(ie!=null&&ie.length))return;const U=ie[0],R=ie[ie.length-1];J.shiftKey&&document.activeElement===U?(J.preventDefault(),R.focus()):!J.shiftKey&&document.activeElement===R&&(J.preventDefault(),U.focus())};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:a,children:h.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",onKeyDown:I,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:J=>J.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ki,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"directory-picker-title",className:"text-sm font-semibold text-ink",children:"Select a directory"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(s==null?void 0:s.current_path)||""})]})]}),h.jsx(Be,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:a,"aria-label":"Close directory picker",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"directory-picker-path",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Location"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:T,id:"directory-picker-path",type:"text",value:p,onChange:J=>x(J.target.value),onKeyDown:J=>{J.key==="Enter"&&D(p.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>D(p.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(Be,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(qd,{className:"h-4 w-4"})})}),(s==null?void 0:s.parent_path)&&h.jsx(Be,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>D(s.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Hd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":y,children:y?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx($i,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading directories…"})]}):w?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:w}),h.jsx("button",{type:"button",onClick:()=>D(p||(s==null?void 0:s.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-0.5",children:[s==null?void 0:s.items.filter(J=>J.is_dir).map(J=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>D(J.path),onDoubleClick:()=>{x(J.path),u(J.path),a()},className:`flex min-h-10 w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${f===J.path?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(os,{className:"h-5 w-5 shrink-0 text-chip-indigo-text"}),h.jsx("span",{className:"truncate",children:J.name})]}),f===J.path&&h.jsx(gi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},J.path)),(s==null?void 0:s.items.filter(J=>J.is_dir).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Ki,{className:"h-7 w-7 text-ink-faint"}),"No subdirectories found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected folder"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:f||p,children:f||p||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:a,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),h.jsxs("button",{type:"button",onClick:$,disabled:!p.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ki,{className:"h-4 w-4"}),"Select folder"]})]})]})]})}):null}function sk({visible:n,onFileSelected:r}){const a=z.useRef(null);return n?h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-drop-overlay)] flex items-center justify-center bg-black/65 backdrop-blur-sm",onClick:()=>{var u;return(u=a.current)==null?void 0:u.click()},"data-testid":"drop-config-overlay",children:[h.jsx("input",{ref:a,type:"file",accept:".profiles,.profiles.yaml,.profiles.yml,.yaml,.yml",className:"hidden",onChange:u=>{var d;const s=(d=u.target.files)==null?void 0:d[0];s&&r(s),u.target.value=""}}),h.jsxs("div",{className:"rounded-xl border-2 border-dashed border-chip-indigo-border bg-surface px-8 py-6 text-center shadow-2xl",children:[h.jsx("span",{className:"mx-auto mb-3 grid h-9 w-9 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ir,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsx("p",{className:"text-sm font-semibold text-ink",children:"Drop configuration file"}),h.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:".profiles, .profiles.yaml, .yml, .yaml — session-only preview"})]})]}):null}function ck({items:n,columnTemplate:r,resizePointerRef:a,resizeMovedRef:u}){return h.jsx("div",{className:"grid select-none items-center border-b border-l-2 border-l-transparent border-line/40 bg-surface/60 font-medium text-ink-muted shadow-sm backdrop-blur-md",role:"row","aria-rowindex":1,"data-file-list-header":!0,style:{gridTemplateColumns:r},children:n.map((s,d)=>{const f=!!(s.onSort&&s.sortKey),m=s.active?s.direction==="asc"?"ascending":"descending":"none";return h.jsxs("div",{role:"columnheader","data-column-key":s.sortKey,className:`group relative flex items-center gap-1.5 truncate px-3 py-2 ${f?"cursor-pointer hover:text-ink transition-colors":""} ${s.active?"text-ink":""}`,...f?{"aria-sort":m,tabIndex:0,onClick:s.onSort,onKeyDown:p=>{var x;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),(x=s.onSort)==null||x.call(s))}}:{},children:[s.icon,h.jsx("span",{className:"truncate",children:s.label}),f?s.active?s.direction==="asc"?h.jsx(U2,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Gy,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-40 hover:opacity-40"}):d>0&&h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-40"}),s.canResize&&s.onResizeBy&&h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s.label} column`,"aria-valuemin":Zr,"aria-valuemax":ns,"aria-valuenow":s.width??s.defaultWidth??Wo,"aria-valuetext":`${s.width??s.defaultWidth??Wo} pixels wide`,title:"Drag to resize; use arrow keys or click either side to adjust",tabIndex:0,onClick:p=>{var g;p.preventDefault(),p.stopPropagation();const x=u.current;if(u.current=!1,x)return;const y=p.currentTarget.getBoundingClientRect();(g=s.onResizeBy)==null||g.call(s,p.clientX{p.preventDefault(),p.stopPropagation();const x=p.currentTarget.parentElement;u.current=!1,a.current={pointerId:p.pointerId,startX:p.clientX,startWidth:s.width??(x==null?void 0:x.getBoundingClientRect().width)??s.defaultWidth??Wo,resizeTo:s.onResizeTo},p.currentTarget.setPointerCapture(p.pointerId)},onPointerMove:p=>{const x=a.current;if(!x||x.pointerId!==p.pointerId)return;const y=p.clientX-x.startX;Math.abs(y)>2&&(u.current=!0),x.resizeTo(x.startWidth+y)},onPointerUp:p=>{var x;((x=a.current)==null?void 0:x.pointerId)===p.pointerId&&(p.currentTarget.releasePointerCapture(p.pointerId),a.current=null,window.setTimeout(()=>{u.current=!1},0))},onPointerCancel:()=>{a.current=null,u.current=!1},onKeyDown:p=>{var x,y;p.stopPropagation(),p.key==="ArrowLeft"||p.key==="ArrowRight"?(p.preventDefault(),(x=s.onResizeBy)==null||x.call(s,p.key==="ArrowLeft"?-Yo:Yo)):(p.key==="Home"||p.key==="End")&&(p.preventDefault(),(y=s.onResizeTo)==null||y.call(s,p.key==="Home"?Zr:ns))},className:"absolute inset-y-0 right-0 z-10 w-3 cursor-col-resize touch-none border-r border-transparent transition-colors hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500"})]},d)})})}const Wn=28,Vo=12,Jf=500,Zr=80,ns=960,Wo=160,Yo=24,Lx=44,Go={File:2,Path:3,FileName:1,Type:1,Version:1};function fk({files:n,totalCount:r,rawLoadedCount:a,onLoadMore:u,loadingMore:s=!1,scanning:d=!1,hasScanned:f=!1,activeDirectory:m="",recursive:p=!1,onDisableRecursive:x,onOpenDirectory:y,onOpenConfig:g,filterText:w,onClearFilter:v,prefilterNote:S,columnHeaders:T,columnNames:L,selectedIndex:D,onSelectIndex:$,onLaunch:I,onContextMenu:J,rowColors:ie,sort:U,onSortChange:R}){const Q=["File"],fe=L.length>0?L:Q,B=T.length>0?T:fe,ne=Array.from({length:Math.max(fe.length,B.length)},(ge,Re)=>({key:fe[Re]??Q[0],header:B[Re]??fe[Re]??Q[0]})),V=z.useRef(null),[se,we]=z.useState(0),[ae,_]=z.useState(600),[P,le]=z.useState(0),[re,N]=z.useState({}),He=z.useRef(null),Ve=z.useRef(!1),M=fe.reduce((ge,Re)=>ge+(Go[Re]??1),1),E=(ge,Re)=>{const Me=Math.min(ns,Math.max(Zr,Math.round(Re)));N(lt=>({...lt,[ge]:Me}))},Y=(ge,Re)=>{var Z;const Me=Array.from(((Z=V.current)==null?void 0:Z.querySelectorAll("[data-column-key]"))??[]).find(ue=>ue.dataset.columnKey===ge),lt=re[ge]??(Me==null?void 0:Me.getBoundingClientRect().width)??Wo;E(ge,lt+Re)},oe=[`${Lx}px`,...fe.map(ge=>re[ge]?`${re[ge]}px`:`minmax(${Zr}px, ${Go[ge]??1}fr)`)].join(" "),he=z.useRef(!1),Ee=z.useRef(null),ye=n.length,_e=a??ye,pe=r??_e,ke=_e{const ge=V.current;if(!ge)return;const Re=new ResizeObserver(Me=>{for(const lt of Me)_(lt.contentRect.height),le(lt.contentRect.width)});return Re.observe(ge),_(ge.clientHeight||600),le(ge.clientWidth||0),()=>Re.disconnect()},[]),z.useEffect(()=>{var ue;const ge=V.current;if(!ge||D<0||D>=ye)return;const Re=((ue=ge.querySelector("[data-file-list-header]"))==null?void 0:ue.offsetHeight)??0,Me=Re+D*Wn,lt=Me+Wn;let Z=ge.scrollTop;Mege.scrollTop+ge.clientHeight&&(Z=lt-ge.clientHeight),Z!==ge.scrollTop&&(ge.scrollTop=Z,we(Z))},[D,ye]),z.useEffect(()=>{const ge=V.current;if(!ge)return;const Re=()=>{if(he.current||!Ut||!u)return;const Me=ge.scrollTop+ge.clientHeight,lt=ye*Wn;lt-MeMe&&(he.current=!0,window.setTimeout(()=>{he.current=!1},200),u())};return ge.addEventListener("scroll",Re,{passive:!0}),window.addEventListener("scroll",Re,{passive:!0}),()=>{ge.removeEventListener("scroll",Re),window.removeEventListener("scroll",Re)}},[n,Ut,u,ye]),z.useEffect(()=>{if(he.current||!Ut||!u)return;const ge=ye*Wn,Re=se+ae;if(!(ge-ReRe))return;const lt=`${ye}:${_e}:${pe}`;Ee.current=lt,u()});const Vt=z.useCallback(ge=>{we(ge.currentTarget.scrollTop)},[]),kt=Math.max(0,Math.floor(se/Wn)-Vo),tt=Math.ceil(ae/Wn)+Vo*2,Ke=Math.min(ye,kt+tt),Wt=kt*Wn,Sn=(ge,Re)=>{if(Re)return{className:"bg-chip-indigo-bg border-l-4 border-chip-indigo-border text-ink",style:{}};for(const[Me,lt]of ie)if(ge.toLowerCase().includes(Me.toLowerCase()))return{className:"hover:bg-elevated border-l-4 text-ink",style:{borderLeftColor:lt,borderLeftWidth:"4px"}};return{className:"border-l-4 border-transparent text-ink-secondary hover:bg-elevated/60",style:{borderLeftColor:"transparent",borderLeftWidth:"4px"}}},en=(Ut?ye+tt:ye)*Wn,Bt="btn btn-secondary px-3 py-1.5";return h.jsxs("div",{ref:V,onScroll:Vt,className:"flex-1 overflow-auto bg-app text-xs transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 focus-visible:outline-offset-[-2px]","data-testid":"file-list","data-loaded-count":_e,"aria-busy":d,role:"grid","aria-label":"Discovered files","aria-rowcount":Math.max(pe,ye===0?1:0)+1,"aria-colcount":fe.length+1,"aria-activedescendant":ye>0?`file-row-${D}`:void 0,tabIndex:0,children:[h.jsx("div",{className:"sticky top-0 z-10",role:"presentation",children:h.jsx(ck,{columnTemplate:oe,resizePointerRef:He,resizeMovedRef:Ve,items:[{label:"#",icon:h.jsx(yd,{className:"h-3.5 w-3.5"})},...ne.map(({key:ge,header:Re})=>({label:Re,weight:Go[ge]??1,width:re[ge],defaultWidth:Math.min(ns,Math.max(Zr,Math.round((P-Lx)*(Go[ge]??1)/M))),canResize:!0,onResizeBy:Me=>Y(ge,Me),onResizeTo:Me=>E(ge,Me),sortKey:ge,active:(U==null?void 0:U.column)===ge,direction:U==null?void 0:U.direction,onSort:()=>{(U==null?void 0:U.column)!==ge?R({column:ge,direction:"asc"}):U.direction==="asc"?R({column:ge,direction:"desc"}):R(null)}}))]})}),S&&ye>0&&h.jsxs("div",{role:"note","data-testid":"prefilter-note",className:"flex items-center gap-1.5 border-b border-line/40 bg-surface px-3 py-1 text-[11px] text-ink-faint",children:[h.jsx(Iy,{className:"h-3 w-3 shrink-0 text-ink-faint","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 truncate",children:S})]}),ye===0?h.jsx("div",{role:"row","aria-rowindex":2,"data-testid":"file-list-empty",children:h.jsx("div",{role:"gridcell","aria-colspan":fe.length+1,className:"p-8 text-center text-ink-faint",children:d?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx($i,{className:"h-5 w-5 animate-spin text-chip-indigo-text motion-reduce:animate-none"}),h.jsx("span",{children:"Scanning files..."})]}):!m.trim()&&g?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"Select a directory first."}),h.jsx("button",{type:"button",onClick:g,className:Bt,children:"Choose configuration"})]}):f?w.trim()?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsxs("span",{children:["No files match “",w,"”."]}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[h.jsx("button",{type:"button",onClick:v,className:Bt,children:"Clear filter"}),p&&x&&h.jsx("button",{type:"button",onClick:x,className:Bt,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Bt,children:"Open directory"})]})]}):h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"No files found for the current directory and extension."}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[p&&x&&h.jsx("button",{type:"button",onClick:x,className:Bt,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Bt,children:"Open directory"})]})]}):h.jsx("span",{children:"Select a directory and scan to find files."})})}):h.jsxs("div",{className:"relative",style:{height:en},role:"rowgroup",children:[s&&h.jsx("div",{className:"pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2","aria-hidden":"true",children:h.jsx($i,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})}),h.jsx("div",{style:{transform:`translateY(${Wt}px)`},"data-testid":"file-list-window",role:"presentation",children:n.slice(kt,Ke).map((ge,Re)=>{const Me=kt+Re,lt=Me===D,Z=Sn(ge.filename,lt);return h.jsxs("div",{id:`file-row-${Me}`,"data-row-index":Me,role:"row","aria-rowindex":Me+2,"aria-selected":lt,onClick:()=>{var ue;$(Me),(ue=V.current)==null||ue.focus()},onDoubleClick:()=>I(ge),onContextMenu:ue=>J(ue,ge,Me),className:`grid cursor-pointer items-center transition-colors ${Z.className}`,style:{...Z.style,height:Wn,gridTemplateColumns:oe},children:[h.jsxs("div",{className:"flex items-center justify-end gap-1 px-3 font-mono text-ink-faint",children:[ge.has_hook&&h.jsx("span",{title:ge.hook_pattern?`Launch workflow: ${ge.hook_pattern}`:"Launch workflow configured","aria-label":"Workflow hook attached",className:"inline-flex items-center text-status-warning-text hover:brightness-95",children:h.jsx(Wy,{className:"h-3 w-3 shrink-0"})}),h.jsx("span",{className:"hidden sm:inline",children:Me+1})]}),fe.map((ue,be)=>{const Ae=ge.column_values[ue]||(ue==="File"?ge.filename:"-");return h.jsx("div",{role:"gridcell","data-column-key":ue,className:"truncate px-3 font-mono",style:{minWidth:Zr},title:ue==="Path"?ge.path:Ae,children:Ae},be)})]},ge.path||Me)})}),ke&&h.jsxs("div",{className:"pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full border border-line bg-surface-strong px-3 py-1 text-[11px] text-ink-muted shadow","data-testid":"file-list-paging",children:[s?h.jsx(D2,{className:"mr-1.5 h-4 w-4 animate-spin motion-reduce:animate-none text-ink-muted"}):null,"(",_e," of ",pe," loaded)"]})]})]})}function vd({id:n,ariaLabel:r,value:a,options:u,onChange:s,placeholder:d,className:f="",inputClassName:m="",optionLabel:p=y=>y,onOpenChange:x}){const y=z.useId(),g=z.useRef(null),[w,v]=z.useState(!1),[S,T]=z.useState(""),[L,D]=z.useState(-1),$=u.filter(R=>p(R).toLocaleLowerCase().includes(S.toLocaleLowerCase())),I=L>=0&&$[L]?`${y}-option-${L}`:void 0;z.useEffect(()=>{const R=Q=>{var fe;(fe=g.current)!=null&&fe.contains(Q.target)||v(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]),z.useEffect(()=>{x==null||x(w)},[w,x]),z.useEffect(()=>{var R;L<0||(R=document.getElementById(`${y}-option-${L}`))==null||R.scrollIntoView({block:"nearest"})},[L,y]);const J=()=>{T(""),D(-1),v(!0)},ie=R=>{s(R),T(""),D(-1),v(!1)},U=R=>{if(R.key==="ArrowDown"){if(R.preventDefault(),!w){J(),D(0);return}D(Q=>Math.min(Q+1,$.length-1))}else if(R.key==="ArrowUp"){if(R.preventDefault(),!w){J(),D($.length-1);return}D(Q=>Q<=0?$.length-1:Q-1)}else R.key==="Enter"&&w&&$[L]!==void 0?(R.preventDefault(),ie($[L])):R.key==="Escape"&&v(!1)};return h.jsxs("div",{ref:g,onBlur:R=>{var Q;(Q=g.current)!=null&&Q.contains(R.relatedTarget)||v(!1)},className:`relative flex min-w-0 ${f}`,children:[h.jsx("input",{id:n,type:"text",role:"combobox","aria-label":r,"aria-autocomplete":"list","aria-expanded":w,"aria-controls":y,"aria-activedescendant":I,value:a,placeholder:d,onChange:R=>{s(R.target.value),T(R.target.value),D(-1),v(!0)},onKeyDown:U,className:`min-w-0 flex-1 rounded-l-md border border-line bg-elevated px-3 py-1.5 text-ink outline-none transition-colors hover:bg-surface-strong focus:border-indigo-500 ${m}`}),h.jsx("button",{type:"button","aria-label":`Show ${r.toLowerCase()} options`,"aria-expanded":w,title:`Show ${r.toLowerCase()} options`,onMouseDown:R=>R.preventDefault(),onClick:()=>w?v(!1):J(),className:"shrink-0 rounded-r-md border border-l-0 border-line bg-elevated px-2 text-ink-muted hover:bg-surface-strong hover:text-ink focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 transition-colors",children:h.jsx(Q2,{className:`h-3.5 w-3.5 transition-transform ${w?"rotate-180":""}`})}),w&&h.jsx("ul",{id:y,role:"listbox","aria-label":`${r} options`,className:"absolute left-0 top-full z-[var(--z-combobox-list)] mt-1 max-h-60 w-full min-w-48 overflow-y-auto rounded-md border border-line bg-surface py-1 text-ink shadow-xl",children:$.length>0?$.map((R,Q)=>{const fe=p(R),B=Q===L,ne=R===a;return h.jsx("li",{id:`${y}-option-${Q}`,role:"option","aria-selected":ne,title:fe||void 0,onMouseEnter:()=>D(Q),onMouseDown:V=>V.preventDefault(),onClick:()=>ie(R),className:`cursor-pointer truncate px-3 py-1.5 ${B?"bg-elevated text-ink":"text-ink-secondary"} ${ne?"font-semibold":""}`,children:fe||"(No filter)"},`${R}-${Q}`)}):h.jsx("li",{className:"px-3 py-1.5 text-ink-muted",children:"No matching presets"})})]})}function dk({title:n,release:r,directories:a,activeDirectory:u,onDirectoryChange:s,onBrowseDirectory:d,onGoToParentDirectory:f,onGoToHomeDirectory:m,onOpenActiveDirectory:p,onOpenTerminal:x}){const[y,g]=z.useState(!1);return h.jsxs("header",{className:"relative z-30 flex flex-wrap items-center gap-3 border-b border-line bg-app/90 px-5 py-2 text-xs backdrop-blur-xl shadow-xs transition-all duration-200",children:[h.jsx("div",{className:"flex shrink-0 items-center gap-3",children:h.jsxs("div",{className:"flex items-center gap-3.5",children:[h.jsxs("div",{className:"relative flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-chip-indigo-bg to-chip-purple-bg text-chip-indigo-text border border-chip-indigo-border shadow-xs",children:[h.jsx(bd,{className:"h-4 w-4"}),h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-emerald-500 ring-2 ring-app"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-sm font-bold tracking-tight text-ink font-heading",children:"ProFiles"}),n&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"/"}),h.jsx("span",{className:"text-xs font-medium text-chip-indigo-text bg-chip-indigo-bg px-2 py-0.5 rounded-md border border-chip-indigo-border/50",children:n})]})]}),h.jsxs("p",{className:"text-[11px] font-medium text-ink-muted tracking-wide mt-0.5",children:["Crafted by ",h.jsx("span",{className:"text-ink font-semibold",children:"Florent ALBANY"})," • ",h.jsxs("span",{className:"font-mono text-chip-indigo-text",children:["v",r||"0.11.0-rc.2"]})]})]})]})}),h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[h.jsxs("label",{className:"flex shrink-0 items-center gap-1.5 font-medium text-ink-secondary text-xs",children:[h.jsx(os,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),h.jsx("span",{children:"Directory:"})]}),h.jsx(Be,{text:"Select or type a directory path to scan files from.",suppress:y,children:h.jsx(vd,{id:"directory-combobox",ariaLabel:"Directory",value:u,options:a,onChange:s,onOpenChange:g,placeholder:"/path/to/directory",className:"w-full",inputClassName:"font-mono"})}),p&&h.jsx(Be,{text:"Open the active directory in the OS file manager",block:!1,children:h.jsx("button",{type:"button",onClick:p,"aria-label":"Open active directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(O2,{className:"h-3.5 w-3.5"})})}),f&&h.jsx(Be,{text:"Go to parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:f,"aria-label":"Go to parent directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Hd,{className:"h-3.5 w-3.5 rotate-180"})})}),d&&h.jsx(Be,{text:"Browse for a folder on this system",block:!1,children:h.jsx("button",{type:"button",onClick:d,"aria-label":"Browse directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Ki,{className:"h-3.5 w-3.5"})})}),x&&h.jsx(Be,{text:"Open the active directory in a terminal",block:!1,children:h.jsx("button",{type:"button",onClick:()=>x(u),"aria-label":"Open directory in terminal",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(bd,{className:"h-3.5 w-3.5"})})}),m&&h.jsx(Be,{text:"Set directory to your home folder",block:!1,children:h.jsx("button",{type:"button",onClick:m,"aria-label":"Go to home directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(qd,{className:"h-3.5 w-3.5"})})})]})]})}function hk({message:n,onRetry:r,retrying:a=!1}){return h.jsx("div",{className:"flex flex-1 items-center justify-center p-8",role:"alert","data-testid":"init-error-panel",children:h.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-line bg-surface p-6 text-center shadow-xl",children:[h.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full border border-status-danger-border bg-status-danger-bg",children:h.jsx(eu,{className:"h-5 w-5 text-status-danger-text/80"})}),h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Couldn't load the app"}),h.jsx("p",{className:"mt-1 break-words text-xs text-ink-secondary",children:n}),h.jsxs("button",{type:"button",onClick:r,disabled:a,className:"btn btn-primary mx-auto mt-4 px-3.5 py-1.5 font-semibold shadow-sm",children:[h.jsx(ss,{className:`h-3.5 w-3.5 ${a?"animate-spin motion-reduce:animate-none":""}`}),h.jsx("span",{children:a?"Retrying...":"Retry"})]})]})})}const Ux=/"([^"]*)"|(\S+)/g,Bx=/"([^"]*)"/g,mk="Unmatched quote";function pk(n){const r=[];let a;for(Ux.lastIndex=0;(a=Ux.exec(n))!==null;){const f=a[1]!==void 0?a[1]:a[2];f&&f.trim()&&r.push(f)}let u="",s=0;Bx.lastIndex=0;let d;for(;(d=Bx.exec(n))!==null;)u+=n.slice(s,d.index),s=d.index+d[0].length;return u+=n.slice(s),{terms:r,error:u.includes('"')?mk:null}}function e0(n){const r=n.trim();if(!r)return{error:null,groups:[]};const{terms:a,error:u}=pk(r);if(a.length===0)return{error:u,groups:[]};const s=[];let d={includes:[],excludes:[]};for(const f of a){if(f.toUpperCase()==="OR"){s.push(d),d={includes:[],excludes:[]};continue}f==="-"||f==="+"||(f.startsWith("-")&&f.length>1?d.excludes.push(f.slice(1)):f.startsWith("+")&&f.length>1?d.includes.push(f.slice(1)):d.includes.push(f))}return s.push(d),{error:u,groups:s}}const gk=256,Qi=new Map;function Hx(n){return n.toLowerCase()}function xk(n){const r=Qi.get(n);if(r)return Qi.delete(n),Qi.set(n,r),r;const{groups:a}=e0(n),u={groups:a.map(s=>({includes:s.includes.map(Hx),excludes:s.excludes.map(Hx)}))};if(Qi.size>=gk){const s=Qi.keys().next().value;s!==void 0&&Qi.delete(s)}return Qi.set(n,u),u}function yk(n,r){return r.includes.every(a=>n.includes(a))&&!r.excludes.some(a=>n.includes(a))}function bk(n,r){const{groups:a}=xk(r);if(a.length===0)return!0;const u=n.toLowerCase();return a.some(s=>yk(u,s))}function vk({query:n,visible:r}){if(!r)return null;const a=e0(n);return a.error?h.jsx("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-status-danger-border bg-surface-strong px-3 py-2 text-[11px] leading-5 text-status-danger-text/90 shadow-xl",children:a.error}):a.groups.length===0?null:h.jsxs("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-line bg-surface-strong px-3 py-2 text-[11px] leading-5 text-ink-secondary shadow-xl",children:[h.jsx("span",{className:"mr-1.5 align-[1px] text-[10px] uppercase tracking-wide text-ink-muted",children:"reads as"}),a.groups.map((u,s)=>h.jsxs("span",{"data-testid":"filter-syntax-group",children:[s>0&&h.jsx("span",{className:"mx-1 font-mono text-chip-indigo-text",children:"OR"}),u.includes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"font-mono text-chip-indigo-text",children:d})]},`i-${f}`)),u.includes.length>0&&u.excludes.length>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),u.excludes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"text-ink-muted",children:"✕ "}),h.jsx("span",{className:"font-mono text-status-danger-text/70 line-through",children:d})]},`x-${f}`))]},s))]})}const qx=h.jsxs("span",{className:"flex flex-col gap-1 whitespace-nowrap text-left",children:[h.jsx("span",{className:"font-semibold",children:"Supported operators"}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a b"})," — AND (both terms)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a OR b"})," — either term"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"-a"})," — NOT (exclude)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"+a"})," — force include"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:'"a b"'})," — exact phrase"]})]});function wk({extensions:n,activeExtension:r,onExtensionChange:a,filterOptions:u,filterText:s,onFilterTextChange:d,recursive:f,onRecursiveChange:m,onScan:p,scanning:x,barcodeMode:y,onBarcodeToggle:g,onCameraBarcodeClick:w,autoRescanActive:v,onTimerClick:S}){const[T,L]=z.useState(!1),[D,$]=z.useState(!1),[I,J]=z.useState(!1);return h.jsxs("div",{className:"flex w-full flex-wrap items-center gap-3 border-b border-line bg-surface-glass p-3 text-xs",children:[h.jsx(Be,{text:qx,suppress:D,children:h.jsxs("div",{className:"relative min-w-0 flex-1 basis-64",onFocusCapture:ie=>{ie.target.tagName==="INPUT"&&L(!0)},onBlurCapture:ie=>{ie.target.tagName==="INPUT"&&L(!1)},children:[h.jsx(Zy,{className:"pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ink-secondary"}),h.jsx(vd,{id:"filter-combobox",ariaLabel:"File filter",value:s,options:u||[],onChange:d,onOpenChange:$,placeholder:"Filter files: keyword, a OR b, -tag, exact phrase...",className:"w-full",inputClassName:"pl-9 pr-3",optionLabel:ie=>ie||"(No filter)"}),h.jsx(vk,{query:s,visible:T&&!D&&s.trim().length>0})]})}),h.jsx(Be,{text:qx,block:!1,suppress:I,children:h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx("span",{className:"text-ink-muted",children:"Ext:"}),h.jsx(vd,{id:"extension-combobox",ariaLabel:"Extension filter",value:r,options:n,onChange:a,onOpenChange:J,placeholder:".py OR .toml",className:"w-44",inputClassName:"font-mono px-2.5"})]})}),h.jsx(Be,{text:"Include subdirectories when scanning",block:!1,children:h.jsxs("label",{className:"flex shrink-0 cursor-pointer select-none items-center gap-1.5 text-ink-secondary",children:[h.jsx("input",{type:"checkbox",checked:f,onChange:ie=>m(ie.target.checked),className:"rounded border-line text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-1 focus-visible:ring-offset-app"}),h.jsx("span",{children:"Recursive"})]})}),h.jsx(Be,{text:"Run the scan with the current criteria (Enter)",block:!1,children:h.jsxs("button",{onClick:p,disabled:x,className:"btn btn-primary shrink-0 px-3.5 py-1.5 font-semibold shadow-sm",children:[x?h.jsx(ss,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}):h.jsx(Ji,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:x?"Scanning...":"Scan"})]})}),h.jsx(Be,{text:v?"Auto-rescan is active. Click to configure.":"Configure periodic auto-rescan (hot-folder mode)",block:!1,children:h.jsx("button",{type:"button",onClick:S,"aria-label":"Configure timer / auto-rescan",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${v?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx($y,{className:`h-3.5 w-3.5 ${v?"animate-pulse":""}`})})}),h.jsx(Be,{text:"Toggle barcode scanner mode (USB HID). When active, scan a barcode to auto-fill controls and trigger a scan.",block:!1,children:h.jsx("button",{type:"button",onClick:g,"aria-label":y?"Disable barcode mode":"Enable barcode mode",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${y?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Fd,{className:`h-3.5 w-3.5 ${y?"animate-pulse":""}`})})}),w&&h.jsx(Be,{text:"Scan barcode or QR code using webcam / camera (Ctrl + Shift + B)",block:!1,children:h.jsx("button",{type:"button",onClick:w,"aria-label":"Scan barcode with camera",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Qy,{className:"h-3.5 w-3.5"})})})]})}const kk=2e3,Sk=500,Nk=[{value:null,label:"ALL"},{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARNING",label:"WARNING"},{value:"ERROR",label:"ERROR"},{value:"CRITICAL",label:"CRITICAL"}],Fx={DEBUG:{icon:H2,className:"text-chip-sky-text"},INFO:{icon:Iy,className:"text-status-success-text"},WARNING:{icon:Py,className:"text-status-warning-text"},ERROR:{icon:gd,className:"text-status-danger-text"},CRITICAL:{icon:gd,className:"text-status-danger-text"},UNKNOWN:{icon:Jr,className:"text-ink-faint"}};function Ek({isOpen:n,onClose:r,onOpenExternally:a}){const[u,s]=z.useState([]),[d,f]=z.useState("profiles.log"),[m,p]=z.useState(0),[x,y]=z.useState(null),[g,w]=z.useState(""),[v,S]=z.useState(!1),[T,L]=z.useState(!0),[D,$]=z.useState(null),[I,J]=z.useState(!0),ie=z.useRef(null),U=z.useRef(null),R=z.useRef(null),Q=z.useRef(null),fe=z.useRef(T),B=z.useRef({level:x,search:g});fe.current=T,B.current={level:x,search:g};const ne=z.useCallback(async()=>{const{level:_,search:P}=B.current;S(!0);try{const le=await u2({limit:Sk,level:_,search:P});s(le.entries),f(le.path),p(le.size_bytes),$(null)}catch(le){$((le==null?void 0:le.message)||"Failed to read the log file")}finally{S(!1)}},[]);z.useEffect(()=>{n&&ne()},[n,ne]),z.useEffect(()=>{if(!n||!T)return;const _=window.setInterval(()=>{ne()},kk);return()=>window.clearInterval(_)},[n,T,ne]),z.useEffect(()=>{if(!n)return;const _=window.setTimeout(()=>void ne(),250);return()=>window.clearTimeout(_)},[n,x,g,ne]),z.useEffect(()=>{if(!I)return;const _=R.current;_&&(_.scrollTop=_.scrollHeight)},[u,I]),z.useEffect(()=>{if(!n)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,P=requestAnimationFrame(()=>{var le;return(le=U.current)==null?void 0:le.focus()});return()=>{cancelAnimationFrame(P),_==null||_.focus()}},[n]);const V=_=>{var N;if(_.key==="Escape"){_.preventDefault(),r();return}if(_.key!=="Tab")return;const P=(N=ie.current)==null?void 0:N.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(P!=null&&P.length))return;const le=P[0],re=P[P.length-1];_.shiftKey&&document.activeElement===le?(_.preventDefault(),re.focus()):!_.shiftKey&&document.activeElement===re&&(_.preventDefault(),le.focus())},se=()=>{const _=R.current;if(!_)return;const P=_.scrollHeight-_.scrollTop-_.clientHeight<24;J(P)},we=async()=>{try{await navigator.clipboard.writeText(u.map(_=>_.raw).join(` -`))}catch{}},ae=z.useMemo(()=>{const _=new Map;for(const P of u)_.set(P.level,(_.get(P.level)??0)+1);return _},[u]);return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:r,children:h.jsxs("div",{ref:ie,role:"dialog","aria-modal":"true","aria-labelledby":"log-viewer-title",onKeyDown:V,className:"animate-modal-in flex h-[min(84dvh,760px)] w-[clamp(560px,85vw,1500px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:_=>_.stopPropagation(),children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line px-5 py-4 sm:px-6",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Jr,{className:"h-5 w-5 text-chip-indigo-text","aria-hidden":"true"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"log-viewer-title",className:"text-base font-semibold text-ink",children:"Application logs"}),h.jsxs("p",{className:"truncate font-mono text-xs text-ink-muted",children:[d,h.jsxs("span",{className:"text-ink-faint",children:[" · ",Vx(m)]})]})]})]}),h.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[h.jsx(Zy,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-faint","aria-hidden":"true"}),h.jsx("input",{ref:Q,type:"search",value:g,onChange:_=>w(_.target.value),placeholder:"Filter log lines…","aria-label":"Filter log lines",className:"w-full rounded-lg border border-line bg-elevated py-1.5 pl-8 pr-2.5 font-mono text-xs text-ink placeholder:text-ink-faint focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.jsx(Be,{text:T?"Pause live tail":"Resume live tail",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>L(_=>!_),"aria-pressed":T,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${T?"border-status-success-border bg-status-success-bg text-status-success-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${T?"bg-emerald-400":"bg-ink-faint"}`,"aria-hidden":"true"}),T?"Live":"Paused"]})}),h.jsx(Be,{text:"Refresh now",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ne(),disabled:v,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(ss,{className:`h-4 w-4 ${v?"animate-spin":""}`,"aria-hidden":"true"})})}),h.jsx(Be,{text:"Copy visible lines",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void we(),disabled:u.length===0,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Mn,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(Be,{text:"Open log file in the default application",block:!1,children:h.jsx("button",{type:"button",onClick:()=>{a==null||a(),r()},className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(rw,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(Be,{text:"Close",block:!1,children:h.jsx("button",{ref:U,type:"button",onClick:r,className:"rounded-lg p-2 text-ink-muted hover:bg-hover-surface hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4","aria-hidden":"true"})})})]})]}),h.jsxs("div",{ref:R,onScroll:se,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain bg-app px-2 py-2 font-mono text-xs leading-relaxed sm:px-3",children:[h.jsxs("div",{className:"sticky top-0 z-10 mb-1 flex items-center gap-2 rounded-md border border-line/40 bg-surface/60 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-ink-muted shadow-sm backdrop-blur-md",role:"row",children:[h.jsx("span",{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink/70",children:"Time"}),h.jsx("span",{className:"w-[52px] shrink-0 text-ink/70",children:"Level"}),h.jsx("span",{className:"w-[150px] shrink-0 text-ink/70",children:"Source"}),h.jsx("span",{className:"min-w-0 flex-1 text-ink/70",children:"Message"})]}),D&&h.jsx("p",{role:"alert",className:"px-3 py-6 text-center text-xs text-status-danger-text",children:D}),!D&&u.length===0&&!v&&h.jsx("p",{className:"px-3 py-6 text-center text-xs text-ink-faint",children:"No log entries match the current filters."}),h.jsx("ul",{className:"space-y-0.5",children:u.map((_,P)=>{const le=Fx[_.level]??Fx.UNKNOWN,re=le.icon,N=_.level==="ERROR"||_.level==="CRITICAL";return h.jsxs("li",{className:`group flex items-start gap-2 rounded px-2 py-1 ${N?"bg-status-danger-bg/40":"hover:bg-elevated/50"}`,children:[h.jsx("span",{className:le.className,children:h.jsx(re,{className:"mt-0.5 h-3.5 w-3.5","aria-hidden":"true"})}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink-faint",children:_.timestamp}),h.jsx("span",{className:`w-[52px] shrink-0 text-[10px] font-semibold ${le.className}`,children:_.level}),h.jsx("span",{className:"w-[150px] shrink-0 truncate text-ink-faint",title:_.source,children:_.source}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-ink-secondary",children:_.message})]},`${P}-${_.raw}`)})})]}),h.jsx("div",{className:"border-t border-line/60 bg-elevated/50 px-5 py-2.5 text-[11px] text-ink-faint shadow-sm backdrop-blur-md sm:px-6",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[h.jsx("span",{className:"mr-auto min-w-0 max-w-full basis-full truncate sm:basis-auto",role:"status","aria-atomic":"true",children:v&&u.length===0?"Loading log entries…":`${u.length} of ${Vx(m)} shown`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex overflow-hidden rounded-lg border border-line/60 text-[11px] backdrop-blur-sm",role:"group","aria-label":"Filter by log level",children:Nk.map(_=>{const P=x===_.value,le=_.value?ae.get(_.value)??0:u.length;return h.jsxs("button",{type:"button",onClick:()=>y(_.value),"aria-pressed":P,title:_.value?`Show ${_.value} and above`:"Show all levels",className:`flex items-center gap-1 px-2.5 py-1 font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${P?"bg-indigo-600 text-white":"text-ink-muted hover:bg-elevated hover:text-ink"}`,children:[_.label,h.jsx("span",{className:P?"text-chip-indigo-text":"text-ink-faint",children:le})]},_.label)})}),h.jsx(Be,{text:"Scroll to the newest entry",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>J(!0),"aria-pressed":I,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${I?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx(Gy,{className:"h-3.5 w-3.5","aria-hidden":"true"}),h.jsx("span",{className:"hidden sm:inline",children:"Follow tail"})]})})]}),h.jsxs("span",{className:"hidden items-center gap-1.5 lg:flex",children:[h.jsx("span",{className:"hidden sm:inline",children:"Ctrl + Shift + L"}),h.jsx("span",{children:"opens externally"})]})]})})]})}):null}function Vx(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const Yx='button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], video[tabindex], [tabindex]:not([tabindex="-1"])';function Pr({isOpen:n,onClose:r,dialogRef:a,initialFocusRef:u}){return z.useEffect(()=>{if(!n)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,d=requestAnimationFrame(()=>{var p;const m=(u==null?void 0:u.current)??((p=a.current)==null?void 0:p.querySelector(Yx))??a.current;m==null||m.focus()}),f=m=>{if(m.key!=="Tab")return;const p=a.current;if(!p)return;const x=Array.from(p.querySelectorAll(Yx));if(!x.length)return;const y=x[0],g=x[x.length-1],w=document.activeElement;if(!(w instanceof Node&&p.contains(w))){m.preventDefault(),(m.shiftKey?g:y).focus();return}m.shiftKey&&(w===y||w===p)?(m.preventDefault(),g.focus()):!m.shiftKey&&(w===g||w===p)&&(m.preventDefault(),y.focus())};return window.addEventListener("keydown",f,!0),()=>{cancelAnimationFrame(d),s==null||s.focus(),window.removeEventListener("keydown",f,!0)}},[n]),s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r())}}function jk({isOpen:n,onClose:r}){const a=z.useRef(null),u=Pr({isOpen:n,onClose:r,dialogRef:a});if(!n)return null;const s=[{key:"F5",desc:"Refresh / re-scan file list"},{key:"Ctrl + R",desc:"Reload configuration & scan"},{key:"Enter",desc:"Execute / launch selected file"},{key:"P",desc:"Open properties for selected file"},{key:"↑ / ↓",desc:"Navigate file list"},{key:"Home / End",desc:"Jump to first / last file"},{key:"PageUp / PageDown",desc:"Page through the file list"},{key:"Ctrl + D",desc:"Focus Directory field"},{key:"Ctrl + E",desc:"Focus Extension field"},{key:"Ctrl + F",desc:"Focus Filter / Search field"},{key:"Ctrl + L",desc:"Focus File List"},{key:"Ctrl + Shift + L",desc:"Open the log viewer"},{key:"Ctrl + ,",desc:"Open config file"},{key:"Ctrl + Shift + T",desc:"Toggle theme (Dark / Light)"},{key:"Ctrl + B",desc:"Toggle barcode scanner mode"},{key:"Ctrl + Shift + B",desc:"Open webcam / camera barcode scanner"},{key:"Ctrl + T",desc:"Open auto-rescan timer modal"},{key:"Ctrl + H",desc:"Set directory to home folder"},{key:"? or Ctrl + /",desc:"Show keyboard shortcuts"},{key:"Y / S / N",desc:"Answer workflow guard: Yes / Skip / No (prompt open)"},{key:"Enter",desc:"Confirm active workflow prompt (prompt open)"},{key:"Escape",desc:"Close dialogs / context menu"}];return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",onKeyDown:u,className:"animate-modal-in w-[450px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Ky,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Keyboard Shortcuts"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"max-h-[60vh] space-y-2 overflow-y-auto pr-1 text-xs",children:s.map(({key:d,desc:f})=>h.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-elevated/50 px-3 py-2",children:[h.jsx("span",{className:"text-ink-secondary",children:f}),h.jsx("kbd",{className:"rounded bg-app px-2 py-0.5 font-mono text-[11px] font-semibold text-chip-indigo-text border border-line",children:d})]},d))}),h.jsx("div",{className:"mt-5 flex justify-end",children:h.jsx("button",{onClick:r,className:"btn btn-primary rounded-lg px-4 py-2 font-semibold",children:"Close"})})]})})}function Ck({isOpen:n,activeConfigPath:r,configExists:a=!0,onClose:u,onLoaded:s}){const[d,f]=z.useState(null),[m,p]=z.useState(""),[x,y]=z.useState(null),[g,w]=z.useState(!1),[v,S]=z.useState(null),T=z.useRef(null),L=z.useRef(null),D=z.useRef(null),$=a===!1;z.useEffect(()=>{var ne;if(!n){(ne=D.current)==null||ne.focus();return}D.current=document.activeElement instanceof HTMLElement?document.activeElement:null,S(null);const R=r??"",Q=Math.max(R.lastIndexOf("/"),R.lastIndexOf("\\")),fe=Q>0?R.slice(0,Q):"";I(fe);const B=requestAnimationFrame(()=>{var V;return(V=L.current)==null?void 0:V.focus()});return()=>{var V;cancelAnimationFrame(B),(V=D.current)==null||V.focus()}},[n,r]);const I=async R=>{w(!0),S(null);try{const Q=await d2(R);f(Q),p(Q.current_path),r&&Q.items.some(fe=>fe.path===r)?y(r):y(null)}catch(Q){S(Q.message||"Navigation failed")}finally{w(!1)}},J=R=>{var ne;if(R.key==="Escape"){R.preventDefault(),u();return}if(R.key!=="Tab")return;const Q=(ne=T.current)==null?void 0:ne.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(Q!=null&&Q.length))return;const fe=Q[0],B=Q[Q.length-1];R.shiftKey&&document.activeElement===fe?(R.preventDefault(),B.focus()):!R.shiftKey&&document.activeElement===B&&(R.preventDefault(),fe.focus())},ie=async()=>{var Q;const R=x||(((Q=d==null?void 0:d.items.find(fe=>fe.is_config))==null?void 0:Q.path)??null);if(!R){S("Select a configuration file to load.");return}try{w(!0);const fe=await o2(R);s(fe),u()}catch(fe){S(fe.message||"Unable to load configuration")}finally{w(!1)}},U=async()=>{const R=(m||(d==null?void 0:d.current_path)||"").trim();if(!R){S("Choose a directory before creating a configuration.");return}try{w(!0);const Q=await f2(R);s(Q),u()}catch(Q){S(Q.message||"Unable to create configuration")}finally{w(!1)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:u,children:h.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-labelledby":"load-config-title",onKeyDown:J,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:R=>R.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ir,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"load-config-title",className:"text-sm font-semibold text-ink",children:$?"Create configuration":"Load configuration"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(d==null?void 0:d.current_path)||""})]})]}),h.jsx(Be,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:u,"aria-label":"Close configuration modal",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),$&&h.jsx("div",{className:"border-b border-line bg-chip-indigo-bg/20 px-4 py-3 text-xs text-ink-secondary",children:"No configuration file was found. Create one here?"}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"config-path-input",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Configuration directory"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:L,id:"config-path-input",type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&I(m.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>I(m.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(Be,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(qd,{className:"h-4 w-4"})})}),(d==null?void 0:d.parent_path)&&h.jsx(Be,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(d.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Hd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":g,children:g?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx($i,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading configuration files…"})]}):v?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:v}),h.jsx("button",{type:"button",onClick:()=>I(m||(d==null?void 0:d.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-1",children:[d==null?void 0:d.items.map(R=>{if(R.is_dir)return h.jsx("li",{children:h.jsx("button",{onClick:()=>I(R.path),onDoubleClick:()=>I(R.path),className:"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-left text-xs text-ink-secondary hover:bg-elevated",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(os,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),R.name]})})},R.path);const Q=x===R.path;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>y(R.path),"aria-pressed":Q,className:`flex w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${Q?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(Jr,{className:"h-5 w-5 shrink-0 text-chip-amber-text"}),h.jsx("span",{className:"truncate",children:R.name})]}),R.is_config&&h.jsx(Ir,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"}),Q&&h.jsx(gi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},R.path)}),(d==null?void 0:d.items.filter(R=>R.is_config).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Jr,{className:"h-7 w-7 text-ink-faint"}),"No configuration files found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected file"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:x||m,children:x||m||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:u,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),$?h.jsxs("button",{type:"button",onClick:U,disabled:!m.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ir,{className:"h-4 w-4"}),"Create configuration"]}):h.jsxs("button",{type:"button",onClick:ie,disabled:!x,className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ir,{className:"h-4 w-4"}),"Load configuration"]})]})]})]})}):null}function t0({isOpen:n,onClose:r,initialFilePath:a,md5:u}){const[s,d]=z.useState(null),[f,m]=z.useState(""),[p,x]=z.useState([]),[y,g]=z.useState(!1),[w,v]=z.useState(null),[S,T]=z.useState(!1),[L,D]=z.useState(!1),[$,I]=z.useState(null),J=z.useRef(null),ie=Pr({isOpen:n,onClose:r,dialogRef:J});z.useEffect(()=>{if(!n)return;async function ae(){if(a){g(!0);try{const _=await _x({filePath:a});d(_.image),m(_.content),U(_.content)}catch(_){v(_.message)}finally{g(!1)}}}ae()},[n,a]);const U=ae=>{const _=ae.split(";").map(P=>{const le=P.split("=");return{key:le[0]||"",value:le[1]||""}}).filter(P=>P.key||P.value);x(_)},R=async ae=>{const _=ae.filter(P=>P.key.trim()).map(P=>`${P.key.trim()}=${P.value.trim()}`).join(";");if(m(_),!_){d(null);return}try{const P=await _x({content:_});d(P.image)}catch(P){console.error("Failed to re-generate barcode:",P)}},Q=(ae,_,P)=>{const le=[...p];le[ae][_]=P,x(le),R(le)},fe=()=>{const ae=[...p,{key:"",value:""}];x(ae)},B=ae=>{const _=p.filter((P,le)=>le!==ae);x(_),R(_)},ne=()=>{if(!u||p.some(_=>_.key.toLowerCase()==="md5"))return;const ae=[...p,{key:"md5",value:u}];x(ae),R(ae)},V=async()=>{if(s){I("Saving…");try{const ae=await y2(s,`profiles-qr-${Date.now()}.png`);I(ae.path||ae.message)}catch(ae){I(`Save failed: ${(ae==null?void 0:ae.message)??ae}`)}finally{setTimeout(()=>I(null),6e3)}}},se=async()=>{try{await navigator.clipboard.writeText(f),T(!0),setTimeout(()=>T(!1),2e3)}catch(ae){console.error("Copy failed",ae)}},we=async()=>{if(s)try{const _=await(await fetch(s)).blob();await navigator.clipboard.write([new ClipboardItem({[_.type]:_})]),D(!0),setTimeout(()=>D(!1),2e3)}catch(ae){console.error("Image copy failed",ae)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4",onClick:r,children:h.jsxs("div",{ref:J,role:"dialog","aria-modal":"true","aria-label":"QR Code Settings",onKeyDown:ie,className:"animate-modal-in w-full max-w-md rounded-xl border border-frame-line glass-panel p-6",onClick:ae=>ae.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"QR Code Settings"}),h.jsx("button",{onClick:r,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),y?h.jsx("div",{className:"flex h-48 items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"})}):w?h.jsx("div",{className:"rounded-md border border-status-danger-border bg-status-danger-bg p-4 text-center text-xs text-status-danger-text",children:w}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsx("div",{className:"h-48 w-48 overflow-hidden rounded-lg border border-line bg-white p-2",children:s?h.jsx("img",{src:s,alt:"QR Code",className:"h-full w-full object-contain"}):h.jsx("div",{className:"flex h-full items-center justify-center text-xs text-slate-400",children:"No content"})}),s&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/20 rounded-lg",children:h.jsxs("button",{onClick:we,className:"focus-ring flex items-center gap-2 rounded-md bg-white/90 p-2 text-xs font-medium text-slate-900 shadow-sm hover:bg-white",children:[L?h.jsx(gi,{className:"h-3.5 w-3.5"}):h.jsx(Mn,{className:"h-3.5 w-3.5"}),L?"Copied":"Copy Image"]})})]}),h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsxs("button",{onClick:se,className:"btn btn-secondary flex-1 px-3 py-1.5",children:[S?h.jsx(gi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(Mn,{className:"h-3.5 w-3.5"}),"Copy Content"]}),h.jsxs("button",{onClick:V,disabled:!s,className:"btn btn-primary flex-1 px-3 py-1.5",children:[h.jsx(Xy,{className:"h-3.5 w-3.5"}),"Save Image"]})]}),$&&h.jsx("p",{className:"break-all text-center text-[11px] text-ink-muted",role:"status",children:$})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("label",{className:"text-xs font-medium text-ink-muted uppercase tracking-wider",children:"Payload Fields"}),h.jsxs("div",{className:"flex gap-2",children:[u&&!p.some(ae=>ae.key==="md5")&&h.jsxs("button",{onClick:ne,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-purple-text border border-chip-purple-border",children:[h.jsx(Kr,{className:"h-3 w-3"})," Inc. MD5"]}),h.jsxs("button",{onClick:fe,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-indigo-text border border-chip-indigo-border",children:[h.jsx(Dw,{className:"h-3 w-3"})," Add Field"]})]})]}),h.jsxs("div",{className:"max-h-48 space-y-2 overflow-y-auto pr-1 custom-scrollbar",children:[p.map((ae,_)=>h.jsxs("div",{className:"flex gap-2 items-center slide-in",children:[h.jsx("input",{type:"text",placeholder:"key",value:ae.key,onChange:P=>Q(_,"key",P.target.value),className:"w-1/3 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("input",{type:"text",placeholder:"value",value:ae.value,onChange:P=>Q(_,"value",P.target.value),className:"flex-1 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{onClick:()=>B(_),className:"p-1 text-ink-muted hover:text-status-danger-text transition-colors","aria-label":"Remove field",children:h.jsx(Jy,{className:"h-3.5 w-3.5"})})]},_)),p.length===0&&h.jsx("p",{className:"text-center py-4 text-xs text-ink-muted italic",children:"No fields defined"})]})]}),h.jsxs("div",{className:"pt-2 border-t border-line",children:[h.jsx("label",{className:"text-[10px] font-medium text-ink-muted uppercase tracking-wider block mb-1.5",children:"Raw Preview"}),h.jsx("div",{className:"rounded bg-elevated p-2 font-mono text-[10px] text-ink-secondary break-all border border-line",children:f||h.jsx("span",{className:"italic text-ink-muted/50",children:"empty"})})]})]})]})}):null}const Gx=["Bytes","KB","MB","GB","TB"];function n0(n){if(n===0)return"0 Bytes";const r=1024,a=Math.max(0,Math.min(Gx.length-1,Math.floor(Math.log(n)/Math.log(r))));return parseFloat((n/Math.pow(r,a)).toFixed(2))+" "+Gx[a]}function Tk(n){const r=Math.max(n.lastIndexOf("\\"),n.lastIndexOf("/"));return r===-1?"":n.slice(0,r)}function _k(n){const r=[`File Properties: ${n.name}`,`Path: ${n.path}`,`Type: ${n.type}`,`Size: ${n0(n.size_bytes)}`,`Created: ${n.created}`,`Modified: ${n.modified}`];return n.md5&&r.push(`MD5: ${n.md5}`),n.sha256&&r.push(`SHA256: ${n.sha256}`),r.join(` -`)}function Pf(n,r,a){return n.length<=r+a+1?n:`${n.slice(0,r)}…${n.slice(-a)}`}function Ak(n){const r=n.includes("\\")?"\\":"/",a=n.split(/[\\/]/);return a.length<=5?n:[a[0],a[1],"…",a[a.length-2],a[a.length-1]].join(r)}const zk=[{ms:1e3*60,unit:"minute"},{ms:1e3*60*60,unit:"hour"},{ms:1e3*60*60*24,unit:"day"},{ms:1e3*60*60*24*30,unit:"month"},{ms:1e3*60*60*24*365,unit:"year"}];function Qx(n,r=new Date){const a=new Date(n.replace(" ","T"));if(Number.isNaN(a.getTime()))return"just now";const u=r.getTime()-a.getTime();if(u<6e4)return"just now";let s="just now";for(const{ms:d,unit:f}of zk){if(u{var V;n||((V=I.current)==null||V.focus(),v(!1))},[n]),z.useEffect(()=>{if(!n||!r)return;const V=new AbortController;return J.current=V,d(null),D(null),m(!0),x(null),(async()=>{try{const se=await g2(r.path,V.signal);if(J.current!==V)return;d(se)}catch(se){if(J.current!==V||se instanceof DOMException&&se.name==="AbortError")return;x(se instanceof Error?se.message:"Failed to load properties")}finally{J.current===V&&m(!1)}})(),()=>{J.current=null,V.abort()}},[n,r]),z.useEffect(()=>{if(!n)return;const V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=V}},[n]),z.useEffect(()=>{if(!n)return;const V=se=>{if(se.key==="Escape"){if(w)return;a();return}if(se.key!=="Tab")return;const we=$.current;if(!we)return;const ae=Array.from(we.querySelectorAll('button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(re=>re.offsetParent!==null);if(ae.length===0)return;const _=ae[0],P=ae[ae.length-1],le=document.activeElement instanceof HTMLElement?document.activeElement:null;se.shiftKey?(le===_||!we.contains(le))&&(se.preventDefault(),P.focus()):le===P&&(se.preventDefault(),_.focus())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,w,a]),z.useEffect(()=>{if(!n)return;const V=document.activeElement instanceof HTMLElement?document.activeElement:null;I.current=V;const se=requestAnimationFrame(()=>{var we,ae;(ae=(we=$.current)==null?void 0:we.querySelector("button"))==null||ae.focus()});return()=>cancelAnimationFrame(se)},[n]);const ie=async(V,se)=>{try{await navigator.clipboard.writeText(V),g(se),setTimeout(()=>g(null),2e3)}catch(we){console.error("Failed to copy:",we)}},U=async(V,se,we)=>{T(V),D(null);try{await we(),D(se)}catch{D("Action failed")}finally{T(null)}},R=V=>`btn btn-chip rounded-md border px-3 py-2 text-xs ${{reveal:"bg-chip-sky-bg text-chip-sky-text border-chip-sky-border",launch:"border-emerald-500/30 bg-emerald-600 font-semibold text-white hover:bg-emerald-500",folder:"bg-chip-amber-bg text-chip-amber-text border-chip-amber-border"}[V]??"bg-chip-indigo-bg text-chip-indigo-text border-chip-indigo-border"}`,Q=(V,se,we,ae=!1,_)=>h.jsxs("div",{className:"flex items-start gap-2 py-1.5 group",children:[h.jsxs("span",{className:"text-ink-muted min-w-[100px] text-xs",children:[V,":"]}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("span",{className:`text-ink text-xs break-all ${ae?"font-mono":""}`,children:_??se})}),h.jsx(Be,{text:"Copy to clipboard",block:!1,children:h.jsx("button",{onClick:()=>ie(se,we),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-elevated","aria-label":`Copy ${V}`,children:y===we?h.jsx(gi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(Mn,{className:"h-3.5 w-3.5 text-ink-muted"})})})]}),fe=(V,se,we)=>h.jsxs("div",{className:"rounded-lg border border-line bg-elevated p-4",children:[h.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[se,h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:V})]}),we]}),B=()=>h.jsx(Be,{text:"Click to copy full path",children:h.jsxs("button",{onClick:()=>void ie(s.path,"path"),className:"group mb-3 flex w-full items-center gap-2 rounded-lg border border-line bg-elevated px-3 py-2 text-left hover:bg-surface",children:[h.jsx(os,{className:"text-chip-amber-text h-4 w-4 flex-shrink-0"}),h.jsx("span",{className:"text-ink min-w-0 flex-1 truncate font-mono text-xs",children:Ak(s.path)}),y==="path"?h.jsx(gi,{className:"text-status-success-text h-3.5 w-3.5"}):h.jsx(Mn,{className:"text-ink-muted h-3.5 w-3.5"})]})});if(!n||!r)return null;const ne=r;return h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 backdrop-blur-md p-4",role:"dialog","aria-modal":"true","aria-labelledby":"properties-modal-title",children:[h.jsx("div",{className:"absolute inset-0",onClick:a,onContextMenu:V=>{V.preventDefault(),a()}}),h.jsxs("div",{ref:$,className:"animate-modal-in relative w-full max-w-4xl max-h-[90vh] overflow-hidden rounded-xl border border-frame-line glass-panel flex flex-col",children:[h.jsx("div",{className:"flex-shrink-0 border-b border-line px-6 py-4",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[h.jsx("div",{className:"rounded-lg bg-indigo-600 p-2 flex-shrink-0",children:h.jsx($f,{className:"h-5 w-5 text-white"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{id:"properties-modal-title",className:"text-base font-semibold text-ink truncate",children:"File Properties"}),h.jsx("p",{className:"text-xs text-ink-muted truncate",children:r.filename})]}),h.jsx(Be,{text:"Copy all properties to clipboard",block:!1,children:h.jsx("button",{onClick:()=>{s&&ie(_k(s),"all")},disabled:!s||f||p!==null,className:"btn-chip ml-2 flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text","aria-label":"Copy all properties",children:y==="all"?h.jsx(gi,{className:"h-4 w-4 text-status-success-text"}):h.jsx(Mn,{className:"h-4 w-4"})})}),h.jsx(Be,{text:"Generate Barcode/QR Code",block:!1,children:h.jsx("button",{onClick:()=>v(!0),className:"btn-chip rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text",children:h.jsx(Fd,{className:"h-4 w-4"})})})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink flex-shrink-0","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]})}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[f&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"}),h.jsx("p",{className:"text-xs text-ink-muted",children:"Loading properties..."})]})}),p&&h.jsx("div",{className:"rounded-lg border border-status-danger-border bg-status-danger-bg p-4 text-center",children:h.jsx("p",{className:"text-xs text-status-danger-text",children:p})}),s&&!f&&!p&&h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-lg border border-line bg-elevated px-4 py-2.5",children:[h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg px-2 py-0.5 text-xs font-semibold text-chip-indigo-text",children:s.type}),s.attributes.extension&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-line bg-surface px-2 py-0.5 text-xs font-medium text-ink-muted",children:s.attributes.extension}),h.jsxs("span",{className:"text-xs text-ink-muted",title:`${s.size_bytes} bytes`,children:["Size ",h.jsx("strong",{className:"text-ink font-medium",children:n0(s.size_bytes)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.created,children:["Created ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.created)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.modified,children:["Modified ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.modified)})]}),s.md5&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-chip-purple-border bg-chip-purple-bg px-2 py-0.5 font-mono text-xs font-medium text-chip-purple-text",title:`MD5 ${s.md5}`,children:Pf(s.md5,4,4)}),s.attributes.is_symlink&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-fuchsia-border bg-chip-fuchsia-bg px-2 py-0.5 text-xs font-medium text-chip-fuchsia-text",children:[h.jsx(Nw,{className:"h-3 w-3"})," Symlink"]})]}),B(),h.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[fe("Hashes",h.jsx(Kr,{className:"text-chip-purple-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("MD5",s.md5,"md5",!0,Pf(s.md5,10,6)),Q("SHA256",s.sha256,"sha256",!0,Pf(s.sha256,10,6))]})),fe("Timestamps",h.jsx(F2,{className:"text-chip-sky-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Created",s.created,"created",!0),Q("Modified",s.modified,"modified",!0)]})),fe("Identity",h.jsx($f,{className:"text-chip-indigo-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Type",s.type,"type"),s.attributes.stem&&Q("Stem",s.attributes.stem,"attrStem"),Q("Extension",s.name.includes(".")?s.name.slice(s.name.lastIndexOf(".")):"None","extension"),Q("Directory",Tk(s.path)||"None","directory",!0)]})),fe("System",h.jsx($f,{className:"text-status-success-text h-3.5 w-3.5"}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-1 flex min-h-[24px] flex-wrap items-center gap-1.5",children:[s.attributes.is_readonly&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-status-danger-border bg-status-danger-bg px-2 py-0.5 text-xs text-status-danger-text",children:[h.jsx(Cw,{className:"h-3 w-3"})," Read-only"]}),s.attributes.is_hidden&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-slate-500/30 bg-slate-600/20 px-2 py-0.5 text-xs text-slate-300",children:[h.jsx(uw,{className:"h-3 w-3"})," Hidden"]}),!s.attributes.is_readonly&&!s.attributes.is_hidden&&!s.attributes.is_symlink&&h.jsx("span",{className:"text-xs text-ink-muted",children:"No special flags"})]}),h.jsxs("div",{className:"space-y-0.5",children:[Q("File Type",s.attributes.is_file?"Regular File":s.attributes.is_dir?"Directory":"Other","fileType"),s.attributes.permissions&&Q("Permissions",s.attributes.permissions,"permissions",!0),s.attributes.owner_uid!==void 0&&Q("Owner UID",String(s.attributes.owner_uid),"ownerUid"),s.attributes.group_gid!==void 0&&Q("Group GID",String(s.attributes.group_gid),"groupGid")]})]}))]})]})]}),h.jsx("div",{className:"flex-shrink-0 border-t border-line px-6 py-3",children:h.jsxs("div",{className:"flex justify-between items-center gap-2",children:[h.jsx("p",{className:"min-w-0 text-xs text-ink-muted truncate",children:L??"Click the copy icon next to any field to copy its value"}),h.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(Be,{text:"Show file in Explorer",block:!1,children:h.jsxs("button",{onClick:()=>void U("reveal","Revealed in Explorer",()=>Vy(ne.path)),disabled:S!==null,className:R("reveal"),children:[h.jsx(xd,{className:"h-3.5 w-3.5"})," Reveal"]})}),h.jsx(Be,{text:"Launch file with default association",block:!1,children:h.jsxs("button",{onClick:()=>{u&&(T("launch"),Promise.resolve(u(ne)).finally(()=>T(null)))},disabled:S!==null||!u,className:R("launch"),children:[h.jsx(Ji,{className:"h-3.5 w-3.5"})," Launch"]})}),h.jsx(Be,{text:"Open containing folder",block:!1,children:h.jsxs("button",{onClick:()=>void U("folder","Opened folder",()=>pd(ne.path)),disabled:S!==null,className:R("folder"),children:[h.jsx(Ki,{className:"h-3.5 w-3.5"})," Open Folder"]})}),h.jsx("button",{onClick:a,className:"btn btn-primary px-4 py-2",children:"Close"})]})]})})]}),h.jsx(t0,{isOpen:w,onClose:()=>v(!1),initialFilePath:r.path,md5:s==null?void 0:s.md5})]})}const Mk=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"],Ok=250,Rk=400,Lk=.7;function Uk(n,r=Rk,a=Lk){const u=n.videoWidth,s=n.videoHeight;if(!u||!s)return null;const d=Math.min(u,s),f=document.createElement("canvas");f.width=Math.min(r,d),f.height=f.width;const m=f.getContext("2d");if(!m)return null;m.drawImage(n,(u-d)/2,(s-d)/2,d,d,0,0,f.width,f.height);const p=f.toDataURL("image/jpeg",a);return p.slice(p.indexOf(",")+1)}function Bk(n,r){const a=n.intervalMs??Ok;let u=!1,s=!1;const d=()=>{u=!0,clearInterval(f)},f=setInterval(()=>{if(u||s)return;const m=n.capture();m&&(s=!0,n.decode(m).then(p=>{u||p.decoded&&(d(),r.onDetected(p.decoded))}).catch(p=>{u||(d(),r.onError(p instanceof Error?p.message:"Frame decoding failed"))}).finally(()=>{s=!1}))},a);return d}const Hk=8e3;function qk({isOpen:n,onClose:r,onDetected:a}){const u=z.useRef(null),s=z.useRef(null),d=Pr({isOpen:n,onClose:r,dialogRef:s}),f=z.useRef(null),m=z.useRef(null),p=z.useRef(null),[x,y]=z.useState(null),[g,w]=z.useState(!1),v=()=>{p.current&&(p.current(),p.current=null),m.current&&(cancelAnimationFrame(m.current),m.current=null),f.current&&(f.current.getTracks().forEach(L=>L.stop()),f.current=null),u.current&&(u.current.srcObject=null)};z.useEffect(()=>{if(!n){v(),y(null);return}let L=!0;async function D(){var I,J,ie,U,R;if(y(null),w(!1),typeof window<"u"&&!window.isSecureContext&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"){y("Camera access requires HTTPS or localhost. If connecting across a local network IP (e.g. 192.168.x.x), modern browsers disable camera access for insecure HTTP.");return}const $=((J=(I=navigator.mediaDevices)==null?void 0:I.getUserMedia)==null?void 0:J.bind(navigator.mediaDevices))||((ie=navigator.getUserMedia)==null?void 0:ie.bind(navigator))||((U=navigator.webkitGetUserMedia)==null?void 0:U.bind(navigator))||((R=navigator.mozGetUserMedia)==null?void 0:R.bind(navigator));if(!$){y(window.isSecureContext?"Camera access is not supported by your browser or environment.":"Camera access is blocked because the page is not served over a secure origin (HTTPS or localhost/127.0.0.1).");return}try{let Q;const fe=await Promise.race([$({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),new Promise((B,ne)=>{Q=window.setTimeout(()=>ne(new DOMException("Camera did not start in time","TimeoutError")),Hk)})]).finally(()=>{Q!==void 0&&window.clearTimeout(Q)});if(!L){fe.getTracks().forEach(B=>B.stop());return}f.current=fe,u.current&&(u.current.srcObject=fe,await u.current.play()),"BarcodeDetector"in window?T():S()}catch(Q){if(!L)return;console.error("Camera access error:",Q),y(Q.name==="NotAllowedError"||Q.name==="PermissionDeniedError"?"Camera permission denied. Please allow camera access in your browser settings.":Q.name==="TimeoutError"?"The camera did not start in time. On macOS, camera capture needs the packaged desktop app — a bare Python process cannot access the camera. Alternatively, open ProFiles in Chrome, Edge or Safari.":`Could not access camera: ${Q.message||"Unknown error"}`)}}return D(),()=>{L=!1,v()}},[n]);const S=()=>{w(!0),p.current=Bk({capture:()=>u.current?Uk(u.current):null,decode:L=>p2({imageBase64:L,formats:[...Mk]})},{onDetected:L=>{v(),a(L)},onError:L=>{v(),y(L)}})},T=()=>{const L=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"];let D;try{D=new window.BarcodeDetector({formats:L})}catch(I){console.warn("BarcodeDetector formats unsupported:",I),D=new window.BarcodeDetector}const $=async()=>{if(!u.current||u.current.readyState<2){m.current=requestAnimationFrame($);return}try{const I=await D.detect(u.current);if(I&&I.length>0){const J=I[0].rawValue;if(J){v(),a(J);return}}}catch(I){console.debug("Frame detection error:",I)}m.current=requestAnimationFrame($)};m.current=requestAnimationFrame($)};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",onClick:r,children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Camera barcode scanner",onKeyDown:d,className:"relative w-full max-w-lg rounded-2xl border border-frame-line glass-panel p-6 flex flex-col",onClick:L=>L.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Qy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Scan with Camera"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink transition-colors","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]}),x?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"rounded-full bg-status-danger-bg p-3 text-status-danger-text mb-3",children:h.jsx(eu,{className:"h-6 w-6"})}),h.jsx("p",{className:"text-xs text-status-danger-text max-w-xs",children:x}),h.jsx("button",{onClick:r,className:"btn btn-secondary mt-6 px-4 py-2",children:"Close"})]}):h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"relative aspect-video w-full overflow-hidden rounded-xl bg-black border border-line flex items-center justify-center",children:[h.jsx("video",{ref:u,playsInline:!0,muted:!0,className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:h.jsxs("div",{className:"relative h-48 w-48 rounded-lg border-2 border-dashed border-indigo-400/80 bg-indigo-500/5 shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",children:[h.jsx("div",{className:"absolute top-0 left-0 h-4 w-4 border-t-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute top-0 right-0 h-4 w-4 border-t-2 border-r-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 left-0 h-4 w-4 border-b-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 right-0 h-4 w-4 border-b-2 border-r-2 border-indigo-400"})]})})]}),h.jsx("p",{className:"mt-4 text-center text-xs text-ink-muted",children:g?"Hold a QR code or barcode steady in front of your camera — frames are decoded by the local ProFiles server (no native Barcode Detector in this browser).":"Hold a QR code or barcode steady in front of your camera to auto-scan."})]})]})}):null}function Fk({isOpen:n,file:r,onConfirm:a,onDismiss:u}){const s=z.useRef(null);return z.useEffect(()=>{var d;if(n){const f=m=>{m.key==="Enter"?(m.preventDefault(),a()):m.key==="Escape"&&(m.preventDefault(),u())};return window.addEventListener("keydown",f),(d=s.current)==null||d.focus(),()=>window.removeEventListener("keydown",f)}},[n,a,u]),!n||!r?null:h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:u,children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`1 file matched: ${r.filename}`,className:"animate-modal-in w-full max-w-sm rounded-xl border border-frame-line glass-panel p-5 flex flex-col gap-4",onClick:d=>d.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink text-sm",children:[r.has_hook?h.jsx($w,{className:"h-4 w-4 text-chip-purple-text"}):h.jsx(Ji,{className:"h-4 w-4 text-status-success-text"}),h.jsx("span",{children:"1 File Matched"})]}),h.jsx("button",{onClick:u,className:"focus-ring rounded p-1 text-ink-muted hover:bg-elevated hover:text-ink","aria-label":"Dismiss",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-line bg-elevated/50 p-3",children:[h.jsx(Jr,{className:"h-5 w-5 text-chip-indigo-text shrink-0 mt-0.5"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h4",{className:"text-xs font-semibold text-ink truncate",children:r.filename}),h.jsx("p",{className:"text-[11px] text-ink-muted truncate mt-0.5",children:r.rel_path||r.path}),r.has_hook&&h.jsx("span",{className:"inline-block mt-1 text-[10px] text-chip-purple-text bg-chip-purple-bg px-1.5 py-0.5 rounded border border-chip-purple-border/50 font-medium",children:"Workflow Hook Configured"})]})]}),h.jsx("p",{className:"text-xs text-ink-muted text-center",children:"Launch this file now?"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{type:"button",onClick:u,className:"btn btn-secondary flex-1 px-3 py-1.5",children:"Dismiss (Esc)"}),h.jsxs("button",{ref:s,type:"button",onClick:a,className:"btn btn-primary flex-1 px-3 py-1.5 shadow-md",children:[h.jsx(Ji,{className:"h-3 w-3 fill-current"}),"Launch (Enter)"]})]})]})})}function Vk({systemInfo:n,fileCount:r,theme:a,onToggleTheme:u,onOpenLog:s,onOpenConfig:d,onLoadConfig:f,onShowShortcuts:m,onReloadConfig:p,onExport:x,exportDisabled:y=!1,language:g="en",onLanguageChange:w,activeConfigName:v}){return h.jsxs("footer",{className:"flex items-center justify-between border-t border-line bg-app px-4 py-2 text-[11px] text-ink-muted transition-colors duration-200",children:[h.jsx("div",{className:"flex items-center gap-4",children:n&&h.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-line bg-surface px-2.5 py-0.5 text-ink-secondary",children:[h.jsx(_2,{className:"h-3 w-3 text-status-success-text"}),h.jsx("a",{href:`http://${n.hostname}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.hostname}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.hostname}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx("a",{href:`http://${n.ip}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.ip}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.ip}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsxs("span",{className:"flex items-center gap-1",title:"Session user",children:[h.jsx(Iw,{className:"h-3 w-3 text-ink-faint"}),h.jsx("span",{children:n.username||"operator"})]})]})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{children:[h.jsx("strong",{className:"text-ink",children:r})," files found"]}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(Be,{text:"Keyboard shortcuts (?)",block:!1,children:h.jsxs("button",{onClick:m,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Ky,{className:"h-3 w-3"}),h.jsx("span",{children:"Shortcuts"})]})}),h.jsx(Be,{text:"Open the application log viewer",block:!1,children:h.jsxs("button",{onClick:s,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Jr,{className:"h-3 w-3"}),h.jsx("span",{children:"Logs"})]})}),h.jsx("span",{className:"text-ink-faint",children:"|"}),p&&h.jsx(Be,{text:"Reload configuration from disk",block:!1,children:h.jsxs("button",{onClick:p,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(ss,{className:"h-3 w-3"}),h.jsx("span",{children:"Reload"})]})}),x&&h.jsx(Be,{text:"Export the current results as CSV",block:!1,children:h.jsxs("button",{onClick:x,disabled:y,className:"focus-ring flex items-center gap-1 rounded text-ink-muted hover:text-ink disabled:opacity-40 disabled:hover:text-ink-muted",children:[h.jsx(Xy,{className:"h-3 w-3"}),h.jsx("span",{children:"Export CSV"})]})}),w&&h.jsxs("div",{className:"flex items-center overflow-hidden rounded border border-line text-[10px]",children:[h.jsx(Be,{text:"English",block:!1,children:h.jsxs("button",{onClick:()=>w("en"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="en"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:[h.jsx(yw,{className:"h-3 w-3"}),h.jsx("span",{children:"EN"})]})}),h.jsx(Be,{text:"Français",block:!1,children:h.jsx("button",{onClick:()=>w("fr"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="fr"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:h.jsx("span",{children:"FR"})})})]}),f&&h.jsx(Be,{text:v?`Load a different .profiles file (active: ${v})`:"Load a .profiles file",block:!1,children:h.jsxs("button",{onClick:f,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Ir,{className:"h-3 w-3"}),h.jsx("span",{children:"Load config…"})]})}),h.jsx(Be,{text:"Open configuration file",block:!1,children:h.jsxs("button",{onClick:d,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Hw,{className:"h-3 w-3"}),h.jsx("span",{children:"Config"})]})}),h.jsx(Be,{text:`Switch to ${a==="dark"?"light":"dark"} mode`,block:!1,children:h.jsxs("button",{onClick:u,className:"focus-ring flex items-center gap-1 rounded px-1.5 py-0.5 text-ink-muted hover:bg-elevated hover:text-status-warning-text",children:[a==="dark"?h.jsx(Fw,{className:"h-3 w-3 text-status-warning-text"}):h.jsx(_w,{className:"h-3 w-3 text-chip-indigo-text"}),h.jsx("span",{children:a==="dark"?"Light":"Dark"})]})})]})]})}const Yk=[{label:"5 seconds",seconds:5},{label:"10 seconds",seconds:10},{label:"30 seconds",seconds:30},{label:"1 minute",seconds:60},{label:"5 minutes",seconds:300}];function Gk({isOpen:n,currentInterval:r,onClose:a,onSetInterval:u}){const s=z.useRef(null),d=Pr({isOpen:n,onClose:a,dialogRef:s});if(!n)return null;const f=r>0,m=y=>{u(y)},p=y=>{y.preventDefault();const w=y.currentTarget.elements.namedItem("custom-interval"),v=parseInt(w.value,10);!isNaN(v)&&v>0&&u(v)},x=()=>{u(0)};return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Auto-Rescan Timer",onKeyDown:d,className:"animate-modal-in w-[420px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx($y,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Auto-Rescan Timer"})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"mb-4 rounded-lg bg-elevated/50 px-3 py-2 text-xs",children:f?h.jsxs("div",{className:"flex items-center gap-2 text-status-success-text",children:[h.jsx(P2,{className:"h-4 w-4 animate-pulse"}),h.jsxs("span",{children:["Auto-rescan every ",r,"s"]})]}):h.jsxs("div",{className:"flex items-center gap-2 text-ink-secondary",children:[h.jsx($2,{className:"h-4 w-4"}),h.jsx("span",{children:"Auto-rescan is disabled"})]})}),h.jsxs("div",{className:"mb-4 space-y-1 text-xs",children:[h.jsx("p",{className:"text-ink-muted",children:"Presets:"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Yk.map(y=>h.jsx("button",{onClick:()=>m(y.seconds),className:"rounded-lg border border-line bg-elevated/50 px-3 py-1.5 text-left font-medium text-ink-secondary hover:border-chip-indigo-border hover:bg-chip-indigo-bg/40 hover:text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:y.label},y.seconds))})]}),h.jsxs("form",{onSubmit:p,className:"mb-4",children:[h.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-ink-secondary",children:[h.jsx(tw,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Custom interval (seconds):"})]}),h.jsxs("div",{className:"mt-1 flex gap-2",children:[h.jsx("input",{type:"number",name:"custom-interval",min:"1",placeholder:"e.g. 45",className:"flex-1 rounded-lg border border-line bg-app px-2 py-1 text-xs text-ink placeholder-ink-faint focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{type:"submit",className:"btn btn-primary rounded-lg px-3 py-1 font-semibold",children:"Set"})]})]}),f&&h.jsx("button",{onClick:x,className:"btn w-full rounded-lg border-line bg-elevated/50 px-3 py-2 text-status-warning-text hover:border-status-warning-border hover:bg-status-warning-bg/40",children:"Stop Auto-Rescan"}),h.jsx("div",{className:"flex justify-end gap-2 border-t border-line pt-3",children:h.jsx("button",{onClick:a,className:"rounded-lg border border-line bg-elevated px-4 py-2 text-xs font-semibold text-ink-secondary hover:bg-elevated/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:"Close"})})]})})}function Qk(n,r){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Xk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ik=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kk={};function Xx(n,r){return(Kk.jsx?Ik:Xk).test(n)}const Zk=/[ \t\n\f\r]/g;function $k(n){return typeof n=="object"?n.type==="text"?Ix(n.value):!1:Ix(n)}function Ix(n){return n.replace(Zk,"")===""}class ru{constructor(r,a,u){this.normal=a,this.property=r,u&&(this.space=u)}}ru.prototype.normal={};ru.prototype.property={};ru.prototype.space=void 0;function l0(n,r){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new ru(a,u,r)}function wd(n){return n.toLowerCase()}class kn{constructor(r,a){this.attribute=a,this.property=r}}kn.prototype.attribute="";kn.prototype.booleanish=!1;kn.prototype.boolean=!1;kn.prototype.commaOrSpaceSeparated=!1;kn.prototype.commaSeparated=!1;kn.prototype.defined=!1;kn.prototype.mustUseProperty=!1;kn.prototype.number=!1;kn.prototype.overloadedBoolean=!1;kn.prototype.property="";kn.prototype.spaceSeparated=!1;kn.prototype.space=void 0;let Jk=0;const Oe=Wi(),Mt=Wi(),kd=Wi(),ce=Wi(),dt=Wi(),Zi=Wi(),Dn=Wi();function Wi(){return 2**++Jk}const Sd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:Mt,commaOrSpaceSeparated:Dn,commaSeparated:Zi,number:ce,overloadedBoolean:kd,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),Wf=Object.keys(Sd);class Vd extends kn{constructor(r,a,u,s){let d=-1;if(super(r,a),Kx(this,"space",s),typeof u=="number")for(;++d4&&a.slice(0,4)==="data"&&nS.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Zx,rS);u="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Zx.test(d)){let f=d.replace(tS,iS);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}s=Vd}return new s(u,r)}function iS(n){return"-"+n.toLowerCase()}function rS(n){return n.charAt(1).toUpperCase()}const aS=l0([i0,Pk,u0,o0,s0],"html"),Yd=l0([i0,Wk,u0,o0,s0],"svg");function uS(n){return n.join(" ").trim()}var $x=/\/\*(?:[^*]|\*(?!\/))*\*\//g,oS=/\n/g,sS=/^\s*/,cS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fS=/^:\s*/,dS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,hS=/^[;\s]*/,mS=` -`,Jx="/",Px="*",Za="",pS="comment",gS="declaration";function xS(n,r){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];r=r||{};var a=1,u=1;function s(S){var T=S.match(oS);T&&(a+=T.length);var L=S.lastIndexOf(mS);u=~L?S.length-L:u+S.length}function d(){var S={line:a,column:u};return function(T){return T.position=new f(S),x(),T}}function f(S){this.start=S,this.end={line:a,column:u},this.source=r.source}f.prototype.content=n;function m(S){var T=new Error(r.source+":"+a+":"+u+": "+S);if(T.reason=S,T.filename=r.source,T.line=a,T.column=u,T.source=n,!r.silent)throw T}function p(S){var T=S.exec(n);if(T){var L=T[0];return s(L),n=n.slice(L.length),T}}function x(){p(sS)}function y(S){for(var T;T=g();)S.push(T);return S}function g(){var S=d();if(!(Jx!=n.charAt(0)||Px!=n.charAt(1))){for(var T=2;Za!=n.charAt(T)&&(Px!=n.charAt(T)||Jx!=n.charAt(T+1));)++T;if(T+=2,Za===n.charAt(T-1))return m("End of comment missing");var L=n.slice(2,T-2);return u+=2,s(L),n=n.slice(T),u+=2,S({type:pS,comment:L})}}function w(){var S=d(),T=p(cS);if(T){if(g(),!p(fS))return m("property missing ':'");var L=p(dS),D=S({type:gS,property:T[0].replace($x,Za).trim(),value:L?L[0].replace($x,Za).trim():Za});return p(hS),D}}function v(){var S=[];y(S);for(var T;T=w();)S.push(T),y(S);return S}return x(),v()}function yS(n,r){let a=null;if(!n||typeof n!="string")return a;const u=xS(n),s=typeof r=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;s?r(f,m,d):m&&(a=a??{},a[f]=m)}),a}const c0=f0("end"),Gd=f0("start");function f0(n){return r;function r(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function bS(n){const r=Gd(n),a=c0(n);if(r&&a)return{start:r,end:a}}function tu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Wx(n.position):"start"in n||"end"in n?Wx(n):"line"in n||"column"in n?Nd(n):""}function Nd(n){return ey(n&&n.line)+":"+ey(n&&n.column)}function Wx(n){return Nd(n&&n.start)+"-"+Nd(n&&n.end)}function ey(n){return n&&typeof n=="number"?n:1}class rn extends Error{constructor(r,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",d={},f=!1;if(a&&("line"in a&&"column"in a?d={place:a}:"start"in a&&"end"in a?d={place:a}:"type"in a?d={ancestors:[a],place:a.position}:d={...a}),typeof r=="string"?s=r:!d.cause&&r&&(f=!0,s=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof u=="string"){const p=u.indexOf(":");p===-1?d.ruleId=u:(d.source=u.slice(0,p),d.ruleId=u.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const m=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=m?m.line:void 0,this.name=tu(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rn.prototype.file="";rn.prototype.name="";rn.prototype.reason="";rn.prototype.message="";rn.prototype.stack="";rn.prototype.column=void 0;rn.prototype.line=void 0;rn.prototype.ancestors=void 0;rn.prototype.cause=void 0;rn.prototype.fatal=void 0;rn.prototype.place=void 0;rn.prototype.ruleId=void 0;rn.prototype.source=void 0;const Qd={}.hasOwnProperty,vS=new Map,wS=/[A-Z]/g,kS=/-([a-z])/g,SS=new Set(["table","tbody","thead","tfoot","tr"]),NS=new Set(["td","th"]),d0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ES(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let u;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=MS(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=DS(a,r.jsx,r.jsxs)}const s={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:u,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Yd:aS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=h0(s,n,void 0);return d&&typeof d!="string"?d:s.create(n,s.Fragment,{children:d||void 0},void 0)}function h0(n,r,a){if(r.type==="element")return jS(n,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return CS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return _S(n,r,a);if(r.type==="mdxjsEsm")return TS(n,r);if(r.type==="root")return AS(n,r,a);if(r.type==="text")return zS(n,r)}function jS(n,r,a){const u=n.schema;let s=u;r.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Yd,n.schema=s),n.ancestors.push(r);const d=p0(n,r.tagName,!1),f=OS(n,r);let m=Id(n,r);return SS.has(r.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!$k(p):!0})),m0(n,f,d,r),Xd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function CS(n,r){if(r.data&&r.data.estree&&n.evaluater){const u=r.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}iu(n,r.position)}function TS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);iu(n,r.position)}function _S(n,r,a){const u=n.schema;let s=u;r.name==="svg"&&u.space==="html"&&(s=Yd,n.schema=s),n.ancestors.push(r);const d=r.name===null?n.Fragment:p0(n,r.name,!0),f=RS(n,r),m=Id(n,r);return m0(n,f,d,r),Xd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function AS(n,r,a){const u={};return Xd(u,Id(n,r)),n.create(r,n.Fragment,u,a)}function zS(n,r){return r.value}function m0(n,r,a,u){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(r.node=u)}function Xd(n,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(n.children=a)}}function DS(n,r,a){return u;function u(s,d,f,m){const x=Array.isArray(f.children)?a:r;return m?x(d,f,m):x(d,f)}}function MS(n,r){return a;function a(u,s,d,f){const m=Array.isArray(d.children),p=Gd(u);return r(s,d,f,m,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function OS(n,r){const a={};let u,s;for(s in r.properties)if(s!=="children"&&Qd.call(r.properties,s)){const d=LS(n,s,r.properties[s]);if(d){const[f,m]=d;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&NS.has(r.tagName)?u=m:a[f]=m}}if(u){const d=a.style||(a.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function RS(n,r){const a={};for(const u of r.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const d=u.data.estree.body[0];d.type;const f=d.expression;f.type;const m=f.properties[0];m.type,Object.assign(a,n.evaluater.evaluateExpression(m.argument))}else iu(n,r.position);else{const{name:s}=u;let d;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const m=u.value.data.estree.body[0];m.type,d=n.evaluater.evaluateExpression(m.expression)}else iu(n,r.position);else d=u.value===null?!0:u.value;a[s]=d}return a}function Id(n,r){const a=[];let u=-1;const s=n.passKeys?new Map:vS;for(;++us?0:s+r:r=r>s?s:r,a=a>0?a:0,u.length<1e4)f=Array.from(u),f.unshift(r,a),n.splice(...f);else for(a&&n.splice(r,a);d0?(el(n,n.length,0,r),n):r}const ly={}.hasOwnProperty;function x0(n){const r={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function tl(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=yi(/[A-Za-z]/),Pt=yi(/[\dA-Za-z]/),XS=yi(/[#-'*+\--9=?A-Z^-~]/);function ls(n){return n!==null&&(n<32||n===127)}const Ed=yi(/\d/),IS=yi(/[\dA-Fa-f]/),b0=yi(/[!-/:-@[-`{-~]/);function Te(n){return n!==null&&n<-2}function ht(n){return n!==null&&(n<0||n===32)}function Fe(n){return n===-2||n===-1||n===32}const cs=yi(new RegExp("\\p{P}|\\p{S}","u")),Pi=yi(/\s/);function yi(n){return r;function r(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function ea(n){const r=[];let a=-1,u=0,s=0;for(;++a55295&&d<57344){const m=n.charCodeAt(a+1);d<56320&&m>56319&&m<57344?(f=String.fromCharCode(d,m),s=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(u,a),encodeURIComponent(f)),u=a+s+1,f=""),s&&(a+=s,s=0)}return r.join("")+n.slice(u)}function We(n,r,a,u){const s=u?u-1:1/0;let d=0;return f;function f(p){return Fe(p)?(n.enter(a),m(p)):r(p)}function m(p){return Fe(p)&&d++=s?r(y):a(y)}}const KS={tokenize:ZS};function ZS(n){const r=n.attempt(this.parser.constructs.contentInitial,u,s);let a;return r;function u(m){if(m===null){n.consume(m);return}return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),We(n,r,"linePrefix")}function s(m){return n.enter("paragraph"),d(m)}function d(m){const p=n.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(m)}function f(m){if(m===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(m);return}return Te(m)?(n.consume(m),n.exit("chunkText"),d):(n.consume(m),f)}}let is=class{constructor(){this.index=new Map,this.map=[]}add(r,a,u){iy(this,r,a,u,!1)}addBefore(r,a,u){iy(this,r,a,u,!0)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}};function iy(n,r,a,u,s){if(a===0&&u.length===0)return;const d=n.index.get(r);if(d){d[1]+=a,s?(u.push(...d[2]),d[2]=u):d[2].push(...u);return}const f=[r,a,u];n.map.push(f),n.index.set(r,f)}const $S={tokenize:JS},ry={tokenize:PS};function JS(n){const r=this,a=[];let u=0,s,d,f;return m;function m(I){if(uf))return;const R=r.events.length;let Q=R,fe,B;for(;Q--;)if(r.events[Q][0]==="exit"&&r.events[Q][1].type==="chunkFlow"){if(fe){B=r.events[Q][1].end;break}fe=!0}for(D(u),U=R;UI;){const ie=a[J];r.containerState=ie[1],ie[0].exit.call(r,n)}a.length=I}function $(){s.write([null]),d=void 0,s=void 0,r.containerState._closeFlow=void 0}}function PS(n,r,a){return We(n,n.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xi(n){if(n===null||ht(n)||Pi(n))return 1;if(cs(n))return 2}function fs(n,r,a){const u=[];let s=-1;for(;++s1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1,f={...n[s][1].end},m={...n[a][1].start};ay(f,-d),ay(m,d);const p={type:d>1?"strongSequence":"emphasisSequence",start:f,end:{...n[s][1].end}},x={type:d>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:m},y={type:d>1?"strongText":"emphasisText",start:{...n[s][1].end},end:{...n[a][1].start}},g={type:d>1?"strong":"emphasis",start:{...p.start},end:{...x.end}};n[s][1].end={...p.start},n[a][1].start={...x.end},u=[],n[s][1].end.offset-n[s][1].start.offset&&(u=Yn(u,[["enter",n[s][1],r],["exit",n[s][1],r]])),u=Yn(u,[["enter",g,r],["enter",p,r],["exit",p,r],["enter",y,r]]),u=Yn(u,fs(r.parser.constructs.insideSpan.null,n.slice(s+1,a),r)),u=Yn(u,[["exit",y,r],["enter",x,r],["exit",x,r],["exit",g,r]]);let w=0;n[a][1].end.offset-n[a][1].start.offset&&(w=2,u=Yn(u,[["enter",n[a][1],r],["exit",n[a][1],r]])),el(n,s-1,a-s+3,u),a=s+u.length-w-2;break}}for(a=-1;++a0&&Fe(U)?We(n,$,"linePrefix",d+1)(U):$(U)}function $(U){return U===null||Te(U)?n.check(Cd,T,J)(U):(n.enter("codeFlowValue"),I(U))}function I(U){return U===null||Te(U)?(n.exit("codeFlowValue"),$(U)):(n.consume(U),I)}function J(U){return n.exit("codeFenced"),r(U)}function ie(U,R,Q){let fe=0;return B;function B(ae){return U.enter("lineEnding"),U.consume(ae),U.exit("lineEnding"),ne}function ne(ae){return U.enter("codeFencedFence"),Fe(ae)?We(U,V,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):V(ae)}function V(ae){return ae===m?(U.enter("codeFencedFenceSequence"),se(ae)):Q(ae)}function se(ae){return ae===m?(fe++,U.consume(ae),se):fe>=f?(U.exit("codeFencedFenceSequence"),Fe(ae)?We(U,we,"whitespace")(ae):we(ae)):Q(ae)}function we(ae){return ae===null||Te(ae)?(U.exit("codeFencedFence"),R(ae)):Q(ae)}}}const td={name:"codeIndented",tokenize:dN},fN={partial:!0,tokenize:hN};function dN(n,r,a){return u;function u(m){return n.enter("codeIndented"),v0(n,s,a,"linePrefix",4,4)(m)}function s(m){return m===null?f(m):Te(m)?n.attempt(fN,s,f)(m):(n.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(n.exit("codeFlowValue"),s(m)):(n.consume(m),d)}function f(m){return n.exit("codeIndented"),r(m)}}function hN(n,r,a){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?a(f):Te(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):v0(n,r,d,"linePrefix",4,4)(f)}function d(f){return Te(f)?s(f):a(f)}}const mN={name:"codeText",previous:gN,resolve:pN,tokenize:xN};function pN(n){let r=n.length-4,a=3,u,s;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(r,a,u){const s=a||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&$a(this.left,u),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),$a(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),$a(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(f):n.interrupt(u.parser.constructs.flow,a,r)(f)}}function E0(n,r,a,u,s,d,f,m,p){const x=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(D){return D===60?(n.enter(u),n.enter(s),n.enter(d),n.consume(D),n.exit(d),w):D===null||D===32||D===41||ls(D)?a(D):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),T(D))}function w(D){return D===62?(n.enter(d),n.consume(D),n.exit(d),n.exit(s),n.exit(u),r):(n.enter(m),n.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===62?(n.exit("chunkString"),n.exit(m),w(D)):D===null||D===60||Te(D)?a(D):(n.consume(D),D===92?S:v)}function S(D){return D===60||D===62||D===92?(n.consume(D),v):v(D)}function T(D){return!y&&(D===null||D===41||ht(D))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),r(D)):y999||v===null||v===91||v===93&&!p||v===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(n.exit(d),n.enter(s),n.consume(v),n.exit(s),n.exit(u),r):Te(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Te(v)||m++>999?(n.exit("chunkString"),y(v)):(n.consume(v),p||(p=!Fe(v)),v===92?w:g)}function w(v){return v===91||v===92||v===93?(n.consume(v),m++,g):g(v)}}function C0(n,r,a,u,s,d){let f;return m;function m(w){return w===34||w===39||w===40?(n.enter(u),n.enter(s),n.consume(w),n.exit(s),f=w===40?41:w,p):a(w)}function p(w){return w===f?(n.enter(s),n.consume(w),n.exit(s),n.exit(u),r):(n.enter(d),x(w))}function x(w){return w===f?(n.exit(d),p(f)):w===null?a(w):Te(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),We(n,x,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===f||w===null||Te(w)?(n.exit("chunkString"),x(w)):(n.consume(w),w===92?g:y)}function g(w){return w===f||w===92?(n.consume(w),y):y(w)}}function nu(n,r){let a;return u;function u(s){return Te(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),a=!0,u):Fe(s)?We(n,u,a?"linePrefix":"lineSuffix")(s):r(s)}}const EN={name:"definition",tokenize:CN},jN={partial:!0,tokenize:TN};function CN(n,r,a){const u=this;let s;return d;function d(v){return n.enter("definition"),f(v)}function f(v){return j0.call(u,n,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function m(v){return s=tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),v===58?(n.enter("definitionMarker"),n.consume(v),n.exit("definitionMarker"),p):a(v)}function p(v){return ht(v)?nu(n,x)(v):x(v)}function x(v){return E0(n,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return n.attempt(jN,g,g)(v)}function g(v){return Fe(v)?We(n,w,"whitespace")(v):w(v)}function w(v){return v===null||Te(v)?(n.exit("definition"),u.parser.defined.push(s),r(v)):a(v)}}function TN(n,r,a){return u;function u(m){return ht(m)?nu(n,s)(m):a(m)}function s(m){return C0(n,d,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function d(m){return Fe(m)?We(n,f,"whitespace")(m):f(m)}function f(m){return m===null||Te(m)?r(m):a(m)}}const _N={name:"hardBreakEscape",tokenize:AN};function AN(n,r,a){return u;function u(d){return n.enter("hardBreakEscape"),n.consume(d),s}function s(d){return Te(d)?(n.exit("hardBreakEscape"),r(d)):a(d)}}const zN={name:"headingAtx",resolve:DN,tokenize:MN};function DN(n,r){let a=n.length-2,u=3;if(n[u][1].type==="whitespace"&&(u+=2),a-2>u&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&n[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u){const s={type:"atxHeadingText",start:n[u][1].start,end:n[a][1].end},d={type:"chunkText",start:n[u][1].start,end:n[a][1].end,contentType:"text"};el(n,u,a-u+1,[["enter",s,r],["enter",d,r],["exit",d,r],["exit",s,r]])}return n}function MN(n,r,a){let u=0;return s;function s(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&u++<6?(n.consume(y),f):y===null||ht(y)?(n.exit("atxHeadingSequence"),m(y)):a(y)}function m(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||Te(y)?(n.exit("atxHeading"),r(y)):Fe(y)?We(n,m,"whitespace")(y):(n.enter("atxHeadingText"),x(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),m(y))}function x(y){return y===null||y===35||ht(y)?(n.exit("atxHeadingText"),m(y)):(n.consume(y),x)}}const T0=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Td=["pre","script","style","textarea"],ON={concrete:!0,name:"htmlFlow",resolveTo:LN,tokenize:UN},RN={partial:!0,tokenize:BN};function LN(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function UN(n,r,a){const u=this;let s,d,f,m,p;return x;function x(M){return y(M)}function y(M){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(M),g}function g(M){return M===33?(n.consume(M),w):M===47?(n.consume(M),d=!0,T):M===63?(n.consume(M),s=3,u.interrupt?r:N):Jt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function w(M){return M===45?(n.consume(M),s=2,v):M===91?(n.consume(M),s=5,m=0,S):Jt(M)?(n.consume(M),s=4,u.interrupt?r:N):a(M)}function v(M){return M===45?(n.consume(M),u.interrupt?r:N):a(M)}function S(M){const E="CDATA[";return M===E.charCodeAt(m++)?(n.consume(M),m===E.length?u.interrupt?r:V:S):a(M)}function T(M){return Jt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function L(M){if(M===null||M===47||M===62||ht(M)){const E=M===47,Y=f.toLowerCase();return!E&&!d&&Td.includes(Y)?(s=1,u.interrupt?r(M):V(M)):T0.includes(f.toLowerCase())?(s=6,E?(n.consume(M),D):u.interrupt?r(M):V(M)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(M):d?$(M):I(M))}return M===45||Pt(M)?(n.consume(M),f+=String.fromCharCode(M),L):a(M)}function D(M){return M===62?(n.consume(M),u.interrupt?r:V):a(M)}function $(M){return Fe(M)?(n.consume(M),$):B(M)}function I(M){return M===47?(n.consume(M),B):M===58||M===95||Jt(M)?(n.consume(M),J):Fe(M)?(n.consume(M),I):B(M)}function J(M){return M===45||M===46||M===58||M===95||Pt(M)?(n.consume(M),J):ie(M)}function ie(M){return M===61?(n.consume(M),U):Fe(M)?(n.consume(M),ie):I(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(n.consume(M),p=M,R):Fe(M)?(n.consume(M),U):Q(M)}function R(M){return M===p?(n.consume(M),p=null,fe):M===null||Te(M)?a(M):(n.consume(M),R)}function Q(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||ht(M)?ie(M):(n.consume(M),Q)}function fe(M){return M===47||M===62||Fe(M)?I(M):a(M)}function B(M){return M===62?(n.consume(M),ne):a(M)}function ne(M){return M===null||Te(M)?V(M):Fe(M)?(n.consume(M),ne):a(M)}function V(M){return M===45&&s===2?(n.consume(M),_):M===60&&s===1?(n.consume(M),P):M===62&&s===4?(n.consume(M),He):M===63&&s===3?(n.consume(M),N):M===93&&s===5?(n.consume(M),re):Te(M)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(RN,Ve,se)(M)):M===null||Te(M)?(n.exit("htmlFlowData"),se(M)):(n.consume(M),V)}function se(M){return n.check(Cd,we,Ve)(M)}function we(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),ae}function ae(M){return M===null||Te(M)?se(M):(n.enter("htmlFlowData"),V(M))}function _(M){return M===45?(n.consume(M),N):V(M)}function P(M){return M===47?(n.consume(M),f="",le):V(M)}function le(M){if(M===62){const E=f.toLowerCase();return Td.includes(E)?(n.consume(M),He):V(M)}return Jt(M)&&f.length<8?(n.consume(M),f+=String.fromCharCode(M),le):V(M)}function re(M){return M===93?(n.consume(M),N):V(M)}function N(M){return M===62?(n.consume(M),He):M===45&&s===2?(n.consume(M),N):V(M)}function He(M){return M===null||Te(M)?(n.exit("htmlFlowData"),Ve(M)):(n.consume(M),He)}function Ve(M){return n.exit("htmlFlow"),r(M)}}function BN(n,r,a){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(au,r,a)}}const HN={name:"htmlText",tokenize:qN};function qN(n,r,a){const u=this;let s,d,f;return m;function m(N){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(N),p}function p(N){return N===33?(n.consume(N),x):N===47?(n.consume(N),ie):N===63?(n.consume(N),I):Jt(N)?(n.consume(N),Q):a(N)}function x(N){return N===45?(n.consume(N),y):N===91?(n.consume(N),d=0,S):Jt(N)?(n.consume(N),$):a(N)}function y(N){return N===45?(n.consume(N),v):a(N)}function g(N){return N===null?a(N):N===45?(n.consume(N),w):Te(N)?(f=g,P(N)):(n.consume(N),g)}function w(N){return N===45?(n.consume(N),v):g(N)}function v(N){return N===62?_(N):N===45?w(N):g(N)}function S(N){const He="CDATA[";return N===He.charCodeAt(d++)?(n.consume(N),d===He.length?T:S):a(N)}function T(N){return N===null?a(N):N===93?(n.consume(N),L):Te(N)?(f=T,P(N)):(n.consume(N),T)}function L(N){return N===93?(n.consume(N),D):T(N)}function D(N){return N===62?_(N):N===93?(n.consume(N),D):T(N)}function $(N){return N===null||N===62?_(N):Te(N)?(f=$,P(N)):(n.consume(N),$)}function I(N){return N===null?a(N):N===63?(n.consume(N),J):Te(N)?(f=I,P(N)):(n.consume(N),I)}function J(N){return N===62?_(N):I(N)}function ie(N){return Jt(N)?(n.consume(N),U):a(N)}function U(N){return N===45||Pt(N)?(n.consume(N),U):R(N)}function R(N){return Te(N)?(f=R,P(N)):Fe(N)?(n.consume(N),R):_(N)}function Q(N){return N===45||Pt(N)?(n.consume(N),Q):N===47||N===62||ht(N)?fe(N):a(N)}function fe(N){return N===47?(n.consume(N),_):N===58||N===95||Jt(N)?(n.consume(N),B):Te(N)?(f=fe,P(N)):Fe(N)?(n.consume(N),fe):_(N)}function B(N){return N===45||N===46||N===58||N===95||Pt(N)?(n.consume(N),B):ne(N)}function ne(N){return N===61?(n.consume(N),V):Te(N)?(f=ne,P(N)):Fe(N)?(n.consume(N),ne):fe(N)}function V(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(n.consume(N),s=N,se):Te(N)?(f=V,P(N)):Fe(N)?(n.consume(N),V):(n.consume(N),we)}function se(N){return N===s?(n.consume(N),s=void 0,ae):N===null?a(N):Te(N)?(f=se,P(N)):(n.consume(N),se)}function we(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||ht(N)?fe(N):(n.consume(N),we)}function ae(N){return N===47||N===62||ht(N)?fe(N):a(N)}function _(N){return N===62?(n.consume(N),n.exit("htmlTextData"),n.exit("htmlText"),r):a(N)}function P(N){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),le}function le(N){return Fe(N)?We(n,re,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):re(N)}function re(N){return n.enter("htmlTextData"),f(N)}}const $d={name:"labelEnd",resolveAll:GN,resolveTo:QN,tokenize:XN},FN={tokenize:IN},VN={tokenize:KN},YN={tokenize:ZN};function GN(n){let r=-1;const a=[];for(;++r0&&s[s.length-1]._balanced;)s.pop();d=s[s.length-1]}return m;function m(w){return d?d._inactive?g(w):(f=u.parser.defined.includes(tl(u.sliceSerialize({start:d.end,end:u.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(w),n.exit("labelMarker"),n.exit("labelEnd"),p):a(w)}function p(w){return w===40?n.attempt(FN,y,f?y:g)(w):w===91?n.attempt(VN,y,f?x:g)(w):f?y(w):g(w)}function x(w){return n.attempt(YN,y,g)(w)}function y(w){return s.pop(),r(w)}function g(w){return d._balanced=!0,a(w)}}function IN(n,r,a){return u;function u(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),s}function s(g){return ht(g)?nu(n,d)(g):d(g)}function d(g){return g===41?y(g):E0(n,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return ht(g)?nu(n,p)(g):y(g)}function m(g){return a(g)}function p(g){return g===34||g===39||g===40?C0(n,x,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function x(g){return ht(g)?nu(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):a(g)}}function KN(n,r,a){const u=this;return s;function s(m){return j0.call(u,n,d,f,"reference","referenceMarker","referenceString")(m)}function d(m){return u.parser.defined.includes(tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)))?r(m):a(m)}function f(m){return a(m)}}function ZN(n,r,a){return u;function u(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),s}function s(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):a(d)}}const $N={name:"labelStartImage",resolveAll:$d.resolveAll,tokenize:JN};function JN(n,r,a){const u=this;let s;return d;function d(p){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(p),n.exit("labelImageMarker"),f}function f(p){return p===91?(n.enter("labelMarker"),n.consume(p),n.exit("labelMarker"),s=n.exit("labelImage"),m):a(p)}function m(p){return p===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(p):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(p))}}const PN={name:"labelStartLink",resolveAll:$d.resolveAll,tokenize:WN};function WN(n,r,a){const u=this;let s;return d;function d(m){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),s=n.exit("labelLink"),f}function f(m){return m===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(m):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(m))}}const nd={name:"lineEnding",tokenize:e3};function e3(n,r){return a;function a(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),We(n,r,"linePrefix")}}const es={name:"thematicBreak",tokenize:t3};function t3(n,r,a){let u=0,s;return d;function d(x){return n.enter("thematicBreak"),f(x)}function f(x){return s=x,m(x)}function m(x){return x===s?(n.enter("thematicBreakSequence"),p(x)):u>=3&&(x===null||Te(x))?(n.exit("thematicBreak"),r(x)):a(x)}function p(x){return x===s?(n.consume(x),u++,p):(n.exit("thematicBreakSequence"),Fe(x)?We(n,m,"whitespace")(x):m(x))}}const wn={continuation:{tokenize:r3},exit:u3,name:"list",tokenize:i3},n3={partial:!0,tokenize:o3},l3={partial:!0,tokenize:a3};function i3(n,r,a){const u=this,s=u.events[u.events.length-1];let d=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return m;function m(v){const S=u.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!u.containerState.marker||v===u.containerState.marker:Ed(v)){if(u.containerState.type||(u.containerState.type=S,n.enter(S,{_container:!0})),S==="listUnordered")return n.enter("listItemPrefix"),v===42||v===45?n.check(es,a,x)(v):x(v);if(!u.interrupt||v===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(v)}return a(v)}function p(v){return Ed(v)&&++f<10?(n.consume(v),p):(!u.interrupt||f<2)&&(u.containerState.marker?v===u.containerState.marker:v===41||v===46)?(n.exit("listItemValue"),x(v)):a(v)}function x(v){return n.enter("listItemMarker"),n.consume(v),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||v,n.check(au,u.interrupt?a:y,n.attempt(n3,w,g))}function y(v){return u.containerState.initialBlankLine=!0,d++,w(v)}function g(v){return Fe(v)?(n.enter("listItemPrefixWhitespace"),n.consume(v),n.exit("listItemPrefixWhitespace"),w):a(v)}function w(v){return u.containerState.size=d+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(v)}}function r3(n,r,a){const u=this;return u.containerState._closeFlow=void 0,n.check(au,s,d);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,We(n,r,"listItemIndent",u.containerState.size+1)(m)}function d(m){return u.containerState.furtherBlankLines||!Fe(m)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(m)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(l3,r,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,We(n,n.attempt(wn,r,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function a3(n,r,a){const u=this;return We(n,s,"listItemIndent",u.containerState.size+1);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?r(d):a(d)}}function u3(n){n.exit(this.containerState.type)}function o3(n,r,a){const u=this;return We(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(d){const f=u.events[u.events.length-1];return!Fe(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):a(d)}}const oy={name:"setextUnderline",resolveTo:s3,tokenize:c3};function s3(n,r){const a=new is;let u=n.length,s,d,f;for(;u--;)if(n[u][0]==="enter"){if(n[u][1].type==="content"){s=u;break}n[u][1].type==="paragraph"&&(d=u)}else n[u][1].type==="content"&&a.add(u,1,[]),!f&&n[u][1].type==="definition"&&(f=u);const m={type:"setextHeading",start:{...n[s][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",f?(a.add(d,0,[["enter",m,r]]),a.add(f+1,0,[["exit",n[s][1],r]]),n[s][1].end={...n[f][1].end}):n[s][1]=m,a.add(n.length,0,[["exit",m,r]]),a.consume(n),n}function c3(n,r,a){const u=this;let s;return d;function d(x){let y=u.events.length,g;for(;y--;)if(u.events[y][1].type!=="lineEnding"&&u.events[y][1].type!=="linePrefix"&&u.events[y][1].type!=="content"){g=u.events[y][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||g)?(n.enter("setextHeadingLine"),s=x,f(x)):a(x)}function f(x){return n.enter("setextHeadingLineSequence"),m(x)}function m(x){return x===s?(n.consume(x),m):(n.exit("setextHeadingLineSequence"),Fe(x)?We(n,p,"lineSuffix")(x):p(x))}function p(x){return x===null||Te(x)?(n.exit("setextHeadingLine"),r(x)):a(x)}}const f3={tokenize:d3};function d3(n){const r=this,a=n.attempt(au,u,n.attempt(this.parser.constructs.flowInitial,s,We(n,n.attempt(this.parser.constructs.flow,s,n.attempt(vN,s)),"linePrefix")));return a;function u(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function s(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,a}}const h3={resolveAll:A0()},m3=_0("string"),p3=_0("text");function _0(n){return{resolveAll:A0(n==="text"?g3:void 0),tokenize:r};function r(a){const u=this,s=this.parser.constructs[n],d=a.attempt(s,f,m);return f;function f(y){return x(y)?d(y):m(y)}function m(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return x(y)?(a.exit("data"),d(y)):(a.consume(y),p)}function x(y){if(y===null)return!0;const g=s[y];let w=-1;if(g)for(;++w-1){const m=f[0];typeof m=="string"?f[0]=m.slice(u):f.shift()}d>0&&f.push(n[s].slice(0,d))}return f}function _3(n,r){let a=-1;const u=[];let s;for(;++a0&&s(r.beforeEnter,{...be,sliceSerialize:Z[it][2].sliceSerialize},Z[it][1]),z0.call(jt,Z[it][1].type)&&jt[Z[it][1].type].call({...be,sliceSerialize:Z[it][2].sliceSerialize},Z[it][1]),Z[it][0]==="exit"&&r.afterExit.length>0&&s(r.afterExit,{...be,sliceSerialize:Z[it][2].sliceSerialize},Z[it][1])}if(be.tokenStack.length>0){const jt=be.tokenStack[be.tokenStack.length-1];(jt[1]||cy).call(be,void 0,jt[0])}for(ue.position={start:mi(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:mi(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it0&&(u.className=["language-"+s[0]]);let d={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function Y3(n,r){const a={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function G3(n,r){const a={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function Q3(n,r){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(r.identifier).toUpperCase(),s=ea(u.toLowerCase()),d=n.footnoteOrder.indexOf(u);let f,m=n.footnoteCounts.get(u);m===void 0?(m=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=d+1,m+=1,n.footnoteCounts.set(u,m);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const x={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,x),n.applyData(r,x)}function X3(n,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function I3(n,r){if(n.options.allowDangerousHtml){const a={type:"raw",value:r.value};return n.patch(r,a),n.applyData(r,a)}}function M0(n,r){const a=r.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+u}];const s=n.all(r),d=s[0];d&&d.type==="text"?d.value="["+d.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function K3(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return M0(n,r);const s={src:ea(u.url||""),alt:r.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,d),n.applyData(r,d)}function Z3(n,r){const a={src:ea(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(r,u),n.applyData(r,u)}function $3(n,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(r,u),n.applyData(r,u)}function J3(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return M0(n,r);const s={href:ea(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function P3(n,r){const a={href:ea(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"a",properties:a,children:n.all(r)};return n.patch(r,u),n.applyData(r,u)}function W3(n,r,a){const u=n.all(r),s=a?eE(a):O0(r),d={},f=[];if(typeof r.checked=="boolean"){const y=u[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},u.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m1}function tE(n,r){const a={},u=n.all(r);let s=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},m=Gd(r.children[1]),p=c0(r.children[r.children.length-1]);m&&p&&(f.position={start:m,end:p}),s.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(r,d),n.applyData(r,d)}function aE(n,r,a){const u=a?a.children:void 0,d=(u?u.indexOf(r):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,m=f?f.length:r.children.length;let p=-1;const x=[];for(;++p0,!0),u[0]),s=u.index+u[0].length,u=a.exec(r);return d.push(hy(r.slice(s),s>0,!1)),d.join("")}function hy(n,r,a){let u=0,s=n.length;if(r){let d=n.codePointAt(u);for(;d===fy||d===dy;)u++,d=n.codePointAt(u)}if(a){let d=n.codePointAt(s-1);for(;d===fy||d===dy;)s--,d=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function sE(n,r){const a={type:"text",value:oE(String(r.value))};return n.patch(r,a),n.applyData(r,a)}function cE(n,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,a),n.applyData(r,a)}const fE={blockquote:q3,break:F3,code:V3,delete:Y3,emphasis:G3,footnoteReference:Q3,heading:X3,html:I3,imageReference:K3,image:Z3,inlineCode:$3,linkReference:J3,link:P3,listItem:W3,list:tE,paragraph:nE,root:lE,strong:iE,table:rE,tableCell:uE,tableRow:aE,text:sE,thematicBreak:cE,toml:Qo,yaml:Qo,definition:Qo,footnoteDefinition:Qo};function Qo(){}const R0=-1,ds=0,lu=1,rs=2,Jd=3,Pd=4,Wd=5,eh=6,L0=7,U0=8,{defineProperty:dE}=Object,B0=typeof self=="object"?self:globalThis,my=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new B0[n](r)},hE=(n,r)=>{const a=(s,d)=>(n.set(d,s),s),u=s=>{if(n.has(s))return n.get(s);const[d,f]=r[s];switch(d){case ds:case R0:return a(f,s);case lu:{const m=a([],s);for(const p of f)m.push(u(p));return m}case rs:{const m=a({},s);for(const[p,x]of f){const y=u(p),g=u(x);y==="__proto__"?dE(m,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):m[y]=g}return m}case Jd:return a(new Date(f),s);case Pd:{const{source:m,flags:p}=f;return a(new RegExp(m,p),s)}case Wd:{const m=a(new Map,s);for(const[p,x]of f)m.set(u(p),u(x));return m}case eh:{const m=a(new Set,s);for(const p of f)m.add(u(p));return m}case L0:{const{name:m,message:p}=f;return a(typeof B0[m]=="function"?my(m,p):new Error(p),s)}case U0:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return a(new DataView(m),f)}case"-0":return-0}return a(my(d,f),s)};return u},py=n=>hE(new Map,n)(0),Ii="",{toString:mE}={},{keys:pE,is:gE}=Object,Ja=n=>{const r=typeof n;if(r!=="object"||!n)return[ds,r];const a=mE.call(n).slice(8,-1);switch(a){case"Array":return[lu,Ii];case"Object":return[rs,Ii];case"Date":return[Jd,Ii];case"RegExp":return[Pd,Ii];case"Map":return[Wd,Ii];case"Set":return[eh,Ii];case"DataView":return[lu,a]}return a.includes("Array")?[lu,a]:n instanceof Error?[L0,n.name||"Error"]:[rs,a]},Xo=([n,r])=>n===ds&&(r==="function"||r==="symbol"),xE=(n,r,a,u)=>{const s=(f,m)=>{const p=u.push(f)-1;return a.set(m,p),p},d=f=>{if(a.has(f))return a.get(f);let[m,p]=Ja(f);switch(m){case ds:{let y=f;switch(p){case"bigint":m=U0,y=f.toString();break;case"number":if(!f&&gE(f,-0))return u.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return s([R0],f)}return s([m,y],f)}case lu:{if(p){let w=f;return p==="DataView"?w=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(f)),s([p,[...w]],f)}const y=[],g=s([m,y],f);for(const w of f)y.push(d(w));return g}case rs:{if(p)switch(p){case"BigInt":return s([p,f.toString()],f);case"Boolean":case"Number":case"String":return s([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=s([m,y],f);for(const w of pE(f))(n||!Xo(Ja(f[w])))&&y.push([d(w),d(f[w])]);return g}case Jd:return s([m,isNaN(f.getTime())?Ii:f.toISOString()],f);case Pd:{const{source:y,flags:g}=f;return s([m,{source:y,flags:g}],f)}case Wd:{const y=[],g=s([m,y],f);for(const[w,v]of f)(n||!(Xo(Ja(w))||Xo(Ja(v))))&&y.push([d(w),d(v)]);return g}case eh:{const y=[],g=s([m,y],f);for(const w of f)(n||!Xo(Ja(w)))&&y.push(d(w));return g}}const{message:x}=f;return s([m,{name:p,message:x}],f)};return d},gy=(n,{json:r,lossy:a}={})=>{const u=[];return xE(!(r||a),!!r,new Map,u)(n),u},as=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?py(gy(n,r)):structuredClone(n):(n,r)=>py(gy(n,r));function yE(n,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function bE(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function vE(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||yE,u=n.options.footnoteBackLabel||bE,s=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p0&&S.push({type:"text",value:" "});let $=typeof a=="string"?a:a(p,v);typeof $=="string"&&($={type:"text",value:$}),S.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+w+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,v),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const L=y[y.length-1];if(L&&L.type==="element"&&L.tagName==="p"){const $=L.children[L.children.length-1];$&&$.type==="text"?$.value+=" ":L.children.push({type:"text",value:" "}),L.children.push(...S)}else y.push(...S);const D={type:"element",tagName:"li",properties:{id:r+"fn-"+w},children:n.wrap(y,!0)};n.patch(x,D),m.push(D)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...as(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:n.wrap(m,!0)},{type:"text",value:` -`}]}}const hs=(function(n){if(n==null)return NE;if(typeof n=="function")return ms(n);if(typeof n=="object")return Array.isArray(n)?wE(n):kE(n);if(typeof n=="string")return SE(n);throw new Error("Expected function, string, or object as test")});function wE(n){const r=[];let a=-1;for(;++a":""))+")"})}return L;function L(){const D=!d||x(w,v,S[S.length-1]||void 0);let $=H0;if(m&&D&&($=xy(m(w,S,v)),$[0]===ts))return $;if("children"in w&&w.children){const I=w;if(I.children&&$[0]!==_d){let J=(s?-1:I.children.length)+y;const ie=[...S,I];for(;J>-1&&J0&&a.push({type:"text",value:` -`}),a}function yy(n){let r=0,a=n.charCodeAt(r);for(;a===9||a===32;)r++,a=n.charCodeAt(r);return n.slice(r)}function by(n,r){const a=_E(n,r),u=a.one(n,void 0),s=vE(a),d=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&d.children.push({type:"text",value:` -`},s),d}function OE(n,r){return n&&"run"in n?async function(a,u){const s=by(a,{file:u,...r});await n.run(s,u)}:function(a,u){return by(a,{file:u,...n||r})}}function vy(n){if(n)throw n}var ld,wy;function RE(){if(wy)return ld;wy=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(x){return typeof Array.isArray=="function"?Array.isArray(x):r.call(x)==="[object Array]"},d=function(x){if(!x||r.call(x)!=="[object Object]")return!1;var y=n.call(x,"constructor"),g=x.constructor&&x.constructor.prototype&&n.call(x.constructor.prototype,"isPrototypeOf");if(x.constructor&&!y&&!g)return!1;var w;for(w in x);return typeof w>"u"||n.call(x,w)},f=function(x,y){a&&y.name==="__proto__"?a(x,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):x[y.name]=y.newValue},m=function(x,y){if(y==="__proto__")if(n.call(x,y)){if(u)return u(x,y).value}else return;return x[y]};return ld=function p(){var x,y,g,w,v,S,T=arguments[0],L=1,D=arguments.length,$=!1;for(typeof T=="boolean"&&($=T,T=arguments[1]||{},L=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});Lf.length;let p;m&&f.push(s);try{p=n.apply(this,f)}catch(x){const y=x;if(m&&a)throw y;return s(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(d,s):p instanceof Error?s(p):d(p))}function s(f,...m){a||(a=!0,r(f,...m))}function d(f){s(null,f)}}const gl={basename:HE,dirname:qE,extname:FE,join:VE,sep:"/"};function HE(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');uu(n);let a=0,u=-1,s=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else u<0&&(d=!0,u=s+1);return u<0?"":n.slice(a,u)}if(r===n)return"";let f=-1,m=r.length-1;for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else f<0&&(d=!0,f=s+1),m>-1&&(n.codePointAt(s)===r.codePointAt(m--)?m<0&&(u=s):(m=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function qE(n){if(uu(n),n.length===0)return".";let r=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){r=a;break}}else u||(u=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function FE(n){uu(n);let r=n.length,a=-1,u=0,s=-1,d=0,f;for(;r--;){const m=n.codePointAt(r);if(m===47){if(f){u=r+1;break}continue}a<0&&(f=!0,a=r+1),m===46?s<0?s=r:d!==1&&(d=1):s>-1&&(d=-1)}return s<0||a<0||d===0||d===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function VE(...n){let r=-1,a;for(;++r0&&n.codePointAt(n.length-1)===47&&(a+="/"),r?"/"+a:a}function GE(n,r){let a="",u=0,s=-1,d=0,f=-1,m,p;for(;++f<=n.length;){if(f2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",u=0):(a=a.slice(0,p),u=a.length-1-a.lastIndexOf("/")),s=f,d=0;continue}}else if(a.length>0){a="",u=0,s=f,d=0;continue}}r&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,d=0}else m===46&&d>-1?d++:d=-1}return a}function uu(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const QE={cwd:XE};function XE(){return"/"}function Od(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function IE(n){if(typeof n=="string")n=new URL(n);else if(!Od(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return KE(n)}function KE(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const r=n.pathname;let a=-1;for(;++a0){let[v,...S]=y;const T=u[w][1];Md(T)&&Md(v)&&(v=id(!0,T,v)),u[w]=[x,v,...S]}}}}const PE=new nh().freeze();function od(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function sd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function cd(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sy(n){if(!Md(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ny(n,r,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Io(n){return WE(n)?n:new q0(n)}function WE(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function e5(n){return typeof n=="string"||t5(n)}function t5(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const n5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ey=[],jy={allowDangerousHtml:!0},l5=/^(https?|ircs?|mailto|xmpp)$/i,i5=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function r5(n){const r=a5(n),a=u5(n);return o5(r.runSync(r.parse(a),a),n)}function a5(n){const r=n.rehypePlugins||Ey,a=n.remarkPlugins||Ey,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...jy}:jy;return PE().use(H3).use(a).use(OE,u).use(r)}function u5(n){const r=n.children||"",a=new q0;return typeof r=="string"&&(a.value=r),a}function o5(n,r){const a=r.allowedElements,u=r.allowElement,s=r.components,d=r.disallowedElements,f=r.skipHtml,m=r.unwrapDisallowed,p=r.urlTransform||s5;for(const y of i5)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+n5+y.id,void 0);return th(n,x),ES(n,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function x(y,g,w){if(y.type==="raw"&&w&&typeof g=="number")return f?w.children.splice(g,1):w.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in ed)if(Object.hasOwn(ed,v)&&Object.hasOwn(y.properties,v)){const S=y.properties[v],T=ed[v];(T===null||T.includes(y.tagName))&&(y.properties[v]=p(String(S||""),v,y))}}if(y.type==="element"){let v=a?!a.includes(y.tagName):d?d.includes(y.tagName):!1;if(!v&&u&&typeof g=="number"&&(v=!u(y,g,w)),v&&w&&typeof g=="number")return m&&y.children?w.children.splice(g,1,...y.children):w.children.splice(g,1),g}}}function s5(n){const r=n.indexOf(":"),a=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return r===-1||s!==-1&&r>s||a!==-1&&r>a||u!==-1&&r>u||l5.test(n.slice(0,r))?n:""}function c5(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function F0(n,r,a){const s=hs((a||{}).ignore||[]),d=f5(r);let f=-1;for(;++f0?{type:"text",value:U}:void 0),U===!1)v.lastIndex=J+1;else{if(T!==J&&I({type:"text",value:x.value.slice(T,J)}),Array.isArray(U))for(const R of U)I(R);else U&&I(U);T=J+$[0].length,L=!0}if(!v.global)break;$=v.exec(x.value)}return L?(T?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let a=r[0],u=a.indexOf(")");const s=Cy(n,"(");let d=Cy(n,")");for(;u!==-1&&s>d;)n+=a.slice(0,u+1),a=a.slice(u+1),u=a.indexOf(")"),d++;return[n,a]}function V0(n,r){const a=n.input.charCodeAt(n.index-1);return(n.index===0||Pi(a)||cs(a))&&(!r||a!==47)}Y0.peek=U5;function _5(){this.buffer()}function A5(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function z5(){this.buffer()}function D5(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function M5(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function O5(n){this.exit(n)}function R5(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function L5(n){this.exit(n)}function U5(){return"["}function Y0(n,r,a,u){const s=a.createTracker(u);let d=s.move("[^");const f=a.enter("footnoteReference"),m=a.enter("reference");return d+=s.move(a.safe(a.associationId(n),{after:"]",before:d})),m(),f(),d+=s.move("]"),d}function B5(){return{enter:{gfmFootnoteCallString:_5,gfmFootnoteCall:A5,gfmFootnoteDefinitionLabelString:z5,gfmFootnoteDefinition:D5},exit:{gfmFootnoteCallString:M5,gfmFootnoteCall:O5,gfmFootnoteDefinitionLabelString:R5,gfmFootnoteDefinition:L5}}}function H5(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Y0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(u,s,d,f){const m=d.createTracker(f);let p=m.move("[^");const x=d.enter("footnoteDefinition"),y=d.enter("label");return p+=m.move(d.safe(d.associationId(u),{before:p,after:"]"})),y(),p+=m.move("]:"),u.children&&u.children.length>0&&(m.shift(4),p+=m.move((r?` -`:" ")+d.indentLines(d.containerFlow(u,m.current()),r?G0:q5))),x(),p}}function q5(n,r,a){return r===0?n:G0(n,r,a)}function G0(n,r,a){return(a?"":" ")+n}const F5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];lh.attention=X5;lh.peek=I5;function V5(){return{canContainEols:["delete"],enter:{strikethrough:G5},exit:{strikethrough:Q5}}}function Y5(){return{handlers:{delete:lh},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:F5}]}}function G5(n){this.enter({type:"delete",children:[],position:void 0},n)}function Q5(n){this.exit(n)}function lh(n,r,a,u){const s=a.createTracker(u),d=a.stack.includes("strikethrough")?"~":"~~",f=a.enter("strikethrough");let m=s.move(d);return m+=a.containerPhrasing(n,{...s.current(),before:m,after:"~"}),m+=s.move(d),f(),m}function X5(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function I5(){return"~"}function K5(n){return n.length}function Z5(n,r){const a=r||{},u=(a.align||[]).concat(),s=a.stringLength||K5,d=[],f=[],m=[],p=[];let x=0,y=-1;for(;++yx&&(x=n[y].length);++Dp[D])&&(p[D]=I)}T.push($)}f[y]=T,m[y]=L}let g=-1;if(typeof u=="object"&&"length"in u)for(;++gp[g]&&(p[g]=$),v[g]=$),w[g]=I}f.splice(1,0,w),m.splice(1,0,v),y=-1;const S=[];for(;++y "),d.shift(2);const f=a.indentLines(a.containerFlow(n,d.current()),W5);return s(),f}function W5(n,r,a){return">"+(a?"":" ")+n}function ej(n,r){return _y(n,r.inConstruct,!0)&&!_y(n,r.notInConstruct,!1)}function _y(n,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let u=-1;for(;++uf&&(f=d):d=1,s=u+r.length,u=a.indexOf(r,s);return f}function nj(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function lj(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function ij(n,r,a,u){const s=lj(a),d=n.value||"";if(nj(n,a)){const g=a.enter("codeIndented"),w=a.indentLines(d,rj);return g(),w}const f=a.createTracker(u),m=s.repeat(Math.max(tj(d,s)+1,3)),p=a.enter("codeFenced"),x=s==="`"?"GraveAccent":"Tilde";let y=f.move(m);if(n.lang){const g=a.enter(`codeFencedLang${x}`);y+=f.move(a.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(n.lang&&n.meta){const g=a.enter(`codeFencedMeta${x}`);y+=f.move(" "),y+=f.move(a.safe(n.meta,{before:y,after:` -`,encode:["`"],...f.current()})),g()}return y+=f.move(` -`),d&&(y+=f.move(d+` -`)),y+=f.move(m),p(),y}function rj(n,r,a){return(a?"":" ")+n}function ih(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function aj(n,r,a,u){const s=ih(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("[");return x+=p.move(a.safe(a.associationId(n),{before:x,after:"]",...p.current()})),x+=p.move("]: "),m(),!n.url||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":` -`,...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),f(),x}function uj(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function us(n){const r=n.codePointAt(0);return r===void 0?"":String.fromCodePoint(r)}function $r(n){const r=n.codePointAt(n.length-2);return r!==void 0&&r>65535?n.slice(-2):n.slice(-1)}function Q0(n){return"&#x"+n.toString(16).toUpperCase()+";"}function zy(n,r,a){const u=xi(n),s=xi(r);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function oj(n){if(n.charCodeAt(0)!==60)return;const r=n.charCodeAt(1);if(r===33){const m=n.charCodeAt(2);return m===45?2:m===91?5:Jt(m)?4:void 0}if(r===63)return 3;const a=r===47,u=a?2:1;let s=u,d=n.charCodeAt(s);if(!Jt(d))return;for(;d===45||Pt(d);)d=n.charCodeAt(++s);const f=n.slice(u,s).toLowerCase();return!a&&d!==47&&Td.includes(f)?1:T0.includes(f)?6:7}const sj=new Map([["*",!1],["_",!0]]);function cj(n,r,a){const u=new Set;for(const d of n){const f=a.get(d);if(f&&d.attention&&r.some(m=>m.attention===d.attention))for(const m of f.tokens)u.add(m.attention)}const s=[];for(const d of n)d.attention&&u.delete(d.attention)&&s.push(d.attention);return s.reverse(),s}function X0(n,r,a){const u=[],s=new Map,d=new Map;let f=0;for(;fa.index)return{chosen:p,mistake:y,tokens:x}}}}function dj(n,r){const a=new Map;for(const u of n){const s=u.tokens[0].value.charAt(0);let d=a.get(s);d||(d=[],a.set(s,d));let f=u.close?d.length:0;for(;f--&&u.start1&&x>1?2:1:x,g=m.markers.slice(m.end-y,m.end),w=u.markers.slice(u.start,u.start+y),v=g[0],S=w[0];if(v===g[y-1]&&v.value.length===y&&S===w[y-1]&&S.value.length===y&&v.attention===S.attention)r.delete(v),r.delete(S);else{const T=[...new Set([...g,...w])];for(const L of T){const D=r.get(L);D&&D.push(...T)}}m.end-=y,u.start+=y,m.start===m.end&&d.splice(f,1),f=d.length}u.open&&u.start0?S[0].value:"",L=zy(w.charCodeAt(w.length-1),T.charCodeAt(0),y);L.inside&&Ko(S,!0);const D=S.length>0?$r(S[S.length-1].value):"",$=zy(v.charCodeAt(0),D.charCodeAt(D.length-1),y);$.inside&&Ko(S,!1),L.outside&&w!==` -`&&w!=="\r"&&Ko(s,!1),$.outside&&(d=v),s.push({value:x,attention:p},...S,{value:x,attention:p}),f=x.charAt(x.length-1)}return s}function ps(n,r,a){let u=new Map;const s=ah(n,u,r,a);let d=s,f=X0(d,r,a);for(;f;){const p=fj(n,u,f,r,a);if(!p){d=s;break}u=p.chosen,d=p.tokens,f=p.mistake}let m="";for(const p of d)m+=p.value;return m}uh.attention=I0;uh.peek=pj;function uh(n,r,a,u){const s=a.enter("phrasing"),d=rh(n,I0,a,a.createTracker(u)),f=ps([d],u.before,u.after);return s(),f}function I0(n,r){return{construct:"emphasis",markers:uj(r)==="*"?["*","_"]:["_","*"],sizes:[1]}}function pj(n,r,a){return a.options.emphasis||"*"}function gj(n,r){let a=!1;return th(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,ts}),!!((!n.depth||n.depth<3)&&Kd(n)&&(r.options.setext||a))}function xj(n,r,a,u){const s=Math.max(Math.min(6,n.depth||1),1),d=a.createTracker(u);if(gj(n,a)){const g=a.enter("headingSetext"),w=a.enter("phrasing"),v=a.containerPhrasing(n,{...d.current(),before:` -`,after:` -`});return w(),g(),v+` -`+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` -`))+1))}const f="#".repeat(s),m=a.enter("headingAtx"),p=a.enter("phrasing");d.move(f+" ");let x=a.containerPhrasing(n,{before:"# ",after:` -`,...d.current()});const y=x.charCodeAt(0);return(y===9||y===32)&&(x=Q0(y)+x.slice(1)),x=x?f+" "+x:f,a.options.closeAtx&&(x+=" "+f),p(),m(),x}K0.peek=yj;function K0(n){return n.value||""}function yj(){return"<"}Z0.peek=bj;function Z0(n,r,a,u){const s=ih(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("![");return x+=p.move(a.safe(n.alt,{before:x,after:"]",...p.current()})),x+=p.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":")",...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),x+=p.move(")"),f(),x}function bj(){return"!"}$0.peek=vj;function $0(n,r,a,u){const s=n.referenceType,d=a.enter("imageReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("![");const x=a.safe(n.alt,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function vj(){return"!"}J0.peek=wj;function J0(n,r,a){let u=n.value||"",s="`",d=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^\n\r ]/.test(u)&&(/^[\n\r ]/.test(u)&&/[\n\r ]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++d\u007F]/.test(n.url))}W0.peek=kj;function W0(n,r,a,u){const s=ih(a),d=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);if(P0(n,a)){const S=a.stack;a.stack=S.filter(function(D){return D!=="phrasing"});const T=a.enter("autolink");let L=f.move("<");return L+=f.move(a.containerPhrasing(n,{before:L,after:">",...f.current()})),L+=f.move(">"),T(),a.stack=S,L}const m=a.enter("link");let p=a.enter("label"),x=f.move("[");const y=a.containerPhrasing(n,{before:x,after:"](",...f.current()});x+=f.move(y),p(),x+=f.move("](");const g=/[\0- \u007F]/.test(n.url),w=u.before.charAt(u.before.length-1);let v=n.title||void 0;if(!v&&!g&&(w===` -`||w==="\r")){let S=0;for(;S",...f.current()})),x+=f.move(">")):(p=a.enter("destinationRaw"),x+=f.move(a.safe(n.url,{before:x,after:typeof v=="string"?" ":")",...f.current()}))),p(),typeof v=="string"&&(p=a.enter(`title${d}`),x+=f.move(" "+s),x+=f.move(a.safe(v,{before:x,after:s,...f.current()})),x+=f.move(s),p()),x+=f.move(")"),m(),x}function kj(n,r,a){return P0(n,a)?"<":"["}eb.peek=Sj;function eb(n,r,a,u){const s=n.referenceType,d=a.enter("linkReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("[");const x=a.containerPhrasing(n,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function Sj(){return"["}function oh(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function Nj(n){const r=oh(n),a=n.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function Ej(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function tb(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function jj(n,r,a,u){const s=a.enter("list"),d=a.bulletCurrent;let f=n.ordered?Ej(a):oh(a);const m=n.ordered?f==="."?")":".":Nj(a);let p=r&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),tb(a)===f&&y){let g=-1;for(;++g-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(s==="tab"||s==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const m=a.createTracker(u);m.move(d+" ".repeat(f-d.length)),m.shift(f);const p=a.enter("listItem"),x=a.indentLines(a.containerFlow(n,m.current()),y);return p(),x;function y(g,w,v){return w?(v?"":" ".repeat(f))+g:(v?d:d+" ".repeat(f-d.length))+g}}function _j(n,r,a,u){const s=a.enter("paragraph"),d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),s(),f}function Aj(n,r,a,u){if(!n.children.some(function(m){return J5(m)}))return a.containerFlow(n,u);const d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),f}function zj(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}sh.attention=nb;sh.peek=Dj;function sh(n,r,a,u){const s=a.enter("phrasing"),d=rh(n,nb,a,a.createTracker(u)),f=ps([d],u.before,u.after);return s(),f}function nb(n,r){return{construct:"strong",markers:zj(r)==="*"?["*","_"]:["_","*"],sizes:[2]}}function Dj(n,r,a){return a.options.strong||"*"}function Mj(n,r,a,u){const s=r?r.children:[],d=a.indexStack[a.indexStack.length-1];return a.safe(n.value,{...u,afterNode:s[d+1],beforeNode:s[d-1]})}function Oj(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function Rj(n,r,a){const u=(tb(a)+(a.options.ruleSpaces?" ":"")).repeat(Oj(a));return a.options.ruleSpaces?u.slice(0,-1):u}const lb={blockquote:P5,break:Ay,code:ij,definition:aj,emphasis:uh,hardBreak:Ay,heading:xj,html:K0,image:Z0,imageReference:$0,inlineCode:J0,link:W0,linkReference:eb,list:jj,listItem:Tj,paragraph:_j,root:Aj,strong:sh,text:Mj,thematicBreak:Rj};function Lj(){return{enter:{table:Uj,tableData:Dy,tableHeader:Dy,tableRow:Hj},exit:{codeText:qj,table:Bj,tableData:md,tableHeader:md,tableRow:md}}}function Uj(n){const r=n._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},n),this.data.inTable=!0}function Bj(n){this.exit(n),this.data.inTable=void 0}function Hj(n){this.enter({type:"tableRow",children:[]},n)}function md(n){this.exit(n)}function Dy(n){this.enter({type:"tableCell",children:[]},n)}function qj(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,Fj));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(n)}function Fj(n,r){return r==="|"?r:n}function Vj(n){const r=n||{},a=r.tableCellPadding,u=r.tablePipeAlign,s=r.stringLength,d=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:f,tableCell:p,tableRow:m}};function f(v,S,T,L){return x(y(v,T,L),v.align)}function m(v,S,T,L){const D=g(v,T,L),$=x([D]);return $.slice(0,$.indexOf(` -`))}function p(v,S,T,L){const D=T.enter("tableCell"),$=T.enter("phrasing"),I=T.containerPhrasing(v,{...L,before:d,after:d});return $(),D(),I}function x(v,S){return Z5(v,{align:S,alignDelimiters:u,padding:a,stringLength:s})}function y(v,S,T){const L=v.children;let D=-1;const $=[],I=S.enter("table");for(;++D0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const a4={tokenize:m4,partial:!0};function u4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:f4,continuation:{tokenize:d4},exit:h4}},text:{91:{name:"gfmFootnoteCall",tokenize:c4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:o4,resolveTo:s4}}}}function o4(n,r,a){const u=this;let s=u.events.length;const d=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const p=u.events[s][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return a(p);const x=tl(u.sliceSerialize({start:f.end,end:u.now()}));return x.codePointAt(0)!==94||!d.includes(x.slice(1))?a(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function s4(n,r){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},m=[n[a+1],n[a+2],["enter",u,r],n[a+3],n[a+4],["enter",s,r],["exit",s,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",u,r]];return n.splice(a,n.length-a+1,...m),n}function c4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d=0,f;return m;function m(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",x)}function x(g){if(d>999||g===93&&!f||g===null||g===91||ht(g))return a(g);if(g===93){n.exit("chunkString");const w=n.exit("gfmFootnoteCallString");return s.includes(tl(u.sliceSerialize(w)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):a(g)}return ht(g)||(f=!0),d++,n.consume(g),g===92?y:x}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,x):x(g)}}function f4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d,f=0,m;return p;function p(S){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(S){return S===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):a(S)}function y(S){if(f>999||S===93&&!m||S===null||S===91||ht(S))return a(S);if(S===93){n.exit("chunkString");const T=n.exit("gfmFootnoteDefinitionLabelString");return d=tl(u.sliceSerialize(T)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),w}return ht(S)||(m=!0),f++,n.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(n.consume(S),f++,y):y(S)}function w(S){return S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),s.includes(d)||s.push(d),We(n,v,"gfmFootnoteDefinitionWhitespace")):a(S)}function v(S){return r(S)}}function d4(n,r,a){return n.check(au,r,n.attempt(a4,r,a))}function h4(n){n.exit("gfmFootnoteDefinition")}function m4(n,r,a){const u=this;return We(n,s,"gfmFootnoteDefinitionIndent",5);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):a(d)}}function p4(n){let a=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:d,resolveAll:s};return a==null&&(a=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,m){let p=-1;for(;++p1?p(S):(f.consume(S),g++,v);if(g<2&&!a)return p(S);const L=f.exit("strikethroughSequenceTemporary"),D=xi(S);return L._open=!D||D===2&&!!T,L._close=!T||T===2&&!!D,m(S)}}}class g4{constructor(){this.map=[],this.index=new Map}add(r,a,u){x4(this,r,a,u)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}}function x4(n,r,a,u){if(a===0&&u.length===0)return;const s=n.index.get(r);if(s){s[1]+=a,s[2].push(...u);return}const d=[r,a,u];n.map.push(d),n.index.set(r,d)}function y4(n,r){let a=!1;const u=[];for(;r-1;){const{type:we}=u.events[ne][1];if(we==="lineEnding"||we==="linePrefix")ne--;else break}const V=ne>-1?u.events[ne][1].type:null,se=V==="tableHead"||V==="tableRow"?U:p;return se===U&&u.parser.lazy[u.now().line]?a(B):se(B)}function p(B){return n.enter("tableHead"),n.enter("tableRow"),x(B)}function x(B){return B===124||(f=!0,d+=1),y(B)}function y(B){return B===null?a(B):Te(B)?d>1?(d=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),v):a(B):Fe(B)?We(n,y,"whitespace")(B):(d+=1,f&&(f=!1,s+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(B)))}function g(B){return B===null||B===124||ht(B)?(n.exit("data"),y(B)):(n.consume(B),B===92?w:g)}function w(B){return B===92||B===124?(n.consume(B),g):g(B)}function v(B){return u.interrupt=!1,u.parser.lazy[u.now().line]?a(B):(n.enter("tableDelimiterRow"),f=!1,Fe(B)?We(n,S,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?L(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),T):ie(B)}function T(B){return Fe(B)?We(n,L,"whitespace")(B):L(B)}function L(B){return B===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),D):B===45?(d+=1,D(B)):B===null||Te(B)?J(B):ie(B)}function D(B){return B===45?(n.enter("tableDelimiterFiller"),$(B)):ie(B)}function $(B){return B===45?(n.consume(B),$):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),I):(n.exit("tableDelimiterFiller"),I(B))}function I(B){return Fe(B)?We(n,J,"whitespace")(B):J(B)}function J(B){return B===124?S(B):B===null||Te(B)?!f||s!==d?ie(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):ie(B)}function ie(B){return a(B)}function U(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||Te(B)?(n.exit("tableRow"),r(B)):Fe(B)?We(n,R,"whitespace")(B):(n.enter("data"),Q(B))}function Q(B){return B===null||B===124||ht(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?fe:Q)}function fe(B){return B===92||B===124?(n.consume(B),Q):Q(B)}}function w4(n,r){let a=-1,u=!0,s=0,d=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,x,y,g;const w=new g4;for(;++aa[2]+1){const S=a[2]+1,T=a[3]-a[2]-1;n.add(S,T,[])}}n.add(a[3]+1,0,[["exit",g,r]])}return s!==void 0&&(d.end=Object.assign({},Xr(r.events,s)),n.add(s,0,[["exit",d,r]]),d=void 0),d}function Oy(n,r,a,u,s){const d=[],f=Xr(r.events,a);s&&(s.end=Object.assign({},f),d.push(["exit",s,r])),u.end=Object.assign({},f),d.push(["exit",u,r]),n.add(a+1,0,d)}function Xr(n,r){const a=n[r],u=a[0]==="enter"?"start":"end";return a[1][u]}const k4={name:"tasklistCheck",tokenize:N4};function S4(){return{text:{91:k4}}}function N4(n,r,a){const u=this;return s;function s(p){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?a(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return ht(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),m):a(p)}function m(p){return Te(p)?r(p):Fe(p)?n.check({tokenize:E4},r,a)(p):a(p)}}function E4(n,r,a){return We(n,u,"whitespace");function u(s){return s===null?a(s):r(s)}}function j4(n){return x0([Jj(),u4(),p4(n),b4(),S4()])}const C4={};function T4(n){const r=this,a=n||C4,u=r.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),d=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(j4(a)),d.push(Ij()),f.push(Kj(a))}function _4(n){return n.replace(/\\n/g,` -`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\\/g,"\\")}const A4={h1:({children:n})=>h.jsx("h3",{className:"mt-3 mb-1.5 text-base font-bold text-ink first:mt-0",children:n}),h2:({children:n})=>h.jsx("h4",{className:"mt-3 mb-1 text-sm font-semibold text-ink first:mt-0",children:n}),h3:({children:n})=>h.jsx("h5",{className:"mt-2 mb-1 text-xs font-semibold text-ink first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"my-1.5 leading-relaxed first:mt-0 last:mb-0",children:n}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold text-ink",children:n}),em:({children:n})=>h.jsx("em",{className:"italic text-ink-secondary",children:n}),del:({children:n})=>h.jsx("del",{className:"text-ink-muted line-through",children:n}),a:({children:n,href:r})=>h.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-chip-indigo-text underline underline-offset-2 hover:text-ink",children:n}),code:({children:n,className:r})=>h.jsx("code",{className:`break-words rounded bg-elevated px-1 py-0.5 font-mono text-chip-indigo-text whitespace-pre-wrap ${r??""}`,children:n}),pre:({children:n})=>h.jsx("pre",{className:"my-2 overflow-x-auto rounded-lg border border-line bg-elevated p-3 font-mono text-xs text-ink [&_code]:bg-transparent [&_code]:px-0 [&_code]:py-0 [&_code]:text-inherit",children:n}),ul:({children:n})=>h.jsx("ul",{className:"my-1.5 list-disc space-y-0.5 pl-5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"my-1.5 list-decimal space-y-0.5 pl-5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"my-2 border-l-2 border-line-strong pl-3 text-ink-secondary italic",children:n}),table:({children:n})=>h.jsx("div",{className:"my-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-line bg-elevated px-2 py-1 text-left font-semibold",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-line px-2 py-1 align-top",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-line"}),img:({alt:n,src:r,title:a})=>h.jsx("img",{src:r,alt:n,title:a,loading:"lazy",referrerPolicy:"no-referrer",className:"my-2 max-w-full rounded-lg border border-line"})};function $o({text:n}){return n?h.jsx(r5,{remarkPlugins:[T4,g5],components:A4,children:_4(n)}):null}function db(n){return n==="completed"||n==="aborted"||n==="failed"}function Pa({label:n}){return h.jsx("kbd",{"aria-hidden":"true",className:"ml-1.5 inline-block rounded border border-line/60 bg-elevated/60 px-1 py-px font-mono text-[10px] font-normal leading-none opacity-90",children:n})}function Ry(n){!n||db(n.status)||w2(n.session_id).catch(()=>{})}const z4={running:"running",completed:"done",skipped:"skipped",failed:"failed",pending:"pending"};function Jo({text:n}){const[r,a]=z.useState(!1),u=z.useRef(void 0);z.useEffect(()=>()=>window.clearTimeout(u.current),[]);const s=async()=>{try{await navigator.clipboard.writeText(n),a(!0),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!1),1500)}catch{}};return h.jsx("button",{type:"button",onClick:s,"aria-label":r?"Copied":"Copy content",title:r?"Copied!":"Copy content",className:"absolute right-2 top-2 rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:r?h.jsx(gi,{className:"h-3.5 w-3.5"}):h.jsx(Mn,{className:"h-3.5 w-3.5"})})}function D4({isOpen:n,onClose:r,directory:a,filename:u,release:s,args:d,onFinished:f}){var Ve,M;const[m,p]=z.useState(null),[x,y]=z.useState(!1),[g,w]=z.useState(null),[v,S]=z.useState(null),[T,L]=z.useState(!1),[D,$]=z.useState(0),I=z.useRef(null),J=z.useRef(!1),ie=z.useRef(null),U=z.useRef(!1);z.useEffect(()=>{if(!n||!a||!u){p(null),w(null),L(!1),S(null),U.current=!1;return}let E=!0;return y(!0),w(null),L(!1),S(null),b2({directory:a,filename:u,release:s,args:d}).then(Y=>{E&&(p(Y),y(!1),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||"")))}).catch(Y=>{E&&((Y==null?void 0:Y.status)===404&&L(!0),w(Y.message||"Failed to start workflow"),y(!1))}),()=>{E=!1}},[n,a,u,s,d,D]);const R=async E=>{if(!(!m||J.current)){J.current=!0,y(!0);try{const Y=await v2(m.session_id,E);p(Y),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||""))}catch(Y){(Y==null?void 0:Y.status)===404?(L(!0),w(Y.message||"Workflow session on the server has expired.")):w(Y.message||"Failed to process workflow response")}finally{J.current=!1,y(!1)}}},Q=z.useRef(m);Q.current=m;const fe=z.useRef(R);fe.current=R;const B=z.useRef(v);B.current=v;const ne=z.useRef([]),V=(E,Y)=>{var Ee,ye;if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"&&E.key!=="Home"&&E.key!=="End")return;E.preventDefault();const oe=((Ee=Q.current)==null?void 0:Ee.steps.length)??0;if(oe===0)return;const he=E.key==="ArrowDown"?(Y+1)%oe:E.key==="ArrowUp"?(Y-1+oe)%oe:E.key==="Home"?0:oe-1;S(he),(ye=ne.current[he])==null||ye.focus()};z.useEffect(()=>()=>Ry(Q.current),[]);const se=()=>{U.current||(U.current=!0,Ry(Q.current),r())},we=()=>{p(null),w(null),L(!1),S(null),U.current=!1,$(E=>E+1)},ae=Pr({isOpen:n,onClose:se,dialogRef:I,initialFocusRef:ie});if(z.useEffect(()=>{if(!n)return;const E=Y=>{var ke,Ot,Ut;if(Y.key==="Escape"){Y.preventDefault(),se();return}const oe=Q.current;if(!oe)return;if(db(oe.status)){Y.key==="Enter"&&!Y.repeat&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!J.current&&((ke=Y.target)==null?void 0:ke.tagName)!=="BUTTON"&&((Ot=document.activeElement)==null?void 0:Ot.tagName)!=="BUTTON"&&(Y.preventDefault(),se());return}if(J.current||Y.repeat||Y.ctrlKey||Y.metaKey||Y.altKey)return;const he=Y.target;if((he==null?void 0:he.tagName)==="INPUT"||(he==null?void 0:he.tagName)==="TEXTAREA"||he!=null&&he.isContentEditable)return;const Ee=B.current,ye=Ee===null||Ee===oe.current_index,_e=oe.status==="waiting_ask"?"yes":oe.status==="waiting_notify"||oe.status==="waiting_notice"?"ack":null;if(!ye||_e===null)return;if(Y.key==="Enter"){const Vt=Y.target;if((Vt==null?void 0:Vt.tagName)==="BUTTON"||((Ut=document.activeElement)==null?void 0:Ut.tagName)==="BUTTON")return;Y.preventDefault(),fe.current(_e);return}if(oe.status!=="waiting_ask")return;const pe=Y.key.toLowerCase();pe==="y"?(Y.preventDefault(),fe.current("yes")):pe==="s"?(Y.preventDefault(),fe.current("skip")):pe==="n"&&(Y.preventDefault(),fe.current("no"))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[n,r]),z.useEffect(()=>{if(!n||!m)return;const E=requestAnimationFrame(()=>{var Y;return(Y=ie.current)==null?void 0:Y.focus()});return()=>cancelAnimationFrame(E)},[n,m==null?void 0:m.status]),!n)return null;const _=v!==null?m==null?void 0:m.steps[v]:m==null?void 0:m.steps[m.current_index],P=(m==null?void 0:m.status)==="completed"||(m==null?void 0:m.status)==="aborted"||(m==null?void 0:m.status)==="failed",le=!!m&&!P&&!T&&(((Ve=m.status)==null?void 0:Ve.startsWith("waiting"))??!1),re=(((M=m==null?void 0:m.steps[(m==null?void 0:m.current_index)??-1])==null?void 0:M.phase)??"pre")==="post",He=!T&&(v===null||v===(m==null?void 0:m.current_index))&&(_!=null&&_.command)&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_notice"||(m==null?void 0:m.status)==="waiting_ask")?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsxs("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 pr-10 font-mono text-xs text-ink leading-relaxed",children:[h.jsx(Jo,{text:_.command}),_.command]})]}):null;return h.jsx("div",{ref:I,role:"dialog","aria-modal":"true","aria-labelledby":"workflow-runner-title",onKeyDown:ae,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs",children:h.jsxs("div",{className:"animate-modal-in flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-frame-line glass-panel overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line px-5 py-3.5 bg-surface-strong/30 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-chip-indigo-bg text-chip-indigo-text",children:h.jsx(Wy,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("h2",{id:"workflow-runner-title",className:"text-sm font-semibold text-ink",children:"Launch Workflow Engine"}),h.jsxs("p",{className:"text-xs text-ink-muted",children:[u," ",m!=null&&m.pattern?`• Pattern: ${m.pattern}`:""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&!P&&!T&&h.jsxs("button",{type:"button",disabled:!le||x,onClick:()=>R("bypass"),title:re?"Skip the remaining post-launch steps":"Skip the remaining steps and launch with the OS default app",className:"btn inline-flex items-center gap-1.5 rounded-md border border-line bg-surface px-3 py-1.5 text-xs font-medium text-status-warning-text hover:bg-status-warning-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 disabled:cursor-not-allowed disabled:opacity-40",children:[h.jsx(Lw,{className:"h-3.5 w-3.5"}),re?"Skip rest":"Launch now"]}),h.jsx("button",{type:"button",onClick:se,className:"rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:h.jsx(nl,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsxs("div",{className:"w-72 border-r border-line bg-surface-strong/20 p-4 overflow-y-auto flex flex-col gap-2 shrink-0",children:[h.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-ink-muted px-1 mb-1",children:"Workflow Steps (Click to inspect)"}),m&&m.steps.length>0?h.jsx("ul",{role:"list",className:"flex flex-col gap-2",children:m.steps.map((E,Y)=>{const oe=m.current_index===Y&&!P,he=v===Y||v===null&&oe,Ee=z4[E.status];return h.jsx("li",{children:h.jsxs("button",{ref:ye=>{ne.current[Y]=ye},type:"button",tabIndex:he?0:-1,"aria-current":he?"step":void 0,onKeyDown:ye=>V(ye,Y),onClick:()=>S(Y),className:`flex items-start text-left gap-2.5 rounded-lg border px-3 py-2.5 transition-colors cursor-pointer w-full ${he?"border-chip-indigo-border bg-chip-indigo-bg shadow-xs ring-1 ring-chip-indigo-border/40":"border-line/60 bg-surface/60 hover:bg-elevated/80"}`,children:[h.jsxs("div",{className:"mt-0.5 shrink-0",children:[E.status==="running"&&h.jsx($i,{className:"h-4 w-4 animate-spin text-chip-indigo-text"}),E.status==="completed"&&h.jsx(Mx,{className:"h-4 w-4 text-status-success-text"}),E.status==="skipped"&&h.jsx(cw,{className:"h-4 w-4 text-status-warning-text"}),E.status==="failed"&&h.jsx(eu,{className:"h-4 w-4 text-status-danger-text"}),E.status==="pending"&&h.jsx("div",{className:"h-4 w-4 rounded-full border border-line-strong flex items-center justify-center text-[10px] text-ink-faint font-mono",children:E.index})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[11px] font-bold uppercase text-chip-indigo-text",children:E.action}),h.jsxs("span",{className:"text-[10px] font-mono text-ink-faint",children:["#",E.index," · ",Ee]})]}),h.jsx("p",{className:"truncate font-mono text-[11px] text-ink-secondary mt-0.5",title:E.command,children:E.message?E.message.split(` -`)[0]:E.command}),E.note&&h.jsx("p",{className:"mt-1 text-[10px] text-ink-faint italic",children:E.note})]})]})},E.index)})}):h.jsx("div",{className:"p-4 text-center text-xs text-ink-faint",children:g||T?"Session unavailable — see the error panel.":"Loading steps..."})]}),h.jsxs("div",{className:"flex-1 flex flex-col bg-app",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:h.jsx("div",{className:"space-y-6",children:h.jsxs("div",{className:"rounded-xl border border-line bg-surface p-5 shadow-xs space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"rounded bg-chip-indigo-bg px-2 py-0.5 font-mono text-xs font-semibold uppercase text-chip-indigo-text",children:(_==null?void 0:_.action)||(m==null?void 0:m.status)}),h.jsx("span",{className:"text-xs text-ink-muted",children:_?`Step ${_.index} of ${m==null?void 0:m.steps.length}`:"Status"}),v!==null&&v!==(m==null?void 0:m.current_index)&&h.jsx("button",{type:"button",onClick:()=>S(null),className:"text-[11px] text-chip-indigo-text hover:underline ml-2",children:"(Return to active step)"})]}),x&&h.jsx($i,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})]}),h.jsxs("div",{className:"space-y-3 text-xs text-ink font-sans leading-relaxed",children:[(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notify"&&m.notify_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notification Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notify_message})}),He]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notice"&&m.notice_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notice:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.notice_message})}),He,h.jsx("p",{className:"text-[11px] text-ink-faint",children:"The command will run when you continue."})]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_ask"&&m.ask_prompt&&h.jsxs("div",{className:"space-y-2",children:[m.ask_message&&h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx($o,{text:m.ask_message})}),h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-status-warning-text",children:"Confirmation Prompt:"}),h.jsx("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-4 text-sm font-medium text-ink",children:m.ask_prompt}),He]}),P&&v===null&&h.jsxs("div",{className:`rounded-xl border p-8 text-center space-y-4 ${(m==null?void 0:m.status)==="completed"?"border-status-success-border bg-status-success-bg text-status-success-text":"border-status-danger-border bg-status-danger-bg text-status-danger-text"}`,children:[h.jsx("div",{className:"inline-flex h-12 w-12 items-center justify-center rounded-full bg-surface/50 mx-auto",children:(m==null?void 0:m.status)==="completed"?h.jsx(Mx,{className:"h-6 w-6 text-status-success-text"}):h.jsx(eu,{className:"h-6 w-6 text-status-danger-text"})}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"text-base font-bold",children:(m==null?void 0:m.status)==="completed"?"Workflow Finished":"Workflow Terminated"}),h.jsx("p",{className:"text-xs text-ink-secondary max-w-md mx-auto",children:(m==null?void 0:m.final_message)||"The launch sequence has ended."})]}),h.jsx("div",{className:"pt-2",children:h.jsx("button",{type:"button",onClick:r,className:"btn btn-primary px-8 py-2.5 font-bold shadow-lg",children:"Close Engine Runner"})})]}),P&&v===null&&(m==null?void 0:m.last_output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:m.last_output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:m.last_output})]})]}),!T&&!(P&&v===null)&&!((v===null||v===(m==null?void 0:m.current_index))&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_ask"||(m==null?void 0:m.status)==="waiting_notice"))&&h.jsxs("div",{className:"space-y-4",children:[(_==null?void 0:_.message)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-xs text-ink",children:h.jsx($o,{text:_.message})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsx("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink leading-relaxed",children:_!=null&&_.command?h.jsxs(h.Fragment,{children:[h.jsx(Jo,{text:_.command}),h.jsx("span",{className:"block pr-8",children:_.command})]}):"Waiting..."})]}),(_==null?void 0:_.output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Jo,{text:_.output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:_.output})]})]}),(_==null?void 0:_.ask)&&h.jsxs("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-3 text-xs text-status-warning-text",children:[h.jsx("span",{className:"font-semibold",children:"Workflow Guard:"})," ",_.ask]}),(_==null?void 0:_.note)&&h.jsxs("div",{className:"rounded-lg border border-line bg-surface-strong p-3 text-xs text-ink-muted italic",children:[h.jsx("span",{className:"font-semibold text-ink-secondary not-italic uppercase text-[10px]",children:"Log:"})," ",_.note]})]})]})]})})}),(g||T)&&h.jsx("div",{className:"shrink-0 px-6 pt-3",children:h.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-status-danger-border bg-status-danger-bg p-3 text-xs text-status-danger-text",children:[h.jsx(eu,{className:"mt-0.5 h-4 w-4 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[h.jsx("p",{children:T?"Workflow session on the server has expired or ended.":g}),T?h.jsxs("div",{className:"space-y-2",children:[g&&h.jsxs("details",{className:"text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[11px] underline",children:"Raw error (for bug reports)"}),h.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",children:g})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:we,className:"btn btn-primary px-4 py-1.5 text-xs font-semibold",children:"Restart workflow"}),h.jsx("button",{type:"button",onClick:se,className:"btn rounded-md border-line bg-surface px-4 py-1.5 text-xs",children:"Close"})]})]}):null]})]})}),h.jsxs("div",{className:"shrink-0 px-6 pt-4 pb-4 border-t border-line flex items-center justify-between bg-app",children:[h.jsx("div",{className:"text-xs text-ink-muted","aria-live":"polite",children:T?"Session unavailable — restart or close above.":(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)?"Action required to proceed:":(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)?"Acknowledge message to proceed:":(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)?"Continue to run the command:":P?"Session terminated.":"Step in progress..."}),h.jsxs("div",{className:"flex items-center gap-2",children:[!T&&(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Run Command",h.jsx(Pa,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Continue Workflow",h.jsx(Pa,{label:"↵"})]}),!T&&(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("no"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-danger-text hover:bg-status-danger-bg",children:["Abort Launch",h.jsx(Pa,{label:"N"})]}),h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("skip"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-warning-text hover:bg-status-warning-bg",children:["Skip Step",h.jsx(Pa,{label:"S"})]}),h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("yes"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Execute Step",h.jsx(Pa,{label:"Y"})]})]}),P&&h.jsx("button",{type:"button",ref:ie,onClick:r,className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:"Close Runner"})]})]})]})]})]})})}function M4({isOpen:n,title:r,message:a,confirmLabel:u="Confirm",cancelLabel:s="Cancel",danger:d=!1,onConfirm:f,onCancel:m}){const p=z.useRef(null),x=z.useRef(null),y=Pr({isOpen:n,onClose:m,dialogRef:p,initialFocusRef:x});return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:m,children:h.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",onKeyDown:y,onClick:g=>g.stopPropagation(),className:"animate-modal-in w-[400px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[h.jsx("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-lg ${d?"bg-status-danger-bg text-status-danger-text":"bg-chip-indigo-bg text-chip-indigo-text"}`,children:h.jsx(Py,{className:"h-5 w-5"})}),h.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-ink",children:r})]}),h.jsx("p",{className:"mb-5 whitespace-pre-line text-xs text-ink-secondary",children:a}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{ref:x,type:"button",onClick:m,className:"min-h-9 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:s}),h.jsx("button",{type:"button",onClick:f,className:`min-h-9 rounded-lg border px-4 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${d?"border-status-danger-border bg-status-danger-bg/30 text-status-danger-text hover:bg-status-danger-bg/60":"btn-primary border-transparent bg-indigo-600 text-white hover:bg-indigo-500"}`,children:u})]})]})}):null}const O4=";",Ly="=";function R4(n){const r=n.trim().toLowerCase();return r==="extension"||r==="file_ext"||r==="filetype"?"ext":r==="directory"||r==="path"||r==="folder"?"dir":r==="recurse"||r==="recursive_search"?"recursive":r==="filter_text"||r==="query"||r==="search"?"filter":r}function Uy(n){const r=n.trim();if(!r.includes(Ly))return{values:{filter:r},isPlainFilter:!0};const a={};for(const u of r.split(O4)){const s=u.trim();if(!s)continue;const d=s.indexOf(Ly);if(d===-1)continue;const f=R4(s.slice(0,d)),m=s.slice(d+1).trim();switch(f){case"filter":a.filter=m;break;case"ext":a.ext=m;break;case"recursive":a.recursive=By(m,!0);break;case"dir":a.dir=m;break;case"scan":a.scan=By(m,!1);break}}return{values:a,isPlainFilter:!1}}function By(n,r){const a=n.toLowerCase();return["0","false","no","off"].includes(a)?!1:["1","true","yes","on"].includes(a)?!0:r}function Wa(n){return/[",\n\r]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function L4(n,r,a,u){var p,x;const s=[],f=[["Exported",new Date().toISOString()],["App Version",(a==null?void 0:a.release)??"unknown"],["Config File",(a==null?void 0:a.config_path)??"none"],["Config Exists",String((a==null?void 0:a.config_exists)??!1)],["Directory",(a==null?void 0:a.active_directory)??""],["Extensions",((p=a==null?void 0:a.extensions)==null?void 0:p.join(" | "))??""],["Filter Text",u??((x=a==null?void 0:a.filters)==null?void 0:x[0])??""],["Recursive",String((a==null?void 0:a.recursive_search)??!0)],["Title",(a==null?void 0:a.title)??""],["Release",(a==null?void 0:a.release)??""]];for(const[y,g]of f)s.push(`${Wa(y)},${Wa(g)}`);s.push("");const m=r.length>0?r:["filename","path","rel_path"];s.push(m.map(Wa).join(","));for(const y of n){const g=m.map(w=>w in y?Wa(String(y[w]??"")):Wa(y.column_values[w]??""));s.push(g.join(","))}return s.join(`\r -`)}const U4=120,Hy=800,B4=4e3,qy=20;function H4(){const[n,r]=z.useState("dark"),[a,u]=z.useState(null),[s,d]=z.useState(null),[f,m]=z.useState(""),[p,x]=z.useState(""),[y,g]=z.useState(""),[w,v]=z.useState(!0),[S,T]=z.useState([]),[L,D]=z.useState(0),[$,I]=z.useState(!1),[J,ie]=z.useState(!1),[U,R]=z.useState(null),[Q,fe]=z.useState(!1),[B,ne]=z.useState(null),[V,se]=z.useState(0),[we,ae]=z.useState(!1),_=z.useRef(0),P=z.useRef(null),le=z.useRef(null),[re,N]=z.useState(""),[He,Ve]=z.useState(null),[M,E]=z.useState(!1),[Y,oe]=z.useState(null),[he,Ee]=z.useState(!1),[ye,_e]=z.useState("en"),[pe,ke]=z.useState(!1),[Ot,Ut]=z.useState(!1),[Vt,kt]=z.useState(!1),[tt,Ke]=z.useState(null),[Wt,Sn]=z.useState(null),[en,Bt]=z.useState(!1),[ge,Re]=z.useState(!1),[Me,lt]=z.useState(null),[Z,ue]=z.useState(!1),be=z.useRef(""),[Ae,St]=z.useState(!1),[it,jt]=z.useState(void 0),[Yt,hn]=z.useState(!1),[an,Gn]=z.useState(null),[ll,Rt]=z.useState(0),Ct=z.useRef(null),un=z.useRef(null),de=(A,C="info")=>{A&&(oe({message:A,kind:C}),un.current&&clearTimeout(un.current),un.current=setTimeout(()=>oe(null),C==="error"?1e4:3500))},er=()=>{un.current&&clearTimeout(un.current),oe(null)},Nn=()=>{var C;le.current&&(clearTimeout(le.current),le.current=null),(C=P.current)==null||C.abort(),P.current=new AbortController;const A=++_.current;return ae(!0),ie(!1),A},yt=A=>A===_.current,mn=A=>{yt(A)&&ae(!1)},pn=z.useRef(null);z.useEffect(()=>{if(!y.trim()){N("");return}const A=window.setTimeout(()=>N(y),U4);return()=>window.clearTimeout(A)},[y]);const st=z.useMemo(()=>re.trim()===""?S:S.filter(A=>bk(A.rel_path,re)),[S,re]),on=y.trim()&&S.length{const A=pn.current,C=A?st.findIndex(W=>W.path===A):-1;if(C>=0){se(W=>C!==W?C:W);return}se(W=>Math.min(W,Math.max(0,st.length-1)))},[st]);const Qn=async(A,C=B)=>{var Se;const W=await Zf({offset:0,limit:Jf,sort_by:C==null?void 0:C.column,sort_dir:C==null?void 0:C.direction,signal:(Se=P.current)==null?void 0:Se.signal});return yt(A)?(T(W.items),D(W.count),I(!0),!0):!1},gt=async(A,C)=>{var W;return!yt(A)||(await Ex(C,(W=P.current)==null?void 0:W.signal),!yt(A)||!await Qn(A))?!1:(pn.current=null,se(0),!0)},gs=async()=>{if(J||S.length>=L)return;const A=_.current;ie(!0);try{const C=await Zf({offset:S.length,limit:Jf,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction});if(!yt(A))return;const W=new Set(S.map(Se=>Se.path||Se.filename));T(Se=>[...Se,...C.items.filter(Ze=>!W.has(Ze.path||Ze.filename))]),D(C.count)}catch{de("Couldn't load more results — scroll to try again.","error")}finally{yt(A)&&ie(!1)}},ou=async()=>{if(he)return;Ee(!0),de("Reloading configuration...");const A=Nn();try{const C=await kx();u(C);const W=await c2();d(W),r(zx(W.theme));const Se=W.active_directory||f,Ze=W.extensions[0]??"",Ye=W.filters[0]??"";Se&&m(Se),x(Ze),g(Ye),v(W.recursive_search),W.reloaded===!1?de(`Config file not found: ${W.config_path||"(unknown path)"} — kept current configuration.`,"error"):de("Configuration reloaded."),Se&&await gt(A,{directory:Se,extension:Ze,filter_text:Ye,recursive:W.recursive_search})}catch(C){de(`Failed to reload configuration: ${C.message}`,"error")}finally{Ee(!1),mn(A)}},ta=async A=>{const C=Nn();d(A),r(zx(A.theme));const W=A.active_directory||f||(A.directories[0]??""),Se=A.extensions[0]??"",Ze=A.filters[0]??"";if(W&&m(W),x(Se),g(Ze),v(A.recursive_search),A.session_trial||de(A.config_exists?`Loaded config: ${A.config_path}`:"Starter configuration created."),W)try{await gt(C,{directory:W,extension:Se,filter_text:Ze,recursive:A.recursive_search})}catch(Ye){de(`Scan failed after config load: ${Ye.message}`,"error")}finally{mn(C)}else mn(C)},[tr,nr]=z.useState(!1),Ll=z.useRef(Po()),On=A=>{Ll.current=A,nr(A.overlayVisible)},Ul=z.useRef(()=>{}),bi=async A=>{try{const C=await A.text(),W=await s2(A.name,C);await ta(W),de(`Session config applied: ${A.name}`)}catch(C){de(C.message||"Failed to apply dropped configuration","error")}};Ul.current=A=>{bi(A)};const lr=z.useRef(0),su=z.useRef(async()=>{});z.useEffect(()=>{su.current=async()=>{const A=await Sx();await ta(A)}}),z.useEffect(()=>{const A=async()=>{let W=[];try{W=(await r2(lr.current)).events}catch{return}for(const Se of W){if(lr.current=Math.max(lr.current,Se.id),Se.config_applied)try{await su.current()}catch{}de(Se.message)}},C=setInterval(()=>void A(),B4);return()=>clearInterval(C)},[]),z.useEffect(()=>{const A=Ye=>{var Gt;return Array.from(((Gt=Ye.dataTransfer)==null?void 0:Gt.types)??[]).includes("Files")},C=Ye=>{On(Ax(Ll.current,"enter",A(Ye)))},W=Ye=>{A(Ye)&&Ye.preventDefault()},Se=Ye=>{On(Ax(Ll.current,"leave",A(Ye)))},Ze=Ye=>{var Je;Ye.preventDefault(),On(Po());const Gt=Array.from(((Je=Ye.dataTransfer)==null?void 0:Je.files)??[]),Ce=N2(Gt);if(!Ce){Gt.length>0&&de("Not a ProFiles configuration file.","error");return}Ul.current(Ce)};return window.addEventListener("dragenter",C),window.addEventListener("dragover",W),window.addEventListener("dragleave",Se),window.addEventListener("drop",Ze),()=>{window.removeEventListener("dragenter",C),window.removeEventListener("dragover",W),window.removeEventListener("dragleave",Se),window.removeEventListener("drop",Ze)}},[]);const cu=()=>{ke(!0)},na=async A=>{const C=Nn();ke(!1),m(A),de(`Directory selected: ${A}`);let W;try{W=await Nx(A),d(W)}catch(Ye){console.error("select-directory failed:",Ye)}if(!yt(C))return;const Se=W!=null&&W.extensions.includes(p)?p:(W==null?void 0:W.extensions[0])??p,Ze=W!=null&&W.filters.includes(y)?y:(W==null?void 0:W.filters[0])??y;x(Se),g(Ze);try{await gt(C,{directory:A,extension:Se,filter_text:Ze,recursive:w})}catch(Ye){yt(C)&&de(`Scan failed: ${Ye.message}`,"error")}finally{mn(C)}},vi=async(A,C)=>{if(!yt(C))return;const W=A.theme==="auto"?"dark":A.theme==="light"?"light":"dark";r(W);try{localStorage.setItem("profiles-theme",W)}catch{}d(A);const Se=A.active_directory||(A.directories.length>0?A.directories[0]:""),Ze=A.extensions.length>0?A.extensions[0]:"",Ye=A.filters.length>0?A.filters[0]:"";if(Se&&m(Se),Ze&&x(Ze),A.recursive_search!==void 0&&v(A.recursive_search),Ye&&g(Ye),A.config_exists||Ut(!0),Se)try{await gt(C,{directory:Se,extension:Ze,filter_text:Ye,recursive:A.recursive_search})}catch(Gt){yt(C)&&de(`Initial scan failed: ${Gt.message}`,"error")}},fu=async()=>{var C;(C=P.current)==null||C.abort(),P.current=new AbortController;const A=++_.current;R(null),fe(!0);try{const W=await kx();u(W);const Se=await Sx();await vi(Se,A)}catch(W){R((W==null?void 0:W.message)||"Couldn't fetch system info or configuration.")}finally{fe(!1)}};z.useEffect(()=>{fu()},[]),z.useEffect(()=>()=>{var A;le.current&&(clearTimeout(le.current),le.current=null),(A=P.current)==null||A.abort()},[]);const wi=async A=>{const C=Nn();m(A);try{const W=await Nx(A);if(!yt(C))return;d(W);const Se=W.extensions.includes(p)?p:W.extensions[0]??"",Ze=W.filters.includes(y)?y:W.filters[0]??"";x(Se),g(Ze),await gt(C,{directory:A,extension:Se,filter_text:Ze,recursive:w})}catch(W){yt(C)&&de(`Directory change failed: ${W.message}`,"error")}finally{mn(C)}},bl=async()=>{if(!f)return;const A=Nn();try{await gt(A,{directory:f,extension:p,filter_text:y,recursive:w})}catch(C){yt(A)&&de(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{mn(A)}},vl=z.useRef(bl);z.useEffect(()=>{vl.current=bl});const la=A=>{g(A),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,vl.current()},Hy)},ia=A=>{v(A),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,vl.current()},Hy)},du=async()=>{if(g(""),!f)return;const A=Nn();try{await gt(A,{directory:f,extension:p,filter_text:"",recursive:w})}catch(C){yt(A)&&de(`Scan failed: ${(C==null?void 0:C.message)??C}`,"error")}finally{mn(A)}},hu=async()=>{if(v(!1),!f)return;const A=Nn();try{await gt(A,{directory:f,extension:p,filter_text:y,recursive:!1})}catch(C){yt(A)&&de(`Scan failed: ${C.message}`,"error")}finally{mn(A)}},tn=async(A,C)=>{if(A.has_hook){lt({file:A,args:C});return}try{await m2({directory:f,filename:A.rel_path,release:s==null?void 0:s.release,args:C}),de(`Launched ${A.filename}`)}catch(W){de(`Launch error: ${W.message}`,"error")}},Tt=()=>{st.length>0&&st[V]&&tn(st[V])},nn=A=>{var C;pn.current=((C=st[A])==null?void 0:C.path)??null,se(A)},Bl=async(A,C)=>{tn(A,C)},mu=async A=>{try{await Vy(A.path),de("Revealed in file manager.")}catch(C){de(`Error: ${C.message}`,"error")}},xs=async A=>{try{await pd(A.path),de("Folder opened in file manager.")}catch(C){de(`Error: ${C.message}`,"error")}},ys=async A=>{try{const C=await jx(A.path);de(C.message||"Terminal opened.")}catch(C){de(`Error: ${C.message}`,"error")}},pu=async A=>{try{await wi(A),de(`Scanned directory: ${A}`)}catch(C){de(`Error: ${C.message}`,"error")}},ki=A=>{g(A);const C=Nn();gt(C,{directory:f,extension:p,filter_text:A,recursive:w}).catch(W=>{yt(C)&&de(`Scan failed: ${(W==null?void 0:W.message)??W}`,"error")}).finally(()=>mn(C))},ir=A=>{x(A);const C=Nn();gt(C,{directory:f,extension:A,filter_text:y,recursive:w}).catch(W=>{yt(C)&&de(`Scan failed: ${(W==null?void 0:W.message)??W}`,"error")}).finally(()=>mn(C))},rr=async(A,C)=>{const W=C?A.path.replace(/\\/g,"/"):A.path;try{await navigator.clipboard.writeText(W),de("Path copied to clipboard.")}catch(Se){de(`Copy failed: ${(Se==null?void 0:Se.message)??Se}`,"error")}},wl=async(A,C)=>{let W=A.filename;if(C){const Se=W.lastIndexOf(".");Se!==-1&&(W=W.slice(0,Se))}try{await navigator.clipboard.writeText(W),de("Filename copied to clipboard.")}catch(Se){de(`Copy failed: ${(Se==null?void 0:Se.message)??Se}`,"error")}},Hl=async(A,C)=>{try{de(`Computing ${C.toUpperCase()}...`);const W=await Cx(A.path,C);await navigator.clipboard.writeText(W.hash),de(`${C.toUpperCase()} hash copied: ${W.hash.slice(0,12)}...`)}catch(W){de(`Hash computation failed: ${W.message}`,"error")}},Si=async A=>{try{const C=new URL("file:///").href+A.path.replace(/\\/g,"/");await navigator.clipboard.writeText(C),de("File URI copied to clipboard.")}catch(C){de(`URI copy failed: ${C.message}`,"error")}},ql=async(A,C)=>{try{const W=await navigator.clipboard.readText();if(!W.trim()){de("Clipboard is empty — copy a hash first, then try again.");return}de(`Computing ${C.toUpperCase()}...`);const Ze=(await Cx(A.path,C)).hash.toLowerCase()===W.trim().toLowerCase();de(Ze?`✅ ${C.toUpperCase()} matches!`:`❌ ${C.toUpperCase()} mismatch`)}catch(W){de(`Verification failed: ${W.message}`,"error")}},Nt=A=>{Sn(A),kt(!0)},gu=A=>{Ke(A)},xu=async()=>{const A=tt;if(Ke(null),!!A)try{if(de("Deleting file..."),!(await fetch("/api/actions/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:A.path})})).ok)throw new Error("Failed to delete file");de("File deleted successfully."),bl()}catch(C){de(`Delete failed: ${C.message}`,"error")}},yu=A=>{jt(A.path),St(!0)},il=async()=>{if(f)try{await pd(f),de("Directory opened in file manager.")}catch(A){de(`Error: ${A.message}`,"error")}},Fl=async A=>{if(A)try{await jx(A),de("Terminal opened in directory.")}catch(C){de(`Error: ${C.message}`,"error")}},bu=async()=>{try{await wi("~"),de("Directory set to home folder.")}catch(A){de(`Error: ${A.message}`,"error")}},vu=async()=>{if(f)try{const A=await h2(f);A.parent_path?(await wi(A.parent_path),de("Moved to parent directory.")):de("Already at root directory.")}catch(A){de(`Error: ${A.message}`,"error")}},wu=async()=>{if(S.length===0){de("No files to export.");return}try{const A=L4(S,(s==null?void 0:s.column_names)||[],s??void 0,y),C=`profiles-export-${new Date().toISOString().slice(0,19).replace(/[:.]/g,"-")}.csv`,W=await x2(A,C);de(`Exported ${S.length} loaded row${S.length===1?"":"s"}${y?` matching "${y}"`:""} — ${W.message}`)}catch(A){de(`Export failed: ${A.message}`,"error")}},bs=async A=>{var Ce,Je;hn(!1),de("Barcode detected!");const W=Uy(A).values,Se=W.dir!==void 0?W.dir:f,Ze=W.ext!==void 0?W.ext:p,Ye=W.filter!==void 0?W.filter:y,Gt=W.recursive!==void 0?W.recursive:w;if(W.dir!==void 0&&m(W.dir),W.ext!==void 0&&x(W.ext),W.filter!==void 0&&g(W.filter),W.recursive!==void 0&&v(W.recursive),Se){const rt=Nn();try{await Ex({directory:Se,extension:Ze,filter_text:Ye,recursive:Gt},(Ce=P.current)==null?void 0:Ce.signal);const Xn=await Zf({offset:0,limit:Jf,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction,signal:(Je=P.current)==null?void 0:Je.signal});if(!yt(rt))return;T(Xn.items),D(Xn.count),I(!0),pn.current=null,se(0),Xn.count===1&&Xn.items.length===1&&Gn(Xn.items[0])}catch(Xn){yt(rt)&&de(`Scan error: ${Xn.message}`,"error")}finally{mn(rt)}}},$e=()=>{ue(A=>{const C=!A;return C?(be.current="",de("Barcode mode ON — scan a barcode now.")):(be.current="",de("Barcode mode OFF.")),C})},ku=A=>{A.filter!==void 0&&g(A.filter),A.ext!==void 0&&x(A.ext),A.recursive!==void 0&&v(A.recursive),A.dir!==void 0&&m(A.dir),(A.scan===!0||A.filter!==void 0||A.ext!==void 0||A.recursive!==void 0||A.dir!==void 0)&&(ue(!1),be.current="",setTimeout(()=>{vl.current()},50))};z.useEffect(()=>{if(!Z)return;const A=C=>{const W=C.target;if(!(W instanceof HTMLElement&&(W.isContentEditable||W instanceof HTMLInputElement||W instanceof HTMLTextAreaElement||W instanceof HTMLSelectElement)))if(C.key==="Enter"){const Ze=be.current;if(!Ze){be.current="";return}C.preventDefault(),be.current="";const Ye=Uy(Ze);if(Ye.isPlainFilter)de(`Barcode filter: ${Ye.values.filter}`),g(Ye.values.filter||""),ue(!1),setTimeout(()=>void vl.current(),50);else{const Gt=Ye.values,Ce=Object.entries(Gt).map(([Je,rt])=>`${Je}=${rt}`).join(", ");de(`Barcode applied: ${Ce}`),ku(Gt)}}else C.key==="Escape"?(ue(!1),be.current="",de("Barcode mode cancelled.")):C.key.length===1&&!C.ctrlKey&&!C.metaKey&&!C.altKey&&(be.current+=C.key)};return document.addEventListener("keydown",A,!0),()=>document.removeEventListener("keydown",A,!0)},[Z]),z.useEffect(()=>(ll>0&&(Ct.current=setInterval(()=>{vl.current()},ll*1e3)),()=>{Ct.current&&(clearInterval(Ct.current),Ct.current=null)}),[ll]);const ar=A=>{Rt(A),A>0?de(`Auto-rescan every ${A}s.`):de("Auto-rescan disabled.")},Ni=!!(He||M||pe||Ot||Vt||en||ge||Ae||Yt||an||Me||tt);return z.useEffect(()=>{const A=C=>{var Se,Ze,Ye,Gt;if(C.key==="Escape"){Ve(null),E(!1),Bt(!1),Re(!1),On(Po());return}if(Ni)return;if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),(Se=document.querySelector("[data-testid='file-list']"))==null||Se.focus();return}const W=C.target;if(!(W instanceof HTMLElement&&W.closest("button, a, [role='menuitem'], [role='option'], [role='columnheader'], [role='separator']"))){if(W instanceof HTMLInputElement||W instanceof HTMLSelectElement){C.key==="Enter"&&bl();return}if(C.key==="ContextMenu"||C.shiftKey&&C.key==="F10"){const Ce=st[V];if(!Ce)return;C.preventDefault();const Je=document.querySelector(`[data-row-index="${V}"]`),rt=Je==null?void 0:Je.getBoundingClientRect();Ve({x:rt?rt.left+24:24,y:rt?rt.top+rt.height/2:24,file:Ce});return}if(C.key==="F5"){C.preventDefault(),bl();return}if(C.ctrlKey&&C.key.toLowerCase()==="r"){C.preventDefault(),ou();return}if(C.ctrlKey&&C.key.toLowerCase()==="d"){C.preventDefault(),(Ze=document.querySelector("#directory-combobox"))==null||Ze.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="e"){C.preventDefault(),(Ye=document.querySelector("#extension-combobox"))==null||Ye.focus();return}if(C.ctrlKey&&C.key.toLowerCase()==="f"){C.preventDefault(),(Gt=document.querySelector("#filter-combobox"))==null||Gt.focus();return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="l"){C.preventDefault(),Bt(Ce=>!Ce);return}if(C.ctrlKey&&C.key===","){C.preventDefault(),Tx().then(Ce=>de(Ce.message));return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),r(Ce=>Ce==="dark"?"light":"dark");return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),ue(Ce=>!Ce);return}if(C.ctrlKey&&C.shiftKey&&C.key.toLowerCase()==="b"){C.preventDefault(),hn(Ce=>!Ce);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="t"){C.preventDefault(),Re(!0);return}if(C.ctrlKey&&!C.shiftKey&&C.key.toLowerCase()==="h"){C.preventDefault(),bu();return}if(C.key==="?"||C.ctrlKey&&C.key==="/"){C.preventDefault(),E(Ce=>!Ce);return}if(C.key.toLowerCase()==="p"&&!C.ctrlKey&&!C.shiftKey&&!C.altKey){const Ce=st[V];Ce&&(C.preventDefault(),Nt(Ce));return}C.key==="ArrowDown"?(C.preventDefault(),se(Ce=>{var rt;const Je=Math.min(Ce+1,Math.max(0,st.length-1));return pn.current=((rt=st[Je])==null?void 0:rt.path)??null,Je})):C.key==="ArrowUp"?(C.preventDefault(),se(Ce=>{var rt;const Je=Math.max(Ce-1,0);return pn.current=((rt=st[Je])==null?void 0:rt.path)??null,Je})):C.key==="Home"?(C.preventDefault(),se(Ce=>{var Je;return pn.current=((Je=st[0])==null?void 0:Je.path)??null,Ce===0?Ce:0})):C.key==="End"?(C.preventDefault(),se(Ce=>{var rt;const Je=Math.max(0,st.length-1);return pn.current=((rt=st[Je])==null?void 0:rt.path)??null,Ce===Je?Ce:Je})):C.key==="PageUp"?(C.preventDefault(),se(Ce=>{var rt;const Je=Math.max(Ce-qy,0);return pn.current=((rt=st[Je])==null?void 0:rt.path)??null,Je})):C.key==="PageDown"?(C.preventDefault(),se(Ce=>{var rt;const Je=Math.min(Ce+qy,Math.max(0,st.length-1));return pn.current=((rt=st[Je])==null?void 0:rt.path)??null,Je})):C.key==="Enter"&&(C.preventDefault(),Tt())}};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[Ni,st,V,f,p,y,w,Z]),z.useEffect(()=>{document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("profiles-theme",n)}catch{}},[n]),h.jsxs("div",{className:"flex h-dvh flex-col bg-elevated/30 p-1 font-sans text-ink transition-colors duration-200 sm:p-1.5",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-frame-line bg-app shadow-[0_2px_6px_rgb(0_0_0/0.35)] transition-colors duration-200 sm:rounded-xl",children:[h.jsx(dk,{title:(s==null?void 0:s.title)||"",release:(s==null?void 0:s.release)||"",directories:(s==null?void 0:s.directories)||[],activeDirectory:f,onDirectoryChange:wi,onBrowseDirectory:cu,onGoToParentDirectory:vu,onGoToHomeDirectory:bu,onOpenActiveDirectory:il,onOpenTerminal:Fl}),h.jsx(wk,{extensions:(s==null?void 0:s.extensions)||[],activeExtension:p,onExtensionChange:x,filterOptions:(s==null?void 0:s.filters)||[],filterText:y,onFilterTextChange:la,recursive:w,onRecursiveChange:ia,onScan:bl,scanning:we,barcodeMode:Z,onBarcodeToggle:$e,onCameraBarcodeClick:()=>hn(!0),autoRescanActive:ll>0,onTimerClick:()=>Re(!0)}),U?h.jsx(hk,{message:U,onRetry:()=>void fu(),retrying:Q}):h.jsx(fk,{files:st,totalCount:L,rawLoadedCount:S.length,onLoadMore:gs,loadingMore:J,scanning:we,hasScanned:$,activeDirectory:f,recursive:w,onDisableRecursive:hu,onOpenDirectory:il,onOpenConfig:()=>Ut(!0),filterText:y,onClearFilter:du,columnHeaders:(s==null?void 0:s.column_headers)||[],columnNames:(s==null?void 0:s.column_names)||[],selectedIndex:V,onSelectIndex:nn,prefilterNote:on,onLaunch:tn,onContextMenu:(A,C,W)=>{A.preventDefault(),pn.current=C.path,se(W),Ve({x:A.clientX,y:A.clientY,file:C})},rowColors:(s==null?void 0:s.row_colors)||[],sort:B,onSortChange:A=>{ne(A),pn.current=null,se(0);const C=Nn();Qn(C,A).catch(W=>{yt(C)&&de(`Sort failed: ${W.message}`,"error")}).finally(()=>mn(C))}}),h.jsx(tk,{onExecute:Tt,scanning:we,scanningDirectory:f,hasSelection:st.length>0,fileCount:st.length,totalCount:L,toastMessage:Y,onToastDismiss:er}),h.jsx(Vk,{systemInfo:a,fileCount:L,theme:n,onToggleTheme:()=>r(A=>A==="dark"?"light":"dark"),onOpenLog:()=>Bt(!0),onOpenConfig:async()=>{try{const A=await Tx();de(A.message)}catch(A){de(`Failed to open config: ${A.message}`,"error")}},onLoadConfig:()=>Ut(!0),onShowShortcuts:()=>E(!0),onReloadConfig:ou,onExport:wu,exportDisabled:S.length===0||we,language:ye,onLanguageChange:_e,activeConfigName:s!=null&&s.config_path?s.config_path.split(/[\\/]/).pop()||s.config_path:void 0})]}),h.jsx(Ck,{isOpen:Ot,activeConfigPath:s==null?void 0:s.config_path,configExists:s==null?void 0:s.config_exists,onClose:()=>Ut(!1),onLoaded:ta}),h.jsx(sk,{visible:tr,onFileSelected:A=>Ul.current(A)}),h.jsx(ok,{isOpen:pe,initialPath:f,onClose:()=>ke(!1),onSelect:na}),h.jsx(nk,{position:He,onClose:()=>Ve(null),onLaunch:tn,onLaunchWithArgs:Bl,onReveal:mu,onOpenFolder:xs,onOpenTerminal:ys,onScanDirectory:pu,onFilterFolder:ki,onFilterExtension:ir,onCopyPath:rr,onCopyFilename:wl,onCopyUri:Si,onComputeHash:Hl,onVerifyHash:ql,onProperties:Nt,onClearFile:gu,onGenerateBarcode:yu,showToast:de}),h.jsx(jk,{isOpen:M,onClose:()=>E(!1)}),h.jsx(Dk,{isOpen:Vt,file:Wt,onLaunch:tn,onClose:()=>{kt(!1),Sn(null)}}),h.jsx(Gk,{isOpen:ge,currentInterval:ll,onClose:()=>Re(!1),onSetInterval:ar}),h.jsx(Ek,{isOpen:en,onClose:()=>Bt(!1),onOpenExternally:()=>{a2().then(A=>de(A.message))}}),h.jsx(D4,{isOpen:!!Me,onClose:()=>lt(null),directory:f,filename:(Me==null?void 0:Me.file.rel_path)||"",release:s==null?void 0:s.release,args:Me==null?void 0:Me.args,onFinished:(A,C)=>{A==="completed"?de(C||"Workflow launched successfully."):(A==="aborted"||A==="failed")&&de(`Workflow stopped: ${C}`,"error")}}),h.jsx(t0,{isOpen:Ae,onClose:()=>{St(!1),jt(void 0)},initialFilePath:it}),h.jsx(qk,{isOpen:Yt,onClose:()=>hn(!1),onDetected:bs}),h.jsx(M4,{isOpen:!!tt,title:"Delete file",message:`Delete this file? - -${(tt==null?void 0:tt.path)??""} - -This action cannot be undone.`,confirmLabel:"Delete",danger:!0,onConfirm:xu,onCancel:()=>Ke(null)}),h.jsx(Fk,{isOpen:!!an,file:an,onConfirm:()=>{if(an){const A=an;Gn(null),tn(A)}},onDismiss:()=>Gn(null)})]})}class q4 extends z.Component{constructor(){super(...arguments);Vf(this,"state",{error:null})}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,u){console.error("Application render error:",a,u.componentStack)}render(){return this.state.error?h.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app p-6 text-ink",children:h.jsxs("section",{className:"w-full max-w-lg rounded-lg border border-line bg-surface p-6",children:[h.jsx("h1",{className:"text-base font-semibold",children:"ProFiles encountered an error"}),h.jsx("p",{className:"mt-2 text-sm text-ink-secondary",children:"The interface could not continue. Reload the application to try again."}),h.jsxs("details",{className:"mt-4 text-xs text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer",children:"Error details"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:this.state.error.message})]}),h.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"btn btn-primary mt-5 px-4 py-2 text-sm font-semibold",children:"Reload application"})]})}):this.props.children}}l2.createRoot(document.getElementById("root")).render(h.jsx($v.StrictMode,{children:h.jsx(q4,{children:h.jsx(H4,{})})})); diff --git a/src/profiles/web/dist/assets/index-C-z6GSZn.js b/src/profiles/web/dist/assets/index-C-z6GSZn.js new file mode 100644 index 0000000..fb4db06 --- /dev/null +++ b/src/profiles/web/dist/assets/index-C-z6GSZn.js @@ -0,0 +1,391 @@ +var Xv=Object.defineProperty;var Iv=(n,r,a)=>r in n?Xv(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Qf=(n,r,a)=>Iv(n,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const d of s)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const d={};return s.integrity&&(d.integrity=s.integrity),s.referrerPolicy&&(d.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?d.credentials="include":s.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(s){if(s.ep)return;s.ep=!0;const d=a(s);fetch(s.href,d)}})();function Hd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xf={exports:{}},$a={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hx;function Kv(){if(hx)return $a;hx=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(u,s,d){var f=null;if(d!==void 0&&(f=""+d),s.key!==void 0&&(f=""+s.key),"key"in s){d={};for(var m in s)m!=="key"&&(d[m]=s[m])}else d=s;return s=d.ref,{$$typeof:n,type:u,key:f,ref:s!==void 0?s:null,props:d}}return $a.Fragment=r,$a.jsx=a,$a.jsxs=a,$a}var mx;function Zv(){return mx||(mx=1,Xf.exports=Kv()),Xf.exports}var h=Zv(),If={exports:{}},ze={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var px;function $v(){if(px)return ze;px=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,z={};function $(E,Y,oe){this.props=E,this.context=Y,this.refs=z,this.updater=oe||C}$.prototype.isReactComponent={},$.prototype.setState=function(E,Y){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,Y,"setState")},$.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function I(){}I.prototype=$.prototype;function J(E,Y,oe){this.props=E,this.context=Y,this.refs=z,this.updater=oe||C}var ie=J.prototype=new I;ie.constructor=J,L(ie,$.prototype),ie.isPureReactComponent=!0;var U=Array.isArray;function R(){}var Q={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function B(E,Y,oe){var de=oe.ref;return{$$typeof:n,type:E,key:Y,ref:de!==void 0?de:null,props:oe}}function ne(E,Y){return B(E.type,Y,E.props)}function V(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function se(E){var Y={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(oe){return Y[oe]})}var ve=/\/+/g;function ae(E,Y){return typeof E=="object"&&E!==null&&E.key!=null?se(""+E.key):Y.toString(36)}function A(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(R,R):(E.status="pending",E.then(function(Y){E.status==="pending"&&(E.status="fulfilled",E.value=Y)},function(Y){E.status==="pending"&&(E.status="rejected",E.reason=Y)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function W(E,Y,oe,de,je){var ye=typeof E;(ye==="undefined"||ye==="boolean")&&(E=null);var _e=!1;if(E===null)_e=!0;else switch(ye){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(E.$$typeof){case n:case r:_e=!0;break;case y:return _e=E._init,W(_e(E._payload),Y,oe,de,je)}}if(_e)return je=je(E),_e=de===""?"."+ae(E,0):de,U(je)?(oe="",_e!=null&&(oe=_e.replace(ve,"$&/")+"/"),W(je,Y,oe,"",function(Rt){return Rt})):je!=null&&(V(je)&&(je=ne(je,oe+(je.key==null||E&&E.key===je.key?"":(""+je.key).replace(ve,"$&/")+"/")+_e)),Y.push(je)),1;_e=0;var pe=de===""?".":de+":";if(U(E))for(var Se=0;Se>>1,N=A[re];if(0>>1;res(M,le))Es(Y,M)?(A[re]=Y,A[E]=le,re=E):(A[re]=M,A[Ge]=le,re=Ge);else if(Es(Y,le))A[re]=Y,A[E]=le,re=E;else break e}}return W}function s(A,W){var le=A.sortIndex-W.sortIndex;return le!==0?le:A.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],x=[],y=1,g=null,w=3,v=!1,S=!1,C=!1,L=!1,z=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function J(A){for(var W=a(x);W!==null;){if(W.callback===null)u(x);else if(W.startTime<=A)u(x),W.sortIndex=W.expirationTime,r(p,W);else break;W=a(x)}}function ie(A){if(C=!1,J(A),!S)if(a(p)!==null)S=!0,U||(U=!0,V());else{var W=a(x);W!==null&&ae(ie,W.startTime-A)}}var U=!1,R=-1,Q=5,fe=-1;function B(){return L?!0:!(n.unstable_now()-feA&&B());){var re=g.callback;if(typeof re=="function"){g.callback=null,w=g.priorityLevel;var N=re(g.expirationTime<=A);if(A=n.unstable_now(),typeof N=="function"){g.callback=N,J(A),W=!0;break t}g===a(p)&&u(p),J(A)}else u(p);g=a(p)}if(g!==null)W=!0;else{var qe=a(x);qe!==null&&ae(ie,qe.startTime-A),W=!1}}break e}finally{g=null,w=le,v=!1}W=void 0}}finally{W?V():U=!1}}}var V;if(typeof I=="function")V=function(){I(ne)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,ve=se.port2;se.port1.onmessage=ne,V=function(){ve.postMessage(null)}}else V=function(){z(ne,0)};function ae(A,W){R=z(function(){A(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125re?(A.sortIndex=le,r(x,A),a(p)===null&&A===a(x)&&(C?($(R),R=-1):C=!0,ae(ie,le-re))):(A.sortIndex=N,r(p,A),S||v||(S=!0,U||(U=!0,V()))),A},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(A){var W=w;return function(){var le=w;w=W;try{return A.apply(this,arguments)}finally{w=le}}}})($f)),$f}var yx;function Wv(){return yx||(yx=1,Zf.exports=Pv()),Zf.exports}var Jf={exports:{}},Jt={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bx;function e2(){if(bx)return Jt;bx=1;var n=qd();function r(y){var g="https://react.dev/errors/"+y;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Jf.exports=e2(),Jf.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var wx;function t2(){if(wx)return Ja;wx=1;var n=Wv(),r=qd(),a=Vy();function u(e){var t="https://react.dev/errors/"+e;if(1Gt||(e.current=Bt[Gt],Bt[Gt]=null,Gt--)}function Je(e,t){Gt++,Bt[Gt]=e.current,e.current=t}var en=St(null),bn=St(null),tn=St(null),Ht=St(null);function ge(e,t){switch(Je(tn,t),Je(bn,e),Je(en,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kg(t),e=Sg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}nt(en),Je(en,e)}function Me(){nt(en),nt(bn),nt(tn)}function Le(e){var t=e.memoizedState;t!==null&&(Gr._currentValue=t.memoizedState,Je(Ht,e)),t=en.current;var l=Sg(t,e.type);t!==l&&(Je(bn,e),Je(en,l))}function lt(e){bn.current===e&&(nt(en),nt(bn)),Ht.current===e&&(nt(Ht),Gr._currentValue=Rt)}var K,ue;function ke(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",ue=-1)":-1o||j[i]!==F[o]){var Z=` +`+j[i].replace(" at new "," at ");return e.displayName&&Z.includes("")&&(Z=Z.replace("",e.displayName)),Z}while(1<=i&&0<=o);break}}}finally{Ce=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ke(l):""}function it(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke("Lazy");case 13:return e.child!==t&&t!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return ft(e.type,!1);case 11:return ft(e.type.render,!1);case 1:return ft(e.type,!0);case 31:return ke("Activity");case 30:return ke("ViewTransition");default:return""}}function Tt(e){try{var t="",l=null;do t+=it(e,l),l=e,e=e.return;while(e);return t}catch(i){return` +Error generating stack: `+i.message+` +`+i.stack}}var nn=Object.prototype.hasOwnProperty,zn=n.unstable_scheduleCallback,Dn=n.unstable_cancelCallback,Mn=n.unstable_shouldYield,ll=n.unstable_requestPaint,Nt=n.unstable_now,Et=n.unstable_getCurrentPriorityLevel,Gn=n.unstable_ImmediatePriority,Qt=n.unstable_UserBlockingPriority,il=n.unstable_NormalPriority,he=n.unstable_LowPriority,fu=n.unstable_IdlePriority,xs=n.log,vn=n.unstable_setDisableYieldValue,pt=null,gt=null;function jt(e){if(typeof xs=="function"&&vn(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(pt,e)}catch{}}var Ke=Math.clz32?Math.clz32:On,ys=Math.log,du=Math.LN2;function On(e){return e>>>=0,e===0?32:31-(ys(e)/du|0)|0}var lr=256,Si=262144,ql=4194304;function wl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ir(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,c=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var k=i&134217727;return k!==0?(i=k&~c,i!==0?o=wl(i):(b&=k,b!==0?o=wl(b):l||(l=k&~e,l!==0&&(o=wl(l))))):(k=i&~c,k!==0?o=wl(k):b!==0?o=wl(b):l||(l=i&~e,l!==0&&(o=wl(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function kl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ni(e,t){(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0l;l++)t.push(e);return t}function Fl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bs(e,t,l,i,o,c){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var k=e.entanglements,j=e.expirationTimes,F=e.hiddenUpdates;for(l=b&~l;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cs=!1;if(jl)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Cs=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Cs=!1}var Xl=null,Ts=null,Nu=null;function yh(){if(Nu)return Nu;var e,t=Ts,l=t.length,i,o="value"in Xl?Xl.value:Xl.textContent,c=o.length;for(e=0;e=da),Nh=" ",Eh=!1;function jh(e,t){switch(e){case"keyup":return Y0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function Q0(e,t){switch(e){case"compositionend":return Ch(t);case"keypress":return t.which!==32?null:(Eh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Eh?null:e;default:return null}}function X0(e,t){if(dr)return e==="compositionend"||!Ms&&jh(e,t)?(e=yh(),Nu=Ts=Xl=null,dr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lh(e,t){var l=Rh(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Rh(l)}}function Uh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ls(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ls(e.document)}return t}function Us(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var e1=jl&&"documentMode"in document&&11>=document.documentMode,hr=null,Bs=null,ga=null,Hs=!1;function Hh(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Hs||hr==null||hr!==Ls(i)||(i=hr,"selectionStart"in i&&Us(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ga&&pa(ga,i)||(ga=i,i=Ao(Bs,"onSelect"),0>=b,o-=b,ol=1<<32-Ke(t)+o|l<Ae?(Mt=Ne,Ne=null):Mt=Ne.sibling;var We=H(q,Ne,G[Ae],ee);if(We===null){Ne===null&&(Ne=Mt);break}e&&Ne&&We.alternate===null&&t(q,Ne),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We,Ne=Mt}if(Ae===G.length)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;AeAe?(Mt=Ne,Ne=null):Mt=Ne.sibling;var xi=H(q,Ne,We.value,ee);if(xi===null){Ne===null&&(Ne=Mt);break}e&&Ne&&xi.alternate===null&&t(q,Ne),O=c(xi,O,Ae),$e===null?xe=xi:$e.sibling=xi,$e=xi,Ne=Mt}if(We.done)return l(q,Ne),Fe&&Al(q,Ae),xe;if(Ne===null){for(;!We.done;Ae++,We=G.next())We=te(q,We.value,ee),We!==null&&(O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return Fe&&Al(q,Ae),xe}for(Ne=i(Ne);!We.done;Ae++,We=G.next())We=X(Ne,q,Ae,We.value,ee),We!==null&&(e&&(Mt=We.alternate,Mt!==null&&Ne.delete(Mt.key===null?Ae:Mt.key)),O=c(We,O,Ae),$e===null?xe=We:$e.sibling=We,$e=We);return e&&Ne.forEach(function(Qv){return t(q,Qv)}),Fe&&Al(q,Ae),xe}function Be(q,O,G,ee){if(typeof G=="object"&&G!==null&&G.type===ne&&G.key===null&&G.props.ref===void 0&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case fe:e:{for(var xe=G.key;O!==null;){if(O.key===xe){if(xe=G.type,xe===ne){if(O.tag===7){l(q,O.sibling),ee=o(O,G.props.children),Pl(ee,G),ee.return=q,q=ee;break e}}else if(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===N&&Bi(xe)===O.type){l(q,O.sibling),ee=o(O,G.props),Pl(ee,G),ee.return=q,q=ee;break e}l(q,O);break}else t(q,O);O=O.sibling}G.type===ne?(ee=zi(G.props.children,q.mode,ee,G.key),Pl(ee,G),ee.return=q,q=ee):(ee=Ou(G.type,G.key,G.props,null,q.mode,ee),Pl(ee,G),ee.return=q,q=ee)}return b(q);case B:e:{for(xe=G.key;O!==null;){if(O.key===xe)if(O.tag===4&&O.stateNode.containerInfo===G.containerInfo&&O.stateNode.implementation===G.implementation){l(q,O.sibling),ee=o(O,G.children||[]),ee.return=q,q=ee;break e}else{l(q,O);break}else t(q,O);O=O.sibling}ee=Xs(G,q.mode,ee),ee.return=q,q=ee}return b(q);case N:return G=Bi(G),Be(q,O,G,ee)}if(_e(G))return me(q,O,G,ee);if(de(G)){if(xe=de(G),typeof xe!="function")throw Error(u(150));return G=xe.call(G),be(q,O,G,ee)}if(typeof G.then=="function")return Be(q,O,Gu(G),ee);if(G.$$typeof===ae)return Be(q,O,qu(q,G),ee);Qu(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,O!==null&&O.tag===6?(l(q,O.sibling),ee=o(O,G),ee.return=q,q=ee):(l(q,O),ee=Qs(G,q.mode,ee),ee.return=q,q=ee),b(q)):l(q,O)}return function(q,O,G,ee){try{ka=0;var xe=Be(q,O,G,ee);return kr=null,xe}catch(Ne){if(Ne===wr||Ne===Vu)throw Ne;var $e=dn(29,Ne,null,q.mode);return $e.lanes=ee,$e.return=q,$e}finally{}}}var qi=sm(!0),cm=sm(!1),Wl=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ei(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ti(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var o=i.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),i.pending=t,t=Mu(e),Ih(e,null,l),t}return Du(e,i,t,l),Mu(e)}function Sa(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}function ic(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=b:c=c.next=b,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:i.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var rc=!1;function Na(){if(rc){var e=vr;if(e!==null)throw e}}function Ea(e,t,l,i){rc=!1;var o=e.updateQueue;Wl=!1;var c=o.firstBaseUpdate,b=o.lastBaseUpdate,k=o.shared.pending;if(k!==null){o.shared.pending=null;var j=k,F=j.next;j.next=null,b===null?c=F:b.next=F,b=j;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,k=Z.lastBaseUpdate,k!==b&&(k===null?Z.firstBaseUpdate=F:k.next=F,Z.lastBaseUpdate=j))}if(c!==null){var te=o.baseState;b=0,Z=F=j=null,k=c;do{var H=k.lane&-536870913,X=H!==k.lane;if(X?(Ze&H)===H:(i&H)===H){H!==0&&H===Li&&(rc=!0),Z!==null&&(Z=Z.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var me=e,be=k;H=t;var Be=l;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){te=me.call(Be,te,H);break e}te=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,H=typeof me=="function"?me.call(Be,te,H):me,H==null)break e;te=R({},te,H);break e;case 2:Wl=!0}}H=k.callback,H!==null&&(e.flags|=64,X&&(e.flags|=8192),X=o.callbacks,X===null?o.callbacks=[H]:X.push(H))}else X={lane:H,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Z===null?(F=Z=X,j=te):Z=Z.next=X,b|=H;if(k=k.next,k===null){if(k=o.shared.pending,k===null)break;X=k,k=X.next,X.next=null,o.lastBaseUpdate=X,o.shared.pending=null}}while(!0);Z===null&&(j=te),o.baseState=j,o.firstBaseUpdate=F,o.lastBaseUpdate=Z,c===null&&(o.shared.lanes=0),oi|=b,e.lanes=b,e.memoizedState=te}}function fm(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function dm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ec?c:8;var b=pe.T,k={};k.types=b!==null?b.types:null,pe.T=k,Ec(e,!1,t,l);try{var j=o(),F=pe.S;if(F!==null&&F(k,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var Z=f1(j,i);_a(e,t,Z,Cn(e))}else _a(e,t,i,Cn(e))}catch(te){_a(e,t,{then:function(){},status:"rejected",reason:te},Cn())}finally{Se.p=c,b!==null&&k.types!==null&&(b.types=k.types),pe.T=b}}function x1(){}function Sc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var o=Gm(e).queue;Ym(e,o,t,Rt,l===null?x1:function(){return Qm(e),l(i)})}function Gm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Rt,baseState:Rt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:Rt},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ol,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qm(e){var t=Gm(e);t.next===null&&(t=e.alternate.memoizedState),_a(e,t.next.queue,{},Cn())}function Nc(){return Xt(Gr)}function Xm(){return Ct().memoizedState}function Im(){return Ct().memoizedState}function y1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Cn();e=ei(l);var i=ti(t,e,l);i!==null&&(gn(i,t,l),Sa(i,t,l)),t={cache:Ps()},e.payload=t;return}t=t.return}}function b1(e,t,l){var i=Cn();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},to(e)?Zm(t,l):(l=Ys(e,t,l,i),l!==null&&(gn(l,e,i),$m(l,t,i)))}function Km(e,t,l){var i=Cn();_a(e,t,l,i)}function _a(e,t,l,i){var o={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(to(e))Zm(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var b=t.lastRenderedState,k=c(b,l);if(o.hasEagerState=!0,o.eagerState=k,kn(k,b))return Du(e,t,o,0),dt===null&&zu(),!1}catch{}finally{}if(l=Ys(e,t,o,i),l!==null)return gn(l,e,i),$m(l,t,i),!0}return!1}function Ec(e,t,l,i){if(i={lane:2,revertLane:gf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},to(e)){if(t)throw Error(u(479))}else t=Ys(e,l,i,2),t!==null&&gn(t,e,2)}function to(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Zm(e,t){Sr=Ku=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function $m(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,pu(e,l)}}var no={readContext:Xt,use:Ju,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},Jm={readContext:Xt,use:Ju,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Om,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Wu(4194308,4,Bm.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var l=sn();t=t===void 0?null:t;var i=e();if(Fi){jt(!0);try{e()}finally{jt(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=sn();if(l!==void 0){var o=l(t);if(Fi){jt(!0);try{l(t)}finally{jt(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=b1.bind(null,Ue,e),[i.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,l=Km.bind(null,Ue,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:wc,useDeferredValue:function(e,t){var l=sn();return kc(l,e,t)},useTransition:function(){var e=yc(!1);return e=Ym.bind(null,Ue,e.queue,!0,!1),sn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ue,o=sn();if(Fe){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),dt===null)throw Error(u(349));(Ze&127)!==0||ym(i,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Om(vm.bind(null,i,c,e),[e]),i.flags|=2048,Er(9,{destroy:void 0},bm.bind(null,i,c,l,t),null),l},useId:function(){var e=sn(),t=dt.identifierPrefix;if(Fe){var l=sl,i=ol;l=(i&~(1<<32-Ke(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Zu++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?b.createElement(o,{is:i.is}):b.createElement(o)}}c[Lt]=t,c[ln]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)c.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=c;e:switch($t(c,o,i),o){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ll(t)}}return yt(t),t.subtreeFlags&=-33554433,Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ll(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=tn.current,br(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,o=Ft,o!==null)switch(o.tag){case 27:case 5:i=o.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||vg(e.nodeValue,l)),e||$l(t,!0)}else e=Va(e).createTextNode(i),e[Lt]=t,t.stateNode=e}return yt(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=br(t),l!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),e=!1}else l=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Sn(t),t):(Sn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return yt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=br(t),i!==null&&i.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Lt]=t}else Di(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),o=!1}else o=Zs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Sn(t),t):(Sn(t),null)}return Sn(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,o=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(o=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==o&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),oo(t,t.updateQueue),yt(t),null);case 4:return Me(),e===null&&vf(t.stateNode.containerInfo),t.flags|=67108864,yt(t),null;case 10:return Dl(t.type),yt(t),null;case 19:if(sc(t),i=t.memoizedState,i===null)return yt(t),null;if(o=(t.flags&128)!==0,c=i.rendering,c===null)if(o)za(i,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Iu(e),c!==null){for(t.flags|=128,za(i,!1),e=c.updateQueue,t.updateQueue=e,oo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Kh(l,e),l=l.sibling;return ja(t,Kt.current&1|2),Fe&&Al(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Nt()>wo&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304)}else{if(!o)if(e=Iu(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,oo(t,e),za(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!c.alternate&&!Fe)return yt(t),null}else 2*Nt()-i.renderingStartTime>wo&&l!==536870912&&(t.flags|=128,o=!0,za(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}if(i.tail!==null){e=i.tail;e:{for(l=e;l!==null;){if(l.alternate!==null){l=!1;break e}l=l.sibling}l=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Nt(),e.sibling=null,c=Kt.current,c=o?c&1|2:c&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!l||Fe?ja(t,c):(l=c,Je(It,t),Je(Kt,l),rn===null&&(rn=t)),Fe&&Al(t,i.treeForkCount),e}return yt(t),null;case 22:case 23:return Sn(t),uc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),l=t.updateQueue,l!==null&&oo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&nt(Ui),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(At),yt(t),null;case 25:return null;case 30:return t.flags|=33554432,yt(t),null}throw Error(u(156,t.tag))}function j1(e,t){switch(Is(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(At),Me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lt(t),null;case 31:if(t.memoizedState!==null){if(Sn(t),t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return Dl(t.type),null;case 22:case 23:return Sn(t),uc(),e!==null&&nt(Ui),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(At),null;case 25:return null;default:return null}}function kp(e,t){switch(Is(t),t.tag){case 3:Dl(At),Me();break;case 26:case 27:case 5:lt(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Sn(t);break;case 13:Sn(t);break;case 19:sc(t);break;case 10:Dl(t.type);break;case 22:case 23:Sn(t),uc(),e!==null&&nt(Ui);break;case 24:Dl(At)}}function Da(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var o=i.next;l=o;do{if((l.tag&e)===e){i=void 0;var c=l.create,b=l.inst;i=c(),b.destroy=i}l=l.next}while(l!==o)}}catch(k){ot(t,t.return,k)}}function ri(e,t,l){try{var i=t.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var c=o.next;i=c;do{if((i.tag&e)===e){var b=i.inst,k=b.destroy;if(k!==void 0){b.destroy=void 0,o=t;var j=l,F=k;try{F()}catch(Z){ot(o,j,Z)}}}i=i.next}while(i!==c)}}catch(Z){ot(t,t.return,Z)}}function Sp(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{dm(t,l)}catch(i){ot(e,e.return,i)}}}function Np(e,t,l){l.props=Vi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){ot(e,t,i)}}function cl(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var o=e.stateNode,c=Cl(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=zg(c)),i=o.ref;break;case 7:if(e.stateNode===null){var b=new Tn(e);g(e.child,!1,gv,b,void 0,void 0),e.stateNode=b}i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(k){ot(e,t,k)}}function Zt(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(o){ot(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){ot(e,t,o)}else l.current=null}function so(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var l=0;l title"))),$t(i,t,l),i[Lt]=e,_t(i),t=i;break e;case"link":if(c=Kg("link","href",o).get(t+(l.href||""))){for(b=0;bBe&&(b=Be,Be=be,be=b);var q=Lh(k,be),O=Lh(k,Be);if(q&&O&&(X.rangeCount!==1||X.anchorNode!==q.node||X.anchorOffset!==q.offset||X.focusNode!==O.node||X.focusOffset!==O.offset)){var G=te.createRange();G.setStart(q.node,q.offset),X.removeAllRanges(),be>Be?(X.addRange(G),X.extend(O.node,O.offset)):(G.setEnd(O.node,O.offset),X.addRange(G))}}}}for(te=[],X=k;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;kl?32:l,pe.T=null,l=af,af=null;var c=Jn,b=gl;if(vt=0,Xi=Jn=null,gl=0,(tt&6)!==0)throw Error(u(331));var k=tt;if(tt|=4,Ip(c.current),Gp(c,c.current,b,l),tt=k,Ha(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(pt,c)}catch{}return!0}finally{Se.p=o,pe.T=i,og(e,t)}}function sg(e,t,l){t=Ln(l,t),t=Tc(e.stateNode,t,2),e=ti(e,t,2),e!==null&&(Fl(e,2),xl(e))}function ot(e,t,l){if(e.tag===3)sg(e,e,l);else for(;t!==null;){if(t.tag===3){sg(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(si===null||!si.has(i))){e=Ln(l,e),l=rp(2),i=ti(t,l,2),i!==null&&(ap(l,i,t,e),Fl(i,2),xl(i));break}}t=t.return}}function hf(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new A1;var o=new Set;i.set(t,o)}else o=i.get(t),o===void 0&&(o=new Set,i.set(t,o));o.has(l)||(nf=!0,o.add(l),e=B1.bind(null,e,t,l),t.then(e,e))}function B1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,dt===e&&(Ze&l)===l&&((kt===4||kt===3&&(Ze&62914560)===Ze&&300>Nt()-vo)&&(tt&2)===0?Lr(e,0):bo|=l,zr===Ze&&(zr=0)),xl(e)}function cg(e,t){t===0&&(t=hu()),e=Ai(e,t),e!==null&&(Fl(e,t),xl(e))}function H1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),cg(e,l)}function q1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),cg(e,l)}function F1(e,t){return zn(e,t)}var Br=null,Hr=null,mf=!1,To=!1,pf=!1,fi=0;function xl(e){e!==Hr&&e.next===null&&(Hr===null?Br=Hr=e:Hr=Hr.next=e),To=!0,mf||(mf=!0,Y1())}function Ha(e,t){if(!pf&&To){pf=!0;do for(var l=!1,i=Br;i!==null;){if(e!==0){var o=i.pendingLanes;if(o===0)var c=0;else{var b=i.suspendedLanes,k=i.pingedLanes;c=(1<<31-Ke(42|e)+1)-1,c&=o&~(b&~k),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,mg(i,c))}else c=Ze,c=ir(i,i===dt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||kl(i,c)||(l=!0,mg(i,c));i=i.next}while(l);pf=!1}}function V1(){fg()}function fg(){To=mf=!1;var e=0;fi!==0&&ev()&&(e=fi);for(var t=Nt(),l=null,i=Br;i!==null;){var o=i.next,c=dg(i,t);c===0?(i.next=null,l===null?Br=o:l.next=o,o===null&&(Hr=l)):(l=i,(e!==0||(c&3)!==0)&&(To=!0)),i=o}vt!==0&&vt!==5||Ha(e),fi!==0&&(fi=0)}function dg(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0k)break;var Z=j.transferSize,te=j.initiatorType;Z&&wg(te)&&(j=j.responseEnd,b+=Z*(jMo){be.length=me;break}G=new Promise(av.bind(G)),be.push(G)}}}if(0"u"?null:document;function Gg(e,t,l){var i=Fr;if(i&&typeof t=="string"&&t){var o=Oe(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Yg.has(o)||(Yg.add(o),e={rel:e,crossOrigin:l,href:t},i.querySelector(o)===null&&(t=i.createElement("link"),$t(t,"link",e),_t(t),i.head.appendChild(t)))}}function Ev(e){Bl.D(e),Gg("dns-prefetch",e,null)}function jv(e,t){Bl.C(e,t),Gg("preconnect",e,t)}function Cv(e,t,l){Bl.L(e,t,l);var i=Fr;if(i&&e&&t){var o='link[rel="preload"][as="'+Oe(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+Oe(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+Oe(l.imageSizes)+'"]')):o+='[href="'+Oe(e)+'"]';var c=o;switch(t){case"style":c=Vr(e);break;case"script":c=Yr(e)}if(!(Vn.has(c)||(e=R({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Vn.set(c,e),i.querySelector(o)!==null||t==="style"&&i.querySelector(Ga(c))||t==="script"&&i.querySelector(Qa(c))))){var b=i.createElement("link");$t(b,"link",e),t==="style"&&(b[rr]=!0,b.onload=b.onerror=function(){yu(b)}),_t(b),i.head.appendChild(b)}}}function Tv(e,t){Bl.m(e,t);var l=Fr;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Oe(i)+'"][href="'+Oe(e)+'"]',c=o;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Yr(e)}if(!Vn.has(c)&&(e=R({rel:"modulepreload",href:e},t),Vn.set(c,e),l.querySelector(o)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Qa(c)))return}i=l.createElement("link"),$t(i,"link",e),_t(i),l.head.appendChild(i)}}}function _v(e,t,l){Bl.S(e,t,l);var i=Fr;if(i&&e){var o=Gl(i).hoistableStyles,c=Vr(e);t=t||"default";var b=o.get(c);if(!b){var k={loading:0,preload:null};if(b=i.querySelector(Ga(c)))k.loading=5;else{e=R({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Vn.get(c))&&Lf(e,l);var j=b=i.createElement("link");_t(j),$t(j,"link",e),j._p=new Promise(function(F,Z){j.onload=F,j.onerror=Z}),j.addEventListener("load",function(){k.loading|=1}),j.addEventListener("error",function(){k.loading|=2}),k.loading|=4,zo(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:k},o.set(c,b)}}}function Av(e,t){Bl.X(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function zv(e,t){Bl.M(e,t);var l=Fr;if(l&&e){var i=Gl(l).hoistableScripts,o=Yr(e),c=i.get(o);c||(c=l.querySelector(Qa(o)),c||(e=R({src:e,async:!0,type:"module"},t),(t=Vn.get(o))&&Uf(e,t),c=l.createElement("script"),_t(c),$t(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(o,c))}}function Qg(e,t,l,i){var o=(o=tn.current)?Ya(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=Vr(l.href),t=Gl(o).hoistableStyles,i=t.get(l),i||(i={type:"style",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Vr(l.href);var c=Gl(o).hoistableStyles,b=c.get(e);if(b||(o=o.ownerDocument||o,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,b),(c=o.querySelector(Ga(e)))?c._p||(b.instance=c,b.state.loading=5):(c=Vn.get(e),c||(c={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Vn.set(e,c)),Dv(o,e,c,b.state))),t&&i===null)throw Error(u(528,""));return b}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(l=Yr(l),t=Gl(o).hoistableScripts,i=t.get(l),i||(i={type:"script",instance:null,count:0,state:null},t.set(l,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Vr(e){return'href="'+Oe(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function Xg(e){return R({},e,{"data-precedence":e.precedence,precedence:null})}function Dv(e,t,l,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[rr]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[rr]=!0,t.onload=t.onerror=yu.bind(null,t),$t(t,"link",l),_t(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Yr(e){return'[src="'+Oe(e)+'"]'}function Qa(e){return"script[async]"+e}function Ig(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Oe(l.href)+'"]');if(i)return t.instance=i,_t(i),i;var o=R({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),_t(i),$t(i,"style",o),zo(i,l.precedence,e),t.instance=i;case"stylesheet":o=Vr(l.href);var c=e.querySelector(Ga(o));if(c)return t.state.loading|=4,t.instance=c,_t(c),c;i=Xg(l),(o=Vn.get(o))&&Lf(i,o),c=(e.ownerDocument||e).createElement("link"),_t(c);var b=c;return b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),t.state.loading|=4,zo(c,l.precedence,e),t.instance=c;case"script":return c=Yr(l.src),(o=e.querySelector(Qa(c)))?(t.instance=o,_t(o),o):(i=l,(o=Vn.get(c))&&(i=R({},l),Uf(i,o)),e=e.ownerDocument||e,o=e.createElement("script"),_t(o),$t(o,"link",i),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,zo(i,l.precedence,e));return t.instance}function zo(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=i.length?i[i.length-1]:null,c=o,b=0;b title"):null)}function Mv(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zg(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function $g(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Pg(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Jg(t),e.suspenseyImages.push(t)),e=Lv.bind(e),t.decode().then(e,e))}function Ov(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=Vr(i.href),c=t.querySelector(Ga(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Xa.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,_t(c);return}c=t.ownerDocument||t,i=Xg(i),(o=Vn.get(o))&&Lf(i,o),c=c.createElement("link"),_t(c);var b=c;b._p=new Promise(function(k,j){b.onload=k,b.onerror=j}),$t(c,"link",i),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Xa.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function Rv(e,t){return e.stylesheets&&e.count===0&&Ro(e,e.stylesheets),0Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(o)}}:null}function Wg(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ro(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Xa(){this.count--,Wg(this)}function Lv(){this.imgCount--,Wg(this)}var Oo=null;function Ro(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oo=new Map,t.forEach(Uv,e),Oo=null,Xa.call(e))}function Uv(e,t){if(!(t.state.loading&4)){var l=Oo.get(e);if(l)var i=l.get(null);else{l=new Map,Oo.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Kf.exports=t2(),Kf.exports}var l2=n2();const i2=Hd(l2);class r2 extends Error{constructor(a,u){super(a);Qf(this,"status");this.name="ApiError",this.status=u}}async function Fd(n,r){let a=r;try{const u=await n.json();u!=null&&u.detail&&(a=u.detail)}catch{}return new r2(a,n.status)}async function a2(n){const r=await fetch(`/api/notifications?after=${n}`);if(!r.ok)throw new Error("Failed to fetch notifications");return r.json()}async function u2(){const n=await fetch("/api/actions/open-log",{method:"POST"});if(!n.ok)throw new Error("Failed to open log file");return n.json()}async function o2(n){const r=new URLSearchParams;r.set("limit",String(n.limit)),n!=null&&n.level&&r.set("level",n.level),n!=null&&n.search&&r.set("search",n.search);const a=await fetch(`/api/logs?${r.toString()}`);if(!a.ok)throw new Error("Failed to fetch log entries");return a.json()}async function Vo(){const n=await fetch("/api/system");if(!n.ok)throw new Error("Failed to fetch system info");return n.json()}async function s2(n){const r=await fetch("/api/system/bind",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lan:n})});if(!r.ok){let a="Failed to update LAN binding";try{const u=await r.json();u!=null&&u.detail&&(a=u.detail)}catch{}throw new Error(a)}return r.json()}async function Sx(){const n=await fetch("/api/config");if(!n.ok)throw new Error("Failed to fetch app configuration");return n.json()}async function Nx(n){const r=await fetch("/api/config/select-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to select directory");return r.json()}async function c2(n){const r=await fetch("/api/config/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config_path:n})});if(!r.ok)throw new Error("Failed to load config file");return r.json()}async function f2(n,r){const a=await fetch("/api/config/load-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:n,content:r})});if(!a.ok){let u=`Failed to apply dropped config (${n})`;try{const s=await a.json();s!=null&&s.detail&&(u=s.detail)}catch{}throw new Error(u)}return a.json()}async function d2(){const n=await fetch("/api/config/reload",{method:"POST"});if(!n.ok){let r="Failed to reload configuration";try{const a=await n.json();a!=null&&a.detail&&(r=a.detail)}catch{}throw new Error(r)}return n.json()}async function h2(n){const r=await fetch("/api/config/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({directory:n})});if(!r.ok)throw new Error("Failed to create config file");return r.json()}async function m2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}&include_hidden=true`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse config files");return a.json()}async function p2(n){const r=`/api/fs/browse?path=${encodeURIComponent(n)}`,a=await fetch(r);if(!a.ok)throw new Error("Failed to browse directory");return a.json()}async function Ex(n,r){const a=await fetch("/api/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});if(!a.ok)throw new Error("Failed to execute scan");return a.json()}async function Pf(n){const r=new URLSearchParams;(n==null?void 0:n.offset)!=null&&r.set("offset",String(n.offset)),(n==null?void 0:n.limit)!=null&&r.set("limit",String(n.limit)),n!=null&&n.sort_by&&r.set("sort_by",n.sort_by),n!=null&&n.sort_dir&&r.set("sort_dir",n.sort_dir);const a=r.toString(),u=`/api/scan/results${a?`?${a}`:""}`,s=await fetch(u,{signal:n==null?void 0:n.signal});if(!s.ok)throw new Error("Failed to fetch scan results");return s.json()}async function g2(n){const r=await fetch("/api/actions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error("Failed to launch file");return r.json()}async function Yy(n){const r=await fetch("/api/actions/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to reveal file");return r.json()}async function yd(n){const r=await fetch("/api/actions/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open folder");return r.json()}async function jx(n){const r=await fetch("/api/actions/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n})});if(!r.ok)throw new Error("Failed to open terminal");return r.json()}async function Cx(n,r){const a=await fetch("/api/actions/hash",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n,algorithm:r})});if(!a.ok)throw new Error("Failed to compute hash");return a.json()}async function Tx(){const n=await fetch("/api/actions/open-config",{method:"POST"});if(!n.ok)throw new Error("Failed to open config file");return n.json()}async function _x(n){const r={file_path:n.file_path||n.filePath,content:n.content},a=await fetch("/api/actions/barcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error("Failed to generate barcode");return a.json()}async function x2(n){const r=await fetch("/api/actions/barcode/decode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n.imageBase64,formats:n.formats})});if(!r.ok)throw r.status===503?new Error("Server-side barcode decoding is unavailable"):new Error(`Failed to decode frame (HTTP ${r.status})`);return r.json()}async function y2(n,r){const a=await fetch("/api/actions/metadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:n}),signal:r});if(!a.ok)throw new Error("Failed to fetch metadata");return a.json()}async function b2(n,r){const a=await fetch("/api/actions/export-csv",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,filename:r})});if(!a.ok)throw new Error("Failed to export CSV");return a.json()}async function v2(n,r){const a=await fetch("/api/actions/save-image",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image_base64:n,filename:r})});if(!a.ok)throw new Error("Failed to save image");return a.json()}async function w2(n){const r=await fetch("/api/workflow/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw await Fd(r,"Failed to start workflow session");return r.json()}async function k2(n,r){const a=await fetch(`/api/workflow/${n}/respond`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r})});if(!a.ok)throw await Fd(a,"Failed to respond to workflow prompt");return a.json()}async function S2(n){const r=await fetch(`/api/workflow/${n}/abort`,{method:"POST"});if(!r.ok)throw await Fd(r,"Failed to abort workflow session");return r.json()}const N2=[".profiles",".profiles.yaml",".profiles.yml",".yaml",".yml"];function E2(n){const r=n.toLowerCase();return N2.some(a=>r.endsWith(a))}function j2(n){for(const r of n)if(E2(r.name))return r;return null}function Wo(){return{depth:0,overlayVisible:!1}}function Ax(n,r,a){switch(r){case"enter":return a?{depth:n.depth+1,overlayVisible:!0}:n;case"leave":{const u=Math.max(0,n.depth-1);return{depth:u,overlayVisible:n.depth>0&&u>0}}case"drop":return Wo()}}function zx(n){return n==="light"?"light":"dark"}/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const C2=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gy=(...n)=>n.filter((r,a,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===a).join(" ").trim();/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var T2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _2=_.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:u,className:s="",children:d,iconNode:f,...m},p)=>_.createElement("svg",{ref:p,...T2,width:r,height:r,stroke:n,strokeWidth:u?Number(a)*24/Number(r):a,className:Gy("lucide",s),...m},[...f.map(([x,y])=>_.createElement(x,y)),...Array.isArray(d)?d:[d]]));/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ee=(n,r)=>{const a=_.forwardRef(({className:u,...s},d)=>_.createElement(_2,{ref:d,iconNode:r,className:Gy(`lucide-${C2(n)}`,u),...s}));return a.displayName=`${n}`,a};/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const A2=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],z2=Ee("Activity",A2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qy=Ee("ArrowDown",D2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M2=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],O2=Ee("ArrowLeftRight",M2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const R2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],L2=Ee("ArrowRight",R2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U2=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Dx=Ee("ArrowUpDown",U2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],H2=Ee("ArrowUp",B2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q2=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],F2=Ee("Bug",q2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V2=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Y2=Ee("Calendar",V2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G2=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Xy=Ee("Camera",G2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vi=Ee("Check",Q2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],I2=Ee("ChevronDown",X2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vd=Ee("ChevronRight",K2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lu=Ee("CircleAlert",Z2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mx=Ee("CircleCheck",$2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],P2=Ee("CirclePause",J2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],ew=Ee("CirclePlay",W2);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],bd=Ee("CircleX",tw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],lw=Ee("Clock",nw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iw=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],An=Ee("Copy",iw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rw=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Iy=Ee("Download",rw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aw=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],uw=Ee("ExternalLink",aw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ow=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],sw=Ee("EyeOff",ow);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cw=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vd=Ee("Eye",cw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fw=[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]],dw=Ee("FastForward",fw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hw=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],wd=Ee("FileCode",hw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mw=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]],Kr=Ee("FileCog",mw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pw=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Pr=Ee("FileText",pw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gw=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],Wf=Ee("File",gw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xw=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Ji=Ee("FolderOpen",xw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yw=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ss=Ee("Folder",yw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],vw=Ee("Globe",bw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ww=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Zr=Ee("Hash",ww);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kw=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],Yd=Ee("House",kw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ky=Ee("Info",Sw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nw=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],Zy=Ee("Keyboard",Nw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ew=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],jw=Ee("Link2",Ew);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cw=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wi=Ee("LoaderCircle",Cw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tw=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],_w=Ee("Lock",Tw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Aw=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],zw=Ee("Moon",Aw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dw=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Mw=Ee("Network",Dw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ow=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],er=Ee("Play",Ow);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Lw=Ee("Plus",Rw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uw=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Gd=Ee("QrCode",Uw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bw=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],cs=Ee("RefreshCw",Bw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hw=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],qw=Ee("Rocket",Hw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fw=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],$y=Ee("Search",Fw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vw=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Yw=Ee("Settings",Vw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gw=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Qw=Ee("Sun",Gw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xw=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],kd=Ee("Terminal",Xw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Iw=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Jy=Ee("Timer",Iw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kw=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Py=Ee("Trash2",Kw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zw=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wy=Ee("TriangleAlert",Zw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $w=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Jw=Ee("User",$w);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pw=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],eb=Ee("Webhook",Pw);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ww=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],ek=Ee("Workflow",Ww);/** + * @license lucide-react v0.477.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nl=Ee("X",tk);function nk(n){if(n<60)return`${n}s`;const r=Math.floor(n/60),a=n%60;return`${r}m${a.toString().padStart(2,"0")}s`}function lk(n){if(!n)return{label:"",cut:!1};const r=n.replace(/\\/g,"/").split("/").filter(Boolean);return r.length===0?{label:n,cut:!1}:{label:r[r.length-1],cut:r.length>1}}function ik({directory:n}){const[r,a]=_.useState(0);_.useEffect(()=>{a(0);const d=window.setInterval(()=>{a(f=>f+1)},1e3);return()=>window.clearInterval(d)},[]);const{label:u,cut:s}=lk(n);return h.jsxs("div",{"data-testid":"scan-status-strip",className:"flex min-w-0 items-center gap-1.5 text-[11px] text-ink-muted",children:[h.jsx(Wi,{className:"h-3 w-3 shrink-0 animate-spin text-chip-indigo-text motion-reduce:animate-none","aria-hidden":"true"}),h.jsxs("span",{className:"min-w-0 truncate",children:["Scanning",n&&h.jsxs(h.Fragment,{children:[" ",h.jsxs("span",{className:"font-mono text-ink-secondary",title:n,children:[s?"…/":"",u]})]})," — ",h.jsx("span",{className:"font-mono tabular-nums text-ink-secondary",children:nk(r)})]})]})}function rk({onExecute:n,scanning:r,hasSelection:a,fileCount:u,totalCount:s,scanningDirectory:d="",toastMessage:f,onToastDismiss:m}){const p=(f==null?void 0:f.kind)==="error";return h.jsxs("div",{className:"relative flex items-center justify-between border-t border-line bg-surface-glass px-4 py-2.5 text-xs transition-colors duration-200",children:[f&&h.jsx("div",{role:"status","aria-live":p?"assertive":"polite","aria-atomic":"true",className:`animate-toast-in absolute left-1/2 top-1/2 z-[var(--z-toast)] max-w-[min(80vw,640px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border px-4 py-2 text-xs font-medium glass-panel-strong ${p?"pointer-events-auto flex max-w-[min(70vw,560px)] items-center gap-2.5 border-status-danger-border text-left text-ink":"pointer-events-none max-w-[min(70vw,560px)] text-center text-ink"}`,children:p?h.jsxs(h.Fragment,{children:[h.jsx(bd,{className:"h-3.5 w-3.5 shrink-0 text-status-danger-text/80","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 flex-1",children:f.message}),m&&h.jsx("button",{type:"button",onClick:m,"aria-label":"Dismiss error",className:"shrink-0 rounded-md p-0.5 text-status-danger-text/60 hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-status-danger-border transition-colors",children:h.jsx(nl,{className:"h-3.5 w-3.5"})})]}):f.message}),h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[r&&h.jsx(ik,{directory:d}),s!==void 0&&s!==u&&h.jsxs("span",{"data-testid":"action-bar-count",className:"text-ink-muted",children:["Showing ",u," of ",s]})]}),h.jsxs("button",{onClick:n,disabled:!a||r,className:"flex shrink-0 items-center gap-2 rounded-xl border border-emerald-300/50 bg-gradient-to-b from-emerald-400/90 to-emerald-600/90 px-5 py-2 font-semibold text-white shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] transition-[filter,box-shadow,transform] hover:-translate-y-px hover:brightness-110 hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_12px_30px_-6px_rgb(16_185_129/0.7)] disabled:opacity-40 disabled:hover:translate-y-0 disabled:hover:brightness-100 disabled:hover:shadow-[inset_0_1px_0_rgb(255_255_255/0.35),0_8px_24px_-6px_rgb(16_185_129/0.55)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-400",children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:"Execute"}),h.jsx("kbd",{className:"rounded bg-emerald-800/60 px-1.5 py-0.5 text-[10px] text-emerald-200 shadow-[inset_0_1px_0_rgb(255_255_255/0.12)]",children:"↵"})]})]})}function ak({position:n,onClose:r,onLaunch:a,onLaunchWithArgs:u,onReveal:s,onOpenFolder:d,onOpenTerminal:f,onScanDirectory:m,onFilterFolder:p,onFilterExtension:x,onCopyPath:y,onCopyFilename:g,onCopyUri:w,onComputeHash:v,onVerifyHash:S,onProperties:C,onClearFile:L,onGenerateBarcode:z,showToast:$}){const[I,J]=_.useState(!1),[ie,U]=_.useState(""),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(null),[B,ne]=_.useState(null);if(_.useEffect(()=>{var re;I&&((re=Q.current)==null||re.showModal())},[I]),_.useLayoutEffect(()=>{if(!n){ne(null);return}const re=()=>{const N=R.current;if(!N)return;const qe=N.getBoundingClientRect(),Ge=8;ne({left:Math.max(Ge,Math.min(n.x,window.innerWidth-qe.width-Ge)),top:Math.max(Ge,Math.min(n.y,window.innerHeight-qe.height-Ge))})};return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[n]),_.useEffect(()=>{if(!n)return;fe.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const re=window.requestAnimationFrame(()=>{var N,qe;(qe=(N=R.current)==null?void 0:N.querySelector("[role='menuitem']"))==null||qe.focus()});return()=>{var N;window.cancelAnimationFrame(re),(N=fe.current)==null||N.focus()}},[n]),!n)return null;const{file:V,x:se,y:ve}=n,ae=()=>{u(V,ie),J(!1),r()},A=re=>{const N=re.lastIndexOf(".");return N!==-1?re.slice(N):""},W=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):re},le=re=>{const N=Math.max(re.lastIndexOf("/"),re.lastIndexOf("\\"));return N!==-1?re.slice(0,N):""};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[calc(var(--z-context-menu)-1)]",onClick:r,onContextMenu:re=>{re.preventDefault(),r()},"aria-hidden":"true"}),h.jsxs("div",{ref:R,role:"menu","aria-label":`Actions for ${V.filename}`,tabIndex:0,onKeyDown:re=>{var Ge,M,E,Y;["Escape","ArrowDown","ArrowUp","Home","End"].includes(re.key)&&re.stopPropagation();const N=Array.from(((Ge=R.current)==null?void 0:Ge.querySelectorAll("[role='menuitem']"))??[]),qe=N.indexOf(document.activeElement);if(re.key==="Escape")re.preventDefault(),r();else if(re.key==="ArrowDown"||re.key==="ArrowUp"){re.preventDefault();const oe=re.key==="ArrowDown"?1:-1;(M=N[(qe+oe+N.length)%N.length])==null||M.focus()}else re.key==="Home"?(re.preventDefault(),(E=N[0])==null||E.focus()):re.key==="End"&&(re.preventDefault(),(Y=N.at(-1))==null||Y.focus())},className:"animate-modal-in fixed z-[var(--z-context-menu)] max-h-[calc(100dvh-16px)] w-56 max-w-[calc(100vw-16px)] overflow-y-auto rounded-lg border border-line bg-surface-glass py-1 text-xs text-ink shadow-2xl backdrop-blur-md",style:B??{left:se,top:ve,visibility:"hidden"},children:[h.jsx("div",{className:"border-b border-line px-3 py-2 font-medium text-ink-muted truncate",children:V.filename}),h.jsxs("button",{role:"menuitem",onClick:()=>{a(V),r()},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename}`,children:[h.jsx(er,{className:"h-3.5 w-3.5 fill-current text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Launch"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{J(!0)},className:"flex w-full items-center gap-2 px-3 py-3 min-h-[44px] hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Launch ${V.filename} with arguments`,children:[h.jsx(er,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Launch with arguments..."})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{s(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Reveal ${V.filename} in file manager`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Reveal in File Manager"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{d(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open folder containing ${V.filename}`,children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-amber-text group-hover:text-white"}),h.jsx("span",{children:"Open Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{f(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Open terminal in directory containing ${V.filename}`,children:[h.jsx(kd,{className:"h-3.5 w-3.5 text-status-success-text group-hover:text-white"}),h.jsx("span",{children:"Open Terminal in Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{z(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Generate QR Code",children:[h.jsx(Gd,{className:"h-3.5 w-3.5 text-chip-fuchsia-text group-hover:text-white"}),h.jsx("span",{children:"Generate QR Code"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=W(V.path);m(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Scan to Directory",children:[h.jsx(Ji,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Scan to Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=le(V.rel_path);re&&p(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view to folder ${V.filename} is in`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter to Folder"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{const re=A(V.filename);re&&x(re),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Filter view by extension ${A(V.filename)}`,children:[h.jsx(wd,{className:"h-3.5 w-3.5 text-chip-indigo-text group-hover:text-white"}),h.jsx("span",{children:"Filter by Extension"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy full path of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Full Path"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{y(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy path of ${V.filename} with forward slashes`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Path (Forward Slashes)"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!1),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{g(V,!0),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy filename of ${V.filename} without extension`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Filename (no ext)"})]}),h.jsxs("button",{role:"menuitem",onClick:async()=>{const re=W(V.path);r();try{await navigator.clipboard.writeText(re),$==null||$(`Copied: ${re}`)}catch(N){$==null||$(`Copy failed: ${(N==null?void 0:N.message)??N}`,"error")}},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":"Copy Directory",children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy Directory"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{w(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Copy URI of ${V.filename}`,children:[h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted group-hover:text-white"}),h.jsx("span",{className:"truncate",children:"Copy URI"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{v(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Compute SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Compute SHA256 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"md5"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify MD5 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify MD5 Hash"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{S(V,"sha256"),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Verify SHA256 hash of ${V.filename}`,children:[h.jsx(Zr,{className:"h-3.5 w-3.5 text-chip-purple-text group-hover:text-white"}),h.jsx("span",{children:"Verify SHA256 Hash"})]}),h.jsx("div",{className:"my-1 border-t border-line"}),h.jsxs("button",{role:"menuitem",onClick:()=>{C(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`View properties of ${V.filename}`,children:[h.jsx(vd,{className:"h-3.5 w-3.5 text-chip-sky-text group-hover:text-white"}),h.jsx("span",{children:"Properties"})]}),h.jsxs("button",{role:"menuitem",onClick:()=>{L(V),r()},className:"flex w-full items-center gap-2 px-3 py-1.5 hover:bg-indigo-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-indigo-500 active:scale-95 transition-transform group","aria-label":`Remove ${V.filename} from list`,children:[h.jsx(Py,{className:"h-3.5 w-3.5 text-status-danger-text group-hover:text-white"}),h.jsx("span",{children:"Delete"})]})]}),I&&h.jsx("dialog",{ref:Q,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 rounded-xl","aria-labelledby":"args-modal-title",onClick:re=>{re.target===Q.current&&J(!1)},onCancel:re=>{re.preventDefault(),J(!1)},children:h.jsxs("div",{className:"animate-modal-in w-96 rounded-xl border border-frame-line glass-panel p-4",children:[h.jsx("h3",{id:"args-modal-title",className:"mb-2 text-sm font-semibold text-ink",children:"Launch with Arguments"}),h.jsx("p",{className:"mb-3 text-xs text-ink-muted truncate",children:V.filename}),h.jsx("input",{type:"text",autoFocus:!0,placeholder:"Arguments (e.g. --verbose --port 80)",value:ie,onChange:re=>U(re.target.value),onKeyDown:re=>{re.key==="Enter"&&ae(),re.key==="Escape"&&J(!1)},className:"mb-4 w-full rounded-md border border-line bg-elevated px-3 py-2 text-xs text-ink outline-none focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500","aria-label":"Command line arguments"}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>J(!1),className:"rounded-md px-3 py-1.5 text-xs text-ink-muted hover:bg-elevated hover:text-ink focus:outline-none focus:ring-2 focus:ring-indigo-500","aria-label":"Cancel launch",children:"Cancel"}),h.jsx("button",{onClick:ae,className:"btn btn-primary px-3 py-1.5","aria-label":`Launch ${V.filename} with arguments`,children:"Launch"})]})]})})]})}var uk=Vy();const bl=8,bi=8,ok=400,Ox={top:"bottom",bottom:"top",left:"right",right:"left"},sk={top:"-bottom-1 left-1/2 -translate-x-1/2",bottom:"-top-1 left-1/2 -translate-x-1/2",left:"-right-1 top-1/2 -translate-y-1/2",right:"-left-1 top-1/2 -translate-y-1/2"},ck={top:"border-b border-r",bottom:"border-t border-l",left:"border-t border-r",right:"border-b border-l"},Rx=(n,r,a)=>{switch(n){case"top":return r.top-bi-a.h>=bl;case"bottom":return r.bottom+bi+a.h<=window.innerHeight-bl;case"left":return r.left-bi-a.w>=bl;default:return r.right+bi+a.w<=window.innerWidth-bl}},fk=(n,r,a)=>{if(n==="top"||n==="bottom"){const f=r.left+r.width/2-a.w/2,m=window.innerWidth-a.w-bl;return{x:Math.min(Math.max(f,bl),Math.max(bl,m))-f,y:0}}const u=r.top+r.height/2-a.h/2,s=window.innerHeight-a.h-bl;return{x:0,y:Math.min(Math.max(u,bl),Math.max(bl,s))-u}},He=({text:n,children:r,block:a=!0,placement:u="top",suppress:s=!1})=>{const d=_.useRef(null),f=_.useRef(null),m=_.useId(),p=_.useRef(null),[x,y]=_.useState(!1),[g,w]=_.useState(u),[v,S]=_.useState({x:0,y:0}),[C,L]=_.useState({left:-9999,top:-9999}),z=()=>{p.current!==null&&(window.clearTimeout(p.current),p.current=null)};_.useEffect(()=>{s&&(z(),y(!1))},[s]),_.useEffect(()=>()=>z(),[]);const $=_.useCallback(()=>{const U=d.current,R=f.current;if(!U||!R)return;const Q=U.getBoundingClientRect(),fe={w:R.offsetWidth,h:R.offsetHeight},B=Rx(u,Q,fe)?u:Rx(Ox[u],Q,fe)?Ox[u]:u,ne=fk(B,Q,fe);w(B),S(ne);const V=Q.left+Q.width/2,se=Q.top+Q.height/2;L(B==="top"?{left:V,top:Q.top-bi-fe.h}:B==="bottom"?{left:V,top:Q.bottom+bi}:B==="left"?{left:Q.left-bi-fe.w,top:se}:{left:Q.right+bi,top:se})},[u]);_.useEffect(()=>{if(!x)return;const U=()=>y(!1);return window.addEventListener("resize",U),window.addEventListener("scroll",U,!0),()=>{window.removeEventListener("resize",U),window.removeEventListener("scroll",U,!0)}},[x]);const I=U=>{if(s)return;z();const R=()=>{$(),y(!0)};U?R():p.current=window.setTimeout(R,ok)},J=()=>{z(),y(!1)};_.useEffect(()=>{if(!x)return;const U=R=>{R.key==="Escape"&&y(!1)};return document.addEventListener("keydown",U,!0),()=>document.removeEventListener("keydown",U,!0)},[x]),_.useEffect(()=>{if(!x)return;const U=()=>!!document.querySelector('[role="dialog"][aria-modal="true"], dialog[open]');if(U()){y(!1);return}const R=new MutationObserver(()=>{U()&&y(!1)});return R.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","open","class"]}),()=>R.disconnect()},[x]);const ie={onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,"aria-describedby":m};return h.jsxs("div",{ref:d,className:`group relative ${a?"flex min-w-0 flex-1 items-center":"inline-flex shrink-0 items-center"}`,onMouseEnter:()=>I(!1),onMouseLeave:J,onFocus:()=>I(!0),onBlur:J,children:[_.cloneElement(r,ie),uk.createPortal(h.jsxs("span",{ref:f,id:m,role:"tooltip",className:`pointer-events-none invisible fixed z-[var(--z-tooltip)] w-max max-w-[calc(100vw-16px)] rounded-md border border-line bg-elevated px-2 py-1 text-left text-[11px] leading-relaxed text-ink shadow-lg ${x?"visible opacity-100":"opacity-0"}`,style:{left:C.left,top:C.top,transform:g==="top"||g==="bottom"?`translateX(calc(-50% + ${v.x}px))`:`translateY(calc(-50% + ${v.y}px))`},children:[n,h.jsx("span",{className:`absolute h-2 w-2 rotate-45 border-line bg-elevated ${sk[g]} ${ck[g]}`,style:g==="top"||g==="bottom"?{left:`calc(50% - ${v.x}px)`}:void 0})]}),document.body)]})};function dk({isOpen:n,initialPath:r,onClose:a,onSelect:u}){const[s,d]=_.useState(null),[f,m]=_.useState(null),[p,x]=_.useState(""),[y,g]=_.useState(!1),[w,v]=_.useState(null),S=_.useRef(null),C=_.useRef(null),L=_.useRef(null);_.useEffect(()=>{var ie;if(!n){(ie=L.current)==null||ie.focus();return}L.current=document.activeElement instanceof HTMLElement?document.activeElement:null,v(null),z(r||"");const J=requestAnimationFrame(()=>{var U;return(U=C.current)==null?void 0:U.focus()});return()=>{var U;cancelAnimationFrame(J),(U=L.current)==null||U.focus()}},[n]);const z=async J=>{g(!0),v(null);try{const ie=await fetch(`/api/fs/browse?path=${encodeURIComponent(J)}`);if(!ie.ok)throw new Error("Failed to browse directory");const U=await ie.json();d(U),m(U.current_path),x(U.current_path)}catch(ie){v(ie.message||"Navigation failed")}finally{g(!1)}},$=()=>{const J=p.trim()||f;J&&(u(J),a())},I=J=>{var Q;if(J.key==="Escape"){J.preventDefault(),a();return}if(J.key!=="Tab")return;const ie=(Q=S.current)==null?void 0:Q.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(ie!=null&&ie.length))return;const U=ie[0],R=ie[ie.length-1];J.shiftKey&&document.activeElement===U?(J.preventDefault(),R.focus()):!J.shiftKey&&document.activeElement===R&&(J.preventDefault(),U.focus())};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:a,children:h.jsxs("div",{ref:S,role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title",onKeyDown:I,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:J=>J.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Ji,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"directory-picker-title",className:"text-sm font-semibold text-ink",children:"Select a directory"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(s==null?void 0:s.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:a,"aria-label":"Close directory picker",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"directory-picker-path",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Location"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:C,id:"directory-picker-path",type:"text",value:p,onChange:J=>x(J.target.value),onKeyDown:J=>{J.key==="Enter"&&z(p.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>z(p.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>z(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(s==null?void 0:s.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>z(s.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":y,children:y?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading directories…"})]}):w?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:w}),h.jsx("button",{type:"button",onClick:()=>z(p||(s==null?void 0:s.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-0.5",children:[s==null?void 0:s.items.filter(J=>J.is_dir).map(J=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>z(J.path),onDoubleClick:()=>{x(J.path),u(J.path),a()},className:`flex min-h-10 w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${f===J.path?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(ss,{className:"h-5 w-5 shrink-0 text-chip-indigo-text"}),h.jsx("span",{className:"truncate",children:J.name})]}),f===J.path&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},J.path)),(s==null?void 0:s.items.filter(J=>J.is_dir).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Ji,{className:"h-7 w-7 text-ink-faint"}),"No subdirectories found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected folder"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:f||p,children:f||p||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:a,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),h.jsxs("button",{type:"button",onClick:$,disabled:!p.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Ji,{className:"h-4 w-4"}),"Select folder"]})]})]})]})}):null}function hk({visible:n,onFileSelected:r}){const a=_.useRef(null);return n?h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-drop-overlay)] flex items-center justify-center bg-black/65 backdrop-blur-sm",onClick:()=>{var u;return(u=a.current)==null?void 0:u.click()},"data-testid":"drop-config-overlay",children:[h.jsx("input",{ref:a,type:"file",accept:".profiles,.profiles.yaml,.profiles.yml,.yaml,.yml",className:"hidden",onChange:u=>{var d;const s=(d=u.target.files)==null?void 0:d[0];s&&r(s),u.target.value=""}}),h.jsxs("div",{className:"rounded-xl border-2 border-dashed border-chip-indigo-border bg-surface px-8 py-6 text-center shadow-2xl",children:[h.jsx("span",{className:"mx-auto mb-3 grid h-9 w-9 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsx("p",{className:"text-sm font-semibold text-ink",children:"Drop configuration file"}),h.jsx("p",{className:"mt-1 text-xs text-ink-muted",children:".profiles, .profiles.yaml, .yml, .yaml — session-only preview"})]})]}):null}function mk({items:n,columnTemplate:r,resizePointerRef:a,resizeMovedRef:u}){return h.jsx("div",{className:"grid select-none items-center border-b border-l-2 border-l-transparent border-line/40 bg-surface/60 font-medium text-ink-muted shadow-sm backdrop-blur-md",role:"row","aria-rowindex":1,"data-file-list-header":!0,style:{gridTemplateColumns:r},children:n.map((s,d)=>{const f=!!(s.onSort&&s.sortKey),m=s.active?s.direction==="asc"?"ascending":"descending":"none";return h.jsxs("div",{role:"columnheader","data-column-key":s.sortKey,className:`group relative flex items-center gap-1.5 truncate px-3 py-2 ${f?"cursor-pointer hover:text-ink transition-colors":""} ${s.active?"text-ink":""}`,...f?{"aria-sort":m,tabIndex:0,onClick:s.onSort,onKeyDown:p=>{var x;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),(x=s.onSort)==null||x.call(s))}}:{},children:[s.icon,h.jsx("span",{className:"truncate",children:s.label}),f?s.active?s.direction==="asc"?h.jsx(H2,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Qy,{className:"ml-auto h-3 w-3 shrink-0 text-chip-indigo-text"}):h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-40 hover:opacity-40"}):d>0&&h.jsx(Dx,{className:"ml-auto h-3 w-3 shrink-0 opacity-40"}),s.canResize&&s.onResizeBy&&h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${s.label} column`,"aria-valuemin":$r,"aria-valuemax":ls,"aria-valuenow":s.width??s.defaultWidth??es,"aria-valuetext":`${s.width??s.defaultWidth??es} pixels wide`,title:"Drag to resize; use arrow keys or click either side to adjust",tabIndex:0,onClick:p=>{var g;p.preventDefault(),p.stopPropagation();const x=u.current;if(u.current=!1,x)return;const y=p.currentTarget.getBoundingClientRect();(g=s.onResizeBy)==null||g.call(s,p.clientX{p.preventDefault(),p.stopPropagation();const x=p.currentTarget.parentElement;u.current=!1,a.current={pointerId:p.pointerId,startX:p.clientX,startWidth:s.width??(x==null?void 0:x.getBoundingClientRect().width)??s.defaultWidth??es,resizeTo:s.onResizeTo},p.currentTarget.setPointerCapture(p.pointerId)},onPointerMove:p=>{const x=a.current;if(!x||x.pointerId!==p.pointerId)return;const y=p.clientX-x.startX;Math.abs(y)>2&&(u.current=!0),x.resizeTo(x.startWidth+y)},onPointerUp:p=>{var x;((x=a.current)==null?void 0:x.pointerId)===p.pointerId&&(p.currentTarget.releasePointerCapture(p.pointerId),a.current=null,window.setTimeout(()=>{u.current=!1},0))},onPointerCancel:()=>{a.current=null,u.current=!1},onKeyDown:p=>{var x,y;p.stopPropagation(),p.key==="ArrowLeft"||p.key==="ArrowRight"?(p.preventDefault(),(x=s.onResizeBy)==null||x.call(s,p.key==="ArrowLeft"?-Go:Go)):(p.key==="Home"||p.key==="End")&&(p.preventDefault(),(y=s.onResizeTo)==null||y.call(s,p.key==="Home"?$r:ls))},className:"absolute inset-y-0 right-0 z-10 w-3 cursor-col-resize touch-none border-r border-transparent transition-colors hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500"})]},d)})})}const Wn=28,Yo=12,ed=500,$r=80,ls=960,es=160,Go=24,Lx=44,Qo={File:2,Path:3,FileName:1,Type:1,Version:1};function pk({files:n,totalCount:r,rawLoadedCount:a,onLoadMore:u,loadingMore:s=!1,scanning:d=!1,hasScanned:f=!1,activeDirectory:m="",recursive:p=!1,onDisableRecursive:x,onOpenDirectory:y,onOpenConfig:g,filterText:w,onClearFilter:v,prefilterNote:S,columnHeaders:C,columnNames:L,selectedIndex:z,onSelectIndex:$,onLaunch:I,onContextMenu:J,rowColors:ie,sort:U,onSortChange:R}){const Q=["File"],fe=L.length>0?L:Q,B=C.length>0?C:fe,ne=Array.from({length:Math.max(fe.length,B.length)},(ge,Me)=>({key:fe[Me]??Q[0],header:B[Me]??fe[Me]??Q[0]})),V=_.useRef(null),[se,ve]=_.useState(0),[ae,A]=_.useState(600),[W,le]=_.useState(0),[re,N]=_.useState({}),qe=_.useRef(null),Ge=_.useRef(!1),M=fe.reduce((ge,Me)=>ge+(Qo[Me]??1),1),E=(ge,Me)=>{const Le=Math.min(ls,Math.max($r,Math.round(Me)));N(lt=>({...lt,[ge]:Le}))},Y=(ge,Me)=>{var K;const Le=Array.from(((K=V.current)==null?void 0:K.querySelectorAll("[data-column-key]"))??[]).find(ue=>ue.dataset.columnKey===ge),lt=re[ge]??(Le==null?void 0:Le.getBoundingClientRect().width)??es;E(ge,lt+Me)},oe=[`${Lx}px`,...fe.map(ge=>re[ge]?`${re[ge]}px`:`minmax(${$r}px, ${Qo[ge]??1}fr)`)].join(" "),de=_.useRef(!1),je=_.useRef(null),ye=n.length,_e=a??ye,pe=r??_e,Se=_e{const ge=V.current;if(!ge)return;const Me=new ResizeObserver(Le=>{for(const lt of Le)A(lt.contentRect.height),le(lt.contentRect.width)});return Me.observe(ge),A(ge.clientHeight||600),le(ge.clientWidth||0),()=>Me.disconnect()},[]),_.useEffect(()=>{var ue;const ge=V.current;if(!ge||z<0||z>=ye)return;const Me=((ue=ge.querySelector("[data-file-list-header]"))==null?void 0:ue.offsetHeight)??0,Le=Me+z*Wn,lt=Le+Wn;let K=ge.scrollTop;Lege.scrollTop+ge.clientHeight&&(K=lt-ge.clientHeight),K!==ge.scrollTop&&(ge.scrollTop=K,ve(K))},[z,ye]),_.useEffect(()=>{const ge=V.current;if(!ge)return;const Me=()=>{if(de.current||!Bt||!u)return;const Le=ge.scrollTop+ge.clientHeight,lt=ye*Wn;lt-LeLe&&(de.current=!0,window.setTimeout(()=>{de.current=!1},200),u())};return ge.addEventListener("scroll",Me,{passive:!0}),window.addEventListener("scroll",Me,{passive:!0}),()=>{ge.removeEventListener("scroll",Me),window.removeEventListener("scroll",Me)}},[n,Bt,u,ye]),_.useEffect(()=>{if(de.current||!Bt||!u)return;const ge=ye*Wn,Me=se+ae;if(!(ge-MeMe))return;const lt=`${ye}:${_e}:${pe}`;je.current=lt,u()});const Gt=_.useCallback(ge=>{ve(ge.currentTarget.scrollTop)},[]),St=Math.max(0,Math.floor(se/Wn)-Yo),nt=Math.ceil(ae/Wn)+Yo*2,Je=Math.min(ye,St+nt),en=St*Wn,bn=(ge,Me)=>{if(Me)return{className:"bg-chip-indigo-bg border-l-4 border-chip-indigo-border text-ink",style:{}};for(const[Le,lt]of ie)if(ge.toLowerCase().includes(Le.toLowerCase()))return{className:"hover:bg-elevated border-l-4 text-ink",style:{borderLeftColor:lt,borderLeftWidth:"4px"}};return{className:"border-l-4 border-transparent text-ink-secondary hover:bg-elevated/60",style:{borderLeftColor:"transparent",borderLeftWidth:"4px"}}},tn=(Bt?ye+nt:ye)*Wn,Ht="btn btn-secondary px-3 py-1.5";return h.jsxs("div",{ref:V,onScroll:Gt,className:"flex-1 overflow-auto bg-app text-xs transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 focus-visible:outline-offset-[-2px]","data-testid":"file-list","data-loaded-count":_e,"aria-busy":d,role:"grid","aria-label":"Discovered files","aria-rowcount":Math.max(pe,ye===0?1:0)+1,"aria-colcount":fe.length+1,"aria-activedescendant":ye>0?`file-row-${z}`:void 0,tabIndex:0,children:[h.jsx("div",{className:"sticky top-0 z-10",role:"presentation",children:h.jsx(mk,{columnTemplate:oe,resizePointerRef:qe,resizeMovedRef:Ge,items:[{label:"#",icon:h.jsx(wd,{className:"h-3.5 w-3.5"})},...ne.map(({key:ge,header:Me})=>({label:Me,weight:Qo[ge]??1,width:re[ge],defaultWidth:Math.min(ls,Math.max($r,Math.round((W-Lx)*(Qo[ge]??1)/M))),canResize:!0,onResizeBy:Le=>Y(ge,Le),onResizeTo:Le=>E(ge,Le),sortKey:ge,active:(U==null?void 0:U.column)===ge,direction:U==null?void 0:U.direction,onSort:()=>{(U==null?void 0:U.column)!==ge?R({column:ge,direction:"asc"}):U.direction==="asc"?R({column:ge,direction:"desc"}):R(null)}}))]})}),S&&ye>0&&h.jsxs("div",{role:"note","data-testid":"prefilter-note",className:"flex items-center gap-1.5 border-b border-line/40 bg-surface px-3 py-1 text-[11px] text-ink-faint",children:[h.jsx(Ky,{className:"h-3 w-3 shrink-0 text-ink-faint","aria-hidden":"true"}),h.jsx("span",{className:"min-w-0 truncate",children:S})]}),ye===0?h.jsx("div",{role:"row","aria-rowindex":2,"data-testid":"file-list-empty",children:h.jsx("div",{role:"gridcell","aria-colspan":fe.length+1,className:"p-8 text-center text-ink-faint",children:d?h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text motion-reduce:animate-none"}),h.jsx("span",{children:"Scanning files..."})]}):!m.trim()&&g?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"Select a directory first."}),h.jsx("button",{type:"button",onClick:g,className:Ht,children:"Choose configuration"})]}):f?w.trim()?h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsxs("span",{children:["No files match “",w,"”."]}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[h.jsx("button",{type:"button",onClick:v,className:Ht,children:"Clear filter"}),p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h.jsx("span",{children:"No files found for the current directory and extension."}),h.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[p&&x&&h.jsx("button",{type:"button",onClick:x,className:Ht,children:"Turn off recursive"}),y&&h.jsx("button",{type:"button",onClick:y,className:Ht,children:"Open directory"})]})]}):h.jsx("span",{children:"Select a directory and scan to find files."})})}):h.jsxs("div",{className:"relative",style:{height:tn},role:"rowgroup",children:[s&&h.jsx("div",{className:"pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2","aria-hidden":"true",children:h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})}),h.jsx("div",{style:{transform:`translateY(${en}px)`},"data-testid":"file-list-window",role:"presentation",children:n.slice(St,Je).map((ge,Me)=>{const Le=St+Me,lt=Le===z,K=bn(ge.filename,lt);return h.jsxs("div",{id:`file-row-${Le}`,"data-row-index":Le,role:"row","aria-rowindex":Le+2,"aria-selected":lt,onClick:()=>{var ue;$(Le),(ue=V.current)==null||ue.focus()},onDoubleClick:()=>I(ge),onContextMenu:ue=>J(ue,ge,Le),className:`grid cursor-pointer items-center transition-colors ${K.className}`,style:{...K.style,height:Wn,gridTemplateColumns:oe},children:[h.jsxs("div",{className:"flex items-center justify-end gap-1 px-3 font-mono text-ink-faint",children:[ge.has_hook&&h.jsx("span",{title:ge.hook_pattern?`Launch workflow: ${ge.hook_pattern}`:"Launch workflow configured","aria-label":"Workflow hook attached",className:"inline-flex items-center text-status-warning-text hover:brightness-95",children:h.jsx(eb,{className:"h-3 w-3 shrink-0"})}),h.jsx("span",{className:"hidden sm:inline",children:Le+1})]}),fe.map((ue,ke)=>{const Ce=ge.column_values[ue]||(ue==="File"?ge.filename:"-");return h.jsx("div",{role:"gridcell","data-column-key":ue,className:"truncate px-3 font-mono",style:{minWidth:$r},title:ue==="Path"?ge.path:Ce,children:Ce},ke)})]},ge.path||Le)})}),Se&&h.jsxs("div",{className:"pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full border border-line bg-surface-strong px-3 py-1 text-[11px] text-ink-muted shadow","data-testid":"file-list-paging",children:[s?h.jsx(O2,{className:"mr-1.5 h-4 w-4 animate-spin motion-reduce:animate-none text-ink-muted"}):null,"(",_e," of ",pe," loaded)"]})]})]})}function Sd({id:n,ariaLabel:r,value:a,options:u,onChange:s,placeholder:d,className:f="",inputClassName:m="",optionLabel:p=y=>y,onOpenChange:x}){const y=_.useId(),g=_.useRef(null),[w,v]=_.useState(!1),[S,C]=_.useState(""),[L,z]=_.useState(-1),$=u.filter(R=>p(R).toLocaleLowerCase().includes(S.toLocaleLowerCase())),I=L>=0&&$[L]?`${y}-option-${L}`:void 0;_.useEffect(()=>{const R=Q=>{var fe;(fe=g.current)!=null&&fe.contains(Q.target)||v(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]),_.useEffect(()=>{x==null||x(w)},[w,x]),_.useEffect(()=>{var R;L<0||(R=document.getElementById(`${y}-option-${L}`))==null||R.scrollIntoView({block:"nearest"})},[L,y]);const J=()=>{C(""),z(-1),v(!0)},ie=R=>{s(R),C(""),z(-1),v(!1)},U=R=>{if(R.key==="ArrowDown"){if(R.preventDefault(),!w){J(),z(0);return}z(Q=>Math.min(Q+1,$.length-1))}else if(R.key==="ArrowUp"){if(R.preventDefault(),!w){J(),z($.length-1);return}z(Q=>Q<=0?$.length-1:Q-1)}else R.key==="Enter"&&w&&$[L]!==void 0?(R.preventDefault(),ie($[L])):R.key==="Escape"&&v(!1)};return h.jsxs("div",{ref:g,onBlur:R=>{var Q;(Q=g.current)!=null&&Q.contains(R.relatedTarget)||v(!1)},className:`relative flex min-w-0 ${f}`,children:[h.jsx("input",{id:n,type:"text",role:"combobox","aria-label":r,"aria-autocomplete":"list","aria-expanded":w,"aria-controls":y,"aria-activedescendant":I,value:a,placeholder:d,onChange:R=>{s(R.target.value),C(R.target.value),z(-1),v(!0)},onKeyDown:U,className:`min-w-0 flex-1 rounded-l-md border border-line bg-elevated px-3 py-1.5 text-ink outline-none transition-colors hover:bg-surface-strong focus:border-indigo-500 ${m}`}),h.jsx("button",{type:"button","aria-label":`Show ${r.toLowerCase()} options`,"aria-expanded":w,title:`Show ${r.toLowerCase()} options`,onMouseDown:R=>R.preventDefault(),onClick:()=>w?v(!1):J(),className:"shrink-0 rounded-r-md border border-l-0 border-line bg-elevated px-2 text-ink-muted hover:bg-surface-strong hover:text-ink focus-visible:z-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-500 transition-colors",children:h.jsx(I2,{className:`h-3.5 w-3.5 transition-transform ${w?"rotate-180":""}`})}),w&&h.jsx("ul",{id:y,role:"listbox","aria-label":`${r} options`,className:"absolute left-0 top-full z-[var(--z-combobox-list)] mt-1 max-h-60 w-full min-w-48 overflow-y-auto rounded-md border border-line bg-surface py-1 text-ink shadow-xl",children:$.length>0?$.map((R,Q)=>{const fe=p(R),B=Q===L,ne=R===a;return h.jsx("li",{id:`${y}-option-${Q}`,role:"option","aria-selected":ne,title:fe||void 0,onMouseEnter:()=>z(Q),onMouseDown:V=>V.preventDefault(),onClick:()=>ie(R),className:`cursor-pointer truncate px-3 py-1.5 ${B?"bg-elevated text-ink":"text-ink-secondary"} ${ne?"font-semibold":""}`,children:fe||"(No filter)"},`${R}-${Q}`)}):h.jsx("li",{className:"px-3 py-1.5 text-ink-muted",children:"No matching presets"})})]})}function gk({title:n,release:r,directories:a,activeDirectory:u,onDirectoryChange:s,onBrowseDirectory:d,onGoToParentDirectory:f,onGoToHomeDirectory:m,onOpenActiveDirectory:p,onOpenTerminal:x}){const[y,g]=_.useState(!1);return h.jsxs("header",{className:"relative z-30 flex flex-wrap items-center gap-3 border-b border-line bg-app/90 px-5 py-2 text-xs backdrop-blur-xl shadow-xs transition-all duration-200",children:[h.jsx("div",{className:"flex shrink-0 items-center gap-3",children:h.jsxs("div",{className:"flex items-center gap-3.5",children:[h.jsxs("div",{className:"relative flex h-9 w-9 items-center justify-center rounded-xl bg-gradient-to-br from-chip-indigo-bg to-chip-purple-bg text-chip-indigo-text border border-chip-indigo-border shadow-xs",children:[h.jsx(kd,{className:"h-4 w-4"}),h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-emerald-500 ring-2 ring-app"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-sm font-bold tracking-tight text-ink font-heading",children:"ProFiles"}),n&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"/"}),h.jsx("span",{className:"text-xs font-medium text-chip-indigo-text bg-chip-indigo-bg px-2 py-0.5 rounded-md border border-chip-indigo-border/50",children:n})]})]}),h.jsxs("p",{className:"text-[11px] font-medium text-ink-muted tracking-wide mt-0.5",children:["Crafted by ",h.jsx("span",{className:"text-ink font-semibold",children:"Florent ALBANY"})," • ",h.jsxs("span",{className:"font-mono text-chip-indigo-text",children:["v",r||"0.11.0-rc.2"]})]})]})]})}),h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[h.jsxs("label",{className:"flex shrink-0 items-center gap-1.5 font-medium text-ink-secondary text-xs",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),h.jsx("span",{children:"Directory:"})]}),h.jsx(He,{text:"Select or type a directory path to scan files from.",suppress:y,children:h.jsx(Sd,{id:"directory-combobox",ariaLabel:"Directory",value:u,options:a,onChange:s,onOpenChange:g,placeholder:"/path/to/directory",className:"w-full",inputClassName:"font-mono"})}),p&&h.jsx(He,{text:"Open the active directory in the OS file manager",block:!1,children:h.jsx("button",{type:"button",onClick:p,"aria-label":"Open active directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(L2,{className:"h-3.5 w-3.5"})})}),f&&h.jsx(He,{text:"Go to parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:f,"aria-label":"Go to parent directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Vd,{className:"h-3.5 w-3.5 rotate-180"})})}),d&&h.jsx(He,{text:"Browse for a folder on this system",block:!1,children:h.jsx("button",{type:"button",onClick:d,"aria-label":"Browse directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Ji,{className:"h-3.5 w-3.5"})})}),x&&h.jsx(He,{text:"Open the active directory in a terminal",block:!1,children:h.jsx("button",{type:"button",onClick:()=>x(u),"aria-label":"Open directory in terminal",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(kd,{className:"h-3.5 w-3.5"})})}),m&&h.jsx(He,{text:"Set directory to your home folder",block:!1,children:h.jsx("button",{type:"button",onClick:m,"aria-label":"Go to home directory",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Yd,{className:"h-3.5 w-3.5"})})})]})]})}function xk({message:n,onRetry:r,retrying:a=!1}){return h.jsx("div",{className:"flex flex-1 items-center justify-center p-8",role:"alert","data-testid":"init-error-panel",children:h.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-line bg-surface p-6 text-center shadow-xl",children:[h.jsx("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full border border-status-danger-border bg-status-danger-bg",children:h.jsx(lu,{className:"h-5 w-5 text-status-danger-text/80"})}),h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Couldn't load the app"}),h.jsx("p",{className:"mt-1 break-words text-xs text-ink-secondary",children:n}),h.jsxs("button",{type:"button",onClick:r,disabled:a,className:"btn btn-primary mx-auto mt-4 px-3.5 py-1.5 font-semibold shadow-sm",children:[h.jsx(cs,{className:`h-3.5 w-3.5 ${a?"animate-spin motion-reduce:animate-none":""}`}),h.jsx("span",{children:a?"Retrying...":"Retry"})]})]})})}const Ux=/"([^"]*)"|(\S+)/g,Bx=/"([^"]*)"/g,yk="Unmatched quote";function bk(n){const r=[];let a;for(Ux.lastIndex=0;(a=Ux.exec(n))!==null;){const f=a[1]!==void 0?a[1]:a[2];f&&f.trim()&&r.push(f)}let u="",s=0;Bx.lastIndex=0;let d;for(;(d=Bx.exec(n))!==null;)u+=n.slice(s,d.index),s=d.index+d[0].length;return u+=n.slice(s),{terms:r,error:u.includes('"')?yk:null}}function tb(n){const r=n.trim();if(!r)return{error:null,groups:[]};const{terms:a,error:u}=bk(r);if(a.length===0)return{error:u,groups:[]};const s=[];let d={includes:[],excludes:[]};for(const f of a){if(f.toUpperCase()==="OR"){s.push(d),d={includes:[],excludes:[]};continue}f==="-"||f==="+"||(f.startsWith("-")&&f.length>1?d.excludes.push(f.slice(1)):f.startsWith("+")&&f.length>1?d.includes.push(f.slice(1)):d.includes.push(f))}return s.push(d),{error:u,groups:s}}const vk=256,Ki=new Map;function Hx(n){return n.toLowerCase()}function wk(n){const r=Ki.get(n);if(r)return Ki.delete(n),Ki.set(n,r),r;const{groups:a}=tb(n),u={groups:a.map(s=>({includes:s.includes.map(Hx),excludes:s.excludes.map(Hx)}))};if(Ki.size>=vk){const s=Ki.keys().next().value;s!==void 0&&Ki.delete(s)}return Ki.set(n,u),u}function kk(n,r){return r.includes.every(a=>n.includes(a))&&!r.excludes.some(a=>n.includes(a))}function Sk(n,r){const{groups:a}=wk(r);if(a.length===0)return!0;const u=n.toLowerCase();return a.some(s=>kk(u,s))}function Nk({query:n,visible:r}){if(!r)return null;const a=tb(n);return a.error?h.jsx("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-status-danger-border bg-surface-strong px-3 py-2 text-[11px] leading-5 text-status-danger-text/90 shadow-xl",children:a.error}):a.groups.length===0?null:h.jsxs("div",{"data-testid":"filter-syntax-helper",className:"pointer-events-none absolute left-0 right-0 top-full z-[var(--z-syntax-helper)] mt-1 rounded-md border border-line bg-surface-strong px-3 py-2 text-[11px] leading-5 text-ink-secondary shadow-xl",children:[h.jsx("span",{className:"mr-1.5 align-[1px] text-[10px] uppercase tracking-wide text-ink-muted",children:"reads as"}),a.groups.map((u,s)=>h.jsxs("span",{"data-testid":"filter-syntax-group",children:[s>0&&h.jsx("span",{className:"mx-1 font-mono text-chip-indigo-text",children:"OR"}),u.includes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"font-mono text-chip-indigo-text",children:d})]},`i-${f}`)),u.includes.length>0&&u.excludes.length>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),u.excludes.map((d,f)=>h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"text-ink-muted",children:" · "}),h.jsx("span",{className:"text-ink-muted",children:"✕ "}),h.jsx("span",{className:"font-mono text-status-danger-text/70 line-through",children:d})]},`x-${f}`))]},s))]})}const qx=h.jsxs("span",{className:"flex flex-col gap-1 whitespace-nowrap text-left",children:[h.jsx("span",{className:"font-semibold",children:"Supported operators"}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a b"})," — AND (both terms)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"a OR b"})," — either term"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"-a"})," — NOT (exclude)"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:"+a"})," — force include"]}),h.jsxs("span",{children:[h.jsx("code",{className:"font-mono text-chip-indigo-text",children:'"a b"'})," — exact phrase"]})]});function Ek({extensions:n,activeExtension:r,onExtensionChange:a,filterOptions:u,filterText:s,onFilterTextChange:d,recursive:f,onRecursiveChange:m,onScan:p,scanning:x,barcodeMode:y,onBarcodeToggle:g,onCameraBarcodeClick:w,autoRescanActive:v,onTimerClick:S}){const[C,L]=_.useState(!1),[z,$]=_.useState(!1),[I,J]=_.useState(!1);return h.jsxs("div",{className:"flex w-full flex-wrap items-center gap-3 border-b border-line bg-surface-glass p-3 text-xs",children:[h.jsx(He,{text:qx,suppress:z,children:h.jsxs("div",{className:"relative min-w-0 flex-1 basis-64",onFocusCapture:ie=>{ie.target.tagName==="INPUT"&&L(!0)},onBlurCapture:ie=>{ie.target.tagName==="INPUT"&&L(!1)},children:[h.jsx($y,{className:"pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ink-secondary"}),h.jsx(Sd,{id:"filter-combobox",ariaLabel:"File filter",value:s,options:u||[],onChange:d,onOpenChange:$,placeholder:"Filter files: keyword, a OR b, -tag, exact phrase...",className:"w-full",inputClassName:"pl-9 pr-3",optionLabel:ie=>ie||"(No filter)"}),h.jsx(Nk,{query:s,visible:C&&!z&&s.trim().length>0})]})}),h.jsx(He,{text:qx,block:!1,suppress:I,children:h.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[h.jsx("span",{className:"text-ink-muted",children:"Ext:"}),h.jsx(Sd,{id:"extension-combobox",ariaLabel:"Extension filter",value:r,options:n,onChange:a,onOpenChange:J,placeholder:".py OR .toml",className:"w-44",inputClassName:"font-mono px-2.5"})]})}),h.jsx(He,{text:"Include subdirectories when scanning",block:!1,children:h.jsxs("label",{className:"flex shrink-0 cursor-pointer select-none items-center gap-1.5 text-ink-secondary",children:[h.jsx("input",{type:"checkbox",checked:f,onChange:ie=>m(ie.target.checked),className:"rounded border-line text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-1 focus-visible:ring-offset-app"}),h.jsx("span",{children:"Recursive"})]})}),h.jsx(He,{text:"Run the scan with the current criteria (Enter)",block:!1,children:h.jsxs("button",{onClick:p,disabled:x,className:"btn btn-primary shrink-0 px-3.5 py-1.5 font-semibold shadow-sm",children:[x?h.jsx(cs,{className:"h-3.5 w-3.5 animate-spin motion-reduce:animate-none"}):h.jsx(er,{className:"h-3.5 w-3.5 fill-current"}),h.jsx("span",{children:x?"Scanning...":"Scan"})]})}),h.jsx(He,{text:v?"Auto-rescan is active. Click to configure.":"Configure periodic auto-rescan (hot-folder mode)",block:!1,children:h.jsx("button",{type:"button",onClick:S,"aria-label":"Configure timer / auto-rescan",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${v?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Jy,{className:`h-3.5 w-3.5 ${v?"animate-pulse":""}`})})}),h.jsx(He,{text:"Toggle barcode scanner mode (USB HID). When active, scan a barcode to auto-fill controls and trigger a scan.",block:!1,children:h.jsx("button",{type:"button",onClick:g,"aria-label":y?"Disable barcode mode":"Enable barcode mode",className:`flex shrink-0 items-center justify-center rounded-md border p-1.5 text-ink-secondary hover:border-indigo-500 hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 transition-colors ${y?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated"}`,children:h.jsx(Gd,{className:`h-3.5 w-3.5 ${y?"animate-pulse":""}`})})}),w&&h.jsx(He,{text:"Scan barcode or QR code using webcam / camera (Ctrl + Shift + B)",block:!1,children:h.jsx("button",{type:"button",onClick:w,"aria-label":"Scan barcode with camera",className:"btn btn-secondary shrink-0 p-1.5",children:h.jsx(Xy,{className:"h-3.5 w-3.5"})})})]})}const jk=2e3,Ck=500,Tk=[{value:null,label:"ALL"},{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARNING",label:"WARNING"},{value:"ERROR",label:"ERROR"},{value:"CRITICAL",label:"CRITICAL"}],Fx={DEBUG:{icon:F2,className:"text-chip-sky-text"},INFO:{icon:Ky,className:"text-status-success-text"},WARNING:{icon:Wy,className:"text-status-warning-text"},ERROR:{icon:bd,className:"text-status-danger-text"},CRITICAL:{icon:bd,className:"text-status-danger-text"},UNKNOWN:{icon:Pr,className:"text-ink-faint"}};function _k({isOpen:n,onClose:r,onOpenExternally:a}){const[u,s]=_.useState([]),[d,f]=_.useState("profiles.log"),[m,p]=_.useState(0),[x,y]=_.useState(null),[g,w]=_.useState(""),[v,S]=_.useState(!1),[C,L]=_.useState(!0),[z,$]=_.useState(null),[I,J]=_.useState(!0),ie=_.useRef(null),U=_.useRef(null),R=_.useRef(null),Q=_.useRef(null),fe=_.useRef(C),B=_.useRef({level:x,search:g});fe.current=C,B.current={level:x,search:g};const ne=_.useCallback(async()=>{const{level:A,search:W}=B.current;S(!0);try{const le=await o2({limit:Ck,level:A,search:W});s(le.entries),f(le.path),p(le.size_bytes),$(null)}catch(le){$((le==null?void 0:le.message)||"Failed to read the log file")}finally{S(!1)}},[]);_.useEffect(()=>{n&&ne()},[n,ne]),_.useEffect(()=>{if(!n||!C)return;const A=window.setInterval(()=>{ne()},jk);return()=>window.clearInterval(A)},[n,C,ne]),_.useEffect(()=>{if(!n)return;const A=window.setTimeout(()=>void ne(),250);return()=>window.clearTimeout(A)},[n,x,g,ne]),_.useEffect(()=>{if(!I)return;const A=R.current;A&&(A.scrollTop=A.scrollHeight)},[u,I]),_.useEffect(()=>{if(!n)return;const A=document.activeElement instanceof HTMLElement?document.activeElement:null,W=requestAnimationFrame(()=>{var le;return(le=U.current)==null?void 0:le.focus()});return()=>{cancelAnimationFrame(W),A==null||A.focus()}},[n]);const V=A=>{var N;if(A.key==="Escape"){A.preventDefault(),r();return}if(A.key!=="Tab")return;const W=(N=ie.current)==null?void 0:N.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(W!=null&&W.length))return;const le=W[0],re=W[W.length-1];A.shiftKey&&document.activeElement===le?(A.preventDefault(),re.focus()):!A.shiftKey&&document.activeElement===re&&(A.preventDefault(),le.focus())},se=()=>{const A=R.current;if(!A)return;const W=A.scrollHeight-A.scrollTop-A.clientHeight<24;J(W)},ve=async()=>{try{await navigator.clipboard.writeText(u.map(A=>A.raw).join(` +`))}catch{}},ae=_.useMemo(()=>{const A=new Map;for(const W of u)A.set(W.level,(A.get(W.level)??0)+1);return A},[u]);return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:r,children:h.jsxs("div",{ref:ie,role:"dialog","aria-modal":"true","aria-labelledby":"log-viewer-title",onKeyDown:V,className:"animate-modal-in flex h-[min(84dvh,760px)] w-[clamp(560px,85vw,1500px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:A=>A.stopPropagation(),children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-line px-5 py-4 sm:px-6",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text","aria-hidden":"true"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"log-viewer-title",className:"text-base font-semibold text-ink",children:"Application logs"}),h.jsxs("p",{className:"truncate font-mono text-xs text-ink-muted",children:[d,h.jsxs("span",{className:"text-ink-faint",children:[" · ",Vx(m)]})]})]})]}),h.jsxs("div",{className:"relative min-w-[220px] flex-1",children:[h.jsx($y,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-faint","aria-hidden":"true"}),h.jsx("input",{ref:Q,type:"search",value:g,onChange:A=>w(A.target.value),placeholder:"Filter log lines…","aria-label":"Filter log lines",className:"w-full rounded-lg border border-line bg-elevated py-1.5 pl-8 pr-2.5 font-mono text-xs text-ink placeholder:text-ink-faint focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400"})]}),h.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[h.jsx(He,{text:C?"Pause live tail":"Resume live tail",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>L(A=>!A),"aria-pressed":C,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${C?"border-status-success-border bg-status-success-bg text-status-success-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${C?"bg-emerald-400":"bg-ink-faint"}`,"aria-hidden":"true"}),C?"Live":"Paused"]})}),h.jsx(He,{text:"Refresh now",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ne(),disabled:v,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(cs,{className:`h-4 w-4 ${v?"animate-spin":""}`,"aria-hidden":"true"})})}),h.jsx(He,{text:"Copy visible lines",block:!1,children:h.jsx("button",{type:"button",onClick:()=>void ve(),disabled:u.length===0,className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(An,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Open log file in the default application",block:!1,children:h.jsx("button",{type:"button",onClick:()=>{a==null||a(),r()},className:"rounded-lg border border-line bg-elevated p-2 text-ink-muted hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(uw,{className:"h-4 w-4","aria-hidden":"true"})})}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{ref:U,type:"button",onClick:r,className:"rounded-lg p-2 text-ink-muted hover:bg-hover-surface hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4","aria-hidden":"true"})})})]})]}),h.jsxs("div",{ref:R,onScroll:se,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain bg-app px-2 py-2 font-mono text-xs leading-relaxed sm:px-3",children:[h.jsxs("div",{className:"sticky top-0 z-10 mb-1 flex items-center gap-2 rounded-md border border-line/40 bg-surface/60 px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-ink-muted shadow-sm backdrop-blur-md",role:"row",children:[h.jsx("span",{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink/70",children:"Time"}),h.jsx("span",{className:"w-[52px] shrink-0 text-ink/70",children:"Level"}),h.jsx("span",{className:"w-[150px] shrink-0 text-ink/70",children:"Source"}),h.jsx("span",{className:"min-w-0 flex-1 text-ink/70",children:"Message"})]}),z&&h.jsx("p",{role:"alert",className:"px-3 py-6 text-center text-xs text-status-danger-text",children:z}),!z&&u.length===0&&!v&&h.jsx("p",{className:"px-3 py-6 text-center text-xs text-ink-faint",children:"No log entries match the current filters."}),h.jsx("ul",{className:"space-y-0.5",children:u.map((A,W)=>{const le=Fx[A.level]??Fx.UNKNOWN,re=le.icon,N=A.level==="ERROR"||A.level==="CRITICAL";return h.jsxs("li",{className:`group flex items-start gap-2 rounded px-2 py-1 ${N?"bg-status-danger-bg/40":"hover:bg-elevated/50"}`,children:[h.jsx("span",{className:le.className,children:h.jsx(re,{className:"mt-0.5 h-3.5 w-3.5","aria-hidden":"true"})}),h.jsx("span",{className:"w-[138px] shrink-0 text-ink-faint",children:A.timestamp}),h.jsx("span",{className:`w-[52px] shrink-0 text-[10px] font-semibold ${le.className}`,children:A.level}),h.jsx("span",{className:"w-[150px] shrink-0 truncate text-ink-faint",title:A.source,children:A.source}),h.jsx("span",{className:"min-w-0 flex-1 break-words text-ink-secondary",children:A.message})]},`${W}-${A.raw}`)})})]}),h.jsx("div",{className:"border-t border-line/60 bg-elevated/50 px-5 py-2.5 text-[11px] text-ink-faint shadow-sm backdrop-blur-md sm:px-6",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[h.jsx("span",{className:"mr-auto min-w-0 max-w-full basis-full truncate sm:basis-auto",role:"status","aria-atomic":"true",children:v&&u.length===0?"Loading log entries…":`${u.length} of ${Vx(m)} shown`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex overflow-hidden rounded-lg border border-line/60 text-[11px] backdrop-blur-sm",role:"group","aria-label":"Filter by log level",children:Tk.map(A=>{const W=x===A.value,le=A.value?ae.get(A.value)??0:u.length;return h.jsxs("button",{type:"button",onClick:()=>y(A.value),"aria-pressed":W,title:A.value?`Show ${A.value} and above`:"Show all levels",className:`flex items-center gap-1 px-2.5 py-1 font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${W?"bg-indigo-600 text-white":"text-ink-muted hover:bg-elevated hover:text-ink"}`,children:[A.label,h.jsx("span",{className:W?"text-chip-indigo-text":"text-ink-faint",children:le})]},A.label)})}),h.jsx(He,{text:"Scroll to the newest entry",block:!1,children:h.jsxs("button",{type:"button",onClick:()=>J(!0),"aria-pressed":I,className:`flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${I?"border-chip-indigo-border bg-chip-indigo-bg text-chip-indigo-text":"border-line bg-elevated text-ink-muted hover:text-ink"}`,children:[h.jsx(Qy,{className:"h-3.5 w-3.5","aria-hidden":"true"}),h.jsx("span",{className:"hidden sm:inline",children:"Follow tail"})]})})]}),h.jsxs("span",{className:"hidden items-center gap-1.5 lg:flex",children:[h.jsx("span",{className:"hidden sm:inline",children:"Ctrl + Shift + L"}),h.jsx("span",{children:"opens externally"})]})]})})]})}):null}function Vx(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}const Yx='button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], video[tabindex], [tabindex]:not([tabindex="-1"])';function Wr({isOpen:n,onClose:r,dialogRef:a,initialFocusRef:u}){return _.useEffect(()=>{if(!n)return;const s=document.activeElement instanceof HTMLElement?document.activeElement:null,d=requestAnimationFrame(()=>{var p;const m=(u==null?void 0:u.current)??((p=a.current)==null?void 0:p.querySelector(Yx))??a.current;m==null||m.focus()}),f=m=>{if(m.key!=="Tab")return;const p=a.current;if(!p)return;const x=Array.from(p.querySelectorAll(Yx));if(!x.length)return;const y=x[0],g=x[x.length-1],w=document.activeElement;if(!(w instanceof Node&&p.contains(w))){m.preventDefault(),(m.shiftKey?g:y).focus();return}m.shiftKey&&(w===y||w===p)?(m.preventDefault(),g.focus()):!m.shiftKey&&(w===g||w===p)&&(m.preventDefault(),y.focus())};return window.addEventListener("keydown",f,!0),()=>{cancelAnimationFrame(d),s==null||s.focus(),window.removeEventListener("keydown",f,!0)}},[n]),s=>{s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r())}}function Ak({isOpen:n,onClose:r}){const a=_.useRef(null),u=Wr({isOpen:n,onClose:r,dialogRef:a});if(!n)return null;const s=[{key:"F5",desc:"Refresh / re-scan file list"},{key:"Ctrl + R",desc:"Reload configuration & scan"},{key:"Enter",desc:"Execute / launch selected file"},{key:"P",desc:"Open properties for selected file"},{key:"↑ / ↓",desc:"Navigate file list"},{key:"Home / End",desc:"Jump to first / last file"},{key:"PageUp / PageDown",desc:"Page through the file list"},{key:"Ctrl + D",desc:"Focus Directory field"},{key:"Ctrl + E",desc:"Focus Extension field"},{key:"Ctrl + F",desc:"Focus Filter / Search field"},{key:"Ctrl + L",desc:"Focus File List"},{key:"Ctrl + Shift + L",desc:"Open the log viewer"},{key:"Ctrl + ,",desc:"Open config file"},{key:"Ctrl + Shift + T",desc:"Toggle theme (Dark / Light)"},{key:"Ctrl + B",desc:"Toggle barcode scanner mode"},{key:"Ctrl + Shift + B",desc:"Open webcam / camera barcode scanner"},{key:"Ctrl + T",desc:"Open auto-rescan timer modal"},{key:"Ctrl + H",desc:"Set directory to home folder"},{key:"? or Ctrl + /",desc:"Show keyboard shortcuts"},{key:"Y / S / N",desc:"Answer workflow guard: Yes / Skip / No (prompt open)"},{key:"Enter",desc:"Confirm active workflow prompt (prompt open)"},{key:"Escape",desc:"Close dialogs / context menu"}];return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",onKeyDown:u,className:"animate-modal-in w-[450px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Zy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Keyboard Shortcuts"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"max-h-[60vh] space-y-2 overflow-y-auto pr-1 text-xs",children:s.map(({key:d,desc:f})=>h.jsxs("div",{className:"flex items-center justify-between rounded-lg bg-elevated/50 px-3 py-2",children:[h.jsx("span",{className:"text-ink-secondary",children:f}),h.jsx("kbd",{className:"rounded bg-app px-2 py-0.5 font-mono text-[11px] font-semibold text-chip-indigo-text border border-line",children:d})]},d))}),h.jsx("div",{className:"mt-5 flex justify-end",children:h.jsx("button",{onClick:r,className:"btn btn-primary rounded-lg px-4 py-2 font-semibold",children:"Close"})})]})})}function zk({isOpen:n,activeConfigPath:r,configExists:a=!0,onClose:u,onLoaded:s}){const[d,f]=_.useState(null),[m,p]=_.useState(""),[x,y]=_.useState(null),[g,w]=_.useState(!1),[v,S]=_.useState(null),C=_.useRef(null),L=_.useRef(null),z=_.useRef(null),$=a===!1;_.useEffect(()=>{var ne;if(!n){(ne=z.current)==null||ne.focus();return}z.current=document.activeElement instanceof HTMLElement?document.activeElement:null,S(null);const R=r??"",Q=Math.max(R.lastIndexOf("/"),R.lastIndexOf("\\")),fe=Q>0?R.slice(0,Q):"";I(fe);const B=requestAnimationFrame(()=>{var V;return(V=L.current)==null?void 0:V.focus()});return()=>{var V;cancelAnimationFrame(B),(V=z.current)==null||V.focus()}},[n,r]);const I=async R=>{w(!0),S(null);try{const Q=await m2(R);f(Q),p(Q.current_path),r&&Q.items.some(fe=>fe.path===r)?y(r):y(null)}catch(Q){S(Q.message||"Navigation failed")}finally{w(!1)}},J=R=>{var ne;if(R.key==="Escape"){R.preventDefault(),u();return}if(R.key!=="Tab")return;const Q=(ne=C.current)==null?void 0:ne.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(Q!=null&&Q.length))return;const fe=Q[0],B=Q[Q.length-1];R.shiftKey&&document.activeElement===fe?(R.preventDefault(),B.focus()):!R.shiftKey&&document.activeElement===B&&(R.preventDefault(),fe.focus())},ie=async()=>{var Q;const R=x||(((Q=d==null?void 0:d.items.find(fe=>fe.is_config))==null?void 0:Q.path)??null);if(!R){S("Select a configuration file to load.");return}try{w(!0);const fe=await c2(R);s(fe),u()}catch(fe){S(fe.message||"Unable to load configuration")}finally{w(!1)}},U=async()=>{const R=(m||(d==null?void 0:d.current_path)||"").trim();if(!R){S("Choose a directory before creating a configuration.");return}try{w(!0);const Q=await h2(R);s(Q),u()}catch(Q){S(Q.message||"Unable to create configuration")}finally{w(!1)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/65 p-3 backdrop-blur-sm sm:p-6",onClick:u,children:h.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-labelledby":"load-config-title",onKeyDown:J,className:"animate-modal-in flex h-[min(84dvh,760px)] max-h-[calc(100dvh-1.5rem)] w-[min(94vw,960px)] min-h-0 flex-col overflow-hidden rounded-xl border border-frame-line glass-panel sm:rounded-2xl",onClick:R=>R.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-line px-4 py-3 sm:px-5",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-chip-indigo-bg",children:h.jsx(Kr,{className:"h-5 w-5 text-chip-indigo-text"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{id:"load-config-title",className:"text-sm font-semibold text-ink",children:$?"Create configuration":"Load configuration"}),h.jsx("p",{className:"truncate font-mono text-xs text-ink-muted",children:(d==null?void 0:d.current_path)||""})]})]}),h.jsx(He,{text:"Close",block:!1,children:h.jsx("button",{type:"button",onClick:u,"aria-label":"Close configuration modal",className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-ink-muted transition-colors hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(nl,{className:"h-4 w-4"})})})]}),$&&h.jsx("div",{className:"border-b border-line bg-chip-indigo-bg/20 px-4 py-3 text-xs text-ink-secondary",children:"No configuration file was found. Create one here?"}),h.jsxs("div",{className:"border-b border-line px-4 py-3 sm:px-5",children:[h.jsx("label",{htmlFor:"config-path-input",className:"mb-1.5 block text-xs font-medium text-ink-secondary",children:"Configuration directory"}),h.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[h.jsx("input",{ref:L,id:"config-path-input",type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&I(m.trim())},placeholder:"/path/to/directory",className:"h-10 min-w-0 flex-1 rounded-lg border border-line bg-elevated px-2.5 font-mono text-sm text-ink outline-none placeholder:text-ink-faint transition-colors hover:bg-surface-strong focus-visible:border-indigo-500 focus-visible:ring-2 focus-visible:ring-indigo-500/30"}),h.jsx("button",{type:"button",onClick:()=>I(m.trim()),className:"inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-line bg-elevated px-3.5 text-sm font-medium text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Go"}),h.jsx(He,{text:"Home directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(""),"aria-label":"Home directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Yd,{className:"h-4 w-4"})})}),(d==null?void 0:d.parent_path)&&h.jsx(He,{text:"Parent directory",block:!1,children:h.jsx("button",{type:"button",onClick:()=>I(d.parent_path),"aria-label":"Parent directory",className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg border border-line bg-elevated text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:h.jsx(Vd,{className:"h-4 w-4 rotate-180"})})})]})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2 sm:px-3 sm:py-3","aria-busy":g,children:g?h.jsxs("div",{className:"flex h-full items-center justify-center gap-2.5 text-sm text-ink-muted",children:[h.jsx(Wi,{className:"h-5 w-5 animate-spin text-chip-indigo-text"}),h.jsx("span",{role:"status",children:"Loading configuration files…"})]}):v?h.jsxs("div",{role:"alert",className:"flex h-full flex-col items-center justify-center gap-2.5 text-center",children:[h.jsx("p",{className:"text-sm text-status-danger-text",children:v}),h.jsx("button",{type:"button",onClick:()=>I(m||(d==null?void 0:d.current_path)||""),className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Retry"})]}):h.jsxs("ul",{className:"space-y-1",children:[d==null?void 0:d.items.map(R=>{if(R.is_dir)return h.jsx("li",{children:h.jsx("button",{onClick:()=>I(R.path),onDoubleClick:()=>I(R.path),className:"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-left text-xs text-ink-secondary hover:bg-elevated",children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(ss,{className:"h-3.5 w-3.5 text-chip-indigo-text"}),R.name]})})},R.path);const Q=x===R.path;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>y(R.path),"aria-pressed":Q,className:`flex w-full items-center justify-between rounded-lg px-3 py-1.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-indigo-400 ${Q?"bg-chip-indigo-bg text-chip-indigo-text":"text-ink-secondary hover:bg-elevated hover:text-ink"}`,children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2.5",children:[h.jsx(Pr,{className:"h-5 w-5 shrink-0 text-chip-amber-text"}),h.jsx("span",{className:"truncate",children:R.name})]}),R.is_config&&h.jsx(Kr,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"}),Q&&h.jsx(vi,{className:"h-4 w-4 shrink-0 text-chip-indigo-text"})]})},R.path)}),(d==null?void 0:d.items.filter(R=>R.is_config).length)===0&&h.jsxs("li",{className:"flex h-full min-h-36 flex-col items-center justify-center gap-2.5 text-center text-sm text-ink-muted",children:[h.jsx(Pr,{className:"h-7 w-7 text-ink-faint"}),"No configuration files found"]})]})}),h.jsxs("div",{className:"flex flex-col gap-2 border-t border-line px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"mb-0.5 text-xs font-medium text-ink-muted",children:"Selected file"}),h.jsx("p",{className:"truncate font-mono text-sm text-ink",title:x||m,children:x||m||"—"})]}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-1.5",children:[h.jsx("button",{type:"button",onClick:u,className:"min-h-10 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:"Cancel"}),$?h.jsxs("button",{type:"button",onClick:U,disabled:!m.trim(),className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Create configuration"]}):h.jsxs("button",{type:"button",onClick:ie,disabled:!x,className:"btn btn-primary min-h-10 rounded-lg px-4 text-sm font-semibold",children:[h.jsx(Kr,{className:"h-4 w-4"}),"Load configuration"]})]})]})]})}):null}function nb({isOpen:n,onClose:r,initialFilePath:a,md5:u}){const[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState([]),[y,g]=_.useState(!1),[w,v]=_.useState(null),[S,C]=_.useState(!1),[L,z]=_.useState(!1),[$,I]=_.useState(null),J=_.useRef(null),ie=Wr({isOpen:n,onClose:r,dialogRef:J});_.useEffect(()=>{if(!n)return;async function ae(){if(a){g(!0);try{const A=await _x({filePath:a});d(A.image),m(A.content),U(A.content)}catch(A){v(A.message)}finally{g(!1)}}}ae()},[n,a]);const U=ae=>{const A=ae.split(";").map(W=>{const le=W.split("=");return{key:le[0]||"",value:le[1]||""}}).filter(W=>W.key||W.value);x(A)},R=async ae=>{const A=ae.filter(W=>W.key.trim()).map(W=>`${W.key.trim()}=${W.value.trim()}`).join(";");if(m(A),!A){d(null);return}try{const W=await _x({content:A});d(W.image)}catch(W){console.error("Failed to re-generate barcode:",W)}},Q=(ae,A,W)=>{const le=[...p];le[ae][A]=W,x(le),R(le)},fe=()=>{const ae=[...p,{key:"",value:""}];x(ae)},B=ae=>{const A=p.filter((W,le)=>le!==ae);x(A),R(A)},ne=()=>{if(!u||p.some(A=>A.key.toLowerCase()==="md5"))return;const ae=[...p,{key:"md5",value:u}];x(ae),R(ae)},V=async()=>{if(s){I("Saving…");try{const ae=await v2(s,`profiles-qr-${Date.now()}.png`);I(ae.path||ae.message)}catch(ae){I(`Save failed: ${(ae==null?void 0:ae.message)??ae}`)}finally{setTimeout(()=>I(null),6e3)}}},se=async()=>{try{await navigator.clipboard.writeText(f),C(!0),setTimeout(()=>C(!1),2e3)}catch(ae){console.error("Copy failed",ae)}},ve=async()=>{if(s)try{const A=await(await fetch(s)).blob();await navigator.clipboard.write([new ClipboardItem({[A.type]:A})]),z(!0),setTimeout(()=>z(!1),2e3)}catch(ae){console.error("Image copy failed",ae)}};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4",onClick:r,children:h.jsxs("div",{ref:J,role:"dialog","aria-modal":"true","aria-label":"QR Code Settings",onKeyDown:ie,className:"animate-modal-in w-full max-w-md rounded-xl border border-frame-line glass-panel p-6",onClick:ae=>ae.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h.jsx("h3",{className:"text-sm font-semibold text-ink",children:"QR Code Settings"}),h.jsx("button",{onClick:r,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),y?h.jsx("div",{className:"flex h-48 items-center justify-center",children:h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"})}):w?h.jsx("div",{className:"rounded-md border border-status-danger-border bg-status-danger-bg p-4 text-center text-xs text-status-danger-text",children:w}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsxs("div",{className:"relative group",children:[h.jsx("div",{className:"h-48 w-48 overflow-hidden rounded-lg border border-line bg-white p-2",children:s?h.jsx("img",{src:s,alt:"QR Code",className:"h-full w-full object-contain"}):h.jsx("div",{className:"flex h-full items-center justify-center text-xs text-slate-400",children:"No content"})}),s&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/20 rounded-lg",children:h.jsxs("button",{onClick:ve,className:"focus-ring flex items-center gap-2 rounded-md bg-white/90 p-2 text-xs font-medium text-slate-900 shadow-sm hover:bg-white",children:[L?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"}),L?"Copied":"Copy Image"]})})]}),h.jsxs("div",{className:"flex w-full gap-2",children:[h.jsxs("button",{onClick:se,className:"btn btn-secondary flex-1 px-3 py-1.5",children:[S?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5"}),"Copy Content"]}),h.jsxs("button",{onClick:V,disabled:!s,className:"btn btn-primary flex-1 px-3 py-1.5",children:[h.jsx(Iy,{className:"h-3.5 w-3.5"}),"Save Image"]})]}),$&&h.jsx("p",{className:"break-all text-center text-[11px] text-ink-muted",role:"status",children:$})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("label",{className:"text-xs font-medium text-ink-muted uppercase tracking-wider",children:"Payload Fields"}),h.jsxs("div",{className:"flex gap-2",children:[u&&!p.some(ae=>ae.key==="md5")&&h.jsxs("button",{onClick:ne,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-purple-text border border-chip-purple-border",children:[h.jsx(Zr,{className:"h-3 w-3"})," Inc. MD5"]}),h.jsxs("button",{onClick:fe,className:"btn-chip flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold text-chip-indigo-text border border-chip-indigo-border",children:[h.jsx(Lw,{className:"h-3 w-3"})," Add Field"]})]})]}),h.jsxs("div",{className:"max-h-48 space-y-2 overflow-y-auto pr-1 custom-scrollbar",children:[p.map((ae,A)=>h.jsxs("div",{className:"flex gap-2 items-center slide-in",children:[h.jsx("input",{type:"text",placeholder:"key",value:ae.key,onChange:W=>Q(A,"key",W.target.value),className:"w-1/3 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("input",{type:"text",placeholder:"value",value:ae.value,onChange:W=>Q(A,"value",W.target.value),className:"flex-1 rounded border border-line bg-elevated px-2 py-1 text-xs text-ink focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{onClick:()=>B(A),className:"p-1 text-ink-muted hover:text-status-danger-text transition-colors","aria-label":"Remove field",children:h.jsx(Py,{className:"h-3.5 w-3.5"})})]},A)),p.length===0&&h.jsx("p",{className:"text-center py-4 text-xs text-ink-muted italic",children:"No fields defined"})]})]}),h.jsxs("div",{className:"pt-2 border-t border-line",children:[h.jsx("label",{className:"text-[10px] font-medium text-ink-muted uppercase tracking-wider block mb-1.5",children:"Raw Preview"}),h.jsx("div",{className:"rounded bg-elevated p-2 font-mono text-[10px] text-ink-secondary break-all border border-line",children:f||h.jsx("span",{className:"italic text-ink-muted/50",children:"empty"})})]})]})]})}):null}const Gx=["Bytes","KB","MB","GB","TB"];function lb(n){if(n===0)return"0 Bytes";const r=1024,a=Math.max(0,Math.min(Gx.length-1,Math.floor(Math.log(n)/Math.log(r))));return parseFloat((n/Math.pow(r,a)).toFixed(2))+" "+Gx[a]}function Dk(n){const r=Math.max(n.lastIndexOf("\\"),n.lastIndexOf("/"));return r===-1?"":n.slice(0,r)}function Mk(n){const r=[`File Properties: ${n.name}`,`Path: ${n.path}`,`Type: ${n.type}`,`Size: ${lb(n.size_bytes)}`,`Created: ${n.created}`,`Modified: ${n.modified}`];return n.md5&&r.push(`MD5: ${n.md5}`),n.sha256&&r.push(`SHA256: ${n.sha256}`),r.join(` +`)}function td(n,r,a){return n.length<=r+a+1?n:`${n.slice(0,r)}…${n.slice(-a)}`}function Ok(n){const r=n.includes("\\")?"\\":"/",a=n.split(/[\\/]/);return a.length<=5?n:[a[0],a[1],"…",a[a.length-2],a[a.length-1]].join(r)}const Rk=[{ms:1e3*60,unit:"minute"},{ms:1e3*60*60,unit:"hour"},{ms:1e3*60*60*24,unit:"day"},{ms:1e3*60*60*24*30,unit:"month"},{ms:1e3*60*60*24*365,unit:"year"}];function Qx(n,r=new Date){const a=new Date(n.replace(" ","T"));if(Number.isNaN(a.getTime()))return"just now";const u=r.getTime()-a.getTime();if(u<6e4)return"just now";let s="just now";for(const{ms:d,unit:f}of Rk){if(u{var V;n||((V=I.current)==null||V.focus(),v(!1))},[n]),_.useEffect(()=>{if(!n||!r)return;const V=new AbortController;return J.current=V,d(null),z(null),m(!0),x(null),(async()=>{try{const se=await y2(r.path,V.signal);if(J.current!==V)return;d(se)}catch(se){if(J.current!==V||se instanceof DOMException&&se.name==="AbortError")return;x(se instanceof Error?se.message:"Failed to load properties")}finally{J.current===V&&m(!1)}})(),()=>{J.current=null,V.abort()}},[n,r]),_.useEffect(()=>{if(!n)return;const V=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=V}},[n]),_.useEffect(()=>{if(!n)return;const V=se=>{if(se.key==="Escape"){if(w)return;a();return}if(se.key!=="Tab")return;const ve=$.current;if(!ve)return;const ae=Array.from(ve.querySelectorAll('button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(re=>re.offsetParent!==null);if(ae.length===0)return;const A=ae[0],W=ae[ae.length-1],le=document.activeElement instanceof HTMLElement?document.activeElement:null;se.shiftKey?(le===A||!ve.contains(le))&&(se.preventDefault(),W.focus()):le===W&&(se.preventDefault(),A.focus())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[n,w,a]),_.useEffect(()=>{if(!n)return;const V=document.activeElement instanceof HTMLElement?document.activeElement:null;I.current=V;const se=requestAnimationFrame(()=>{var ve,ae;(ae=(ve=$.current)==null?void 0:ve.querySelector("button"))==null||ae.focus()});return()=>cancelAnimationFrame(se)},[n]);const ie=async(V,se)=>{try{await navigator.clipboard.writeText(V),g(se),setTimeout(()=>g(null),2e3)}catch(ve){console.error("Failed to copy:",ve)}},U=async(V,se,ve)=>{C(V),z(null);try{await ve(),z(se)}catch{z("Action failed")}finally{C(null)}},R=V=>`btn btn-chip rounded-md border px-3 py-2 text-xs ${{reveal:"bg-chip-sky-bg text-chip-sky-text border-chip-sky-border",launch:"border-emerald-500/30 bg-emerald-600 font-semibold text-white hover:bg-emerald-500",folder:"bg-chip-amber-bg text-chip-amber-text border-chip-amber-border"}[V]??"bg-chip-indigo-bg text-chip-indigo-text border-chip-indigo-border"}`,Q=(V,se,ve,ae=!1,A)=>h.jsxs("div",{className:"flex items-start gap-2 py-1.5 group",children:[h.jsxs("span",{className:"text-ink-muted min-w-[100px] text-xs",children:[V,":"]}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("span",{className:`text-ink text-xs break-all ${ae?"font-mono":""}`,children:A??se})}),h.jsx(He,{text:"Copy to clipboard",block:!1,children:h.jsx("button",{onClick:()=>ie(se,ve),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-elevated","aria-label":`Copy ${V}`,children:y===ve?h.jsx(vi,{className:"h-3.5 w-3.5 text-status-success-text"}):h.jsx(An,{className:"h-3.5 w-3.5 text-ink-muted"})})})]}),fe=(V,se,ve)=>h.jsxs("div",{className:"rounded-lg border border-line bg-elevated p-4",children:[h.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[se,h.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:V})]}),ve]}),B=()=>h.jsx(He,{text:"Click to copy full path",children:h.jsxs("button",{onClick:()=>void ie(s.path,"path"),className:"group mb-3 flex w-full items-center gap-2 rounded-lg border border-line bg-elevated px-3 py-2 text-left hover:bg-surface",children:[h.jsx(ss,{className:"text-chip-amber-text h-4 w-4 flex-shrink-0"}),h.jsx("span",{className:"text-ink min-w-0 flex-1 truncate font-mono text-xs",children:Ok(s.path)}),y==="path"?h.jsx(vi,{className:"text-status-success-text h-3.5 w-3.5"}):h.jsx(An,{className:"text-ink-muted h-3.5 w-3.5"})]})});if(!n||!r)return null;const ne=r;return h.jsxs("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 backdrop-blur-md p-4",role:"dialog","aria-modal":"true","aria-labelledby":"properties-modal-title",children:[h.jsx("div",{className:"absolute inset-0",onClick:a,onContextMenu:V=>{V.preventDefault(),a()}}),h.jsxs("div",{ref:$,className:"animate-modal-in relative w-full max-w-4xl max-h-[90vh] overflow-hidden rounded-xl border border-frame-line glass-panel flex flex-col",children:[h.jsx("div",{className:"flex-shrink-0 border-b border-line px-6 py-4",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[h.jsx("div",{className:"rounded-lg bg-indigo-600 p-2 flex-shrink-0",children:h.jsx(Wf,{className:"h-5 w-5 text-white"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{id:"properties-modal-title",className:"text-base font-semibold text-ink truncate",children:"File Properties"}),h.jsx("p",{className:"text-xs text-ink-muted truncate",children:r.filename})]}),h.jsx(He,{text:"Copy all properties to clipboard",block:!1,children:h.jsx("button",{onClick:()=>{s&&ie(Mk(s),"all")},disabled:!s||f||p!==null,className:"btn-chip ml-2 flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text","aria-label":"Copy all properties",children:y==="all"?h.jsx(vi,{className:"h-4 w-4 text-status-success-text"}):h.jsx(An,{className:"h-4 w-4"})})}),h.jsx(He,{text:"Generate Barcode/QR Code",block:!1,children:h.jsx("button",{onClick:()=>v(!0),className:"btn-chip rounded-md border border-chip-indigo-border bg-chip-indigo-bg p-1.5 text-chip-indigo-text",children:h.jsx(Gd,{className:"h-4 w-4"})})})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-md p-1 text-ink-muted hover:bg-elevated hover:text-ink flex-shrink-0","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]})}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[f&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsxs("div",{className:"flex flex-col items-center gap-2",children:[h.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent"}),h.jsx("p",{className:"text-xs text-ink-muted",children:"Loading properties..."})]})}),p&&h.jsx("div",{className:"rounded-lg border border-status-danger-border bg-status-danger-bg p-4 text-center",children:h.jsx("p",{className:"text-xs text-status-danger-text",children:p})}),s&&!f&&!p&&h.jsxs("div",{children:[h.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-lg border border-line bg-elevated px-4 py-2.5",children:[h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-indigo-border bg-chip-indigo-bg px-2 py-0.5 text-xs font-semibold text-chip-indigo-text",children:s.type}),s.attributes.extension&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-line bg-surface px-2 py-0.5 text-xs font-medium text-ink-muted",children:s.attributes.extension}),h.jsxs("span",{className:"text-xs text-ink-muted",title:`${s.size_bytes} bytes`,children:["Size ",h.jsx("strong",{className:"text-ink font-medium",children:lb(s.size_bytes)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.created,children:["Created ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.created)})]}),h.jsxs("span",{className:"text-xs text-ink-muted",title:s.modified,children:["Modified ",h.jsx("strong",{className:"text-ink font-medium",children:Qx(s.modified)})]}),s.md5&&h.jsx("span",{className:"inline-flex items-center rounded-md border border-chip-purple-border bg-chip-purple-bg px-2 py-0.5 font-mono text-xs font-medium text-chip-purple-text",title:`MD5 ${s.md5}`,children:td(s.md5,4,4)}),s.attributes.is_symlink&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-chip-fuchsia-border bg-chip-fuchsia-bg px-2 py-0.5 text-xs font-medium text-chip-fuchsia-text",children:[h.jsx(jw,{className:"h-3 w-3"})," Symlink"]})]}),B(),h.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[fe("Hashes",h.jsx(Zr,{className:"text-chip-purple-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("MD5",s.md5,"md5",!0,td(s.md5,10,6)),Q("SHA256",s.sha256,"sha256",!0,td(s.sha256,10,6))]})),fe("Timestamps",h.jsx(Y2,{className:"text-chip-sky-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Created",s.created,"created",!0),Q("Modified",s.modified,"modified",!0)]})),fe("Identity",h.jsx(Wf,{className:"text-chip-indigo-text h-3.5 w-3.5"}),h.jsxs("div",{className:"space-y-0.5",children:[Q("Type",s.type,"type"),s.attributes.stem&&Q("Stem",s.attributes.stem,"attrStem"),Q("Extension",s.name.includes(".")?s.name.slice(s.name.lastIndexOf(".")):"None","extension"),Q("Directory",Dk(s.path)||"None","directory",!0)]})),fe("System",h.jsx(Wf,{className:"text-status-success-text h-3.5 w-3.5"}),h.jsxs("div",{children:[h.jsxs("div",{className:"mb-1 flex min-h-[24px] flex-wrap items-center gap-1.5",children:[s.attributes.is_readonly&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-status-danger-border bg-status-danger-bg px-2 py-0.5 text-xs text-status-danger-text",children:[h.jsx(_w,{className:"h-3 w-3"})," Read-only"]}),s.attributes.is_hidden&&h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-slate-500/30 bg-slate-600/20 px-2 py-0.5 text-xs text-slate-300",children:[h.jsx(sw,{className:"h-3 w-3"})," Hidden"]}),!s.attributes.is_readonly&&!s.attributes.is_hidden&&!s.attributes.is_symlink&&h.jsx("span",{className:"text-xs text-ink-muted",children:"No special flags"})]}),h.jsxs("div",{className:"space-y-0.5",children:[Q("File Type",s.attributes.is_file?"Regular File":s.attributes.is_dir?"Directory":"Other","fileType"),s.attributes.permissions&&Q("Permissions",s.attributes.permissions,"permissions",!0),s.attributes.owner_uid!==void 0&&Q("Owner UID",String(s.attributes.owner_uid),"ownerUid"),s.attributes.group_gid!==void 0&&Q("Group GID",String(s.attributes.group_gid),"groupGid")]})]}))]})]})]}),h.jsx("div",{className:"flex-shrink-0 border-t border-line px-6 py-3",children:h.jsxs("div",{className:"flex justify-between items-center gap-2",children:[h.jsx("p",{className:"min-w-0 text-xs text-ink-muted truncate",children:L??"Click the copy icon next to any field to copy its value"}),h.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[h.jsx(He,{text:"Show file in Explorer",block:!1,children:h.jsxs("button",{onClick:()=>void U("reveal","Revealed in Explorer",()=>Yy(ne.path)),disabled:S!==null,className:R("reveal"),children:[h.jsx(vd,{className:"h-3.5 w-3.5"})," Reveal"]})}),h.jsx(He,{text:"Launch file with default association",block:!1,children:h.jsxs("button",{onClick:()=>{u&&(C("launch"),Promise.resolve(u(ne)).finally(()=>C(null)))},disabled:S!==null||!u,className:R("launch"),children:[h.jsx(er,{className:"h-3.5 w-3.5"})," Launch"]})}),h.jsx(He,{text:"Open containing folder",block:!1,children:h.jsxs("button",{onClick:()=>void U("folder","Opened folder",()=>yd(ne.path)),disabled:S!==null,className:R("folder"),children:[h.jsx(Ji,{className:"h-3.5 w-3.5"})," Open Folder"]})}),h.jsx("button",{onClick:a,className:"btn btn-primary px-4 py-2",children:"Close"})]})]})})]}),h.jsx(nb,{isOpen:w,onClose:()=>v(!1),initialFilePath:r.path,md5:s==null?void 0:s.md5})]})}const Uk=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"],Bk=250,Hk=400,qk=.7;function Fk(n,r=Hk,a=qk){const u=n.videoWidth,s=n.videoHeight;if(!u||!s)return null;const d=Math.min(u,s),f=document.createElement("canvas");f.width=Math.min(r,d),f.height=f.width;const m=f.getContext("2d");if(!m)return null;m.drawImage(n,(u-d)/2,(s-d)/2,d,d,0,0,f.width,f.height);const p=f.toDataURL("image/jpeg",a);return p.slice(p.indexOf(",")+1)}function Vk(n,r){const a=n.intervalMs??Bk;let u=!1,s=!1;const d=()=>{u=!0,clearInterval(f)},f=setInterval(()=>{if(u||s)return;const m=n.capture();m&&(s=!0,n.decode(m).then(p=>{u||p.decoded&&(d(),r.onDetected(p.decoded))}).catch(p=>{u||(d(),r.onError(p instanceof Error?p.message:"Frame decoding failed"))}).finally(()=>{s=!1}))},a);return d}const Yk=8e3;function Gk({isOpen:n,onClose:r,onDetected:a}){const u=_.useRef(null),s=_.useRef(null),d=Wr({isOpen:n,onClose:r,dialogRef:s}),f=_.useRef(null),m=_.useRef(null),p=_.useRef(null),[x,y]=_.useState(null),[g,w]=_.useState(!1),v=()=>{p.current&&(p.current(),p.current=null),m.current&&(cancelAnimationFrame(m.current),m.current=null),f.current&&(f.current.getTracks().forEach(L=>L.stop()),f.current=null),u.current&&(u.current.srcObject=null)};_.useEffect(()=>{if(!n){v(),y(null);return}let L=!0;async function z(){var I,J,ie,U,R;if(y(null),w(!1),typeof window<"u"&&!window.isSecureContext&&window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1"){y("Camera access requires HTTPS or localhost. If connecting across a local network IP (e.g. 192.168.x.x), modern browsers disable camera access for insecure HTTP.");return}const $=((J=(I=navigator.mediaDevices)==null?void 0:I.getUserMedia)==null?void 0:J.bind(navigator.mediaDevices))||((ie=navigator.getUserMedia)==null?void 0:ie.bind(navigator))||((U=navigator.webkitGetUserMedia)==null?void 0:U.bind(navigator))||((R=navigator.mozGetUserMedia)==null?void 0:R.bind(navigator));if(!$){y(window.isSecureContext?"Camera access is not supported by your browser or environment.":"Camera access is blocked because the page is not served over a secure origin (HTTPS or localhost/127.0.0.1).");return}try{let Q;const fe=await Promise.race([$({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),new Promise((B,ne)=>{Q=window.setTimeout(()=>ne(new DOMException("Camera did not start in time","TimeoutError")),Yk)})]).finally(()=>{Q!==void 0&&window.clearTimeout(Q)});if(!L){fe.getTracks().forEach(B=>B.stop());return}f.current=fe,u.current&&(u.current.srcObject=fe,await u.current.play()),"BarcodeDetector"in window?C():S()}catch(Q){if(!L)return;console.error("Camera access error:",Q),y(Q.name==="NotAllowedError"||Q.name==="PermissionDeniedError"?"Camera permission denied. Please allow camera access in your browser settings.":Q.name==="TimeoutError"?"The camera did not start in time. On macOS, camera capture needs the packaged desktop app — a bare Python process cannot access the camera. Alternatively, open ProFiles in Chrome, Edge or Safari.":`Could not access camera: ${Q.message||"Unknown error"}`)}}return z(),()=>{L=!1,v()}},[n]);const S=()=>{w(!0),p.current=Vk({capture:()=>u.current?Fk(u.current):null,decode:L=>x2({imageBase64:L,formats:[...Uk]})},{onDetected:L=>{v(),a(L)},onError:L=>{v(),y(L)}})},C=()=>{const L=["qr_code","code_128","code_39","ean_13","ean_8","upc_a","upc_e","data_matrix"];let z;try{z=new window.BarcodeDetector({formats:L})}catch(I){console.warn("BarcodeDetector formats unsupported:",I),z=new window.BarcodeDetector}const $=async()=>{if(!u.current||u.current.readyState<2){m.current=requestAnimationFrame($);return}try{const I=await z.detect(u.current);if(I&&I.length>0){const J=I[0].rawValue;if(J){v(),a(J);return}}}catch(I){console.debug("Frame detection error:",I)}m.current=requestAnimationFrame($)};m.current=requestAnimationFrame($)};return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",onClick:r,children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Camera barcode scanner",onKeyDown:d,className:"relative w-full max-w-lg rounded-2xl border border-frame-line glass-panel p-6 flex flex-col",onClick:L=>L.stopPropagation(),children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Xy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Scan with Camera"})]}),h.jsx("button",{onClick:r,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink transition-colors","aria-label":"Close",children:h.jsx(nl,{className:"h-4 w-4"})})]}),x?h.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[h.jsx("div",{className:"rounded-full bg-status-danger-bg p-3 text-status-danger-text mb-3",children:h.jsx(lu,{className:"h-6 w-6"})}),h.jsx("p",{className:"text-xs text-status-danger-text max-w-xs",children:x}),h.jsx("button",{onClick:r,className:"btn btn-secondary mt-6 px-4 py-2",children:"Close"})]}):h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"relative aspect-video w-full overflow-hidden rounded-xl bg-black border border-line flex items-center justify-center",children:[h.jsx("video",{ref:u,playsInline:!0,muted:!0,className:"h-full w-full object-cover"}),h.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:h.jsxs("div",{className:"relative h-48 w-48 rounded-lg border-2 border-dashed border-indigo-400/80 bg-indigo-500/5 shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",children:[h.jsx("div",{className:"absolute top-0 left-0 h-4 w-4 border-t-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute top-0 right-0 h-4 w-4 border-t-2 border-r-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 left-0 h-4 w-4 border-b-2 border-l-2 border-indigo-400"}),h.jsx("div",{className:"absolute bottom-0 right-0 h-4 w-4 border-b-2 border-r-2 border-indigo-400"})]})})]}),h.jsx("p",{className:"mt-4 text-center text-xs text-ink-muted",children:g?"Hold a QR code or barcode steady in front of your camera — frames are decoded by the local ProFiles server (no native Barcode Detector in this browser).":"Hold a QR code or barcode steady in front of your camera to auto-scan."})]})]})}):null}function Qk({isOpen:n,file:r,onConfirm:a,onDismiss:u}){const s=_.useRef(null);return _.useEffect(()=>{var d;if(n){const f=m=>{m.key==="Enter"?(m.preventDefault(),a()):m.key==="Escape"&&(m.preventDefault(),u())};return window.addEventListener("keydown",f),(d=s.current)==null||d.focus(),()=>window.removeEventListener("keydown",f)}},[n,a,u]),!n||!r?null:h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:u,children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`1 file matched: ${r.filename}`,className:"animate-modal-in w-full max-w-sm rounded-xl border border-frame-line glass-panel p-5 flex flex-col gap-4",onClick:d=>d.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink text-sm",children:[r.has_hook?h.jsx(ek,{className:"h-4 w-4 text-chip-purple-text"}):h.jsx(er,{className:"h-4 w-4 text-status-success-text"}),h.jsx("span",{children:"1 File Matched"})]}),h.jsx("button",{onClick:u,className:"focus-ring rounded p-1 text-ink-muted hover:bg-elevated hover:text-ink","aria-label":"Dismiss",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-line bg-elevated/50 p-3",children:[h.jsx(Pr,{className:"h-5 w-5 text-chip-indigo-text shrink-0 mt-0.5"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h4",{className:"text-xs font-semibold text-ink truncate",children:r.filename}),h.jsx("p",{className:"text-[11px] text-ink-muted truncate mt-0.5",children:r.rel_path||r.path}),r.has_hook&&h.jsx("span",{className:"inline-block mt-1 text-[10px] text-chip-purple-text bg-chip-purple-bg px-1.5 py-0.5 rounded border border-chip-purple-border/50 font-medium",children:"Workflow Hook Configured"})]})]}),h.jsx("p",{className:"text-xs text-ink-muted text-center",children:"Launch this file now?"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{type:"button",onClick:u,className:"btn btn-secondary flex-1 px-3 py-1.5",children:"Dismiss (Esc)"}),h.jsxs("button",{ref:s,type:"button",onClick:a,className:"btn btn-primary flex-1 px-3 py-1.5 shadow-md",children:[h.jsx(er,{className:"h-3 w-3 fill-current"}),"Launch (Enter)"]})]})]})})}function Xk({systemInfo:n,fileCount:r,theme:a,onToggleTheme:u,onOpenLog:s,onOpenConfig:d,onLoadConfig:f,onShowShortcuts:m,onReloadConfig:p,onExport:x,exportDisabled:y=!1,language:g="en",onLanguageChange:w,activeConfigName:v,lanEnabled:S,onToggleLan:C}){return h.jsxs("footer",{className:"flex items-center justify-between border-t border-line bg-app px-4 py-2 text-[11px] text-ink-muted transition-colors duration-200",children:[h.jsx("div",{className:"flex items-center gap-4",children:n&&h.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-line bg-surface px-2.5 py-0.5 text-ink-secondary",children:[h.jsx(z2,{className:"h-3 w-3 text-status-success-text"}),h.jsx("a",{href:`http://${n.hostname}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.hostname}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.hostname}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx("a",{href:`http://${n.ip}:${window.location.port}`,target:"_blank",rel:"noopener noreferrer","aria-label":`Open ProFiles on ${n.ip}`,className:"font-mono hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 rounded px-1 py-0.5",children:n.ip}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsxs("span",{className:"flex items-center gap-1",title:"Session user",children:[h.jsx(Jw,{className:"h-3 w-3 text-ink-faint"}),h.jsx("span",{children:n.username||"operator"})]}),C!==void 0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"LAN access",block:!1,children:h.jsxs("button",{onClick:()=>C(S!==!0),disabled:S===null,"aria-pressed":S===!0,className:`focus-ring flex items-center gap-1 rounded px-1 py-0.5 text-[10px] ${S===null?"text-ink-faint cursor-not-allowed":S===!0?"text-status-success-text":"text-ink-muted hover:text-ink"}`,children:[h.jsx(Mw,{className:"h-3 w-3"}),h.jsx("span",{children:"LAN"})]})})]})]})}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("span",{children:[h.jsx("strong",{className:"text-ink",children:r})," files found"]}),h.jsx("span",{className:"text-ink-faint",children:"|"}),h.jsx(He,{text:"Keyboard shortcuts (?)",block:!1,children:h.jsxs("button",{onClick:m,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Zy,{className:"h-3 w-3"}),h.jsx("span",{children:"Shortcuts"})]})}),h.jsx(He,{text:"Open the application log viewer",block:!1,children:h.jsxs("button",{onClick:s,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Pr,{className:"h-3 w-3"}),h.jsx("span",{children:"Logs"})]})}),h.jsx("span",{className:"text-ink-faint",children:"|"}),p&&h.jsx(He,{text:"Reload configuration from disk",block:!1,children:h.jsxs("button",{onClick:p,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(cs,{className:"h-3 w-3"}),h.jsx("span",{children:"Reload"})]})}),x&&h.jsx(He,{text:"Export the current results as CSV",block:!1,children:h.jsxs("button",{onClick:x,disabled:y,className:"focus-ring flex items-center gap-1 rounded text-ink-muted hover:text-ink disabled:opacity-40 disabled:hover:text-ink-muted",children:[h.jsx(Iy,{className:"h-3 w-3"}),h.jsx("span",{children:"Export CSV"})]})}),w&&h.jsxs("div",{className:"flex items-center overflow-hidden rounded border border-line text-[10px]",children:[h.jsx(He,{text:"English",block:!1,children:h.jsxs("button",{onClick:()=>w("en"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="en"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:[h.jsx(vw,{className:"h-3 w-3"}),h.jsx("span",{children:"EN"})]})}),h.jsx(He,{text:"Français",block:!1,children:h.jsx("button",{onClick:()=>w("fr"),className:`flex items-center gap-1 px-1.5 py-0.5 transition-colors ${g==="fr"?"bg-indigo-600 text-white focus-ring":"text-ink-muted hover:text-ink focus-ring"}`,children:h.jsx("span",{children:"FR"})})})]}),f&&h.jsx(He,{text:v?`Load a different .profiles file (active: ${v})`:"Load a .profiles file",block:!1,children:h.jsxs("button",{onClick:f,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Kr,{className:"h-3 w-3"}),h.jsx("span",{children:"Load config…"})]})}),h.jsx(He,{text:"Open configuration file",block:!1,children:h.jsxs("button",{onClick:d,className:"focus-ring flex items-center gap-1 text-ink-muted hover:text-ink",children:[h.jsx(Yw,{className:"h-3 w-3"}),h.jsx("span",{children:"Config"})]})}),h.jsx(He,{text:`Switch to ${a==="dark"?"light":"dark"} mode`,block:!1,children:h.jsxs("button",{onClick:u,className:"focus-ring flex items-center gap-1 rounded px-1.5 py-0.5 text-ink-muted hover:bg-elevated hover:text-status-warning-text",children:[a==="dark"?h.jsx(Qw,{className:"h-3 w-3 text-status-warning-text"}):h.jsx(zw,{className:"h-3 w-3 text-chip-indigo-text"}),h.jsx("span",{children:a==="dark"?"Light":"Dark"})]})})]})]})}const Ik=[{label:"5 seconds",seconds:5},{label:"10 seconds",seconds:10},{label:"30 seconds",seconds:30},{label:"1 minute",seconds:60},{label:"5 minutes",seconds:300}];function Kk({isOpen:n,currentInterval:r,onClose:a,onSetInterval:u}){const s=_.useRef(null),d=Wr({isOpen:n,onClose:a,dialogRef:s});if(!n)return null;const f=r>0,m=y=>{u(y)},p=y=>{y.preventDefault();const w=y.currentTarget.elements.namedItem("custom-interval"),v=parseInt(w.value,10);!isNaN(v)&&v>0&&u(v)},x=()=>{u(0)};return h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",children:h.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":"Auto-Rescan Timer",onKeyDown:d,className:"animate-modal-in w-[420px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-4 flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2 font-semibold text-ink",children:[h.jsx(Jy,{className:"h-5 w-5 text-chip-indigo-text"}),h.jsx("span",{children:"Auto-Rescan Timer"})]}),h.jsx("button",{onClick:a,className:"focus-ring rounded-lg p-1 text-ink-muted hover:bg-elevated hover:text-ink",children:h.jsx(nl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"mb-4 rounded-lg bg-elevated/50 px-3 py-2 text-xs",children:f?h.jsxs("div",{className:"flex items-center gap-2 text-status-success-text",children:[h.jsx(ew,{className:"h-4 w-4 animate-pulse"}),h.jsxs("span",{children:["Auto-rescan every ",r,"s"]})]}):h.jsxs("div",{className:"flex items-center gap-2 text-ink-secondary",children:[h.jsx(P2,{className:"h-4 w-4"}),h.jsx("span",{children:"Auto-rescan is disabled"})]})}),h.jsxs("div",{className:"mb-4 space-y-1 text-xs",children:[h.jsx("p",{className:"text-ink-muted",children:"Presets:"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ik.map(y=>h.jsx("button",{onClick:()=>m(y.seconds),className:"rounded-lg border border-line bg-elevated/50 px-3 py-1.5 text-left font-medium text-ink-secondary hover:border-chip-indigo-border hover:bg-chip-indigo-bg/40 hover:text-chip-indigo-text focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:y.label},y.seconds))})]}),h.jsxs("form",{onSubmit:p,className:"mb-4",children:[h.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-ink-secondary",children:[h.jsx(lw,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Custom interval (seconds):"})]}),h.jsxs("div",{className:"mt-1 flex gap-2",children:[h.jsx("input",{type:"number",name:"custom-interval",min:"1",placeholder:"e.g. 45",className:"flex-1 rounded-lg border border-line bg-app px-2 py-1 text-xs text-ink placeholder-ink-faint focus:border-indigo-500 focus:outline-none"}),h.jsx("button",{type:"submit",className:"btn btn-primary rounded-lg px-3 py-1 font-semibold",children:"Set"})]})]}),f&&h.jsx("button",{onClick:x,className:"btn w-full rounded-lg border-line bg-elevated/50 px-3 py-2 text-status-warning-text hover:border-status-warning-border hover:bg-status-warning-bg/40",children:"Stop Auto-Rescan"}),h.jsx("div",{className:"flex justify-end gap-2 border-t border-line pt-3",children:h.jsx("button",{onClick:a,className:"rounded-lg border border-line bg-elevated px-4 py-2 text-xs font-semibold text-ink-secondary hover:bg-elevated/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:"Close"})})]})})}function Zk(n,r){const a={};return(n[n.length-1]===""?[...n,""]:n).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const $k=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk={};function Xx(n,r){return(Pk.jsx?Jk:$k).test(n)}const Wk=/[ \t\n\f\r]/g;function eS(n){return typeof n=="object"?n.type==="text"?Ix(n.value):!1:Ix(n)}function Ix(n){return n.replace(Wk,"")===""}class ou{constructor(r,a,u){this.normal=a,this.property=r,u&&(this.space=u)}}ou.prototype.normal={};ou.prototype.property={};ou.prototype.space=void 0;function ib(n,r){const a={},u={};for(const s of n)Object.assign(a,s.property),Object.assign(u,s.normal);return new ou(a,u,r)}function Nd(n){return n.toLowerCase()}class yn{constructor(r,a){this.attribute=a,this.property=r}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let tS=0;const De=nr(),Ot=nr(),Ed=nr(),ce=nr(),ht=nr(),Pi=nr(),_n=nr();function nr(){return 2**++tS}const jd=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Ot,commaOrSpaceSeparated:_n,commaSeparated:Pi,number:ce,overloadedBoolean:Ed,spaceSeparated:ht},Symbol.toStringTag,{value:"Module"})),nd=Object.keys(jd);class Qd extends yn{constructor(r,a,u,s){let d=-1;if(super(r,a),Kx(this,"space",s),typeof u=="number")for(;++d4&&a.slice(0,4)==="data"&&aS.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Zx,sS);u="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Zx.test(d)){let f=d.replace(rS,oS);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}s=Qd}return new s(u,r)}function oS(n){return"-"+n.toLowerCase()}function sS(n){return n.charAt(1).toUpperCase()}const cS=ib([rb,nS,ob,sb,cb],"html"),Xd=ib([rb,lS,ob,sb,cb],"svg");function fS(n){return n.join(" ").trim()}var $x=/\/\*(?:[^*]|\*(?!\/))*\*\//g,dS=/\n/g,hS=/^\s*/,mS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,pS=/^:\s*/,gS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,xS=/^[;\s]*/,yS=` +`,Jx="/",Px="*",Pa="",bS="comment",vS="declaration";function wS(n,r){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];r=r||{};var a=1,u=1;function s(S){var C=S.match(dS);C&&(a+=C.length);var L=S.lastIndexOf(yS);u=~L?S.length-L:u+S.length}function d(){var S={line:a,column:u};return function(C){return C.position=new f(S),x(),C}}function f(S){this.start=S,this.end={line:a,column:u},this.source=r.source}f.prototype.content=n;function m(S){var C=new Error(r.source+":"+a+":"+u+": "+S);if(C.reason=S,C.filename=r.source,C.line=a,C.column=u,C.source=n,!r.silent)throw C}function p(S){var C=S.exec(n);if(C){var L=C[0];return s(L),n=n.slice(L.length),C}}function x(){p(hS)}function y(S){for(var C;C=g();)S.push(C);return S}function g(){var S=d();if(!(Jx!=n.charAt(0)||Px!=n.charAt(1))){for(var C=2;Pa!=n.charAt(C)&&(Px!=n.charAt(C)||Jx!=n.charAt(C+1));)++C;if(C+=2,Pa===n.charAt(C-1))return m("End of comment missing");var L=n.slice(2,C-2);return u+=2,s(L),n=n.slice(C),u+=2,S({type:bS,comment:L})}}function w(){var S=d(),C=p(mS);if(C){if(g(),!p(pS))return m("property missing ':'");var L=p(gS),z=S({type:vS,property:C[0].replace($x,Pa).trim(),value:L?L[0].replace($x,Pa).trim():Pa});return p(xS),z}}function v(){var S=[];y(S);for(var C;C=w();)S.push(C),y(S);return S}return x(),v()}function kS(n,r){let a=null;if(!n||typeof n!="string")return a;const u=wS(n),s=typeof r=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;s?r(f,m,d):m&&(a=a??{},a[f]=m)}),a}const fb=db("end"),Id=db("start");function db(n){return r;function r(a){const u=a&&a.position&&a.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function SS(n){const r=Id(n),a=fb(n);if(r&&a)return{start:r,end:a}}function iu(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Wx(n.position):"start"in n||"end"in n?Wx(n):"line"in n||"column"in n?Cd(n):""}function Cd(n){return ey(n&&n.line)+":"+ey(n&&n.column)}function Wx(n){return Cd(n&&n.start)+"-"+Cd(n&&n.end)}function ey(n){return n&&typeof n=="number"?n:1}class an extends Error{constructor(r,a,u){super(),typeof a=="string"&&(u=a,a=void 0);let s="",d={},f=!1;if(a&&("line"in a&&"column"in a?d={place:a}:"start"in a&&"end"in a?d={place:a}:"type"in a?d={ancestors:[a],place:a.position}:d={...a}),typeof r=="string"?s=r:!d.cause&&r&&(f=!0,s=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof u=="string"){const p=u.indexOf(":");p===-1?d.ruleId=u:(d.source=u.slice(0,p),d.ruleId=u.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const m=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=m?m.line:void 0,this.name=iu(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const Kd={}.hasOwnProperty,NS=new Map,ES=/[A-Z]/g,jS=/-([a-z])/g,CS=new Set(["table","tbody","thead","tfoot","tr"]),TS=new Set(["td","th"]),hb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _S(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=r.filePath||void 0;let u;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=US(a,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=LS(a,r.jsx,r.jsxs)}const s={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:u,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Xd:cS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=mb(s,n,void 0);return d&&typeof d!="string"?d:s.create(n,s.Fragment,{children:d||void 0},void 0)}function mb(n,r,a){if(r.type==="element")return AS(n,r,a);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return zS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return MS(n,r,a);if(r.type==="mdxjsEsm")return DS(n,r);if(r.type==="root")return OS(n,r,a);if(r.type==="text")return RS(n,r)}function AS(n,r,a){const u=n.schema;let s=u;r.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=gb(n,r.tagName,!1),f=BS(n,r);let m=$d(n,r);return CS.has(r.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!eS(p):!0})),pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function zS(n,r){if(r.data&&r.data.estree&&n.evaluater){const u=r.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}uu(n,r.position)}function DS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);uu(n,r.position)}function MS(n,r,a){const u=n.schema;let s=u;r.name==="svg"&&u.space==="html"&&(s=Xd,n.schema=s),n.ancestors.push(r);const d=r.name===null?n.Fragment:gb(n,r.name,!0),f=HS(n,r),m=$d(n,r);return pb(n,f,d,r),Zd(f,m),n.ancestors.pop(),n.schema=u,n.create(r,d,f,a)}function OS(n,r,a){const u={};return Zd(u,$d(n,r)),n.create(r,n.Fragment,u,a)}function RS(n,r){return r.value}function pb(n,r,a,u){typeof a!="string"&&a!==n.Fragment&&n.passNode&&(r.node=u)}function Zd(n,r){if(r.length>0){const a=r.length>1?r:r[0];a&&(n.children=a)}}function LS(n,r,a){return u;function u(s,d,f,m){const x=Array.isArray(f.children)?a:r;return m?x(d,f,m):x(d,f)}}function US(n,r){return a;function a(u,s,d,f){const m=Array.isArray(d.children),p=Id(u);return r(s,d,f,m,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function BS(n,r){const a={};let u,s;for(s in r.properties)if(s!=="children"&&Kd.call(r.properties,s)){const d=qS(n,s,r.properties[s]);if(d){const[f,m]=d;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&TS.has(r.tagName)?u=m:a[f]=m}}if(u){const d=a.style||(a.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return a}function HS(n,r){const a={};for(const u of r.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const d=u.data.estree.body[0];d.type;const f=d.expression;f.type;const m=f.properties[0];m.type,Object.assign(a,n.evaluater.evaluateExpression(m.argument))}else uu(n,r.position);else{const{name:s}=u;let d;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const m=u.value.data.estree.body[0];m.type,d=n.evaluater.evaluateExpression(m.expression)}else uu(n,r.position);else d=u.value===null?!0:u.value;a[s]=d}return a}function $d(n,r){const a=[];let u=-1;const s=n.passKeys?new Map:NS;for(;++us?0:s+r:r=r>s?s:r,a=a>0?a:0,u.length<1e4)f=Array.from(u),f.unshift(r,a),n.splice(...f);else for(a&&n.splice(r,a);d0?(el(n,n.length,0,r),n):r}const ly={}.hasOwnProperty;function yb(n){const r={};let a=-1;for(;++a13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function tl(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pt=ki(/[A-Za-z]/),Wt=ki(/[\dA-Za-z]/),$S=ki(/[#-'*+\--9=?A-Z^-~]/);function is(n){return n!==null&&(n<32||n===127)}const Td=ki(/\d/),JS=ki(/[\dA-Fa-f]/),vb=ki(/[!-/:-@[-`{-~]/);function Te(n){return n!==null&&n<-2}function mt(n){return n!==null&&(n<0||n===32)}function Ve(n){return n===-2||n===-1||n===32}const fs=ki(new RegExp("\\p{P}|\\p{S}","u")),tr=ki(/\s/);function ki(n){return r;function r(a){return a!==null&&a>-1&&n.test(String.fromCharCode(a))}}function ta(n){const r=[];let a=-1,u=0,s=0;for(;++a55295&&d<57344){const m=n.charCodeAt(a+1);d<56320&&m>56319&&m<57344?(f=String.fromCharCode(d,m),s=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(u,a),encodeURIComponent(f)),u=a+s+1,f=""),s&&(a+=s,s=0)}return r.join("")+n.slice(u)}function et(n,r,a,u){const s=u?u-1:1/0;let d=0;return f;function f(p){return Ve(p)?(n.enter(a),m(p)):r(p)}function m(p){return Ve(p)&&d++=s?r(y):a(y)}}const PS={tokenize:WS};function WS(n){const r=n.attempt(this.parser.constructs.contentInitial,u,s);let a;return r;function u(m){if(m===null){n.consume(m);return}return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),et(n,r,"linePrefix")}function s(m){return n.enter("paragraph"),d(m)}function d(m){const p=n.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(m)}function f(m){if(m===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(m);return}return Te(m)?(n.consume(m),n.exit("chunkText"),d):(n.consume(m),f)}}let rs=class{constructor(){this.index=new Map,this.map=[]}add(r,a,u){iy(this,r,a,u,!1)}addBefore(r,a,u){iy(this,r,a,u,!0)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}};function iy(n,r,a,u,s){if(a===0&&u.length===0)return;const d=n.index.get(r);if(d){d[1]+=a,s?(u.push(...d[2]),d[2]=u):d[2].push(...u);return}const f=[r,a,u];n.map.push(f),n.index.set(r,f)}const eN={tokenize:tN},ry={tokenize:nN};function tN(n){const r=this,a=[];let u=0,s,d,f;return m;function m(I){if(uf))return;const R=r.events.length;let Q=R,fe,B;for(;Q--;)if(r.events[Q][0]==="exit"&&r.events[Q][1].type==="chunkFlow"){if(fe){B=r.events[Q][1].end;break}fe=!0}for(z(u),U=R;UI;){const ie=a[J];r.containerState=ie[1],ie[0].exit.call(r,n)}a.length=I}function $(){s.write([null]),d=void 0,s=void 0,r.containerState._closeFlow=void 0}}function nN(n,r,a){return et(n,n.attempt(this.parser.constructs.document,r,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wi(n){if(n===null||mt(n)||tr(n))return 1;if(fs(n))return 2}function ds(n,r,a){const u=[];let s=-1;for(;++s1&&n[a][1].end.offset-n[a][1].start.offset>1?2:1,f={...n[s][1].end},m={...n[a][1].start};ay(f,-d),ay(m,d);const p={type:d>1?"strongSequence":"emphasisSequence",start:f,end:{...n[s][1].end}},x={type:d>1?"strongSequence":"emphasisSequence",start:{...n[a][1].start},end:m},y={type:d>1?"strongText":"emphasisText",start:{...n[s][1].end},end:{...n[a][1].start}},g={type:d>1?"strong":"emphasis",start:{...p.start},end:{...x.end}};n[s][1].end={...p.start},n[a][1].start={...x.end},u=[],n[s][1].end.offset-n[s][1].start.offset&&(u=Yn(u,[["enter",n[s][1],r],["exit",n[s][1],r]])),u=Yn(u,[["enter",g,r],["enter",p,r],["exit",p,r],["enter",y,r]]),u=Yn(u,ds(r.parser.constructs.insideSpan.null,n.slice(s+1,a),r)),u=Yn(u,[["exit",y,r],["enter",x,r],["exit",x,r],["exit",g,r]]);let w=0;n[a][1].end.offset-n[a][1].start.offset&&(w=2,u=Yn(u,[["enter",n[a][1],r],["exit",n[a][1],r]])),el(n,s-1,a-s+3,u),a=s+u.length-w-2;break}}for(a=-1;++a0&&Ve(U)?et(n,$,"linePrefix",d+1)(U):$(U)}function $(U){return U===null||Te(U)?n.check(Ad,C,J)(U):(n.enter("codeFlowValue"),I(U))}function I(U){return U===null||Te(U)?(n.exit("codeFlowValue"),$(U)):(n.consume(U),I)}function J(U){return n.exit("codeFenced"),r(U)}function ie(U,R,Q){let fe=0;return B;function B(ae){return U.enter("lineEnding"),U.consume(ae),U.exit("lineEnding"),ne}function ne(ae){return U.enter("codeFencedFence"),Ve(ae)?et(U,V,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):V(ae)}function V(ae){return ae===m?(U.enter("codeFencedFenceSequence"),se(ae)):Q(ae)}function se(ae){return ae===m?(fe++,U.consume(ae),se):fe>=f?(U.exit("codeFencedFenceSequence"),Ve(ae)?et(U,ve,"whitespace")(ae):ve(ae)):Q(ae)}function ve(ae){return ae===null||Te(ae)?(U.exit("codeFencedFence"),R(ae)):Q(ae)}}}const id={name:"codeIndented",tokenize:gN},pN={partial:!0,tokenize:xN};function gN(n,r,a){return u;function u(m){return n.enter("codeIndented"),wb(n,s,a,"linePrefix",4,4)(m)}function s(m){return m===null?f(m):Te(m)?n.attempt(pN,s,f)(m):(n.enter("codeFlowValue"),d(m))}function d(m){return m===null||Te(m)?(n.exit("codeFlowValue"),s(m)):(n.consume(m),d)}function f(m){return n.exit("codeIndented"),r(m)}}function xN(n,r,a){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?a(f):Te(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):wb(n,r,d,"linePrefix",4,4)(f)}function d(f){return Te(f)?s(f):a(f)}}const yN={name:"codeText",previous:vN,resolve:bN,tokenize:wN};function bN(n){let r=n.length-4,a=3,u,s;if((n[a][1].type==="lineEnding"||n[a][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(u=a;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return rthis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(r,a,u){const s=a||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&Wa(this.left,u),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Wa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Wa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r=4?r(f):n.interrupt(u.parser.constructs.flow,a,r)(f)}}function jb(n,r,a,u,s,d,f,m,p){const x=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(z){return z===60?(n.enter(u),n.enter(s),n.enter(d),n.consume(z),n.exit(d),w):z===null||z===32||z===41||is(z)?a(z):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),C(z))}function w(z){return z===62?(n.enter(d),n.consume(z),n.exit(d),n.exit(s),n.exit(u),r):(n.enter(m),n.enter("chunkString",{contentType:"string"}),v(z))}function v(z){return z===62?(n.exit("chunkString"),n.exit(m),w(z)):z===null||z===60||Te(z)?a(z):(n.consume(z),z===92?S:v)}function S(z){return z===60||z===62||z===92?(n.consume(z),v):v(z)}function C(z){return!y&&(z===null||z===41||mt(z))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),r(z)):y999||v===null||v===91||v===93&&!p||v===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(n.exit(d),n.enter(s),n.consume(v),n.exit(s),n.exit(u),r):Te(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Te(v)||m++>999?(n.exit("chunkString"),y(v)):(n.consume(v),p||(p=!Ve(v)),v===92?w:g)}function w(v){return v===91||v===92||v===93?(n.consume(v),m++,g):g(v)}}function Tb(n,r,a,u,s,d){let f;return m;function m(w){return w===34||w===39||w===40?(n.enter(u),n.enter(s),n.consume(w),n.exit(s),f=w===40?41:w,p):a(w)}function p(w){return w===f?(n.enter(s),n.consume(w),n.exit(s),n.exit(u),r):(n.enter(d),x(w))}function x(w){return w===f?(n.exit(d),p(f)):w===null?a(w):Te(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),et(n,x,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(w))}function y(w){return w===f||w===null||Te(w)?(n.exit("chunkString"),x(w)):(n.consume(w),w===92?g:y)}function g(w){return w===f||w===92?(n.consume(w),y):y(w)}}function ru(n,r){let a;return u;function u(s){return Te(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),a=!0,u):Ve(s)?et(n,u,a?"linePrefix":"lineSuffix")(s):r(s)}}const _N={name:"definition",tokenize:zN},AN={partial:!0,tokenize:DN};function zN(n,r,a){const u=this;let s;return d;function d(v){return n.enter("definition"),f(v)}function f(v){return Cb.call(u,n,m,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function m(v){return s=tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),v===58?(n.enter("definitionMarker"),n.consume(v),n.exit("definitionMarker"),p):a(v)}function p(v){return mt(v)?ru(n,x)(v):x(v)}function x(v){return jb(n,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return n.attempt(AN,g,g)(v)}function g(v){return Ve(v)?et(n,w,"whitespace")(v):w(v)}function w(v){return v===null||Te(v)?(n.exit("definition"),u.parser.defined.push(s),r(v)):a(v)}}function DN(n,r,a){return u;function u(m){return mt(m)?ru(n,s)(m):a(m)}function s(m){return Tb(n,d,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function d(m){return Ve(m)?et(n,f,"whitespace")(m):f(m)}function f(m){return m===null||Te(m)?r(m):a(m)}}const MN={name:"hardBreakEscape",tokenize:ON};function ON(n,r,a){return u;function u(d){return n.enter("hardBreakEscape"),n.consume(d),s}function s(d){return Te(d)?(n.exit("hardBreakEscape"),r(d)):a(d)}}const RN={name:"headingAtx",resolve:LN,tokenize:UN};function LN(n,r){let a=n.length-2,u=3;if(n[u][1].type==="whitespace"&&(u+=2),a-2>u&&n[a][1].type==="whitespace"&&(a-=2),n[a][1].type==="atxHeadingSequence"&&(u===a-1||a-4>u&&n[a-2][1].type==="whitespace")&&(a-=u+1===a?2:4),a>u){const s={type:"atxHeadingText",start:n[u][1].start,end:n[a][1].end},d={type:"chunkText",start:n[u][1].start,end:n[a][1].end,contentType:"text"};el(n,u,a-u+1,[["enter",s,r],["enter",d,r],["exit",d,r],["exit",s,r]])}return n}function UN(n,r,a){let u=0;return s;function s(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&u++<6?(n.consume(y),f):y===null||mt(y)?(n.exit("atxHeadingSequence"),m(y)):a(y)}function m(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||Te(y)?(n.exit("atxHeading"),r(y)):Ve(y)?et(n,m,"whitespace")(y):(n.enter("atxHeadingText"),x(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),m(y))}function x(y){return y===null||y===35||mt(y)?(n.exit("atxHeadingText"),m(y)):(n.consume(y),x)}}const _b=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zd=["pre","script","style","textarea"],BN={concrete:!0,name:"htmlFlow",resolveTo:qN,tokenize:FN},HN={partial:!0,tokenize:VN};function qN(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function FN(n,r,a){const u=this;let s,d,f,m,p;return x;function x(M){return y(M)}function y(M){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(M),g}function g(M){return M===33?(n.consume(M),w):M===47?(n.consume(M),d=!0,C):M===63?(n.consume(M),s=3,u.interrupt?r:N):Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function w(M){return M===45?(n.consume(M),s=2,v):M===91?(n.consume(M),s=5,m=0,S):Pt(M)?(n.consume(M),s=4,u.interrupt?r:N):a(M)}function v(M){return M===45?(n.consume(M),u.interrupt?r:N):a(M)}function S(M){const E="CDATA[";return M===E.charCodeAt(m++)?(n.consume(M),m===E.length?u.interrupt?r:V:S):a(M)}function C(M){return Pt(M)?(n.consume(M),f=String.fromCharCode(M),L):a(M)}function L(M){if(M===null||M===47||M===62||mt(M)){const E=M===47,Y=f.toLowerCase();return!E&&!d&&zd.includes(Y)?(s=1,u.interrupt?r(M):V(M)):_b.includes(f.toLowerCase())?(s=6,E?(n.consume(M),z):u.interrupt?r(M):V(M)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?a(M):d?$(M):I(M))}return M===45||Wt(M)?(n.consume(M),f+=String.fromCharCode(M),L):a(M)}function z(M){return M===62?(n.consume(M),u.interrupt?r:V):a(M)}function $(M){return Ve(M)?(n.consume(M),$):B(M)}function I(M){return M===47?(n.consume(M),B):M===58||M===95||Pt(M)?(n.consume(M),J):Ve(M)?(n.consume(M),I):B(M)}function J(M){return M===45||M===46||M===58||M===95||Wt(M)?(n.consume(M),J):ie(M)}function ie(M){return M===61?(n.consume(M),U):Ve(M)?(n.consume(M),ie):I(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?a(M):M===34||M===39?(n.consume(M),p=M,R):Ve(M)?(n.consume(M),U):Q(M)}function R(M){return M===p?(n.consume(M),p=null,fe):M===null||Te(M)?a(M):(n.consume(M),R)}function Q(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||mt(M)?ie(M):(n.consume(M),Q)}function fe(M){return M===47||M===62||Ve(M)?I(M):a(M)}function B(M){return M===62?(n.consume(M),ne):a(M)}function ne(M){return M===null||Te(M)?V(M):Ve(M)?(n.consume(M),ne):a(M)}function V(M){return M===45&&s===2?(n.consume(M),A):M===60&&s===1?(n.consume(M),W):M===62&&s===4?(n.consume(M),qe):M===63&&s===3?(n.consume(M),N):M===93&&s===5?(n.consume(M),re):Te(M)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(HN,Ge,se)(M)):M===null||Te(M)?(n.exit("htmlFlowData"),se(M)):(n.consume(M),V)}function se(M){return n.check(Ad,ve,Ge)(M)}function ve(M){return n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),ae}function ae(M){return M===null||Te(M)?se(M):(n.enter("htmlFlowData"),V(M))}function A(M){return M===45?(n.consume(M),N):V(M)}function W(M){return M===47?(n.consume(M),f="",le):V(M)}function le(M){if(M===62){const E=f.toLowerCase();return zd.includes(E)?(n.consume(M),qe):V(M)}return Pt(M)&&f.length<8?(n.consume(M),f+=String.fromCharCode(M),le):V(M)}function re(M){return M===93?(n.consume(M),N):V(M)}function N(M){return M===62?(n.consume(M),qe):M===45&&s===2?(n.consume(M),N):V(M)}function qe(M){return M===null||Te(M)?(n.exit("htmlFlowData"),Ge(M)):(n.consume(M),qe)}function Ge(M){return n.exit("htmlFlow"),r(M)}}function VN(n,r,a){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(su,r,a)}}const YN={name:"htmlText",tokenize:GN};function GN(n,r,a){const u=this;let s,d,f;return m;function m(N){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(N),p}function p(N){return N===33?(n.consume(N),x):N===47?(n.consume(N),ie):N===63?(n.consume(N),I):Pt(N)?(n.consume(N),Q):a(N)}function x(N){return N===45?(n.consume(N),y):N===91?(n.consume(N),d=0,S):Pt(N)?(n.consume(N),$):a(N)}function y(N){return N===45?(n.consume(N),v):a(N)}function g(N){return N===null?a(N):N===45?(n.consume(N),w):Te(N)?(f=g,W(N)):(n.consume(N),g)}function w(N){return N===45?(n.consume(N),v):g(N)}function v(N){return N===62?A(N):N===45?w(N):g(N)}function S(N){const qe="CDATA[";return N===qe.charCodeAt(d++)?(n.consume(N),d===qe.length?C:S):a(N)}function C(N){return N===null?a(N):N===93?(n.consume(N),L):Te(N)?(f=C,W(N)):(n.consume(N),C)}function L(N){return N===93?(n.consume(N),z):C(N)}function z(N){return N===62?A(N):N===93?(n.consume(N),z):C(N)}function $(N){return N===null||N===62?A(N):Te(N)?(f=$,W(N)):(n.consume(N),$)}function I(N){return N===null?a(N):N===63?(n.consume(N),J):Te(N)?(f=I,W(N)):(n.consume(N),I)}function J(N){return N===62?A(N):I(N)}function ie(N){return Pt(N)?(n.consume(N),U):a(N)}function U(N){return N===45||Wt(N)?(n.consume(N),U):R(N)}function R(N){return Te(N)?(f=R,W(N)):Ve(N)?(n.consume(N),R):A(N)}function Q(N){return N===45||Wt(N)?(n.consume(N),Q):N===47||N===62||mt(N)?fe(N):a(N)}function fe(N){return N===47?(n.consume(N),A):N===58||N===95||Pt(N)?(n.consume(N),B):Te(N)?(f=fe,W(N)):Ve(N)?(n.consume(N),fe):A(N)}function B(N){return N===45||N===46||N===58||N===95||Wt(N)?(n.consume(N),B):ne(N)}function ne(N){return N===61?(n.consume(N),V):Te(N)?(f=ne,W(N)):Ve(N)?(n.consume(N),ne):fe(N)}function V(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(n.consume(N),s=N,se):Te(N)?(f=V,W(N)):Ve(N)?(n.consume(N),V):(n.consume(N),ve)}function se(N){return N===s?(n.consume(N),s=void 0,ae):N===null?a(N):Te(N)?(f=se,W(N)):(n.consume(N),se)}function ve(N){return N===null||N===34||N===39||N===60||N===61||N===96?a(N):N===47||N===62||mt(N)?fe(N):(n.consume(N),ve)}function ae(N){return N===47||N===62||mt(N)?fe(N):a(N)}function A(N){return N===62?(n.consume(N),n.exit("htmlTextData"),n.exit("htmlText"),r):a(N)}function W(N){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(N),n.exit("lineEnding"),le}function le(N){return Ve(N)?et(n,re,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):re(N)}function re(N){return n.enter("htmlTextData"),f(N)}}const Wd={name:"labelEnd",resolveAll:KN,resolveTo:ZN,tokenize:$N},QN={tokenize:JN},XN={tokenize:PN},IN={tokenize:WN};function KN(n){let r=-1;const a=[];for(;++r0&&s[s.length-1]._balanced;)s.pop();d=s[s.length-1]}return m;function m(w){return d?d._inactive?g(w):(f=u.parser.defined.includes(tl(u.sliceSerialize({start:d.end,end:u.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(w),n.exit("labelMarker"),n.exit("labelEnd"),p):a(w)}function p(w){return w===40?n.attempt(QN,y,f?y:g)(w):w===91?n.attempt(XN,y,f?x:g)(w):f?y(w):g(w)}function x(w){return n.attempt(IN,y,g)(w)}function y(w){return s.pop(),r(w)}function g(w){return d._balanced=!0,a(w)}}function JN(n,r,a){return u;function u(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),s}function s(g){return mt(g)?ru(n,d)(g):d(g)}function d(g){return g===41?y(g):jb(n,f,m,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return mt(g)?ru(n,p)(g):y(g)}function m(g){return a(g)}function p(g){return g===34||g===39||g===40?Tb(n,x,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function x(g){return mt(g)?ru(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):a(g)}}function PN(n,r,a){const u=this;return s;function s(m){return Cb.call(u,n,d,f,"reference","referenceMarker","referenceString")(m)}function d(m){return u.parser.defined.includes(tl(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)))?r(m):a(m)}function f(m){return a(m)}}function WN(n,r,a){return u;function u(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),s}function s(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):a(d)}}const e3={name:"labelStartImage",resolveAll:Wd.resolveAll,tokenize:t3};function t3(n,r,a){const u=this;let s;return d;function d(p){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(p),n.exit("labelImageMarker"),f}function f(p){return p===91?(n.enter("labelMarker"),n.consume(p),n.exit("labelMarker"),s=n.exit("labelImage"),m):a(p)}function m(p){return p===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(p):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(p))}}const n3={name:"labelStartLink",resolveAll:Wd.resolveAll,tokenize:l3};function l3(n,r,a){const u=this;let s;return d;function d(m){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(m),n.exit("labelMarker"),s=n.exit("labelLink"),f}function f(m){return m===94&&"_hiddenFootnoteSupport"in u.parser.constructs?a(m):(u._labelStarts=u._labelStarts||[],u._labelStarts.push(s),r(m))}}const rd={name:"lineEnding",tokenize:i3};function i3(n,r){return a;function a(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),et(n,r,"linePrefix")}}const ts={name:"thematicBreak",tokenize:r3};function r3(n,r,a){let u=0,s;return d;function d(x){return n.enter("thematicBreak"),f(x)}function f(x){return s=x,m(x)}function m(x){return x===s?(n.enter("thematicBreakSequence"),p(x)):u>=3&&(x===null||Te(x))?(n.exit("thematicBreak"),r(x)):a(x)}function p(x){return x===s?(n.consume(x),u++,p):(n.exit("thematicBreakSequence"),Ve(x)?et(n,m,"whitespace")(x):m(x))}}const xn={continuation:{tokenize:s3},exit:f3,name:"list",tokenize:o3},a3={partial:!0,tokenize:d3},u3={partial:!0,tokenize:c3};function o3(n,r,a){const u=this,s=u.events[u.events.length-1];let d=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return m;function m(v){const S=u.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!u.containerState.marker||v===u.containerState.marker:Td(v)){if(u.containerState.type||(u.containerState.type=S,n.enter(S,{_container:!0})),S==="listUnordered")return n.enter("listItemPrefix"),v===42||v===45?n.check(ts,a,x)(v):x(v);if(!u.interrupt||v===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(v)}return a(v)}function p(v){return Td(v)&&++f<10?(n.consume(v),p):(!u.interrupt||f<2)&&(u.containerState.marker?v===u.containerState.marker:v===41||v===46)?(n.exit("listItemValue"),x(v)):a(v)}function x(v){return n.enter("listItemMarker"),n.consume(v),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||v,n.check(su,u.interrupt?a:y,n.attempt(a3,w,g))}function y(v){return u.containerState.initialBlankLine=!0,d++,w(v)}function g(v){return Ve(v)?(n.enter("listItemPrefixWhitespace"),n.consume(v),n.exit("listItemPrefixWhitespace"),w):a(v)}function w(v){return u.containerState.size=d+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(v)}}function s3(n,r,a){const u=this;return u.containerState._closeFlow=void 0,n.check(su,s,d);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,et(n,r,"listItemIndent",u.containerState.size+1)(m)}function d(m){return u.containerState.furtherBlankLines||!Ve(m)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(m)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(u3,r,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,et(n,n.attempt(xn,r,a),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function c3(n,r,a){const u=this;return et(n,s,"listItemIndent",u.containerState.size+1);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?r(d):a(d)}}function f3(n){n.exit(this.containerState.type)}function d3(n,r,a){const u=this;return et(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(d){const f=u.events[u.events.length-1];return!Ve(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):a(d)}}const oy={name:"setextUnderline",resolveTo:h3,tokenize:m3};function h3(n,r){const a=new rs;let u=n.length,s,d,f;for(;u--;)if(n[u][0]==="enter"){if(n[u][1].type==="content"){s=u;break}n[u][1].type==="paragraph"&&(d=u)}else n[u][1].type==="content"&&a.add(u,1,[]),!f&&n[u][1].type==="definition"&&(f=u);const m={type:"setextHeading",start:{...n[s][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",f?(a.add(d,0,[["enter",m,r]]),a.add(f+1,0,[["exit",n[s][1],r]]),n[s][1].end={...n[f][1].end}):n[s][1]=m,a.add(n.length,0,[["exit",m,r]]),a.consume(n),n}function m3(n,r,a){const u=this;let s;return d;function d(x){let y=u.events.length,g;for(;y--;)if(u.events[y][1].type!=="lineEnding"&&u.events[y][1].type!=="linePrefix"&&u.events[y][1].type!=="content"){g=u.events[y][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||g)?(n.enter("setextHeadingLine"),s=x,f(x)):a(x)}function f(x){return n.enter("setextHeadingLineSequence"),m(x)}function m(x){return x===s?(n.consume(x),m):(n.exit("setextHeadingLineSequence"),Ve(x)?et(n,p,"lineSuffix")(x):p(x))}function p(x){return x===null||Te(x)?(n.exit("setextHeadingLine"),r(x)):a(x)}}const p3={tokenize:g3};function g3(n){const r=this,a=n.attempt(su,u,n.attempt(this.parser.constructs.flowInitial,s,et(n,n.attempt(this.parser.constructs.flow,s,n.attempt(NN,s)),"linePrefix")));return a;function u(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,a}function s(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,a}}const x3={resolveAll:zb()},y3=Ab("string"),b3=Ab("text");function Ab(n){return{resolveAll:zb(n==="text"?v3:void 0),tokenize:r};function r(a){const u=this,s=this.parser.constructs[n],d=a.attempt(s,f,m);return f;function f(y){return x(y)?d(y):m(y)}function m(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return x(y)?(a.exit("data"),d(y)):(a.consume(y),p)}function x(y){if(y===null)return!0;const g=s[y];let w=-1;if(g)for(;++w-1){const m=f[0];typeof m=="string"?f[0]=m.slice(u):f.shift()}d>0&&f.push(n[s].slice(0,d))}return f}function M3(n,r){let a=-1;const u=[];let s;for(;++a0&&s(r.beforeEnter,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),Db.call(Tt,K[it][1].type)&&Tt[K[it][1].type].call({...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1]),K[it][0]==="exit"&&r.afterExit.length>0&&s(r.afterExit,{...ke,sliceSerialize:K[it][2].sliceSerialize},K[it][1])}if(ke.tokenStack.length>0){const Tt=ke.tokenStack[ke.tokenStack.length-1];(Tt[1]||cy).call(ke,void 0,Tt[0])}for(ue.position={start:yi(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:yi(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it0&&(u.className=["language-"+s[0]]);let d={type:"element",tagName:"code",properties:u,children:[{type:"text",value:a}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function I3(n,r){const a={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function K3(n,r){const a={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function Z3(n,r){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(r.identifier).toUpperCase(),s=ta(u.toLowerCase()),d=n.footnoteOrder.indexOf(u);let f,m=n.footnoteCounts.get(u);m===void 0?(m=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=d+1,m+=1,n.footnoteCounts.set(u,m);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const x={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,x),n.applyData(r,x)}function $3(n,r){const a={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,a),n.applyData(r,a)}function J3(n,r){if(n.options.allowDangerousHtml){const a={type:"raw",value:r.value};return n.patch(r,a),n.applyData(r,a)}}function Ob(n,r){const a=r.referenceType;let u="]";if(a==="collapsed"?u+="[]":a==="full"&&(u+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+u}];const s=n.all(r),d=s[0];d&&d.type==="text"?d.value="["+d.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function P3(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={src:ta(u.url||""),alt:r.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,d),n.applyData(r,d)}function W3(n,r){const a={src:ta(r.url)};r.alt!==null&&r.alt!==void 0&&(a.alt=r.alt),r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"img",properties:a,children:[]};return n.patch(r,u),n.applyData(r,u)}function eE(n,r){const a={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,a);const u={type:"element",tagName:"code",properties:{},children:[a]};return n.patch(r,u),n.applyData(r,u)}function tE(n,r){const a=String(r.identifier).toUpperCase(),u=n.definitionById.get(a);if(!u)return Ob(n,r);const s={href:ta(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const d={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function nE(n,r){const a={href:ta(r.url)};r.title!==null&&r.title!==void 0&&(a.title=r.title);const u={type:"element",tagName:"a",properties:a,children:n.all(r)};return n.patch(r,u),n.applyData(r,u)}function lE(n,r,a){const u=n.all(r),s=a?iE(a):Rb(r),d={},f=[];if(typeof r.checked=="boolean"){const y=u[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},u.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let m=-1;for(;++m1}function rE(n,r){const a={},u=n.all(r);let s=-1;for(typeof r.start=="number"&&r.start!==1&&(a.start=r.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(a,!0)},m=Id(r.children[1]),p=fb(r.children[r.children.length-1]);m&&p&&(f.position={start:m,end:p}),s.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(r,d),n.applyData(r,d)}function cE(n,r,a){const u=a?a.children:void 0,d=(u?u.indexOf(r):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,m=f?f.length:r.children.length;let p=-1;const x=[];for(;++p0,!0),u[0]),s=u.index+u[0].length,u=a.exec(r);return d.push(hy(r.slice(s),s>0,!1)),d.join("")}function hy(n,r,a){let u=0,s=n.length;if(r){let d=n.codePointAt(u);for(;d===fy||d===dy;)u++,d=n.codePointAt(u)}if(a){let d=n.codePointAt(s-1);for(;d===fy||d===dy;)s--,d=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function hE(n,r){const a={type:"text",value:dE(String(r.value))};return n.patch(r,a),n.applyData(r,a)}function mE(n,r){const a={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,a),n.applyData(r,a)}const pE={blockquote:G3,break:Q3,code:X3,delete:I3,emphasis:K3,footnoteReference:Z3,heading:$3,html:J3,imageReference:P3,image:W3,inlineCode:eE,linkReference:tE,link:nE,listItem:lE,list:rE,paragraph:aE,root:uE,strong:oE,table:sE,tableCell:fE,tableRow:cE,text:hE,thematicBreak:mE,toml:Xo,yaml:Xo,definition:Xo,footnoteDefinition:Xo};function Xo(){}const Lb=-1,hs=0,au=1,as=2,eh=3,th=4,nh=5,lh=6,Ub=7,Bb=8,{defineProperty:gE}=Object,Hb=typeof self=="object"?self:globalThis,my=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new Hb[n](r)},xE=(n,r)=>{const a=(s,d)=>(n.set(d,s),s),u=s=>{if(n.has(s))return n.get(s);const[d,f]=r[s];switch(d){case hs:case Lb:return a(f,s);case au:{const m=a([],s);for(const p of f)m.push(u(p));return m}case as:{const m=a({},s);for(const[p,x]of f){const y=u(p),g=u(x);y==="__proto__"?gE(m,y,{value:g,configurable:!0,enumerable:!0,writable:!0}):m[y]=g}return m}case eh:return a(new Date(f),s);case th:{const{source:m,flags:p}=f;return a(new RegExp(m,p),s)}case nh:{const m=a(new Map,s);for(const[p,x]of f)m.set(u(p),u(x));return m}case lh:{const m=a(new Set,s);for(const p of f)m.add(u(p));return m}case Ub:{const{name:m,message:p}=f;return a(typeof Hb[m]=="function"?my(m,p):new Error(p),s)}case Bb:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return a(new DataView(m),f)}case"-0":return-0}return a(my(d,f),s)};return u},py=n=>xE(new Map,n)(0),$i="",{toString:yE}={},{keys:bE,is:vE}=Object,eu=n=>{const r=typeof n;if(r!=="object"||!n)return[hs,r];const a=yE.call(n).slice(8,-1);switch(a){case"Array":return[au,$i];case"Object":return[as,$i];case"Date":return[eh,$i];case"RegExp":return[th,$i];case"Map":return[nh,$i];case"Set":return[lh,$i];case"DataView":return[au,a]}return a.includes("Array")?[au,a]:n instanceof Error?[Ub,n.name||"Error"]:[as,a]},Io=([n,r])=>n===hs&&(r==="function"||r==="symbol"),wE=(n,r,a,u)=>{const s=(f,m)=>{const p=u.push(f)-1;return a.set(m,p),p},d=f=>{if(a.has(f))return a.get(f);let[m,p]=eu(f);switch(m){case hs:{let y=f;switch(p){case"bigint":m=Bb,y=f.toString();break;case"number":if(!f&&vE(f,-0))return u.push(["-0"])-1;break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return s([Lb],f)}return s([m,y],f)}case au:{if(p){let w=f;return p==="DataView"?w=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(w=new Uint8Array(f)),s([p,[...w]],f)}const y=[],g=s([m,y],f);for(const w of f)y.push(d(w));return g}case as:{if(p)switch(p){case"BigInt":return s([p,f.toString()],f);case"Boolean":case"Number":case"String":return s([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=s([m,y],f);for(const w of bE(f))(n||!Io(eu(f[w])))&&y.push([d(w),d(f[w])]);return g}case eh:return s([m,isNaN(f.getTime())?$i:f.toISOString()],f);case th:{const{source:y,flags:g}=f;return s([m,{source:y,flags:g}],f)}case nh:{const y=[],g=s([m,y],f);for(const[w,v]of f)(n||!(Io(eu(w))||Io(eu(v))))&&y.push([d(w),d(v)]);return g}case lh:{const y=[],g=s([m,y],f);for(const w of f)(n||!Io(eu(w)))&&y.push(d(w));return g}}const{message:x}=f;return s([m,{name:p,message:x}],f)};return d},gy=(n,{json:r,lossy:a}={})=>{const u=[];return wE(!(r||a),!!r,new Map,u)(n),u},us=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?py(gy(n,r)):structuredClone(n):(n,r)=>py(gy(n,r));function kE(n,r){const a=[{type:"text",value:"↩"}];return r>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),a}function SE(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function NE(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=n.options.footnoteBackContent||kE,u=n.options.footnoteBackLabel||SE,s=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p0&&S.push({type:"text",value:" "});let $=typeof a=="string"?a:a(p,v);typeof $=="string"&&($={type:"text",value:$}),S.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+w+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,v),className:["data-footnote-backref"]},children:Array.isArray($)?$:[$]})}const L=y[y.length-1];if(L&&L.type==="element"&&L.tagName==="p"){const $=L.children[L.children.length-1];$&&$.type==="text"?$.value+=" ":L.children.push({type:"text",value:" "}),L.children.push(...S)}else y.push(...S);const z={type:"element",tagName:"li",properties:{id:r+"fn-"+w},children:n.wrap(y,!0)};n.patch(x,z),m.push(z)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...us(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:n.wrap(m,!0)},{type:"text",value:` +`}]}}const ms=(function(n){if(n==null)return TE;if(typeof n=="function")return ps(n);if(typeof n=="object")return Array.isArray(n)?EE(n):jE(n);if(typeof n=="string")return CE(n);throw new Error("Expected function, string, or object as test")});function EE(n){const r=[];let a=-1;for(;++a":""))+")"})}return L;function L(){const z=!d||x(w,v,S[S.length-1]||void 0);let $=qb;if(m&&z&&($=xy(m(w,S,v)),$[0]===ns))return $;if("children"in w&&w.children){const I=w;if(I.children&&$[0]!==Dd){let J=(s?-1:I.children.length)+y;const ie=[...S,I];for(;J>-1&&J0&&a.push({type:"text",value:` +`}),a}function yy(n){let r=0,a=n.charCodeAt(r);for(;a===9||a===32;)r++,a=n.charCodeAt(r);return n.slice(r)}function by(n,r){const a=ME(n,r),u=a.one(n,void 0),s=NE(a),d=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&d.children.push({type:"text",value:` +`},s),d}function BE(n,r){return n&&"run"in n?async function(a,u){const s=by(a,{file:u,...r});await n.run(s,u)}:function(a,u){return by(a,{file:u,...n||r})}}function vy(n){if(n)throw n}var ad,wy;function HE(){if(wy)return ad;wy=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,a=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(x){return typeof Array.isArray=="function"?Array.isArray(x):r.call(x)==="[object Array]"},d=function(x){if(!x||r.call(x)!=="[object Object]")return!1;var y=n.call(x,"constructor"),g=x.constructor&&x.constructor.prototype&&n.call(x.constructor.prototype,"isPrototypeOf");if(x.constructor&&!y&&!g)return!1;var w;for(w in x);return typeof w>"u"||n.call(x,w)},f=function(x,y){a&&y.name==="__proto__"?a(x,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):x[y.name]=y.newValue},m=function(x,y){if(y==="__proto__")if(n.call(x,y)){if(u)return u(x,y).value}else return;return x[y]};return ad=function p(){var x,y,g,w,v,S,C=arguments[0],L=1,z=arguments.length,$=!1;for(typeof C=="boolean"&&($=C,C=arguments[1]||{},L=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});Lf.length;let p;m&&f.push(s);try{p=n.apply(this,f)}catch(x){const y=x;if(m&&a)throw y;return s(y)}m||(p&&p.then&&typeof p.then=="function"?p.then(d,s):p instanceof Error?s(p):d(p))}function s(f,...m){a||(a=!0,r(f,...m))}function d(f){s(null,f)}}const yl={basename:YE,dirname:GE,extname:QE,join:XE,sep:"/"};function YE(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');cu(n);let a=0,u=-1,s=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else u<0&&(d=!0,u=s+1);return u<0?"":n.slice(a,u)}if(r===n)return"";let f=-1,m=r.length-1;for(;s--;)if(n.codePointAt(s)===47){if(d){a=s+1;break}}else f<0&&(d=!0,f=s+1),m>-1&&(n.codePointAt(s)===r.codePointAt(m--)?m<0&&(u=s):(m=-1,u=f));return a===u?u=f:u<0&&(u=n.length),n.slice(a,u)}function GE(n){if(cu(n),n.length===0)return".";let r=-1,a=n.length,u;for(;--a;)if(n.codePointAt(a)===47){if(u){r=a;break}}else u||(u=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function QE(n){cu(n);let r=n.length,a=-1,u=0,s=-1,d=0,f;for(;r--;){const m=n.codePointAt(r);if(m===47){if(f){u=r+1;break}continue}a<0&&(f=!0,a=r+1),m===46?s<0?s=r:d!==1&&(d=1):s>-1&&(d=-1)}return s<0||a<0||d===0||d===1&&s===a-1&&s===u+1?"":n.slice(s,a)}function XE(...n){let r=-1,a;for(;++r0&&n.codePointAt(n.length-1)===47&&(a+="/"),r?"/"+a:a}function KE(n,r){let a="",u=0,s=-1,d=0,f=-1,m,p;for(;++f<=n.length;){if(f2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",u=0):(a=a.slice(0,p),u=a.length-1-a.lastIndexOf("/")),s=f,d=0;continue}}else if(a.length>0){a="",u=0,s=f,d=0;continue}}r&&(a=a.length>0?a+"/..":"..",u=2)}else a.length>0?a+="/"+n.slice(s+1,f):a=n.slice(s+1,f),u=f-s-1;s=f,d=0}else m===46&&d>-1?d++:d=-1}return a}function cu(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const ZE={cwd:$E};function $E(){return"/"}function Ud(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function JE(n){if(typeof n=="string")n=new URL(n);else if(!Ud(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return PE(n)}function PE(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const r=n.pathname;let a=-1;for(;++a0){let[v,...S]=y;const C=u[w][1];Ld(C)&&Ld(v)&&(v=ud(!0,C,v)),u[w]=[x,v,...S]}}}}const nj=new rh().freeze();function fd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function dd(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function hd(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Sy(n){if(!Ld(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ny(n,r,a){if(!a)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Ko(n){return lj(n)?n:new Fb(n)}function lj(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function ij(n){return typeof n=="string"||rj(n)}function rj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const aj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ey=[],jy={allowDangerousHtml:!0},uj=/^(https?|ircs?|mailto|xmpp)$/i,oj=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function sj(n){const r=cj(n),a=fj(n);return dj(r.runSync(r.parse(a),a),n)}function cj(n){const r=n.rehypePlugins||Ey,a=n.remarkPlugins||Ey,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...jy}:jy;return nj().use(Y3).use(a).use(BE,u).use(r)}function fj(n){const r=n.children||"",a=new Fb;return typeof r=="string"&&(a.value=r),a}function dj(n,r){const a=r.allowedElements,u=r.allowElement,s=r.components,d=r.disallowedElements,f=r.skipHtml,m=r.unwrapDisallowed,p=r.urlTransform||hj;for(const y of oj)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+aj+y.id,void 0);return ih(n,x),_S(n,{Fragment:h.Fragment,components:s,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function x(y,g,w){if(y.type==="raw"&&w&&typeof g=="number")return f?w.children.splice(g,1):w.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let v;for(v in ld)if(Object.hasOwn(ld,v)&&Object.hasOwn(y.properties,v)){const S=y.properties[v],C=ld[v];(C===null||C.includes(y.tagName))&&(y.properties[v]=p(String(S||""),v,y))}}if(y.type==="element"){let v=a?!a.includes(y.tagName):d?d.includes(y.tagName):!1;if(!v&&u&&typeof g=="number"&&(v=!u(y,g,w)),v&&w&&typeof g=="number")return m&&y.children?w.children.splice(g,1,...y.children):w.children.splice(g,1),g}}}function hj(n){const r=n.indexOf(":"),a=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return r===-1||s!==-1&&r>s||a!==-1&&r>a||u!==-1&&r>u||uj.test(n.slice(0,r))?n:""}function mj(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Vb(n,r,a){const s=ms((a||{}).ignore||[]),d=pj(r);let f=-1;for(;++f0?{type:"text",value:U}:void 0),U===!1)v.lastIndex=J+1;else{if(C!==J&&I({type:"text",value:x.value.slice(C,J)}),Array.isArray(U))for(const R of U)I(R);else U&&I(U);C=J+$[0].length,L=!0}if(!v.global)break;$=v.exec(x.value)}return L?(C?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let a=r[0],u=a.indexOf(")");const s=Cy(n,"(");let d=Cy(n,")");for(;u!==-1&&s>d;)n+=a.slice(0,u+1),a=a.slice(u+1),u=a.indexOf(")"),d++;return[n,a]}function Yb(n,r){const a=n.input.charCodeAt(n.index-1);return(n.index===0||tr(a)||fs(a))&&(!r||a!==47)}Gb.peek=Fj;function Mj(){this.buffer()}function Oj(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function Rj(){this.buffer()}function Lj(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function Uj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function Bj(n){this.exit(n)}function Hj(n){const r=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=tl(this.sliceSerialize(n)).toLowerCase(),a.label=r}function qj(n){this.exit(n)}function Fj(){return"["}function Gb(n,r,a,u){const s=a.createTracker(u);let d=s.move("[^");const f=a.enter("footnoteReference"),m=a.enter("reference");return d+=s.move(a.safe(a.associationId(n),{after:"]",before:d})),m(),f(),d+=s.move("]"),d}function Vj(){return{enter:{gfmFootnoteCallString:Mj,gfmFootnoteCall:Oj,gfmFootnoteDefinitionLabelString:Rj,gfmFootnoteDefinition:Lj},exit:{gfmFootnoteCallString:Uj,gfmFootnoteCall:Bj,gfmFootnoteDefinitionLabelString:Hj,gfmFootnoteDefinition:qj}}}function Yj(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:a,footnoteReference:Gb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(u,s,d,f){const m=d.createTracker(f);let p=m.move("[^");const x=d.enter("footnoteDefinition"),y=d.enter("label");return p+=m.move(d.safe(d.associationId(u),{before:p,after:"]"})),y(),p+=m.move("]:"),u.children&&u.children.length>0&&(m.shift(4),p+=m.move((r?` +`:" ")+d.indentLines(d.containerFlow(u,m.current()),r?Qb:Gj))),x(),p}}function Gj(n,r,a){return r===0?n:Qb(n,r,a)}function Qb(n,r,a){return(a?"":" ")+n}const Qj=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ah.attention=$j;ah.peek=Jj;function Xj(){return{canContainEols:["delete"],enter:{strikethrough:Kj},exit:{strikethrough:Zj}}}function Ij(){return{handlers:{delete:ah},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Qj}]}}function Kj(n){this.enter({type:"delete",children:[],position:void 0},n)}function Zj(n){this.exit(n)}function ah(n,r,a,u){const s=a.createTracker(u),d=a.stack.includes("strikethrough")?"~":"~~",f=a.enter("strikethrough");let m=s.move(d);return m+=a.containerPhrasing(n,{...s.current(),before:m,after:"~"}),m+=s.move(d),f(),m}function $j(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function Jj(){return"~"}function Pj(n){return n.length}function Wj(n,r){const a=r||{},u=(a.align||[]).concat(),s=a.stringLength||Pj,d=[],f=[],m=[],p=[];let x=0,y=-1;for(;++yx&&(x=n[y].length);++zp[z])&&(p[z]=I)}C.push($)}f[y]=C,m[y]=L}let g=-1;if(typeof u=="object"&&"length"in u)for(;++gp[g]&&(p[g]=$),v[g]=$),w[g]=I}f.splice(1,0,w),m.splice(1,0,v),y=-1;const S=[];for(;++y "),d.shift(2);const f=a.indentLines(a.containerFlow(n,d.current()),l5);return s(),f}function l5(n,r,a){return">"+(a?"":" ")+n}function i5(n,r){return _y(n,r.inConstruct,!0)&&!_y(n,r.notInConstruct,!1)}function _y(n,r,a){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return a;let u=-1;for(;++uf&&(f=d):d=1,s=u+r.length,u=a.indexOf(r,s);return f}function a5(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^\n\r ]/.test(n.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(n.value))}function u5(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function o5(n,r,a,u){const s=u5(a),d=n.value||"";if(a5(n,a)){const g=a.enter("codeIndented"),w=a.indentLines(d,s5);return g(),w}const f=a.createTracker(u),m=s.repeat(Math.max(r5(d,s)+1,3)),p=a.enter("codeFenced"),x=s==="`"?"GraveAccent":"Tilde";let y=f.move(m);if(n.lang){const g=a.enter(`codeFencedLang${x}`);y+=f.move(a.safe(n.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(n.lang&&n.meta){const g=a.enter(`codeFencedMeta${x}`);y+=f.move(" "),y+=f.move(a.safe(n.meta,{before:y,after:` +`,encode:["`"],...f.current()})),g()}return y+=f.move(` +`),d&&(y+=f.move(d+` +`)),y+=f.move(m),p(),y}function s5(n,r,a){return(a?"":" ")+n}function uh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function c5(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("[");return x+=p.move(a.safe(a.associationId(n),{before:x,after:"]",...p.current()})),x+=p.move("]: "),m(),!n.url||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":` +`,...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),f(),x}function f5(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function os(n){const r=n.codePointAt(0);return r===void 0?"":String.fromCodePoint(r)}function Jr(n){const r=n.codePointAt(n.length-2);return r!==void 0&&r>65535?n.slice(-2):n.slice(-1)}function Xb(n){return"&#x"+n.toString(16).toUpperCase()+";"}function zy(n,r,a){const u=wi(n),s=wi(r);return u===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function d5(n){if(n.charCodeAt(0)!==60)return;const r=n.charCodeAt(1);if(r===33){const m=n.charCodeAt(2);return m===45?2:m===91?5:Pt(m)?4:void 0}if(r===63)return 3;const a=r===47,u=a?2:1;let s=u,d=n.charCodeAt(s);if(!Pt(d))return;for(;d===45||Wt(d);)d=n.charCodeAt(++s);const f=n.slice(u,s).toLowerCase();return!a&&d!==47&&zd.includes(f)?1:_b.includes(f)?6:7}const h5=new Map([["*",!1],["_",!0]]);function m5(n,r,a){const u=new Set;for(const d of n){const f=a.get(d);if(f&&d.attention&&r.some(m=>m.attention===d.attention))for(const m of f.tokens)u.add(m.attention)}const s=[];for(const d of n)d.attention&&u.delete(d.attention)&&s.push(d.attention);return s.reverse(),s}function Ib(n,r,a){const u=[],s=new Map,d=new Map;let f=0;for(;fa.index)return{chosen:p,mistake:y,tokens:x}}}}function g5(n,r){const a=new Map;for(const u of n){const s=u.tokens[0].value.charAt(0);let d=a.get(s);d||(d=[],a.set(s,d));let f=u.close?d.length:0;for(;f--&&u.start1&&x>1?2:1:x,g=m.markers.slice(m.end-y,m.end),w=u.markers.slice(u.start,u.start+y),v=g[0],S=w[0];if(v===g[y-1]&&v.value.length===y&&S===w[y-1]&&S.value.length===y&&v.attention===S.attention)r.delete(v),r.delete(S);else{const C=[...new Set([...g,...w])];for(const L of C){const z=r.get(L);z&&z.push(...C)}}m.end-=y,u.start+=y,m.start===m.end&&d.splice(f,1),f=d.length}u.open&&u.start0?S[0].value:"",L=zy(w.charCodeAt(w.length-1),C.charCodeAt(0),y);L.inside&&Zo(S,!0);const z=S.length>0?Jr(S[S.length-1].value):"",$=zy(v.charCodeAt(0),z.charCodeAt(z.length-1),y);$.inside&&Zo(S,!1),L.outside&&w!==` +`&&w!=="\r"&&Zo(s,!1),$.outside&&(d=v),s.push({value:x,attention:p},...S,{value:x,attention:p}),f=x.charAt(x.length-1)}return s}function gs(n,r,a){let u=new Map;const s=sh(n,u,r,a);let d=s,f=Ib(d,r,a);for(;f;){const p=p5(n,u,f,r,a);if(!p){d=s;break}u=p.chosen,d=p.tokens,f=p.mistake}let m="";for(const p of d)m+=p.value;return m}ch.attention=Kb;ch.peek=b5;function ch(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,Kb,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function Kb(n,r){return{construct:"emphasis",markers:f5(r)==="*"?["*","_"]:["_","*"],sizes:[1]}}function b5(n,r,a){return a.options.emphasis||"*"}function v5(n,r){let a=!1;return ih(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return a=!0,ns}),!!((!n.depth||n.depth<3)&&Jd(n)&&(r.options.setext||a))}function w5(n,r,a,u){const s=Math.max(Math.min(6,n.depth||1),1),d=a.createTracker(u);if(v5(n,a)){const g=a.enter("headingSetext"),w=a.enter("phrasing"),v=a.containerPhrasing(n,{...d.current(),before:` +`,after:` +`});return w(),g(),v+` +`+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` +`))+1))}const f="#".repeat(s),m=a.enter("headingAtx"),p=a.enter("phrasing");d.move(f+" ");let x=a.containerPhrasing(n,{before:"# ",after:` +`,...d.current()});const y=x.charCodeAt(0);return(y===9||y===32)&&(x=Xb(y)+x.slice(1)),x=x?f+" "+x:f,a.options.closeAtx&&(x+=" "+f),p(),m(),x}Zb.peek=k5;function Zb(n){return n.value||""}function k5(){return"<"}$b.peek=S5;function $b(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let m=a.enter("label");const p=a.createTracker(u);let x=p.move("![");return x+=p.move(a.safe(n.alt,{before:x,after:"]",...p.current()})),x+=p.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=a.enter("destinationLiteral"),x+=p.move("<"),x+=p.move(a.safe(n.url,{before:x,after:">",...p.current()})),x+=p.move(">")):(m=a.enter("destinationRaw"),x+=p.move(a.safe(n.url,{before:x,after:n.title?" ":")",...p.current()}))),m(),n.title&&(m=a.enter(`title${d}`),x+=p.move(" "+s),x+=p.move(a.safe(n.title,{before:x,after:s,...p.current()})),x+=p.move(s),m()),x+=p.move(")"),f(),x}function S5(){return"!"}Jb.peek=N5;function Jb(n,r,a,u){const s=n.referenceType,d=a.enter("imageReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("![");const x=a.safe(n.alt,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function N5(){return"!"}Pb.peek=E5;function Pb(n,r,a){let u=n.value||"",s="`",d=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^\n\r ]/.test(u)&&(/^[\n\r ]/.test(u)&&/[\n\r ]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++d\u007F]/.test(n.url))}e0.peek=j5;function e0(n,r,a,u){const s=uh(a),d=s==='"'?"Quote":"Apostrophe",f=a.createTracker(u);if(Wb(n,a)){const S=a.stack;a.stack=S.filter(function(z){return z!=="phrasing"});const C=a.enter("autolink");let L=f.move("<");return L+=f.move(a.containerPhrasing(n,{before:L,after:">",...f.current()})),L+=f.move(">"),C(),a.stack=S,L}const m=a.enter("link");let p=a.enter("label"),x=f.move("[");const y=a.containerPhrasing(n,{before:x,after:"](",...f.current()});x+=f.move(y),p(),x+=f.move("](");const g=/[\0- \u007F]/.test(n.url),w=u.before.charAt(u.before.length-1);let v=n.title||void 0;if(!v&&!g&&(w===` +`||w==="\r")){let S=0;for(;S",...f.current()})),x+=f.move(">")):(p=a.enter("destinationRaw"),x+=f.move(a.safe(n.url,{before:x,after:typeof v=="string"?" ":")",...f.current()}))),p(),typeof v=="string"&&(p=a.enter(`title${d}`),x+=f.move(" "+s),x+=f.move(a.safe(v,{before:x,after:s,...f.current()})),x+=f.move(s),p()),x+=f.move(")"),m(),x}function j5(n,r,a){return Wb(n,a)?"<":"["}t0.peek=C5;function t0(n,r,a,u){const s=n.referenceType,d=a.enter("linkReference");let f=a.enter("label");const m=a.createTracker(u);let p=m.move("[");const x=a.containerPhrasing(n,{before:p,after:"]",...m.current()});p+=m.move(x+"]["),f();const y=a.stack;a.stack=y.filter(function(w){return w!=="phrasing"}),f=a.enter("reference");const g=a.safe(a.associationId(n),{before:p,after:"]",...m.current()});return f(),a.stack=y,d(),s==="full"||!x||x!==g?p+=m.move(g+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function C5(){return"["}function fh(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function T5(n){const r=fh(n),a=n.options.bulletOther;if(!a)return r==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+a+"`) to be different");return a}function _5(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function n0(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function A5(n,r,a,u){const s=a.enter("list"),d=a.bulletCurrent;let f=n.ordered?_5(a):fh(a);const m=n.ordered?f==="."?")":".":T5(a);let p=r&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),n0(a)===f&&y){let g=-1;for(;++g-1?r.start:1)+(a.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(s==="tab"||s==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const m=a.createTracker(u);m.move(d+" ".repeat(f-d.length)),m.shift(f);const p=a.enter("listItem"),x=a.indentLines(a.containerFlow(n,m.current()),y);return p(),x;function y(g,w,v){return w?(v?"":" ".repeat(f))+g:(v?d:d+" ".repeat(f-d.length))+g}}function M5(n,r,a,u){const s=a.enter("paragraph"),d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),s(),f}function O5(n,r,a,u){if(!n.children.some(function(m){return t5(m)}))return a.containerFlow(n,u);const d=a.enter("phrasing"),f=a.containerPhrasing(n,u);return d(),f}function R5(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}dh.attention=l0;dh.peek=L5;function dh(n,r,a,u){const s=a.enter("phrasing"),d=oh(n,l0,a,a.createTracker(u)),f=gs([d],u.before,u.after);return s(),f}function l0(n,r){return{construct:"strong",markers:R5(r)==="*"?["*","_"]:["_","*"],sizes:[2]}}function L5(n,r,a){return a.options.strong||"*"}function U5(n,r,a,u){const s=r?r.children:[],d=a.indexStack[a.indexStack.length-1];return a.safe(n.value,{...u,afterNode:s[d+1],beforeNode:s[d-1]})}function B5(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function H5(n,r,a){const u=(n0(a)+(a.options.ruleSpaces?" ":"")).repeat(B5(a));return a.options.ruleSpaces?u.slice(0,-1):u}const i0={blockquote:n5,break:Ay,code:o5,definition:c5,emphasis:ch,hardBreak:Ay,heading:w5,html:Zb,image:$b,imageReference:Jb,inlineCode:Pb,link:e0,linkReference:t0,list:A5,listItem:D5,paragraph:M5,root:O5,strong:dh,text:U5,thematicBreak:H5};function q5(){return{enter:{table:F5,tableData:Dy,tableHeader:Dy,tableRow:Y5},exit:{codeText:G5,table:V5,tableData:xd,tableHeader:xd,tableRow:xd}}}function F5(n){const r=n._align;this.enter({type:"table",align:r.map(function(a){return a==="none"?null:a}),children:[]},n),this.data.inTable=!0}function V5(n){this.exit(n),this.data.inTable=void 0}function Y5(n){this.enter({type:"tableRow",children:[]},n)}function xd(n){this.exit(n)}function Dy(n){this.enter({type:"tableCell",children:[]},n)}function G5(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,Q5));const a=this.stack[this.stack.length-1];a.type,a.value=r,this.exit(n)}function Q5(n,r){return r==="|"?r:n}function X5(n){const r=n||{},a=r.tableCellPadding,u=r.tablePipeAlign,s=r.stringLength,d=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:f,tableCell:p,tableRow:m}};function f(v,S,C,L){return x(y(v,C,L),v.align)}function m(v,S,C,L){const z=g(v,C,L),$=x([z]);return $.slice(0,$.indexOf(` +`))}function p(v,S,C,L){const z=C.enter("tableCell"),$=C.enter("phrasing"),I=C.containerPhrasing(v,{...L,before:d,after:d});return $(),z(),I}function x(v,S){return Wj(v,{align:S,alignDelimiters:u,padding:a,stringLength:s})}function y(v,S,C){const L=v.children;let z=-1;const $=[],I=S.enter("table");for(;++z0&&!a&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const c4={tokenize:y4,partial:!0};function f4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:p4,continuation:{tokenize:g4},exit:x4}},text:{91:{name:"gfmFootnoteCall",tokenize:m4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:d4,resolveTo:h4}}}}function d4(n,r,a){const u=this;let s=u.events.length;const d=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const p=u.events[s][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return a(p);const x=tl(u.sliceSerialize({start:f.end,end:u.now()}));return x.codePointAt(0)!==94||!d.includes(x.slice(1))?a(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function h4(n,r){let a=n.length;for(;a--;)if(n[a][1].type==="labelImage"&&n[a][0]==="enter"){n[a][1];break}n[a+1][1].type="data",n[a+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[a+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[a+3][1].end),end:Object.assign({},n[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},m=[n[a+1],n[a+2],["enter",u,r],n[a+3],n[a+4],["enter",s,r],["exit",s,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",u,r]];return n.splice(a,n.length-a+1,...m),n}function m4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d=0,f;return m;function m(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",x)}function x(g){if(d>999||g===93&&!f||g===null||g===91||mt(g))return a(g);if(g===93){n.exit("chunkString");const w=n.exit("gfmFootnoteCallString");return s.includes(tl(u.sliceSerialize(w)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):a(g)}return mt(g)||(f=!0),d++,n.consume(g),g===92?y:x}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,x):x(g)}}function p4(n,r,a){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let d,f=0,m;return p;function p(S){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(S){return S===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):a(S)}function y(S){if(f>999||S===93&&!m||S===null||S===91||mt(S))return a(S);if(S===93){n.exit("chunkString");const C=n.exit("gfmFootnoteDefinitionLabelString");return d=tl(u.sliceSerialize(C)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(S),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),w}return mt(S)||(m=!0),f++,n.consume(S),S===92?g:y}function g(S){return S===91||S===92||S===93?(n.consume(S),f++,y):y(S)}function w(S){return S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),s.includes(d)||s.push(d),et(n,v,"gfmFootnoteDefinitionWhitespace")):a(S)}function v(S){return r(S)}}function g4(n,r,a){return n.check(su,r,n.attempt(c4,r,a))}function x4(n){n.exit("gfmFootnoteDefinition")}function y4(n,r,a){const u=this;return et(n,s,"gfmFootnoteDefinitionIndent",5);function s(d){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):a(d)}}function b4(n){let a=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:d,resolveAll:s};return a==null&&(a=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,m){let p=-1;for(;++p1?p(S):(f.consume(S),g++,v);if(g<2&&!a)return p(S);const L=f.exit("strikethroughSequenceTemporary"),z=wi(S);return L._open=!z||z===2&&!!C,L._close=!C||C===2&&!!z,m(S)}}}class v4{constructor(){this.map=[],this.index=new Map}add(r,a,u){w4(this,r,a,u)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const u=[];for(;a>0;)a-=1,u.push(r.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),r.length=this.map[a][0];u.push(r.slice()),r.length=0;let s=u.pop();for(;s;){for(const d of s)r.push(d);s=u.pop()}this.map.length=0,this.index.clear()}}function w4(n,r,a,u){if(a===0&&u.length===0)return;const s=n.index.get(r);if(s){s[1]+=a,s[2].push(...u);return}const d=[r,a,u];n.map.push(d),n.index.set(r,d)}function k4(n,r){let a=!1;const u=[];for(;r-1;){const{type:ve}=u.events[ne][1];if(ve==="lineEnding"||ve==="linePrefix")ne--;else break}const V=ne>-1?u.events[ne][1].type:null,se=V==="tableHead"||V==="tableRow"?U:p;return se===U&&u.parser.lazy[u.now().line]?a(B):se(B)}function p(B){return n.enter("tableHead"),n.enter("tableRow"),x(B)}function x(B){return B===124||(f=!0,d+=1),y(B)}function y(B){return B===null?a(B):Te(B)?d>1?(d=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),v):a(B):Ve(B)?et(n,y,"whitespace")(B):(d+=1,f&&(f=!1,s+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(B)))}function g(B){return B===null||B===124||mt(B)?(n.exit("data"),y(B)):(n.consume(B),B===92?w:g)}function w(B){return B===92||B===124?(n.consume(B),g):g(B)}function v(B){return u.interrupt=!1,u.parser.lazy[u.now().line]?a(B):(n.enter("tableDelimiterRow"),f=!1,Ve(B)?et(n,S,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?L(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),C):ie(B)}function C(B){return Ve(B)?et(n,L,"whitespace")(B):L(B)}function L(B){return B===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),z):B===45?(d+=1,z(B)):B===null||Te(B)?J(B):ie(B)}function z(B){return B===45?(n.enter("tableDelimiterFiller"),$(B)):ie(B)}function $(B){return B===45?(n.consume(B),$):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),I):(n.exit("tableDelimiterFiller"),I(B))}function I(B){return Ve(B)?et(n,J,"whitespace")(B):J(B)}function J(B){return B===124?S(B):B===null||Te(B)?!f||s!==d?ie(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):ie(B)}function ie(B){return a(B)}function U(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||Te(B)?(n.exit("tableRow"),r(B)):Ve(B)?et(n,R,"whitespace")(B):(n.enter("data"),Q(B))}function Q(B){return B===null||B===124||mt(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?fe:Q)}function fe(B){return B===92||B===124?(n.consume(B),Q):Q(B)}}function E4(n,r){let a=-1,u=!0,s=0,d=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,x,y,g;const w=new v4;for(;++aa[2]+1){const S=a[2]+1,C=a[3]-a[2]-1;n.add(S,C,[])}}n.add(a[3]+1,0,[["exit",g,r]])}return s!==void 0&&(d.end=Object.assign({},Ir(r.events,s)),n.add(s,0,[["exit",d,r]]),d=void 0),d}function Oy(n,r,a,u,s){const d=[],f=Ir(r.events,a);s&&(s.end=Object.assign({},f),d.push(["exit",s,r])),u.end=Object.assign({},f),d.push(["exit",u,r]),n.add(a+1,0,d)}function Ir(n,r){const a=n[r],u=a[0]==="enter"?"start":"end";return a[1][u]}const j4={name:"tasklistCheck",tokenize:T4};function C4(){return{text:{91:j4}}}function T4(n,r,a){const u=this;return s;function s(p){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?a(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return mt(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),m):a(p)}function m(p){return Te(p)?r(p):Ve(p)?n.check({tokenize:_4},r,a)(p):a(p)}}function _4(n,r,a){return et(n,u,"whitespace");function u(s){return s===null?a(s):r(s)}}function A4(n){return yb([t4(),f4(),b4(n),S4(),C4()])}const z4={};function D4(n){const r=this,a=n||z4,u=r.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),d=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(A4(a)),d.push(J5()),f.push(P5(a))}function M4(n){return n.replace(/\\n/g,` +`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\\/g,"\\")}const O4={h1:({children:n})=>h.jsx("h3",{className:"mt-3 mb-1.5 text-base font-bold text-ink first:mt-0",children:n}),h2:({children:n})=>h.jsx("h4",{className:"mt-3 mb-1 text-sm font-semibold text-ink first:mt-0",children:n}),h3:({children:n})=>h.jsx("h5",{className:"mt-2 mb-1 text-xs font-semibold text-ink first:mt-0",children:n}),p:({children:n})=>h.jsx("p",{className:"my-1.5 leading-relaxed first:mt-0 last:mb-0",children:n}),strong:({children:n})=>h.jsx("strong",{className:"font-semibold text-ink",children:n}),em:({children:n})=>h.jsx("em",{className:"italic text-ink-secondary",children:n}),del:({children:n})=>h.jsx("del",{className:"text-ink-muted line-through",children:n}),a:({children:n,href:r})=>h.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-chip-indigo-text underline underline-offset-2 hover:text-ink",children:n}),code:({children:n,className:r})=>h.jsx("code",{className:`break-words rounded bg-elevated px-1 py-0.5 font-mono text-chip-indigo-text whitespace-pre-wrap ${r??""}`,children:n}),pre:({children:n})=>h.jsx("pre",{className:"my-2 overflow-x-auto rounded-lg border border-line bg-elevated p-3 font-mono text-xs text-ink [&_code]:bg-transparent [&_code]:px-0 [&_code]:py-0 [&_code]:text-inherit",children:n}),ul:({children:n})=>h.jsx("ul",{className:"my-1.5 list-disc space-y-0.5 pl-5",children:n}),ol:({children:n})=>h.jsx("ol",{className:"my-1.5 list-decimal space-y-0.5 pl-5",children:n}),li:({children:n})=>h.jsx("li",{className:"leading-relaxed",children:n}),blockquote:({children:n})=>h.jsx("blockquote",{className:"my-2 border-l-2 border-line-strong pl-3 text-ink-secondary italic",children:n}),table:({children:n})=>h.jsx("div",{className:"my-2 overflow-x-auto",children:h.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>h.jsx("th",{className:"border border-line bg-elevated px-2 py-1 text-left font-semibold",children:n}),td:({children:n})=>h.jsx("td",{className:"border border-line px-2 py-1 align-top",children:n}),hr:()=>h.jsx("hr",{className:"my-3 border-line"}),img:({alt:n,src:r,title:a})=>h.jsx("img",{src:r,alt:n,title:a,loading:"lazy",referrerPolicy:"no-referrer",className:"my-2 max-w-full rounded-lg border border-line"})};function Jo({text:n}){return n?h.jsx(sj,{remarkPlugins:[D4,vj],components:O4,children:M4(n)}):null}function h0(n){return n==="completed"||n==="aborted"||n==="failed"}function tu({label:n}){return h.jsx("kbd",{"aria-hidden":"true",className:"ml-1.5 inline-block rounded border border-line/60 bg-elevated/60 px-1 py-px font-mono text-[10px] font-normal leading-none opacity-90",children:n})}function Ry(n){!n||h0(n.status)||S2(n.session_id).catch(()=>{})}const R4={running:"running",completed:"done",skipped:"skipped",failed:"failed",pending:"pending"};function Po({text:n}){const[r,a]=_.useState(!1),u=_.useRef(void 0);_.useEffect(()=>()=>window.clearTimeout(u.current),[]);const s=async()=>{try{await navigator.clipboard.writeText(n),a(!0),window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!1),1500)}catch{}};return h.jsx("button",{type:"button",onClick:s,"aria-label":r?"Copied":"Copy content",title:r?"Copied!":"Copy content",className:"absolute right-2 top-2 rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:r?h.jsx(vi,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"})})}function L4({isOpen:n,onClose:r,directory:a,filename:u,release:s,args:d,onFinished:f}){var Ge,M;const[m,p]=_.useState(null),[x,y]=_.useState(!1),[g,w]=_.useState(null),[v,S]=_.useState(null),[C,L]=_.useState(!1),[z,$]=_.useState(0),I=_.useRef(null),J=_.useRef(!1),ie=_.useRef(null),U=_.useRef(!1);_.useEffect(()=>{if(!n||!a||!u){p(null),w(null),L(!1),S(null),U.current=!1;return}let E=!0;return y(!0),w(null),L(!1),S(null),w2({directory:a,filename:u,release:s,args:d}).then(Y=>{E&&(p(Y),y(!1),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||"")))}).catch(Y=>{E&&((Y==null?void 0:Y.status)===404&&L(!0),w(Y.message||"Failed to start workflow"),y(!1))}),()=>{E=!1}},[n,a,u,s,d,z]);const R=async E=>{if(!(!m||J.current)){J.current=!0,y(!0);try{const Y=await k2(m.session_id,E);p(Y),(Y.status==="completed"||Y.status==="aborted"||Y.status==="failed")&&(f==null||f(Y.status,Y.final_message||""))}catch(Y){(Y==null?void 0:Y.status)===404?(L(!0),w(Y.message||"Workflow session on the server has expired.")):w(Y.message||"Failed to process workflow response")}finally{J.current=!1,y(!1)}}},Q=_.useRef(m);Q.current=m;const fe=_.useRef(R);fe.current=R;const B=_.useRef(v);B.current=v;const ne=_.useRef([]),V=(E,Y)=>{var je,ye;if(E.key!=="ArrowDown"&&E.key!=="ArrowUp"&&E.key!=="Home"&&E.key!=="End")return;E.preventDefault();const oe=((je=Q.current)==null?void 0:je.steps.length)??0;if(oe===0)return;const de=E.key==="ArrowDown"?(Y+1)%oe:E.key==="ArrowUp"?(Y-1+oe)%oe:E.key==="Home"?0:oe-1;S(de),(ye=ne.current[de])==null||ye.focus()};_.useEffect(()=>()=>Ry(Q.current),[]);const se=()=>{U.current||(U.current=!0,Ry(Q.current),r())},ve=()=>{p(null),w(null),L(!1),S(null),U.current=!1,$(E=>E+1)},ae=Wr({isOpen:n,onClose:se,dialogRef:I,initialFocusRef:ie});if(_.useEffect(()=>{if(!n)return;const E=Y=>{var Se,Rt,Bt;if(Y.key==="Escape"){Y.preventDefault(),se();return}const oe=Q.current;if(!oe)return;if(h0(oe.status)){Y.key==="Enter"&&!Y.repeat&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!J.current&&((Se=Y.target)==null?void 0:Se.tagName)!=="BUTTON"&&((Rt=document.activeElement)==null?void 0:Rt.tagName)!=="BUTTON"&&(Y.preventDefault(),se());return}if(J.current||Y.repeat||Y.ctrlKey||Y.metaKey||Y.altKey)return;const de=Y.target;if((de==null?void 0:de.tagName)==="INPUT"||(de==null?void 0:de.tagName)==="TEXTAREA"||de!=null&&de.isContentEditable)return;const je=B.current,ye=je===null||je===oe.current_index,_e=oe.status==="waiting_ask"?"yes":oe.status==="waiting_notify"||oe.status==="waiting_notice"?"ack":null;if(!ye||_e===null)return;if(Y.key==="Enter"){const Gt=Y.target;if((Gt==null?void 0:Gt.tagName)==="BUTTON"||((Bt=document.activeElement)==null?void 0:Bt.tagName)==="BUTTON")return;Y.preventDefault(),fe.current(_e);return}if(oe.status!=="waiting_ask")return;const pe=Y.key.toLowerCase();pe==="y"?(Y.preventDefault(),fe.current("yes")):pe==="s"?(Y.preventDefault(),fe.current("skip")):pe==="n"&&(Y.preventDefault(),fe.current("no"))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[n,r]),_.useEffect(()=>{if(!n||!m)return;const E=requestAnimationFrame(()=>{var Y;return(Y=ie.current)==null?void 0:Y.focus()});return()=>cancelAnimationFrame(E)},[n,m==null?void 0:m.status]),!n)return null;const A=v!==null?m==null?void 0:m.steps[v]:m==null?void 0:m.steps[m.current_index],W=(m==null?void 0:m.status)==="completed"||(m==null?void 0:m.status)==="aborted"||(m==null?void 0:m.status)==="failed",le=!!m&&!W&&!C&&(((Ge=m.status)==null?void 0:Ge.startsWith("waiting"))??!1),re=(((M=m==null?void 0:m.steps[(m==null?void 0:m.current_index)??-1])==null?void 0:M.phase)??"pre")==="post",qe=!C&&(v===null||v===(m==null?void 0:m.current_index))&&(A!=null&&A.command)&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_notice"||(m==null?void 0:m.status)==="waiting_ask")?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsxs("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 pr-10 font-mono text-xs text-ink leading-relaxed",children:[h.jsx(Po,{text:A.command}),A.command]})]}):null;return h.jsx("div",{ref:I,role:"dialog","aria-modal":"true","aria-labelledby":"workflow-runner-title",onKeyDown:ae,className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-xs",children:h.jsxs("div",{className:"animate-modal-in flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-frame-line glass-panel overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line px-5 py-3.5 bg-surface-strong/30 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-chip-indigo-bg text-chip-indigo-text",children:h.jsx(eb,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("h2",{id:"workflow-runner-title",className:"text-sm font-semibold text-ink",children:"Launch Workflow Engine"}),h.jsxs("p",{className:"text-xs text-ink-muted",children:[u," ",m!=null&&m.pattern?`• Pattern: ${m.pattern}`:""]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[m&&!W&&!C&&h.jsxs("button",{type:"button",disabled:!le||x,onClick:()=>R("bypass"),title:re?"Skip the remaining post-launch steps":"Skip the remaining steps and launch with the OS default app",className:"btn inline-flex items-center gap-1.5 rounded-md border border-line bg-surface px-3 py-1.5 text-xs font-medium text-status-warning-text hover:bg-status-warning-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 disabled:cursor-not-allowed disabled:opacity-40",children:[h.jsx(qw,{className:"h-3.5 w-3.5"}),re?"Skip rest":"Launch now"]}),h.jsx("button",{type:"button",onClick:se,className:"rounded-md p-1.5 text-ink-muted hover:bg-elevated hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",children:h.jsx(nl,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsxs("div",{className:"w-72 border-r border-line bg-surface-strong/20 p-4 overflow-y-auto flex flex-col gap-2 shrink-0",children:[h.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-ink-muted px-1 mb-1",children:"Workflow Steps (Click to inspect)"}),m&&m.steps.length>0?h.jsx("ul",{role:"list",className:"flex flex-col gap-2",children:m.steps.map((E,Y)=>{const oe=m.current_index===Y&&!W,de=v===Y||v===null&&oe,je=R4[E.status];return h.jsx("li",{children:h.jsxs("button",{ref:ye=>{ne.current[Y]=ye},type:"button",tabIndex:de?0:-1,"aria-current":de?"step":void 0,onKeyDown:ye=>V(ye,Y),onClick:()=>S(Y),className:`flex items-start text-left gap-2.5 rounded-lg border px-3 py-2.5 transition-colors cursor-pointer w-full ${de?"border-chip-indigo-border bg-chip-indigo-bg shadow-xs ring-1 ring-chip-indigo-border/40":"border-line/60 bg-surface/60 hover:bg-elevated/80"}`,children:[h.jsxs("div",{className:"mt-0.5 shrink-0",children:[E.status==="running"&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"}),E.status==="completed"&&h.jsx(Mx,{className:"h-4 w-4 text-status-success-text"}),E.status==="skipped"&&h.jsx(dw,{className:"h-4 w-4 text-status-warning-text"}),E.status==="failed"&&h.jsx(lu,{className:"h-4 w-4 text-status-danger-text"}),E.status==="pending"&&h.jsx("div",{className:"h-4 w-4 rounded-full border border-line-strong flex items-center justify-center text-[10px] text-ink-faint font-mono",children:E.index})]}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[11px] font-bold uppercase text-chip-indigo-text",children:E.action}),h.jsxs("span",{className:"text-[10px] font-mono text-ink-faint",children:["#",E.index," · ",je]})]}),h.jsx("p",{className:"truncate font-mono text-[11px] text-ink-secondary mt-0.5",title:E.command,children:E.message?E.message.split(` +`)[0]:E.command}),E.note&&h.jsx("p",{className:"mt-1 text-[10px] text-ink-faint italic",children:E.note})]})]})},E.index)})}):h.jsx("div",{className:"p-4 text-center text-xs text-ink-faint",children:g||C?"Session unavailable — see the error panel.":"Loading steps..."})]}),h.jsxs("div",{className:"flex-1 flex flex-col bg-app",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:h.jsx("div",{className:"space-y-6",children:h.jsxs("div",{className:"rounded-xl border border-line bg-surface p-5 shadow-xs space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-line pb-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"rounded bg-chip-indigo-bg px-2 py-0.5 font-mono text-xs font-semibold uppercase text-chip-indigo-text",children:(A==null?void 0:A.action)||(m==null?void 0:m.status)}),h.jsx("span",{className:"text-xs text-ink-muted",children:A?`Step ${A.index} of ${m==null?void 0:m.steps.length}`:"Status"}),v!==null&&v!==(m==null?void 0:m.current_index)&&h.jsx("button",{type:"button",onClick:()=>S(null),className:"text-[11px] text-chip-indigo-text hover:underline ml-2",children:"(Return to active step)"})]}),x&&h.jsx(Wi,{className:"h-4 w-4 animate-spin text-chip-indigo-text"})]}),h.jsxs("div",{className:"space-y-3 text-xs text-ink font-sans leading-relaxed",children:[(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notify"&&m.notify_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notification Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx(Jo,{text:m.notify_message})}),qe]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_notice"&&m.notice_message&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Notice:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx(Jo,{text:m.notice_message})}),qe,h.jsx("p",{className:"text-[11px] text-ink-faint",children:"The command will run when you continue."})]}),(v===null||v===(m==null?void 0:m.current_index))&&(m==null?void 0:m.status)==="waiting_ask"&&m.ask_prompt&&h.jsxs("div",{className:"space-y-2",children:[m.ask_message&&h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-ink",children:h.jsx(Jo,{text:m.ask_message})}),h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-status-warning-text",children:"Confirmation Prompt:"}),h.jsx("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-4 text-sm font-medium text-ink",children:m.ask_prompt}),qe]}),W&&v===null&&h.jsxs("div",{className:`rounded-xl border p-8 text-center space-y-4 ${(m==null?void 0:m.status)==="completed"?"border-status-success-border bg-status-success-bg text-status-success-text":"border-status-danger-border bg-status-danger-bg text-status-danger-text"}`,children:[h.jsx("div",{className:"inline-flex h-12 w-12 items-center justify-center rounded-full bg-surface/50 mx-auto",children:(m==null?void 0:m.status)==="completed"?h.jsx(Mx,{className:"h-6 w-6 text-status-success-text"}):h.jsx(lu,{className:"h-6 w-6 text-status-danger-text"})}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h3",{className:"text-base font-bold",children:(m==null?void 0:m.status)==="completed"?"Workflow Finished":"Workflow Terminated"}),h.jsx("p",{className:"text-xs text-ink-secondary max-w-md mx-auto",children:(m==null?void 0:m.final_message)||"The launch sequence has ended."})]}),h.jsx("div",{className:"pt-2",children:h.jsx("button",{type:"button",onClick:r,className:"btn btn-primary px-8 py-2.5 font-bold shadow-lg",children:"Close Engine Runner"})})]}),W&&v===null&&(m==null?void 0:m.last_output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Po,{text:m.last_output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:m.last_output})]})]}),!C&&!(W&&v===null)&&!((v===null||v===(m==null?void 0:m.current_index))&&((m==null?void 0:m.status)==="waiting_notify"||(m==null?void 0:m.status)==="waiting_ask"||(m==null?void 0:m.status)==="waiting_notice"))&&h.jsxs("div",{className:"space-y-4",children:[(A==null?void 0:A.message)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Message:"}),h.jsx("div",{className:"rounded-lg border border-line bg-surface-strong p-4 text-xs text-ink",children:h.jsx(Jo,{text:A.message})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Command:"}),h.jsx("div",{className:"relative rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink leading-relaxed",children:A!=null&&A.command?h.jsxs(h.Fragment,{children:[h.jsx(Po,{text:A.command}),h.jsx("span",{className:"block pr-8",children:A.command})]}):"Waiting..."})]}),(A==null?void 0:A.output)&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-ink-muted",children:"Output:"}),h.jsxs("div",{className:"relative",children:[h.jsx(Po,{text:A.output}),h.jsx("pre",{className:"max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-lg border border-line bg-surface-strong p-4 font-mono text-xs text-ink",children:A.output})]})]}),(A==null?void 0:A.ask)&&h.jsxs("div",{className:"rounded-lg border border-status-warning-border bg-status-warning-bg p-3 text-xs text-status-warning-text",children:[h.jsx("span",{className:"font-semibold",children:"Workflow Guard:"})," ",A.ask]}),(A==null?void 0:A.note)&&h.jsxs("div",{className:"rounded-lg border border-line bg-surface-strong p-3 text-xs text-ink-muted italic",children:[h.jsx("span",{className:"font-semibold text-ink-secondary not-italic uppercase text-[10px]",children:"Log:"})," ",A.note]})]})]})]})})}),(g||C)&&h.jsx("div",{className:"shrink-0 px-6 pt-3",children:h.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-status-danger-border bg-status-danger-bg p-3 text-xs text-status-danger-text",children:[h.jsx(lu,{className:"mt-0.5 h-4 w-4 shrink-0"}),h.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[h.jsx("p",{children:C?"Workflow session on the server has expired or ended.":g}),C?h.jsxs("div",{className:"space-y-2",children:[g&&h.jsxs("details",{className:"text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer select-none text-[11px] underline",children:"Raw error (for bug reports)"}),h.jsx("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap break-words font-mono text-[11px]",children:g})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:ve,className:"btn btn-primary px-4 py-1.5 text-xs font-semibold",children:"Restart workflow"}),h.jsx("button",{type:"button",onClick:se,className:"btn rounded-md border-line bg-surface px-4 py-1.5 text-xs",children:"Close"})]})]}):null]})]})}),h.jsxs("div",{className:"shrink-0 px-6 pt-4 pb-4 border-t border-line flex items-center justify-between bg-app",children:[h.jsx("div",{className:"text-xs text-ink-muted","aria-live":"polite",children:C?"Session unavailable — restart or close above.":(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)?"Action required to proceed:":(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)?"Acknowledge message to proceed:":(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)?"Continue to run the command:":W?"Session terminated.":"Step in progress..."}),h.jsxs("div",{className:"flex items-center gap-2",children:[!C&&(m==null?void 0:m.status)==="waiting_notice"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Run Command",h.jsx(tu,{label:"↵"})]}),!C&&(m==null?void 0:m.status)==="waiting_notify"&&(v===null||v===m.current_index)&&h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("ack"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Continue Workflow",h.jsx(tu,{label:"↵"})]}),!C&&(m==null?void 0:m.status)==="waiting_ask"&&(v===null||v===m.current_index)&&h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("no"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-danger-text hover:bg-status-danger-bg",children:["Abort Launch",h.jsx(tu,{label:"N"})]}),h.jsxs("button",{type:"button",disabled:x,onClick:()=>R("skip"),className:"btn rounded-md border-line bg-surface px-4 py-2 text-status-warning-text hover:bg-status-warning-bg",children:["Skip Step",h.jsx(tu,{label:"S"})]}),h.jsxs("button",{type:"button",ref:ie,disabled:x,onClick:()=>R("yes"),className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:["Execute Step",h.jsx(tu,{label:"Y"})]})]}),W&&h.jsx("button",{type:"button",ref:ie,onClick:r,className:"btn btn-primary px-5 py-2 font-semibold shadow-sm",children:"Close Runner"})]})]})]})]})]})})}function Ly({isOpen:n,title:r,message:a,confirmLabel:u="Confirm",cancelLabel:s="Cancel",danger:d=!1,onConfirm:f,onCancel:m}){const p=_.useRef(null),x=_.useRef(null),y=Wr({isOpen:n,onClose:m,dialogRef:p,initialFocusRef:x});return n?h.jsx("div",{className:"animate-overlay-in fixed inset-0 z-[var(--z-modal)] flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",onClick:m,children:h.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",onKeyDown:y,onClick:g=>g.stopPropagation(),className:"animate-modal-in w-[400px] max-w-full rounded-2xl border border-frame-line glass-panel p-5",children:[h.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[h.jsx("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-lg ${d?"bg-status-danger-bg text-status-danger-text":"bg-chip-indigo-bg text-chip-indigo-text"}`,children:h.jsx(Wy,{className:"h-5 w-5"})}),h.jsx("h2",{id:"confirm-dialog-title",className:"text-sm font-semibold text-ink",children:r})]}),h.jsx("p",{className:"mb-5 whitespace-pre-line text-xs text-ink-secondary",children:a}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{ref:x,type:"button",onClick:m,className:"min-h-9 rounded-lg border border-line bg-elevated px-3.5 text-sm text-ink-secondary transition-colors hover:bg-surface-strong hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400",children:s}),h.jsx("button",{type:"button",onClick:f,className:`min-h-9 rounded-lg border px-4 text-sm font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400 ${d?"border-status-danger-border bg-status-danger-bg/30 text-status-danger-text hover:bg-status-danger-bg/60":"btn-primary border-transparent bg-indigo-600 text-white hover:bg-indigo-500"}`,children:u})]})]})}):null}const U4=";",Uy="=";function B4(n){const r=n.trim().toLowerCase();return r==="extension"||r==="file_ext"||r==="filetype"?"ext":r==="directory"||r==="path"||r==="folder"?"dir":r==="recurse"||r==="recursive_search"?"recursive":r==="filter_text"||r==="query"||r==="search"?"filter":r}function By(n){const r=n.trim();if(!r.includes(Uy))return{values:{filter:r},isPlainFilter:!0};const a={};for(const u of r.split(U4)){const s=u.trim();if(!s)continue;const d=s.indexOf(Uy);if(d===-1)continue;const f=B4(s.slice(0,d)),m=s.slice(d+1).trim();switch(f){case"filter":a.filter=m;break;case"ext":a.ext=m;break;case"recursive":a.recursive=Hy(m,!0);break;case"dir":a.dir=m;break;case"scan":a.scan=Hy(m,!1);break}}return{values:a,isPlainFilter:!1}}function Hy(n,r){const a=n.toLowerCase();return["0","false","no","off"].includes(a)?!1:["1","true","yes","on"].includes(a)?!0:r}function nu(n){return/[",\n\r]/.test(n)?`"${n.replace(/"/g,'""')}"`:n}function H4(n,r,a,u){var p,x;const s=[],f=[["Exported",new Date().toISOString()],["App Version",(a==null?void 0:a.release)??"unknown"],["Config File",(a==null?void 0:a.config_path)??"none"],["Config Exists",String((a==null?void 0:a.config_exists)??!1)],["Directory",(a==null?void 0:a.active_directory)??""],["Extensions",((p=a==null?void 0:a.extensions)==null?void 0:p.join(" | "))??""],["Filter Text",u??((x=a==null?void 0:a.filters)==null?void 0:x[0])??""],["Recursive",String((a==null?void 0:a.recursive_search)??!0)],["Title",(a==null?void 0:a.title)??""],["Release",(a==null?void 0:a.release)??""]];for(const[y,g]of f)s.push(`${nu(y)},${nu(g)}`);s.push("");const m=r.length>0?r:["filename","path","rel_path"];s.push(m.map(nu).join(","));for(const y of n){const g=m.map(w=>w in y?nu(String(y[w]??"")):nu(y.column_values[w]??""));s.push(g.join(","))}return s.join(`\r +`)}const q4=120,qy=800,F4=4e3,Fy=20;function V4(){const[n,r]=_.useState("dark"),[a,u]=_.useState(null),[s,d]=_.useState(null),[f,m]=_.useState(""),[p,x]=_.useState(""),[y,g]=_.useState(""),[w,v]=_.useState(!0),[S,C]=_.useState([]),[L,z]=_.useState(0),[$,I]=_.useState(!1),[J,ie]=_.useState(!1),[U,R]=_.useState(null),[Q,fe]=_.useState(!1),[B,ne]=_.useState(null),[V,se]=_.useState(0),[ve,ae]=_.useState(!1),A=_.useRef(0),W=_.useRef(null),le=_.useRef(null),[re,N]=_.useState(""),[qe,Ge]=_.useState(null),[M,E]=_.useState(!1),[Y,oe]=_.useState(null),[de,je]=_.useState(!1),[ye,_e]=_.useState("en"),[pe,Se]=_.useState(!1),[Rt,Bt]=_.useState(!1),[Gt,St]=_.useState(!1),[nt,Je]=_.useState(null),[en,bn]=_.useState(null),[tn,Ht]=_.useState(!1),[ge,Me]=_.useState(!1),[Le,lt]=_.useState(null),[K,ue]=_.useState(null),[ke,Ce]=_.useState(!1),ft=_.useRef(""),[it,Tt]=_.useState(!1),[nn,zn]=_.useState(void 0),[Dn,Mn]=_.useState(!1),[ll,Nt]=_.useState(null),[Et,Gn]=_.useState(0),Qt=_.useRef(null),il=_.useRef(null),he=(D,T="info")=>{D&&(oe({message:D,kind:T}),il.current&&clearTimeout(il.current),il.current=setTimeout(()=>oe(null),T==="error"?1e4:3500))},fu=()=>{il.current&&clearTimeout(il.current),oe(null)},xs=D=>{lt(D)},vn=()=>{var T;le.current&&(clearTimeout(le.current),le.current=null),(T=W.current)==null||T.abort(),W.current=new AbortController;const D=++A.current;return ae(!0),ie(!1),D},pt=D=>D===A.current,gt=D=>{pt(D)&&ae(!1)},jt=_.useRef(null);_.useEffect(()=>{if(!y.trim()){N("");return}const D=window.setTimeout(()=>N(y),q4);return()=>window.clearTimeout(D)},[y]);const Ke=_.useMemo(()=>re.trim()===""?S:S.filter(D=>Sk(D.rel_path,re)),[S,re]),ys=y.trim()&&S.length{const D=jt.current,T=D?Ke.findIndex(P=>P.path===D):-1;if(T>=0){se(P=>T!==P?T:P);return}se(P=>Math.min(P,Math.max(0,Ke.length-1)))},[Ke]);const du=async(D,T=B)=>{var we;const P=await Pf({offset:0,limit:ed,sort_by:T==null?void 0:T.column,sort_dir:T==null?void 0:T.direction,signal:(we=W.current)==null?void 0:we.signal});return pt(D)?(C(P.items),z(P.count),I(!0),!0):!1},On=async(D,T)=>{var P;return!pt(D)||(await Ex(T,(P=W.current)==null?void 0:P.signal),!pt(D)||!await du(D))?!1:(jt.current=null,se(0),!0)},lr=async()=>{if(J||S.length>=L)return;const D=A.current;ie(!0);try{const T=await Pf({offset:S.length,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction});if(!pt(D))return;const P=new Set(S.map(we=>we.path||we.filename));C(we=>[...we,...T.items.filter(Oe=>!P.has(Oe.path||Oe.filename))]),z(T.count)}catch{he("Couldn't load more results — scroll to try again.","error")}finally{pt(D)&&ie(!1)}},Si=async()=>{if(de)return;je(!0),he("Reloading configuration...");const D=vn();try{const T=await Vo();u(T);const P=await d2();d(P),r(zx(P.theme));const we=P.active_directory||f,Oe=P.extensions[0]??"",Ye=P.filters[0]??"";we&&m(we),x(Oe),g(Ye),v(P.recursive_search),P.reloaded===!1?he(`Config file not found: ${P.config_path||"(unknown path)"} — kept current configuration.`,"error"):he("Configuration reloaded."),we&&await On(D,{directory:we,extension:Oe,filter_text:Ye,recursive:P.recursive_search})}catch(T){he(`Failed to reload configuration: ${T.message}`,"error")}finally{je(!1),gt(D)}},ql=async D=>{const T=vn();d(D),r(zx(D.theme));const P=D.active_directory||f||(D.directories[0]??""),we=D.extensions[0]??"",Oe=D.filters[0]??"";if(P&&m(P),x(we),g(Oe),v(D.recursive_search),D.session_trial||he(D.config_exists?`Loaded config: ${D.config_path}`:"Starter configuration created."),P)try{await On(T,{directory:P,extension:we,filter_text:Oe,recursive:D.recursive_search})}catch(Ye){he(`Scan failed after config load: ${Ye.message}`,"error")}finally{gt(T)}else gt(T)},[wl,ir]=_.useState(!1),kl=_.useRef(Wo()),Ni=D=>{kl.current=D,ir(D.overlayVisible)},na=_.useRef(()=>{}),hu=async D=>{try{const T=await D.text(),P=await f2(D.name,T);await ql(P),he(`Session config applied: ${D.name}`)}catch(T){he(T.message||"Failed to apply dropped configuration","error")}};na.current=D=>{hu(D)};const Ei=_.useRef(0),Fl=_.useRef(async()=>{});_.useEffect(()=>{Fl.current=async()=>{const D=await Sx();await ql(D)}}),_.useEffect(()=>{const D=async()=>{let P=[];try{P=(await a2(Ei.current)).events}catch{return}for(const we of P){if(Ei.current=Math.max(Ei.current,we.id),we.config_applied)try{await Fl.current()}catch{}he(we.message)}},T=setInterval(()=>void D(),F4);return()=>clearInterval(T)},[]),_.useEffect(()=>{const D=Ye=>{var qt;return Array.from(((qt=Ye.dataTransfer)==null?void 0:qt.types)??[]).includes("Files")},T=Ye=>{Ni(Ax(kl.current,"enter",D(Ye)))},P=Ye=>{D(Ye)&&Ye.preventDefault()},we=Ye=>{Ni(Ax(kl.current,"leave",D(Ye)))},Oe=Ye=>{var Qe;Ye.preventDefault(),Ni(Wo());const qt=Array.from(((Qe=Ye.dataTransfer)==null?void 0:Qe.files)??[]),Re=j2(qt);if(!Re){qt.length>0&&he("Not a ProFiles configuration file.","error");return}na.current(Re)};return window.addEventListener("dragenter",T),window.addEventListener("dragover",P),window.addEventListener("dragleave",we),window.addEventListener("drop",Oe),()=>{window.removeEventListener("dragenter",T),window.removeEventListener("dragover",P),window.removeEventListener("dragleave",we),window.removeEventListener("drop",Oe)}},[]);const bs=()=>{Se(!0)},mu=async D=>{const T=vn();Se(!1),m(D),he(`Directory selected: ${D}`);let P;try{P=await Nx(D),d(P)}catch(Ye){console.error("select-directory failed:",Ye)}if(!pt(T))return;const we=P!=null&&P.extensions.includes(p)?p:(P==null?void 0:P.extensions[0])??p,Oe=P!=null&&P.filters.includes(y)?y:(P==null?void 0:P.filters[0])??y;x(we),g(Oe);try{await On(T,{directory:D,extension:we,filter_text:Oe,recursive:w})}catch(Ye){pt(T)&&he(`Scan failed: ${Ye.message}`,"error")}finally{gt(T)}},pu=async(D,T)=>{if(!pt(T))return;const P=D.theme==="auto"?"dark":D.theme==="light"?"light":"dark";r(P);try{localStorage.setItem("profiles-theme",P)}catch{}d(D);const we=D.active_directory||(D.directories.length>0?D.directories[0]:""),Oe=D.extensions.length>0?D.extensions[0]:"",Ye=D.filters.length>0?D.filters[0]:"";if(we&&m(we),Oe&&x(Oe),D.recursive_search!==void 0&&v(D.recursive_search),Ye&&g(Ye),D.config_exists||Bt(!0),we)try{await On(T,{directory:we,extension:Oe,filter_text:Ye,recursive:D.recursive_search})}catch(qt){pt(T)&&he(`Initial scan failed: ${qt.message}`,"error")}},la=async()=>{var T;(T=W.current)==null||T.abort(),W.current=new AbortController;const D=++A.current;R(null),fe(!0);try{const P=await Vo();u(P);const we=await Sx();await pu(we,D)}catch(P){R((P==null?void 0:P.message)||"Couldn't fetch system info or configuration.")}finally{fe(!1)}};_.useEffect(()=>{la()},[]),_.useEffect(()=>()=>{var D;le.current&&(clearTimeout(le.current),le.current=null),(D=W.current)==null||D.abort()},[]);const Vl=async D=>{const T=vn();m(D);try{const P=await Nx(D);if(!pt(T))return;d(P);const we=P.extensions.includes(p)?p:P.extensions[0]??"",Oe=P.filters.includes(y)?y:P.filters[0]??"";x(we),g(Oe),await On(T,{directory:D,extension:we,filter_text:Oe,recursive:w})}catch(P){pt(T)&&he(`Directory change failed: ${P.message}`,"error")}finally{gt(T)}},rl=async()=>{if(!f)return;const D=vn();try{await On(D,{directory:f,extension:p,filter_text:y,recursive:w})}catch(T){pt(D)&&he(`Scan failed: ${(T==null?void 0:T.message)??T}`,"error")}finally{gt(D)}},Sl=_.useRef(rl);_.useEffect(()=>{Sl.current=rl});const gu=D=>{g(D),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Qn=D=>{v(D),le.current&&clearTimeout(le.current),le.current=setTimeout(()=>{le.current=null,Sl.current()},qy)},Lt=async()=>{if(g(""),!f)return;const D=vn();try{await On(D,{directory:f,extension:p,filter_text:"",recursive:w})}catch(T){pt(D)&&he(`Scan failed: ${(T==null?void 0:T.message)??T}`,"error")}finally{gt(D)}},ln=async()=>{if(v(!1),!f)return;const D=vn();try{await On(D,{directory:f,extension:p,filter_text:y,recursive:!1})}catch(T){pt(D)&&he(`Scan failed: ${T.message}`,"error")}finally{gt(D)}},wn=async(D,T)=>{if(D.has_hook){ue({file:D,args:T});return}try{await g2({directory:f,filename:D.rel_path,release:s==null?void 0:s.release,args:T}),he(`Launched ${D.filename}`)}catch(P){he(`Launch error: ${P.message}`,"error")}},ia=()=>{Ke.length>0&&Ke[V]&&wn(Ke[V])},vs=D=>{var T;jt.current=((T=Ke[D])==null?void 0:T.path)??null,se(D)},ws=async(D,T)=>{wn(D,T)},xu=async D=>{try{await Yy(D.path),he("Revealed in file manager.")}catch(T){he(`Error: ${T.message}`,"error")}},ji=async D=>{try{await yd(D.path),he("Folder opened in file manager.")}catch(T){he(`Error: ${T.message}`,"error")}},rr=async D=>{try{const T=await jx(D.path);he(T.message||"Terminal opened.")}catch(T){he(`Error: ${T.message}`,"error")}},ar=async D=>{try{await Vl(D),he(`Scanned directory: ${D}`)}catch(T){he(`Error: ${T.message}`,"error")}},Nl=D=>{g(D);const T=vn();On(T,{directory:f,extension:p,filter_text:D,recursive:w}).catch(P=>{pt(T)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(T))},Yl=D=>{x(D);const T=vn();On(T,{directory:f,extension:D,filter_text:y,recursive:w}).catch(P=>{pt(T)&&he(`Scan failed: ${(P==null?void 0:P.message)??P}`,"error")}).finally(()=>gt(T))},Ci=async(D,T)=>{const P=T?D.path.replace(/\\/g,"/"):D.path;try{await navigator.clipboard.writeText(P),he("Path copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},Gl=async(D,T)=>{let P=D.filename;if(T){const we=P.lastIndexOf(".");we!==-1&&(P=P.slice(0,we))}try{await navigator.clipboard.writeText(P),he("Filename copied to clipboard.")}catch(we){he(`Copy failed: ${(we==null?void 0:we.message)??we}`,"error")}},_t=async(D,T)=>{try{he(`Computing ${T.toUpperCase()}...`);const P=await Cx(D.path,T);await navigator.clipboard.writeText(P.hash),he(`${T.toUpperCase()} hash copied: ${P.hash.slice(0,12)}...`)}catch(P){he(`Hash computation failed: ${P.message}`,"error")}},yu=async D=>{try{const T=new URL("file:///").href+D.path.replace(/\\/g,"/");await navigator.clipboard.writeText(T),he("File URI copied to clipboard.")}catch(T){he(`URI copy failed: ${T.message}`,"error")}},bu=async(D,T)=>{try{const P=await navigator.clipboard.readText();if(!P.trim()){he("Clipboard is empty — copy a hash first, then try again.");return}he(`Computing ${T.toUpperCase()}...`);const Oe=(await Cx(D.path,T)).hash.toLowerCase()===P.trim().toLowerCase();he(Oe?`✅ ${T.toUpperCase()} matches!`:`❌ ${T.toUpperCase()} mismatch`)}catch(P){he(`Verification failed: ${P.message}`,"error")}},ra=D=>{bn(D),St(!0)},El=D=>{Je(D)},Ql=async()=>{const D=nt;if(Je(null),!!D)try{if(he("Deleting file..."),!(await fetch("/api/actions/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file_path:D.path})})).ok)throw new Error("Failed to delete file");he("File deleted successfully."),rl()}catch(T){he(`Delete failed: ${T.message}`,"error")}},ks=D=>{zn(D.path),Tt(!0)},aa=async()=>{if(f)try{await yd(f),he("Directory opened in file manager.")}catch(D){he(`Error: ${D.message}`,"error")}},vu=async D=>{if(D)try{await jx(D),he("Terminal opened in directory.")}catch(T){he(`Error: ${T.message}`,"error")}},wu=async()=>{try{await Vl("~"),he("Directory set to home folder.")}catch(D){he(`Error: ${D.message}`,"error")}},Pe=async()=>{if(f)try{const D=await p2(f);D.parent_path?(await Vl(D.parent_path),he("Moved to parent directory.")):he("Already at root directory.")}catch(D){he(`Error: ${D.message}`,"error")}},ku=async()=>{if(S.length===0){he("No files to export.");return}try{const D=H4(S,(s==null?void 0:s.column_names)||[],s??void 0,y),T=`profiles-export-${new Date().toISOString().slice(0,19).replace(/[:.]/g,"-")}.csv`,P=await b2(D,T);he(`Exported ${S.length} loaded row${S.length===1?"":"s"}${y?` matching "${y}"`:""} — ${P.message}`)}catch(D){he(`Export failed: ${D.message}`,"error")}},ur=async D=>{var Re,Qe;Mn(!1),he("Barcode detected!");const P=By(D).values,we=P.dir!==void 0?P.dir:f,Oe=P.ext!==void 0?P.ext:p,Ye=P.filter!==void 0?P.filter:y,qt=P.recursive!==void 0?P.recursive:w;if(P.dir!==void 0&&m(P.dir),P.ext!==void 0&&x(P.ext),P.filter!==void 0&&g(P.filter),P.recursive!==void 0&&v(P.recursive),we){const at=vn();try{await Ex({directory:we,extension:Oe,filter_text:Ye,recursive:qt},(Re=W.current)==null?void 0:Re.signal);const al=await Pf({offset:0,limit:ed,sort_by:B==null?void 0:B.column,sort_dir:B==null?void 0:B.direction,signal:(Qe=W.current)==null?void 0:Qe.signal});if(!pt(at))return;C(al.items),z(al.count),I(!0),jt.current=null,se(0),al.count===1&&al.items.length===1&&Nt(al.items[0])}catch(al){pt(at)&&he(`Scan error: ${al.message}`,"error")}finally{gt(at)}}},or=()=>{Ce(D=>{const T=!D;return T?(ft.current="",he("Barcode mode ON — scan a barcode now.")):(ft.current="",he("Barcode mode OFF.")),T})},Xn=D=>{D.filter!==void 0&&g(D.filter),D.ext!==void 0&&x(D.ext),D.recursive!==void 0&&v(D.recursive),D.dir!==void 0&&m(D.dir),(D.scan===!0||D.filter!==void 0||D.ext!==void 0||D.recursive!==void 0||D.dir!==void 0)&&(Ce(!1),ft.current="",setTimeout(()=>{Sl.current()},50))};_.useEffect(()=>{if(!ke)return;const D=T=>{const P=T.target;if(!(P instanceof HTMLElement&&(P.isContentEditable||P instanceof HTMLInputElement||P instanceof HTMLTextAreaElement||P instanceof HTMLSelectElement)))if(T.key==="Enter"){const Oe=ft.current;if(!Oe){ft.current="";return}T.preventDefault(),ft.current="";const Ye=By(Oe);if(Ye.isPlainFilter)he(`Barcode filter: ${Ye.values.filter}`),g(Ye.values.filter||""),Ce(!1),setTimeout(()=>void Sl.current(),50);else{const qt=Ye.values,Re=Object.entries(qt).map(([Qe,at])=>`${Qe}=${at}`).join(", ");he(`Barcode applied: ${Re}`),Xn(qt)}}else T.key==="Escape"?(Ce(!1),ft.current="",he("Barcode mode cancelled.")):T.key.length===1&&!T.ctrlKey&&!T.metaKey&&!T.altKey&&(ft.current+=T.key)};return document.addEventListener("keydown",D,!0),()=>document.removeEventListener("keydown",D,!0)},[ke]),_.useEffect(()=>(Et>0&&(Qt.current=setInterval(()=>{Sl.current()},Et*1e3)),()=>{Qt.current&&(clearInterval(Qt.current),Qt.current=null)}),[Et]);const un=D=>{Gn(D),D>0?he(`Auto-rescan every ${D}s.`):he("Auto-rescan disabled.")},ua=!!(qe||M||pe||Rt||Gt||tn||ge||it||Dn||ll||K||nt);return _.useEffect(()=>{const D=T=>{var we,Oe,Ye,qt;if(T.key==="Escape"){Ge(null),E(!1),Ht(!1),Me(!1),Ni(Wo());return}if(ua)return;if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="l"){T.preventDefault(),(we=document.querySelector("[data-testid='file-list']"))==null||we.focus();return}const P=T.target;if(!(P instanceof HTMLElement&&P.closest("button, a, [role='menuitem'], [role='option'], [role='columnheader'], [role='separator']"))){if(P instanceof HTMLInputElement||P instanceof HTMLSelectElement){T.key==="Enter"&&rl();return}if(T.key==="ContextMenu"||T.shiftKey&&T.key==="F10"){const Re=Ke[V];if(!Re)return;T.preventDefault();const Qe=document.querySelector(`[data-row-index="${V}"]`),at=Qe==null?void 0:Qe.getBoundingClientRect();Ge({x:at?at.left+24:24,y:at?at.top+at.height/2:24,file:Re});return}if(T.key==="F5"){T.preventDefault(),rl();return}if(T.ctrlKey&&T.key.toLowerCase()==="r"){T.preventDefault(),Si();return}if(T.ctrlKey&&T.key.toLowerCase()==="d"){T.preventDefault(),(Oe=document.querySelector("#directory-combobox"))==null||Oe.focus();return}if(T.ctrlKey&&T.key.toLowerCase()==="e"){T.preventDefault(),(Ye=document.querySelector("#extension-combobox"))==null||Ye.focus();return}if(T.ctrlKey&&T.key.toLowerCase()==="f"){T.preventDefault(),(qt=document.querySelector("#filter-combobox"))==null||qt.focus();return}if(T.ctrlKey&&T.shiftKey&&T.key.toLowerCase()==="l"){T.preventDefault(),Ht(Re=>!Re);return}if(T.ctrlKey&&T.key===","){T.preventDefault(),Tx().then(Re=>he(Re.message));return}if(T.ctrlKey&&T.shiftKey&&T.key.toLowerCase()==="t"){T.preventDefault(),r(Re=>Re==="dark"?"light":"dark");return}if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="b"){T.preventDefault(),Ce(Re=>!Re);return}if(T.ctrlKey&&T.shiftKey&&T.key.toLowerCase()==="b"){T.preventDefault(),Mn(Re=>!Re);return}if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="t"){T.preventDefault(),Me(!0);return}if(T.ctrlKey&&!T.shiftKey&&T.key.toLowerCase()==="h"){T.preventDefault(),wu();return}if(T.key==="?"||T.ctrlKey&&T.key==="/"){T.preventDefault(),E(Re=>!Re);return}if(T.key.toLowerCase()==="p"&&!T.ctrlKey&&!T.shiftKey&&!T.altKey){const Re=Ke[V];Re&&(T.preventDefault(),ra(Re));return}T.key==="ArrowDown"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+1,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="ArrowUp"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-1,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="Home"?(T.preventDefault(),se(Re=>{var Qe;return jt.current=((Qe=Ke[0])==null?void 0:Qe.path)??null,Re===0?Re:0})):T.key==="End"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.max(0,Ke.length-1);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Re===Qe?Re:Qe})):T.key==="PageUp"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.max(Re-Fy,0);return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="PageDown"?(T.preventDefault(),se(Re=>{var at;const Qe=Math.min(Re+Fy,Math.max(0,Ke.length-1));return jt.current=((at=Ke[Qe])==null?void 0:at.path)??null,Qe})):T.key==="Enter"&&(T.preventDefault(),ia())}};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[ua,Ke,V,f,p,y,w,ke]),_.useEffect(()=>{document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("profiles-theme",n)}catch{}},[n]),h.jsxs("div",{className:"flex h-dvh flex-col bg-elevated/30 p-1 font-sans text-ink transition-colors duration-200 sm:p-1.5",children:[h.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-frame-line bg-app shadow-[0_2px_6px_rgb(0_0_0/0.35)] transition-colors duration-200 sm:rounded-xl",children:[h.jsx(gk,{title:(s==null?void 0:s.title)||"",release:(s==null?void 0:s.release)||"",directories:(s==null?void 0:s.directories)||[],activeDirectory:f,onDirectoryChange:Vl,onBrowseDirectory:bs,onGoToParentDirectory:Pe,onGoToHomeDirectory:wu,onOpenActiveDirectory:aa,onOpenTerminal:vu}),h.jsx(Ek,{extensions:(s==null?void 0:s.extensions)||[],activeExtension:p,onExtensionChange:x,filterOptions:(s==null?void 0:s.filters)||[],filterText:y,onFilterTextChange:gu,recursive:w,onRecursiveChange:Qn,onScan:rl,scanning:ve,barcodeMode:ke,onBarcodeToggle:or,onCameraBarcodeClick:()=>Mn(!0),autoRescanActive:Et>0,onTimerClick:()=>Me(!0)}),U?h.jsx(xk,{message:U,onRetry:()=>void la(),retrying:Q}):h.jsx(pk,{files:Ke,totalCount:L,rawLoadedCount:S.length,onLoadMore:lr,loadingMore:J,scanning:ve,hasScanned:$,activeDirectory:f,recursive:w,onDisableRecursive:ln,onOpenDirectory:aa,onOpenConfig:()=>Bt(!0),filterText:y,onClearFilter:Lt,columnHeaders:(s==null?void 0:s.column_headers)||[],columnNames:(s==null?void 0:s.column_names)||[],selectedIndex:V,onSelectIndex:vs,prefilterNote:ys,onLaunch:wn,onContextMenu:(D,T,P)=>{D.preventDefault(),jt.current=T.path,se(P),Ge({x:D.clientX,y:D.clientY,file:T})},rowColors:(s==null?void 0:s.row_colors)||[],sort:B,onSortChange:D=>{ne(D),jt.current=null,se(0);const T=vn();du(T,D).catch(P=>{pt(T)&&he(`Sort failed: ${P.message}`,"error")}).finally(()=>gt(T))}}),h.jsx(rk,{onExecute:ia,scanning:ve,scanningDirectory:f,hasSelection:Ke.length>0,fileCount:Ke.length,totalCount:L,toastMessage:Y,onToastDismiss:fu}),h.jsx(Xk,{systemInfo:a,fileCount:L,theme:n,onToggleTheme:()=>r(D=>D==="dark"?"light":"dark"),onOpenLog:()=>Ht(!0),onOpenConfig:async()=>{try{const D=await Tx();he(D.message)}catch(D){he(`Failed to open config: ${D.message}`,"error")}},onLoadConfig:()=>Bt(!0),onShowShortcuts:()=>E(!0),onReloadConfig:Si,onExport:ku,exportDisabled:S.length===0||ve,language:ye,onLanguageChange:_e,activeConfigName:s!=null&&s.config_path?s.config_path.split(/[\\/]/).pop()||s.config_path:void 0,lanEnabled:(a==null?void 0:a.lan_enabled)??null,onToggleLan:xs})]}),h.jsx(zk,{isOpen:Rt,activeConfigPath:s==null?void 0:s.config_path,configExists:s==null?void 0:s.config_exists,onClose:()=>Bt(!1),onLoaded:ql}),h.jsx(hk,{visible:wl,onFileSelected:D=>na.current(D)}),h.jsx(dk,{isOpen:pe,initialPath:f,onClose:()=>Se(!1),onSelect:mu}),h.jsx(ak,{position:qe,onClose:()=>Ge(null),onLaunch:wn,onLaunchWithArgs:ws,onReveal:xu,onOpenFolder:ji,onOpenTerminal:rr,onScanDirectory:ar,onFilterFolder:Nl,onFilterExtension:Yl,onCopyPath:Ci,onCopyFilename:Gl,onCopyUri:yu,onComputeHash:_t,onVerifyHash:bu,onProperties:ra,onClearFile:El,onGenerateBarcode:ks,showToast:he}),h.jsx(Ak,{isOpen:M,onClose:()=>E(!1)}),h.jsx(Lk,{isOpen:Gt,file:en,onLaunch:wn,onClose:()=>{St(!1),bn(null)}}),h.jsx(Kk,{isOpen:ge,currentInterval:Et,onClose:()=>Me(!1),onSetInterval:un}),h.jsx(_k,{isOpen:tn,onClose:()=>Ht(!1),onOpenExternally:()=>{u2().then(D=>he(D.message))}}),h.jsx(L4,{isOpen:!!K,onClose:()=>ue(null),directory:f,filename:(K==null?void 0:K.file.rel_path)||"",release:s==null?void 0:s.release,args:K==null?void 0:K.args,onFinished:(D,T)=>{D==="completed"?he(T||"Workflow launched successfully."):(D==="aborted"||D==="failed")&&he(`Workflow stopped: ${T}`,"error")}}),h.jsx(nb,{isOpen:it,onClose:()=>{Tt(!1),zn(void 0)},initialFilePath:nn}),h.jsx(Gk,{isOpen:Dn,onClose:()=>Mn(!1),onDetected:ur}),h.jsx(Ly,{isOpen:!!nt,title:"Delete file",message:`Delete this file? + +${(nt==null?void 0:nt.path)??""} + +This action cannot be undone.`,confirmLabel:"Delete",danger:!0,onConfirm:Ql,onCancel:()=>Je(null)}),h.jsx(Ly,{isOpen:Le!==null,title:Le?"Enable LAN access?":"Restrict to this machine?",message:Le?`ProFiles will be reachable by anyone on this network: +http://${a==null?void 0:a.hostname}:${window.location.port} +http://${a==null?void 0:a.ip}:${window.location.port}`:"ProFiles will be reachable only on this machine.",confirmLabel:Le?"Enable LAN":"Restrict",onConfirm:async()=>{const D=Le;lt(null);try{await s2(D);const T=await Vo();u(T),he(D?"ProFiles is now reachable on the local network.":"ProFiles is restricted to this machine.","info")}catch(T){const P=T instanceof Error?T.message:"Failed to update LAN binding";he(`Failed to update LAN binding: ${P}`,"error");const we=await Vo();u(we)}},onCancel:()=>lt(null)}),h.jsx(Qk,{isOpen:!!ll,file:ll,onConfirm:()=>{if(ll){const D=ll;Nt(null),wn(D)}},onDismiss:()=>Nt(null)})]})}class Y4 extends _.Component{constructor(){super(...arguments);Qf(this,"state",{error:null})}static getDerivedStateFromError(a){return{error:a}}componentDidCatch(a,u){console.error("Application render error:",a,u.componentStack)}render(){return this.state.error?h.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app p-6 text-ink",children:h.jsxs("section",{className:"w-full max-w-lg rounded-lg border border-line bg-surface p-6",children:[h.jsx("h1",{className:"text-base font-semibold",children:"ProFiles encountered an error"}),h.jsx("p",{className:"mt-2 text-sm text-ink-secondary",children:"The interface could not continue. Reload the application to try again."}),h.jsxs("details",{className:"mt-4 text-xs text-ink-muted",children:[h.jsx("summary",{className:"cursor-pointer",children:"Error details"}),h.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap",children:this.state.error.message})]}),h.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"btn btn-primary mt-5 px-4 py-2 text-sm font-semibold",children:"Reload application"})]})}):this.props.children}}i2.createRoot(document.getElementById("root")).render(h.jsx(Jv.StrictMode,{children:h.jsx(Y4,{children:h.jsx(V4,{})})})); diff --git a/src/profiles/web/dist/assets/index-DlrIRth4.css b/src/profiles/web/dist/assets/index-DlrIRth4.css new file mode 100644 index 0000000..e7cc5ff --- /dev/null +++ b/src/profiles/web/dist/assets/index-DlrIRth4.css @@ -0,0 +1 @@ +/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-800:oklch(43.2% .095 166.913);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-900:oklch(20.8% .042 265.755);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-4xl:56rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.glass-panel{background:var(--app-glass-panel);-webkit-backdrop-filter:blur(24px)saturate(160%);backdrop-filter:blur(24px)saturate(160%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.glass-panel-strong{background:var(--app-glass-panel-strong);-webkit-backdrop-filter:blur(28px)saturate(180%);backdrop-filter:blur(28px)saturate(180%);box-shadow:var(--app-panel-shadow),inset 0 1px 0 var(--app-glass-highlight)}.btn{justify-content:center;align-items:center;gap:calc(var(--spacing) * 1.5);border-radius:var(--radius-md);border-style:var(--tw-border-style);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-width:1px;display:inline-flex}.btn:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn:focus-visible{--tw-outline-style:none;outline-style:none}.btn:disabled{cursor:not-allowed;opacity:.4}.btn-primary{background-color:var(--color-indigo-600);color:var(--color-white);border-color:#0000}@media(hover:hover){.btn-primary:hover{background-color:var(--color-indigo-500)}}.btn-secondary{border-color:var(--app-border);background-color:var(--app-elevated);color:var(--app-text-secondary)}@media(hover:hover){.btn-secondary:hover{border-color:var(--color-indigo-500);color:var(--app-text-primary)}.btn-chip:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.btn-chip:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.btn-chip:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.btn-chip:focus-visible{--tw-outline-style:none;outline-style:none}.btn-chip:disabled{cursor:not-allowed;opacity:.4}.focus-ring:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:#625fffb3}@supports (color:color-mix(in lab,red,red)){.focus-ring:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 70%, transparent)}}.focus-ring:focus-visible{--tw-outline-style:none;outline-style:none}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-full{top:100%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.-right-1{right:calc(var(--spacing) * -1)}.right-0{right:0}.right-2{right:calc(var(--spacing) * 2)}.-bottom-0\.5{bottom:calc(var(--spacing) * -.5)}.-bottom-1{bottom:calc(var(--spacing) * -1)}.bottom-0{bottom:0}.bottom-2{bottom:calc(var(--spacing) * 2)}.-left-1{left:calc(var(--spacing) * -1)}.left-0{left:0}.left-1\/2{left:50%}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-\[calc\(var\(--z-context-menu\)-1\)\]{z-index:calc(var(--z-context-menu) - 1)}.z-\[var\(--z-combobox-list\)\]{z-index:var(--z-combobox-list)}.z-\[var\(--z-context-menu\)\]{z-index:var(--z-context-menu)}.z-\[var\(--z-drop-overlay\)\]{z-index:var(--z-drop-overlay)}.z-\[var\(--z-modal\)\]{z-index:var(--z-modal)}.z-\[var\(--z-syntax-helper\)\]{z-index:var(--z-syntax-helper)}.z-\[var\(--z-toast\)\]{z-index:var(--z-toast)}.z-\[var\(--z-tooltip\)\]{z-index:var(--z-tooltip)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.my-1\.5{margin-block:calc(var(--spacing) * 1.5)}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-auto{margin-right:auto}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[80vh\]{height:80vh}.h-\[min\(84dvh\,760px\)\]{height:min(84dvh,760px)}.h-dvh{height:100dvh}.h-full{height:100%}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-1\.5rem\)\]{max-height:calc(100dvh - 1.5rem)}.max-h-\[calc\(100dvh-16px\)\]{max-height:calc(100dvh - 16px)}.min-h-0{min-height:0}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-36{min-height:calc(var(--spacing) * 36)}.min-h-\[24px\]{min-height:24px}.min-h-\[44px\]{min-height:44px}.min-h-screen{min-height:100vh}.w-1\/3{width:33.3333%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-96{width:calc(var(--spacing) * 96)}.w-\[52px\]{width:52px}.w-\[138px\]{width:138px}.w-\[150px\]{width:150px}.w-\[400px\]{width:400px}.w-\[420px\]{width:420px}.w-\[450px\]{width:450px}.w-\[clamp\(560px\,85vw\,1500px\)\]{width:clamp(560px,85vw,1500px)}.w-\[min\(94vw\,960px\)\]{width:min(94vw,960px)}.w-full{width:100%}.w-max{width:max-content}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[calc\(100vw-16px\)\]{max-width:calc(100vw - 16px)}.max-w-\[min\(70vw\,560px\)\]{max-width:min(70vw,560px)}.max-w-\[min\(80vw\,640px\)\]{max-width:min(80vw,640px)}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[100px\]{min-width:100px}.min-w-\[220px\]{min-width:220px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.basis-64{flex-basis:calc(var(--spacing) * 64)}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-2{border-right-style:var(--tw-border-style);border-right-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-0{border-left-style:var(--tw-border-style);border-left-width:0}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-chip-amber-border{border-color:var(--chip-amber-border)}.border-chip-fuchsia-border{border-color:var(--chip-fuchsia-border)}.border-chip-indigo-border,.border-chip-indigo-border\/50{border-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-indigo-border\/50{border-color:color-mix(in oklab,var(--chip-indigo-border) 50%,transparent)}}.border-chip-purple-border,.border-chip-purple-border\/50{border-color:var(--chip-purple-border)}@supports (color:color-mix(in lab,red,red)){.border-chip-purple-border\/50{border-color:color-mix(in oklab,var(--chip-purple-border) 50%,transparent)}}.border-chip-sky-border{border-color:var(--chip-sky-border)}.border-emerald-300\/50{border-color:#5ee9b580}@supports (color:color-mix(in lab,red,red)){.border-emerald-300\/50{border-color:color-mix(in oklab,var(--color-emerald-300) 50%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-frame-line{border-color:var(--app-frame-border)}.border-indigo-400{border-color:var(--color-indigo-400)}.border-indigo-400\/80{border-color:#7d87ffcc}@supports (color:color-mix(in lab,red,red)){.border-indigo-400\/80{border-color:color-mix(in oklab,var(--color-indigo-400) 80%,transparent)}}.border-indigo-600{border-color:var(--color-indigo-600)}.border-line,.border-line\/40{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/40{border-color:color-mix(in oklab,var(--app-border) 40%,transparent)}}.border-line\/60{border-color:var(--app-border)}@supports (color:color-mix(in lab,red,red)){.border-line\/60{border-color:color-mix(in oklab,var(--app-border) 60%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-status-danger-border{border-color:var(--status-danger-border)}.border-status-success-border{border-color:var(--status-success-border)}.border-status-warning-border{border-color:var(--status-warning-border)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-app,.bg-app\/90{background-color:var(--app-bg)}@supports (color:color-mix(in lab,red,red)){.bg-app\/90{background-color:color-mix(in oklab,var(--app-bg) 90%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/65{background-color:#000000a6}@supports (color:color-mix(in lab,red,red)){.bg-black\/65{background-color:color-mix(in oklab,var(--color-black) 65%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-chip-amber-bg{background-color:var(--chip-amber-bg)}.bg-chip-fuchsia-bg{background-color:var(--chip-fuchsia-bg)}.bg-chip-indigo-bg,.bg-chip-indigo-bg\/20{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.bg-chip-indigo-bg\/20{background-color:color-mix(in oklab,var(--chip-indigo-bg) 20%,transparent)}}.bg-chip-purple-bg{background-color:var(--chip-purple-bg)}.bg-chip-sky-bg{background-color:var(--chip-sky-bg)}.bg-elevated,.bg-elevated\/30{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/30{background-color:color-mix(in oklab,var(--app-elevated) 30%,transparent)}}.bg-elevated\/50{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/50{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.bg-elevated\/60{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.bg-elevated\/60{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-600{background-color:var(--color-emerald-600)}.bg-emerald-800\/60{background-color:#005f4699}@supports (color:color-mix(in lab,red,red)){.bg-emerald-800\/60{background-color:color-mix(in oklab,var(--color-emerald-800) 60%,transparent)}}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-ink-faint{background-color:var(--app-text-faint)}.bg-slate-600\/20{background-color:#45556c33}@supports (color:color-mix(in lab,red,red)){.bg-slate-600\/20{background-color:color-mix(in oklab,var(--color-slate-600) 20%,transparent)}}.bg-status-danger-bg,.bg-status-danger-bg\/30{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/30{background-color:color-mix(in oklab,var(--status-danger-bg) 30%,transparent)}}.bg-status-danger-bg\/40{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.bg-status-danger-bg\/40{background-color:color-mix(in oklab,var(--status-danger-bg) 40%,transparent)}}.bg-status-success-bg{background-color:var(--status-success-bg)}.bg-status-warning-bg{background-color:var(--status-warning-bg)}.bg-surface{background-color:var(--app-surface)}.bg-surface-glass{background-color:var(--app-glass)}.bg-surface-strong,.bg-surface-strong\/20{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/20{background-color:color-mix(in oklab,var(--app-glass-strong) 20%,transparent)}}.bg-surface-strong\/30{background-color:var(--app-glass-strong)}@supports (color:color-mix(in lab,red,red)){.bg-surface-strong\/30{background-color:color-mix(in oklab,var(--app-glass-strong) 30%,transparent)}}.bg-surface\/50{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/50{background-color:color-mix(in oklab,var(--app-surface) 50%,transparent)}}.bg-surface\/60{background-color:var(--app-surface)}@supports (color:color-mix(in lab,red,red)){.bg-surface\/60{background-color:color-mix(in oklab,var(--app-surface) 60%,transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab,red,red)){.bg-white\/90{background-color:color-mix(in oklab,var(--color-white) 90%,transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-chip-indigo-bg{--tw-gradient-from:var(--chip-indigo-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-400\/90{--tw-gradient-from:#00d294e6}@supports (color:color-mix(in lab,red,red)){.from-emerald-400\/90{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-400) 90%, transparent)}}.from-emerald-400\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-chip-purple-bg{--tw-gradient-to:var(--chip-purple-bg);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600\/90{--tw-gradient-to:#009767e6}@supports (color:color-mix(in lab,red,red)){.to-emerald-600\/90{--tw-gradient-to:color-mix(in oklab, var(--color-emerald-600) 90%, transparent)}}.to-emerald-600\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-px{padding-block:1px}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.align-\[1px\]{vertical-align:1px}.align-top{vertical-align:top}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-chip-amber-text{color:var(--chip-amber-text)}.text-chip-fuchsia-text{color:var(--chip-fuchsia-text)}.text-chip-indigo-text{color:var(--chip-indigo-text)}.text-chip-purple-text{color:var(--chip-purple-text)}.text-chip-sky-text{color:var(--chip-sky-text)}.text-emerald-200{color:var(--color-emerald-200)}.text-ink{color:var(--app-text-primary)}.text-ink-faint{color:var(--app-text-faint)}.text-ink-muted,.text-ink-muted\/50{color:var(--app-text-muted)}@supports (color:color-mix(in lab,red,red)){.text-ink-muted\/50{color:color-mix(in oklab,var(--app-text-muted) 50%,transparent)}}.text-ink-secondary{color:var(--app-text-secondary)}.text-ink\/70{color:var(--app-text-primary)}@supports (color:color-mix(in lab,red,red)){.text-ink\/70{color:color-mix(in oklab,var(--app-text-primary) 70%,transparent)}}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-900{color:var(--color-slate-900)}.text-status-danger-text,.text-status-danger-text\/60{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/60{color:color-mix(in oklab,var(--status-danger-text) 60%,transparent)}}.text-status-danger-text\/70{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/70{color:color-mix(in oklab,var(--status-danger-text) 70%,transparent)}}.text-status-danger-text\/80{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/80{color:color-mix(in oklab,var(--status-danger-text) 80%,transparent)}}.text-status-danger-text\/90{color:var(--status-danger-text)}@supports (color:color-mix(in lab,red,red)){.text-status-danger-text\/90{color:color-mix(in oklab,var(--status-danger-text) 90%,transparent)}}.text-status-success-text{color:var(--status-success-text)}.text-status-warning-text{color:var(--status-warning-text)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-ink-faint::placeholder{color:var(--app-text-faint)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_9999px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow:0 0 0 9999px var(--tw-shadow-color,#00000073);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_2px_6px_rgb\(0_0_0\/0\.35\)\]{--tw-shadow:0 2px 6px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.12\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff1f);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-app{--tw-ring-color:var(--app-bg)}.ring-chip-indigo-border\/40{--tw-ring-color:var(--chip-indigo-border)}@supports (color:color-mix(in lab,red,red)){.ring-chip-indigo-border\/40{--tw-ring-color:color-mix(in oklab, var(--chip-indigo-border) 40%, transparent)}}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xs{--tw-backdrop-blur:blur(var(--blur-xs));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[filter\,box-shadow\,transform\]{transition-property:filter,box-shadow,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:opacity-40:is(:where(.group):hover *){opacity:.4}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\:bg-indigo-500 ::selection{background-color:var(--color-indigo-500)}.selection\:bg-indigo-500::selection{background-color:var(--color-indigo-500)}.selection\:text-white ::selection{color:var(--color-white)}.selection\:text-white::selection{color:var(--color-white)}.placeholder\:text-ink-faint::placeholder{color:var(--app-text-faint)}.first\:mt-0:first-child{margin-top:0}.last\:mb-0:last-child{margin-bottom:0}@media(hover:hover){.hover\:-translate-y-px:hover{--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.hover\:border-chip-indigo-border:hover{border-color:var(--chip-indigo-border)}.hover\:border-indigo-400:hover{border-color:var(--color-indigo-400)}.hover\:border-indigo-500:hover{border-color:var(--color-indigo-500)}.hover\:border-status-warning-border:hover{border-color:var(--status-warning-border)}.hover\:bg-chip-indigo-bg\/40:hover{background-color:var(--chip-indigo-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-chip-indigo-bg\/40:hover{background-color:color-mix(in oklab,var(--chip-indigo-bg) 40%,transparent)}}.hover\:bg-elevated:hover,.hover\:bg-elevated\/50:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/50:hover{background-color:color-mix(in oklab,var(--app-elevated) 50%,transparent)}}.hover\:bg-elevated\/60:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/60:hover{background-color:color-mix(in oklab,var(--app-elevated) 60%,transparent)}}.hover\:bg-elevated\/70:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/70:hover{background-color:color-mix(in oklab,var(--app-elevated) 70%,transparent)}}.hover\:bg-elevated\/80:hover{background-color:var(--app-elevated)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-elevated\/80:hover{background-color:color-mix(in oklab,var(--app-elevated) 80%,transparent)}}.hover\:bg-emerald-500:hover{background-color:var(--color-emerald-500)}.hover\:bg-hover-surface:hover{background-color:var(--app-hover)}.hover\:bg-indigo-500:hover{background-color:var(--color-indigo-500)}.hover\:bg-indigo-600:hover{background-color:var(--color-indigo-600)}.hover\:bg-status-danger-bg:hover,.hover\:bg-status-danger-bg\/60:hover{background-color:var(--status-danger-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-danger-bg\/60:hover{background-color:color-mix(in oklab,var(--status-danger-bg) 60%,transparent)}}.hover\:bg-status-warning-bg:hover,.hover\:bg-status-warning-bg\/40:hover{background-color:var(--status-warning-bg)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-status-warning-bg\/40:hover{background-color:color-mix(in oklab,var(--status-warning-bg) 40%,transparent)}}.hover\:bg-surface:hover{background-color:var(--app-surface)}.hover\:bg-surface-strong:hover{background-color:var(--app-glass-strong)}.hover\:bg-white:hover{background-color:var(--color-white)}.hover\:text-chip-indigo-text:hover{color:var(--chip-indigo-text)}.hover\:text-ink:hover{color:var(--app-text-primary)}.hover\:text-status-danger-text:hover{color:var(--status-danger-text)}.hover\:text-status-warning-text:hover{color:var(--status-warning-text)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-40:hover{opacity:.4}.hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_12px_30px_-6px_rgb\(16_185_129\/0\.7\)\]:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 12px 30px -6px var(--tw-shadow-color,#10b981b3);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:brightness-95:hover{--tw-brightness:brightness(95%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:brightness-110:hover{--tw-brightness:brightness(110%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-indigo-400:focus-visible{border-color:var(--color-indigo-400)}.focus-visible\:border-indigo-500:focus-visible{border-color:var(--color-indigo-500)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-emerald-400:focus-visible{--tw-ring-color:var(--color-emerald-400)}.focus-visible\:ring-indigo-400:focus-visible{--tw-ring-color:var(--color-indigo-400)}.focus-visible\:ring-indigo-500:focus-visible{--tw-ring-color:var(--color-indigo-500)}.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-indigo-500\/30:focus-visible{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 30%, transparent)}}.focus-visible\:ring-status-danger-border:focus-visible{--tw-ring-color:var(--status-danger-border)}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-app:focus-visible{--tw-ring-offset-color:var(--app-bg)}.focus-visible\:outline:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\:outline-offset-\[-2px\]:focus-visible{outline-offset:-2px}.focus-visible\:outline-indigo-500:focus-visible{outline-color:var(--color-indigo-500)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(hover:hover){.disabled\:hover\:translate-y-0:disabled:hover{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:hover\:text-ink-muted:disabled:hover{color:var(--app-text-muted)}.disabled\:hover\:shadow-\[inset_0_1px_0_rgb\(255_255_255\/0\.35\)\,0_8px_24px_-6px_rgb\(16_185_129\/0\.55\)\]:disabled:hover{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff59), 0 8px 24px -6px var(--tw-shadow-color,#10b9818c);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.disabled\:hover\:brightness-100:disabled:hover{--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@media(prefers-reduced-motion:reduce){.motion-reduce\:animate-none{animation:none}}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:basis-auto{flex-basis:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:rounded-2xl{border-radius:var(--radius-2xl)}.sm\:rounded-xl{border-radius:var(--radius-xl)}.sm\:p-1\.5{padding:calc(var(--spacing) * 1.5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}.sm\:px-6{padding-inline:calc(var(--spacing) * 6)}.sm\:py-3{padding-block:calc(var(--spacing) * 3)}}@media(min-width:64rem){.lg\:flex{display:flex}}.\[\&_code\]\:bg-transparent code{background-color:#0000}.\[\&_code\]\:px-0 code{padding-inline:0}.\[\&_code\]\:py-0 code{padding-block:0}.\[\&_code\]\:text-inherit code{color:inherit}.animate-modal-in{animation:.15s cubic-bezier(.2,.8,.2,1) modal-in}.animate-overlay-in{animation:.15s ease-out overlay-in}.animate-toast-in{animation:.12s ease-out toast-in}}:where(button,[role=button],input,select,textarea,a,summary,video[tabindex],[tabindex]):focus-visible{outline:2px solid var(--color-indigo-500,#6366f1);outline-offset:2px}:root{color-scheme:light dark;--z-combobox-list:60;--z-syntax-helper:65;--z-context-menu:70;--z-modal:80;--z-drop-overlay:85;--z-toast:90;--z-tooltip:100}:root,[data-theme=dark]{--app-bg:#020617;--app-surface:#0f172a;--app-elevated:#1e293b;--app-hover:#334155;--app-border:#334155;--app-frame-border:#94a3b84d;--app-text-primary:#f8fafc;--app-text-secondary:#cbd5e1;--app-text-muted:#94a3b8;--app-text-faint:#94a3b8;--app-glass:#0f172a99;--app-glass-strong:#020617e6;--app-glass-panel:#0f172ac7;--app-glass-panel-strong:#020617e0;--app-glass-highlight:#ffffff17;--app-panel-shadow:0 24px 60px -12px #0206178c;color-scheme:dark;--chip-indigo-bg:#6366f140;--chip-indigo-border:#818cf880;--chip-indigo-text:#c7d2fe;--chip-purple-bg:#a855f740;--chip-purple-border:#c084fc80;--chip-purple-text:#f3e8ff;--chip-fuchsia-bg:#c026d340;--chip-fuchsia-border:#e879f980;--chip-fuchsia-text:#f5d0fe;--chip-sky-bg:#0ea5e940;--chip-sky-border:#38bdf880;--chip-sky-text:#bae6fd;--chip-amber-bg:#f59e0b40;--chip-amber-border:#fbbf2480;--chip-amber-text:#fde68a;--status-success-bg:#10b98140;--status-success-border:#34d39980;--status-success-text:#a7f3d0;--status-warning-bg:#f59e0b40;--status-warning-border:#fbbf2480;--status-warning-text:#fde68a;--status-danger-bg:#f43f5e40;--status-danger-border:#fb718580;--status-danger-text:#fecdd3}[data-theme=light]{--chip-indigo-bg:#e0e7ff;--chip-indigo-border:#a5b4fc;--chip-indigo-text:#3730a3;--chip-purple-bg:#f3e8ff;--chip-purple-border:#d8b4fe;--chip-purple-text:#6b21a8;--chip-fuchsia-bg:#fae8ff;--chip-fuchsia-border:#f0abfc;--chip-fuchsia-text:#86198f;--chip-sky-bg:#e0f2fe;--chip-sky-border:#7dd3fc;--chip-sky-text:#0369a1;--chip-amber-bg:#fef3c7;--chip-amber-border:#fcd34d;--chip-amber-text:#92400e;--status-success-bg:#d1fae5;--status-success-border:#6ee7b7;--status-success-text:#065f46;--status-warning-bg:#fef3c7;--status-warning-border:#fcd34d;--status-warning-text:#92400e;--status-danger-bg:#ffe4e6;--status-danger-border:#fda4af;--status-danger-text:#9f1239;--app-bg:#f8fafc;--app-surface:#fff;--app-elevated:#f1f5f9;--app-hover:#e2e8f0;--app-border:#cbd5e1;--app-frame-border:#0f172a29;--app-text-primary:#0f172a;--app-text-secondary:#334155;--app-text-muted:#475569;--app-text-faint:#475569;--app-glass:#ffffffb3;--app-glass-strong:#f8fafcf2;--app-glass-panel:#fffc;--app-glass-panel-strong:#f8fafceb;--app-glass-highlight:#ffffffe6;--app-panel-shadow:0 24px 60px -18px #0f172a47;color-scheme:light}body{background-color:var(--app-bg);min-height:100vh;color:var(--app-text-primary);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;transition:background-color .2s,color .2s}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes modal-in{0%{opacity:0;transform:translateY(4px)scale(.995)}to{opacity:1;transform:none}}@keyframes overlay-in{0%{opacity:0}to{opacity:1}}@keyframes toast-in{0%{opacity:0;translate:-50% calc(6px - 50%)}to{opacity:1;translate:-50% -50%}}*{scrollbar-color:var(--app-border) transparent;scrollbar-width:thin}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:var(--app-border);background-clip:content-box;border:2px solid #0000;border-radius:9999px}::-webkit-scrollbar-thumb:hover{background-color:var(--app-text-faint)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/profiles/web/dist/index.html b/src/profiles/web/dist/index.html index 29f74b2..02f22fe 100644 --- a/src/profiles/web/dist/index.html +++ b/src/profiles/web/dist/index.html @@ -1,14 +1,14 @@ - - - - - - ProFiles - - - - - -
- - + + + + + + ProFiles + + + + + +
+ + diff --git a/src/profiles/web/dist/sw.js b/src/profiles/web/dist/sw.js index 409e227..0e8758d 100644 --- a/src/profiles/web/dist/sw.js +++ b/src/profiles/web/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const d=e=>i(e,t),l={module:{uri:t},exports:o,require:d};s[t]=Promise.all(n.map(e=>l[e]||d(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"dd68c7c2907295ef08787989d733688e"},{url:"assets/index-BJQkS9RK.js",revision:null},{url:"assets/index-859mEJTx.css",revision:null},{url:"manifest.webmanifest",revision:"5a42ebe8b55b07b5831cbbddda834829"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),d={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>d[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"72c400a126a682d81cf470895cabad52"},{url:"assets/index-DlrIRth4.css",revision:null},{url:"assets/index-C-z6GSZn.js",revision:null},{url:"manifest.webmanifest",revision:"5a42ebe8b55b07b5831cbbddda834829"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}); diff --git a/src/profiles/web/package-lock.json b/src/profiles/web/package-lock.json index c154ccf..351093e 100644 --- a/src/profiles/web/package-lock.json +++ b/src/profiles/web/package-lock.json @@ -19,6 +19,7 @@ "devDependencies": { "@tailwindcss/vite": "^4.0.9", "@testing-library/dom": "^10.4.2", + "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.3.3", "@testing-library/user-event": "^14.6.8", "@types/node": "^22.13.9", @@ -33,6 +34,13 @@ "vitest": "^5.0.5" } }, + "node_modules/@adobe/css-tools": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.5.0.tgz", + "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@apideck/better-ajv-errors": { "version": "0.3.7", "resolved": "https://registry.npmjs.org/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.7.tgz", @@ -3244,6 +3252,33 @@ "node": ">=18" } }, + "node_modules/@testing-library/jest-dom": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz", + "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "picocolors": "^1.1.1", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, "node_modules/@testing-library/react": { "version": "16.3.3", "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.3.tgz", @@ -4030,6 +4065,13 @@ "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -4591,9 +4633,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz", - "integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", "dev": true, "funding": [ { @@ -5073,6 +5115,16 @@ "dev": true, "license": "ISC" }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/inline-style-parser": { "version": "0.2.9", "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.9.tgz", @@ -6968,6 +7020,16 @@ ], "license": "MIT" }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/minimatch": { "version": "10.2.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", @@ -7367,6 +7429,20 @@ "node": ">=0.10.0" } }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -7713,9 +7789,9 @@ } }, "node_modules/serialize-javascript": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.2.tgz", - "integrity": "sha512-GL2BWwVa6JydKO6l/ljVgjAZF4QJ3S7dWDWi53s5GZT8PJzD2fNxi67HANQGKAqPrwEpL5ba7gUBGi0Ls/sEoQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.4.tgz", + "integrity": "sha512-FqlEuoTq/zRmA4Lg6aOqyH3lCHbUtCB0bmHCeFniX2GBdDqMJM3FwdvEhlE5Pim1dlt2FfBdVPmUNNiGhhKqpw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -8092,6 +8168,19 @@ "node": ">=10" } }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/style-to-object": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-2.0.2.tgz", @@ -8668,9 +8757,9 @@ } }, "node_modules/vite": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.4.tgz", - "integrity": "sha512-xGjU/SyjeNyb0E4KxXBvYz/1C+3JXuujvf2hXNOtnlcE+58o5ajd9N2/n2VhkiJvpCP2qQasnUpx5PXNeI+p1Q==", + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.5.tgz", + "integrity": "sha512-4enwjFfi4IwtEh0w+jPzpLVOFQiPHmmzPxcHXQOyEur47o6u0jE573DmGpjA+7irXoMLYRZD5ZaFUEneS3abPg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/src/profiles/web/package.json b/src/profiles/web/package.json index 825ff77..ce86e57 100644 --- a/src/profiles/web/package.json +++ b/src/profiles/web/package.json @@ -22,6 +22,7 @@ "devDependencies": { "@tailwindcss/vite": "^4.0.9", "@testing-library/dom": "^10.4.2", + "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.3.3", "@testing-library/user-event": "^14.6.8", "@types/node": "^22.13.9", diff --git a/src/profiles/web/src/App.tsx b/src/profiles/web/src/App.tsx index c3674e5..7c1f848 100644 --- a/src/profiles/web/src/App.tsx +++ b/src/profiles/web/src/App.tsx @@ -17,6 +17,7 @@ import { loadConfigContent, reloadConfig, exportCsvToDisk, + setLanEnabled, } from "./api/client"; import type { AppConfigData, ExternalEvent, ScanSort, ScannedFileItem, SystemInfo } from "./api/types"; import { @@ -104,6 +105,8 @@ export default function App() { const [propertiesFile, setPropertiesFile] = useState(null); const [showLogViewer, setShowLogViewer] = useState(false); const [showTimerModal, setShowTimerModal] = useState(false); + /** Pending LAN toggle (true/false) awaiting user confirmation. */ + const [lanPending, setLanPending] = useState(null); // Workflow Modal state const [workflowLaunchParams, setWorkflowLaunchParams] = useState<{ @@ -151,6 +154,11 @@ export default function App() { setToastMessage(null); }; + /** Open the in-app confirmation dialog for a LAN toggle request. */ + const toggleLan = (next: boolean) => { + setLanPending(next); + }; + const beginScan = () => { // Collision rule: any explicit scan (Enter, Scan button, programmatic // filter change, barcode apply…) supersedes a pending deferred @@ -1553,6 +1561,8 @@ export default function App() { language={language} onLanguageChange={setLanguage} activeConfigName={config?.config_path ? config.config_path.split(/[\\/]/).pop() || config.config_path : undefined} + lanEnabled={systemInfo?.lan_enabled ?? null} + onToggleLan={toggleLan} /> @@ -1678,6 +1688,40 @@ export default function App() { onCancel={() => setPendingDeleteFile(null)} /> + {/* LAN toggle confirmation */} + { + const next = lanPending!; + setLanPending(null); + try { + await setLanEnabled(next); + const sys = await fetchSystemInfo(); + setSystemInfo(sys); + showToast( + next + ? "ProFiles is now reachable on the local network." + : "ProFiles is restricted to this machine.", + "info" + ); + } catch (err) { + const msg = err instanceof Error ? err.message : "Failed to update LAN binding"; + showToast(`Failed to update LAN binding: ${msg}`, "error"); + // Refetch to restore the actual state + const sys = await fetchSystemInfo(); + setSystemInfo(sys); + } + }} + onCancel={() => setLanPending(null)} + /> + {/* Single Match Launch Confirmation */} { return res.json(); } +/** Flip the running server between LAN exposure and loopback-only. */ +export async function setLanEnabled( + lan: boolean +): Promise<{ host: string; lan_enabled: boolean }> { + const res = await fetch("/api/system/bind", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ lan }), + }); + if (!res.ok) { + let detail = "Failed to update LAN binding"; + try { + const body = await res.json(); + if (body?.detail) detail = body.detail; + } catch { + // keep the fallback message + } + throw new Error(detail); + } + return res.json(); +} + export async function fetchConfig(): Promise { const res = await fetch("/api/config"); if (!res.ok) throw new Error("Failed to fetch app configuration"); diff --git a/src/profiles/web/src/api/types.ts b/src/profiles/web/src/api/types.ts index 0b8c069..5a81b4b 100644 --- a/src/profiles/web/src/api/types.ts +++ b/src/profiles/web/src/api/types.ts @@ -3,6 +3,8 @@ export interface SystemInfo { ip: string; username: string; os_release: string; + /** Current bind state; null when the server object is unknown. */ + lan_enabled: boolean | null; } export interface AppConfigData { diff --git a/src/profiles/web/src/components/StatusBar.test.tsx b/src/profiles/web/src/components/StatusBar.test.tsx new file mode 100644 index 0000000..fd3bc37 --- /dev/null +++ b/src/profiles/web/src/components/StatusBar.test.tsx @@ -0,0 +1,58 @@ +// @vitest-environment jsdom +import { afterEach, describe, expect, it, vi } from "vitest"; +import { cleanup, render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { StatusBar } from "./StatusBar"; +import type { SystemInfo } from "../api/types"; + +const systemInfo: SystemInfo = { + hostname: "st-465", + ip: "172.16.41.65", + username: "operator", + os_release: "Windows 11", + lan_enabled: false, +}; + +/** Build minimal StatusBar props for each scenario. */ +function baseProps() { + return { + systemInfo, + fileCount: 1, + theme: "dark" as const, + onToggleTheme: vi.fn(), + onOpenLog: vi.fn(), + onOpenConfig: vi.fn(), + onShowShortcuts: vi.fn(), + }; +} + +afterEach(() => cleanup()); + +describe("StatusBar LAN toggle", () => { + it("shows the LAN switch and forwards the requested next state", async () => { + const onToggleLan = vi.fn(); + render(); + const sw = screen.getByRole("button", { name: /lan/i }); + expect(sw).not.toBeDisabled(); + await userEvent.click(sw); + expect(onToggleLan).toHaveBeenCalledWith(true); + }); + + it("reflects the enabled state via aria-pressed", () => { + render(); + expect(screen.getByRole("button", { name: /lan/i })).toHaveAttribute( + "aria-pressed", + "true" + ); + }); + + it("disables the switch while the bind state is unknown", () => { + render(); + expect(screen.getByRole("button", { name: /lan/i })).toBeDisabled(); + }); + + it("renders no LAN switch without a toggle handler", () => { + render(); + expect(screen.queryByRole("button", { name: /lan/i })).toBeNull(); + }); +}); diff --git a/src/profiles/web/src/components/StatusBar.tsx b/src/profiles/web/src/components/StatusBar.tsx index 20a9a97..0617bdd 100644 --- a/src/profiles/web/src/components/StatusBar.tsx +++ b/src/profiles/web/src/components/StatusBar.tsx @@ -1,5 +1,5 @@ import Tooltip from "./Tooltip"; -import { Activity, Download, FileCog, FileText, Globe, Keyboard, Moon, RefreshCw, Settings, Sun, User } from "lucide-react"; +import { Activity, Download, FileCog, FileText, Globe, Keyboard, Moon, Network, RefreshCw, Settings, Sun, User } from "lucide-react"; import type { SystemInfo } from "../api/types"; type Language = "en" | "fr"; @@ -21,6 +21,10 @@ interface StatusBarProps { language?: Language; onLanguageChange?: (lang: Language) => void; activeConfigName?: string; + /** Current bind state from /api/system; null while unknown. */ + lanEnabled?: boolean | null; + /** Request a bind change; renders the LAN switch only when set. */ + onToggleLan?: (next: boolean) => void; } export function StatusBar({ @@ -38,6 +42,8 @@ export function StatusBar({ language = "en", onLanguageChange, activeConfigName, + lanEnabled, + onToggleLan, }: StatusBarProps) { return (